mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 17:45:41 -04:00
Add broadcast channel to service schema
This will show which channel is configured, if any, for a service. It mimics what we are doing for the `allowed_broadcast_provider`.
This commit is contained in:
@@ -236,10 +236,14 @@ class ServiceSchema(BaseSchema, UUIDsAsStringsMixin):
|
|||||||
override_flag = False
|
override_flag = False
|
||||||
go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE)
|
go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE)
|
||||||
allowed_broadcast_provider = fields.Method(dump_only=True, serialize='_get_allowed_broadcast_provider')
|
allowed_broadcast_provider = fields.Method(dump_only=True, serialize='_get_allowed_broadcast_provider')
|
||||||
|
broadcast_channel = fields.Method(dump_only=True, serialize='_get_broadcast_channel')
|
||||||
|
|
||||||
def _get_allowed_broadcast_provider(self, service):
|
def _get_allowed_broadcast_provider(self, service):
|
||||||
return service.allowed_broadcast_provider
|
return service.allowed_broadcast_provider
|
||||||
|
|
||||||
|
def _get_broadcast_channel(self, service):
|
||||||
|
return service.broadcast_channel
|
||||||
|
|
||||||
def get_letter_logo_filename(self, service):
|
def get_letter_logo_filename(self, service):
|
||||||
return service.letter_branding and service.letter_branding.filename
|
return service.letter_branding and service.letter_branding.filename
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ def test_get_service_by_id(admin_request, sample_service):
|
|||||||
assert json_resp['data']['email_branding'] is None
|
assert json_resp['data']['email_branding'] is None
|
||||||
assert json_resp['data']['prefix_sms'] is True
|
assert json_resp['data']['prefix_sms'] is True
|
||||||
assert json_resp['data']['allowed_broadcast_provider'] is None
|
assert json_resp['data']['allowed_broadcast_provider'] is None
|
||||||
|
assert json_resp['data']['broadcast_channel'] is None
|
||||||
|
|
||||||
assert set(json_resp['data'].keys()) == {
|
assert set(json_resp['data'].keys()) == {
|
||||||
'active',
|
'active',
|
||||||
@@ -250,6 +251,7 @@ def test_get_service_by_id(admin_request, sample_service):
|
|||||||
'billing_contact_email_addresses',
|
'billing_contact_email_addresses',
|
||||||
'billing_contact_names',
|
'billing_contact_names',
|
||||||
'billing_reference',
|
'billing_reference',
|
||||||
|
'broadcast_channel',
|
||||||
'consent_to_research',
|
'consent_to_research',
|
||||||
'contact_link',
|
'contact_link',
|
||||||
'count_as_live',
|
'count_as_live',
|
||||||
|
|||||||
Reference in New Issue
Block a user