Update schema to account for Marshmallow updates

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2025-04-30 12:53:16 -04:00
parent 3250e22d3b
commit 43fb72d79c

View File

@@ -588,31 +588,33 @@ class NotificationWithPersonalisationSchema(NotificationWithTemplateSchema):
) )
class Meta(NotificationWithTemplateSchema.Meta): class Meta(NotificationWithTemplateSchema.Meta):
# mark as many fields as possible as required since this is a public api. # Mark as many fields as possible as required since this is a public api.
# WARNING: Does _not_ reference fields computed in handle_template_merge, such as # WARNING: Does _not_ reference fields computed in handle_template_merge, such as
# 'body', 'subject' [for emails], and 'content_char_count' # 'body', 'subject' [for emails], and 'content_char_count'
fields = (
# db rows # db rows
"billable_units", billable_units = auto_field()
"created_at", created_at = auto_field()
"id", id = auto_field()
"job_row_number", job_row_number = auto_field()
"notification_type", notification_type = auto_field()
"reference", reference = auto_field()
"sent_at", sent_at = auto_field()
"sent_by", sent_by = auto_field()
"status", status = auto_field()
"template_version", template_version = auto_field()
"to", to = auto_field()
"updated_at", updated_at = auto_field()
# computed fields
"personalisation", # computed fields
# relationships personalisation = auto_field()
"api_key",
"job", # relationships
"service", api_key = auto_field()
"template_history", job = auto_field()
) service = auto_field()
template_history = auto_field()
# Overwrite the `NotificationWithTemplateSchema` base class to not exclude `_personalisation`, which # Overwrite the `NotificationWithTemplateSchema` base class to not exclude `_personalisation`, which
# isn't a defined field for this class # isn't a defined field for this class
exclude = () exclude = ()