...
the three dots menu will apply either to all selected line OR to all records filtered, once an option is selected a confirmation popup will precise the action and how many instance are concerned, the mutation result will show how many entity “update“ were successful and failed
Create invoice
Contract
Web application
(TBC, could work with scheduler)UC3-1: Add bulk "contract": Policy holder List > select policyholder(s) (or for all the PH part of the search result) > generate bulk contract (…) > enter the date on which the contract must be created if not already covered by previous contract.
UC3-10: add “Contract“: Contract search > “Add“ contract > fill the details on the contract page (draft) >save (mandatory fields required) > the insuree from the PH are imported with default calculation params
UC3-2: Add "contract" from PH: Policy holder List > Select a Policy Holder > Contract list> Generate contract (the insuree from the PH are imported with default calculation params) > fill the details on the contract page (draft)
UC3-11: Access to contract via contract search: Contract search > select contract
UC3-12: Access to a contract via PolicyHolder :Policy holder List > Select a Policy Holder > Contract list > Select contract
UC3-3: Update contract details: edit button on contract selected >update the details on the contract page (updatable fields will depend on the state) > save
UC3-3.1: add contractDetail : update contract > click on add ContractDetail (show Ph insuree) > enter the details in the popup > save
UC3-3.2: Update contractDetails: update contract > click the edit button of the ContractDetail (show Ph insuree)> confirm in the delete conf popup
UC3-3.3: Dupdate delete contract detail: update contract > click the delete button of the ContractDetail (show Ph insuree)> confirm in the delete conf popup
UC3-4: Submit (“sign PH)) "contract": contract selected >open contract > Submit/sign contract > conf popup
(TBC)UC3-5: Approve (“sign Insurance“) "Contract" bulk: Select contract(s) > Approve contract (…)(only for submitted contract) > conf pop up with the number of contract impacted
UC3-13: Approve (“sign Insurance“) "Contract": Select contract > open contract > contract Approved (only for submitted contract) > conf popup
UC3-13.1: see contribution details: "Contract": Select contract > open contract > open contribution details tab
UC3-6: Counter "Contract": Select contract > open contract > Counter contract / reject (only for submitted contract) > conf popup
UC3-7: Amend "contract": Select contract > open contract > Generate Amendment > confirmation with Amendment number > add details (if it is about a new employee, they should be added before on the employee list)
UC3-X: Delete"contract": Contract list > click on the delete button> conf popup (only available for contract in updatable or approvable status)
UCP-1: Create invoice via PolicyHolder :Policy holder List > tree dots menu ( > select contract(s)) > create invoice
Backend
UC3-8: send payment notification by email
UC3-9: send update required (from ask update) notification by email
UC3-14: (TBC replace UC3-1) create contract based on CPB periodicity / “renew-replace contract”
UC3-15: once approved (contract):
Check if there is a valid policy for the insure covered by the contract (+ grace period), if not then it will create such policy with the normal duration and a status "contracted."
matching contribution need to be created linked to the policie(s)
it the overall amount is > 0 ; create the related payment (payment status 3),
if there is an amendment with a null or negative amount and without payment, add the policy of that amendment to the payment
...
ContractUUID (fk Contract)*
insureeeID (fk_insuree)*
PolicyHolderInsureeUUID (fk PolicyHolderInsuree)ContributionPlanBundleUUID:Version(fk ContributionPlanBundle)*
Json_param ext (json fields part of HistoryModel)
PolicyHolderInsuree parameters
...
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)
send signal
Contract state will become “Negotiable”
approved
check rights (Approve/ask for change)
send signal
RectifiedAmount = ContractValuation(true)
Contract state will become “Executable”
createContribution
createcontractPayment
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.
Date to (the previous contract) became date From of the new contract (TBC if we need to add 1 day)
Date To of the new contract is calculated by DateFrom new contract + “Duration in month of previous contract“
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 (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
createCCPDetails
if amendement: Contract value = value of the contributionplandetails - amount already payed for that contract (contract in state 7-8)
return the total amount
createCCPDetails
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“ “contracted“ 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.
create the matching CCPDetail (C: contract, P: policy CCPD Contract contributionplanDetails)
1 policy: CCPD.DateVaildFrom = C.DateVaildFrom CCPD.DateVaildTo = C.DateVaildFrom + Duration
2 policies:
CCPD1.DateVaildFrom = C.DateVaildFrom & CCPD.DateVaildTo = p1.expiry_date / P2.startdate
CCPD2.DateVaildFrom = p1.expiry_date / P2.startdate & CCPD2.DateVaildTo = C.DateVaildFrom + Duration
createContribution
create the contributions (from openimis-be-contribuiton_py) 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)
NICE TO HAVE: this function will call a function for the contributionplan to retrieve the list of dependant that need to be covered by the contact (in addition to the insuree )
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 createInvoice
will try to run convert the ContractContributionPlanDetails of the contract to invoice lines
will save the invoice and the converted lines
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
...
approve contract (confirmation box with the number of contract to be approved)
counter contract (confirmation box with the number of contract to be countered)
(nice to have): renew contract
(nice to have): Add payment
(nice to have): Activate policy
...
Code (varchar (64) )
PolicyHolderUUID (fk policyHolder)
AmountNotified (float)
AmountRectified (float)
AmountDue (float)
DateApproved (datetime) READ ONLY
DatePaymentDue (date ) READ ONLY, NICE TO HAVE update possible only with the approve/counter authority
State (ConfigEnum:ContractState,
2
(which corresponds toDraft
) by default, read-only)PayementReference(varchar 256)
Amendment (
0
by default, read-only)*DateValidFrom
DateValidTo
...
Code, DateValidFrom and DateValidTo is mandatory
on contract update
Nice to have:
with update/create authority,
Date payment due READ ONLY
with the authority “Approve/ask for change”
Editable
on contract update
PH Can be set but not edited once saved.
with update authority,
in updatable state only Code, PH, DateValidFrom and DateValidTo cannot be changed,
no changes possible in other status
with the authority “Approve/ask for change”
in updatable state all can be changed,
in “Approvable” changes are possible only Code, DateValidFrom and DateValidTo cannot be changed,
...
{“comments”:[{“From”:”Portal/webapp”, “user“:<userid>, “date“:<datetime>,”msg”<message> }]}
on contract create invoice
Show how many invoice were created
Contract details tab
search criteria / filter
insuree picker (with sort option ASC/DESC)
Limited to PHInsuree
Nice to have : not limited to PHinsuree if PH not set
CBP picker (with sort option ASC/DESC)
Limited to PHCPB
Nice to have : not limited to PHCPB if PH not set
Apply search button
reset search button
Add
Create new
contract detailsContract Details
button (top right) enabled only ifwith Update authority, updatable state
with Approve authority, updatable and approvable state
will show the contract details
insuree picker readonly
CPB picker readonly
calculation parameters
edit and delete button
Edit
andDelete
buttons enabled only ifwith update Update authority, updatable state
with Approve authority, updatable and approvable state
on add contract details
a popup will be display with (mandatory fields marked with *
):
if PH is set (must have)
PHInsuree picker (Insuree, same fields as he the Insuree picker) *
CPB not editable per the user, auto update form Pinsuree (unless this can be add on the PH insuree picker)
if PH is not set (nice to have)
CPB picker restricted to the PHCPB if PH define on the contract *
Insuree picker restricted to the PHinsuree if PH define on the contract *
calculation parameters (Mandatory fields will be managed by the calculation contribution)
Save button
...
insuree picker readonly
CP picker readonly
calculation param
(Nice to have)Contract payment tab
Will display the payments that concern contribution linked to CCPD
the material UI button can create a payment for the remaining amount not covered by the payment.
calculation param
(Nice to have)Contract payment tab
Will display the payments that concern contribution linked to CCPD
the material UI button can create a payment for the remaining amount not covered by the payment.
Insureepolicy tab
Will dispaly the list of insuree impacted by the contract (as primary insuree or dependant)
Search criteria
Insuree (search box popup with name .. )
Result page
read only lines
columns
insuree label (as defined by insuree contribution)
Nice to have: start_date, effective_date, expiry_date
INSUREEPOLICY_SEARCH perms = 101500
NICE TO HAVE: Contract comment tab
...
Contract Tab on PolicyHolder
should display only Contracts, which have this particular Policy Holder assigned
search options
it will be possible to search on:
...
approve contract (confirmation box with the number of contract to be approved)
(nice to have: renew contract)
Create invoice
Material UI “add” to add a new contract (redirect to new contract page)
...