...
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“
ContractValuation(bool save)
create the ContractContributionPlanDetails based on the ContractDetails
save them only if the save param is true
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
Signal
ApprovedContract
Use Django Email to send payment notificaiton (it means that the setting in code should use Env var for the EMAIL settings)
Use text from configuration using django LANGUAGE CODE
Config
"ContractState":[
{
"value":"1",
"label":{
"fr":"Demande d'information",
"en":"Request for information"
...
“Approvable”:[ “Negotiable“]
“payment_notification“:{“en“:”Dear <CONTACT-NAME>\n The contract<CONTRACT-CODE> - <CONTRACT-NAME> was approved\n Please proceed to the payment of <CONTRACT-DUEAMOUNT> with the reference <CONTRACT-PAYMENT-REFERENCE>\n Best regards ” , “fr“:”Monsieur, Madame <CONTACT-NAME>\n le contract<CONTRACT-CODE> - <CONTRACT-NAME> à été apprové\n Veuillez faire un paiement de <CONTRACT-DUEAMOUNT> avec la référence <CONTRACT-PAYMENT-REFERENCE>\n Meilleurs Salutations ”}
Front end detail design
menu
...