Configuring Cloud API PolicyContactRole entities for Cloud Retrofit
This topic only applies to PolicyCenter.
- In the template configuration, define policy contact role entities that are attached to the policy line as a coverable if the entity has child entities. Define policy contact role entities that are attached to the policy line as an exposure if the entity has no child entities. For more information, see Cloud API template gen config YAML files.
- If two policy contact role entities share a child entity and that shared child
entity is also a coverable or an exposure, complete the following additional
steps:
- In the template configuration, use the
childTypeNameproperty to provide a unique name for each field. For more information, see The types property fields. - In the codegen configuration, use the
collectionUrlPartproperty to generate endpoints that share the collection uri part but have different parent uri parts. For more information, see Cloud API codegen type-level overrides.
- In the template configuration, use the
- If policy contact role fields are synced with account contact role fields, complete additional steps to ensure that the product template and associated endpoints generate as expected. See Handling fields that sync to AccountContactRole
Handling fields that sync to AccountContactRole
PolicyContactRole entities can have fields that sync to their associated AccountContactRole. In this case, you need to complete additional configuration to ensure that the product template and associated endpoints generate as expected during the cloud retrofit with APD App process.
PolicyContactRole entities can have fields that sync to their associated AccountContactRole. In this case, you need to complete additional configuration to ensure that the product template and associated endpoints generate as expected during the cloud retrofit with APD App process.
For PolicyContactRole entity fields that sync to the AccountContactRole, an "Internal" suffix is often added on the entity property. The "Internal" suffix indicates that Gosu helper classes handle the AccountContactRole syncing process, and that Gosu setter and getter methods manage the retrieval and updates to the synced data.
- Configure the internal field name to appear in the product template with the name of the field that it synchronizes with. See Step 1: Expose and map internal fields to synced field name in product.
- Configure the code generation file to map the data from the synced field back to the internal field name. See Step 2: Map synced field data back to the internal field.
Step 1: Expose and map internal fields to synced field name in product
In the template_gen_config.lob_prefix.yaml file, complete the following for each PolicyContactRole entity field that syncs with an AccountContactRole entity field:
- Configure the
fieldNameproperty with the name you want to give the field in the APD product. For example, you can remove the "Internal" suffix from the entity field name. - Set the
ignoredproperty to false.
fieldName and ignored
property setting: PolicyDriver:
handling: exposure
fields:
ExcludedInternal:
fieldName: Excluded
ignored: false
LicenseNumberInternal:
fieldName: LicenseNumber
ignored: false
LicenseStateInternal:
fieldName: LicenseState
ignored: falseStep 2: Map synced field data back to the internal field
In the lob_prefix_codegen_config_ext-1.0.yaml file, configure the generated code to use the appropriate Gosu getter and setter methods for the "Internal" suffixed PolicyContactRole field.
- Configure the
getterPropertyto the AccountContactRole field or the name that matches the Gosu getter method. - Configure the
nameOverrideto be the PolicyContactRole field with the "Internal" suffix. - Configure the
schemaPropertyNameto the schema property name of the AccountContactRole field. - Configure the
setterPropertyto the field name of the AccountContactRole field or the name that matches the Gosu setter method.
getterProperty, nameOverride,
schemaPropertyName, and setterProperty
properties.PAPolicyDriver:
fields:
Excluded:
mapperHandling:
getterProperty: Excluded
nameOverride: ExcludedInternal
nullable: false
schemaHandling:
schemaPropertyName: excluded
updaterHandling:
setterProperty: Excluded
LicenseNumber:
mapperHandling:
getterProperty: LicenseNumber
nameOverride: LicenseNumberInternal
schemaHandling:
schemaPropertyName: licenseNumber
updaterHandling:
setterProperty: LicenseNumber
LicenseState:
mapperHandling:
getterProperty: LicenseState
nameOverride: LicenseStateInternal
schemaHandling:
schemaPropertyName: licenseState
updaterHandling:
setterProperty: LicenseState