...
ContractUUID (fk Contract)*
insureeeID (fk_insuree)*
PolicyHolderInsureeUUID (fk PolicyHolderInsuree)ContributionPlanBundleUUID:Version(fk ContributionPlanBundle)*
Json_param (json)
PolicyHolderInsuree parameters
Entity ContractContributionPlanDetails (output) - under ContractDetails (
...
HistoryBusinessModel)
ContributionPlanUUID (fk_contributionPlan)*
PolicyID (fk_policy)*
ContractDetailsUUID (fk_contractdetails)*
ContributionId (fk_contribution)
...
create
run service updateFromPHInsuree
NotifiedAmount = ContractValuation(false)
Contract state will become “Draft”
edit/update
check rights for contract / amendments
check status
if in “draft”/ “request for information“ / “counter“ only the code cannot be changed,
if in “Negotiable” changes are possible only with the authority “Approve/ask for change”
delete
check rights
block deleting contract not in Updateable or Approvable state
submit
check right
RectifiedAmount = ContractValuation(false)
create Contractcontribution (see createcontractContribution service)
send signal
Contract state will become “Negotiable”
approved
check rights (Approve/ask for change)
send signal
RectifiedAmount = ContractValuation(true)
create Contractpayment (see createcontractPayment service)
Contract state will become “Executable”
counter
check right (Approve/ask for change)
Contract state will become “counter”,
renew
create a new contract that follow the existing active contract (if not yet existing)
amend
check rights
create a new “amendment“ contract from the last amendement
increment Amendment of 1 (i.e. 1st amendment will have 1, 2nd: 2 … )
change status of the previous contract/amendement to 6 “addendum“ (Nice to have: 4 and 6 when addendum approved)
NotifiedAmount = ContractValuation(false)
Amendement state will become “Draft”
ContractValuation(bool save)
create the ContractContributionPlanDetails based on the ContractDetails
save them only if the save param is true(nice to have: if periodicity of the contribution plan is smaller that the contract datevalidFrom-datevalidTo then create enough ContractContributionPlanDetails to cover for the contract duration)
if the save param is true
use GetContributionLength to get the dateValidFrom DateValidTo of ContractContributionPlanDetails
Check if there is a policy to cover from the dateValidFrom DateValidTo
if none: create one using the duration from the product with the status “open/ouvert“ 32
if there is one that cover the full duration: use it
if there is one that does NOT cover the full duration: create a new policy to cover the missing part and split the ContractContributionPlanDetails and linked to the matching policies (dates of ContractContributionPlanDetails ) must be within policy dates.
createContribution
if amendement: Contract value = value of the contributionplandetails - amount already payed for that contract (contract in state 7-8)
return the total amount
createContribution
create the contributions based on the ContractContributionPlanDetails
createcontractPayment
create a payment that cover all contributions related to the contract
updateFromPHInsuree
if PH is set, Update the ContractDetails based on the PHInsuree
getNegativeAmountAmendement (creditnote)
look for approved contract (amendement) for that PH that have a negative AmountDue
activateContractedPolicies (listen to payment signal)
Activate the policy related to the contract (create policy insuree for the contract period + grace period)
Contract state will become “effective”,
change status to 7 - Effective
TerminateContract
previous contract of the (DateValidTo) will become “terminated“
PHInsureToCDetatils
Takes a PHinsuree as input and a contractDetails as output where the insuree and the CPB from the PH insureee will be used
This is likely to be called by the mutation to create details from front end when the PH is set
...