Skip to content

Commit 34aedbd

Browse files
committed
fix: updating forgoten enums and class models in services
1 parent 5a4b475 commit 34aedbd

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

app/api/schemas/enums.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ class TemplateStatus(str, Enum):
7878
draft = "draft"
7979

8080

81+
class TextAlign(str, Enum):
82+
left = "left"
83+
center = "center"
84+
right = "right"
85+
86+
8187
class TemplateFieldType(str, Enum):
8288
string = "string"
8389
integer = "integer"

app/services/form_templates.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def _to_detail(template: FormTemplate) -> TemplateDetail:
5959
jurisdiction=template.jurisdiction,
6060
agency_type=template.agency_type,
6161
fields=template.fields,
62-
field_mappings_from_incident=template.field_mappings_from_incident,
6362
source_standard=template.source_standard,
6463
pdf_template_ref=template.pdf_template_ref,
6564
version=template.version,
@@ -102,8 +101,7 @@ def create_template(db: Session, body: CreateTemplateRequest) -> TemplateDetail:
102101
display_name=body.display_name,
103102
jurisdiction=body.jurisdiction,
104103
agency_type=body.agency_type,
105-
fields=[f.model_dump() for f in body.fields],
106-
field_mappings_from_incident=body.field_mappings_from_incident,
104+
fields=[f.model_dump(mode="json") for f in body.fields],
107105
source_standard=body.source_standard,
108106
pdf_template_ref=body.pdf_template_ref,
109107
)
@@ -129,8 +127,7 @@ def replace_template(
129127
template.display_name = body.display_name
130128
template.jurisdiction = body.jurisdiction
131129
template.agency_type = body.agency_type
132-
template.fields = [f.model_dump() for f in body.fields]
133-
template.field_mappings_from_incident = body.field_mappings_from_incident
130+
template.fields = [f.model_dump(mode="json") for f in body.fields]
134131
template.source_standard = body.source_standard
135132
template.pdf_template_ref = body.pdf_template_ref
136133
template.updated_at = datetime.now(timezone.utc)

0 commit comments

Comments
 (0)