Closed tomkralidis closed 10 months ago
Yes, we support 1..n contacts. For contact types, we are bound to STAC roles: https://github.com/wmo-im/wcmp2-codelists/blob/main/codelists/contact-role.csv
My idea was whether we should leave the role information more open and only require specific roles from us as a minimum:
so instead of:
for c in self.record['properties']['contacts']:
for role in c['roles']:
if role not in contact_role_types:
status['code'] = 'FAILED'
status['message'] = f'Invalid role {role}'
break
e.g.
producer_role_included = False
for c in self.record['properties']['contacts']:
for role in c['roles']:
if "producer" in role:
producer_role_included = True
if producer_role_included is False:
status['code'] = 'FAILED'
status['message'] = f'Missing producer role in contacts'
But maybe that makes it too complicated for maintenance/customization for additional roles and then we need to clarify which roles should always be included
WCMP2 Requirement 12C specifies to use the controlled vocabulary.
In the context of this PR, the code is doing what the specification requires. If we wish to discuss further, we should cover as a WCMP2 item proper.
ok
This PR fixes the check for contact roles against the WCMP2 codelists.