In this step, you will refactor the Claim domain by adding mappings for each related table in the relational database and embedding all claim-related information under a single MongoDB claim document. Since the Claim and Litigation domains are closely related, you will also recreate the many-to-many relationship between the two domains by referencing the Litigation entity from the claim document.
About this Task
The Claim domain includes the following key entities:
Claim: Claim for coverage or compensation
Claim Party Role: An associative entity which links the following entities:
Party
Party Roles
Insurable Objects
Insurable Object Party Role: An associative entity which links the following entities:
Party
Party Roles
Insurable Objects
Before You Begin
Refactoring the Claim & Litigation domain is the fourth step of the insurance data model example tutorial. Before you refactor the Claim & Litigation domain, ensure that you:
Connected to your PostgreSQL database in Relational Migrator.
Steps
Embed the policy_coverage_detail table within insurableObject
Policy coverage details help establish the link between claims and policies. To embed the information from the policy_coverage_detail table, click Add and select Embedded array. Choose policy_coverage_detail from the Source table drop-down menu.
Under the All fields checkbox, uncheck the insurableObjectIdentifier field, and click Save and close.
Map the many-to-many relationship between litigation and claim
Since Litigation is a separate entity, you just need to reference that entity from the claims document as an array of litigation identifiers.
Next to Mappings from relational tables, click Add and select Embedded array. Choose litigation_party_role from the Source table drop-down menu.
Under the All fields checkbox, uncheck the litigationIdentifier field, and click Save and close.
Next Steps
After you map the Claim domain, refactor the Litigation domain in a similar manner. See Refactor the Litigation Domain.