Advanced Versioning Configurations
Scripts supporting standard versioning process and custom code.
FTOS_INSPA_Policy_Before_Insert
This script calls the standard versioning library, according to the configuration instructions. For example, the standard FintechOS versioning mechanism stops the user from inserting multiple versions of a record, checking if the referenced record is in Version Draft status.
The script also implements other insurance business requirements, specific to policy versioning, through the following functions:
| Function | Input parameters | Output parameters |
|---|---|---|
checkExistingPendingRequests()Prevents the user to create a new policy version if the referenced record is already in Pending status. |
referencedAttributeId – The unique identifier of the FTOS_INSPA_Policy record. |
N/A. |
getSecurityRoles()Reads the flow settings from FTOS_PA_Policy and the processor settings from FTOS_PA_PolicyProcessor entities and determines if the user is allowed to register a new version for a policy. |
N/A. | SecurityRoles - An array from the FTOS_PA_PolicyProcessor entity. |
getUserRoles()
Selects the security roles of a system user. |
userId - The unique identifier of the user trying to create a new version of the policy. |
An arraycontaining the names of the security roles available for the system user. |
versioningRolesValidation()Calls the getSecurityRoles and getUserRoles functions to establish if the user is allowed to register a new policy version. Based on the attributeVersion input parameter, it also determines if the record is part of the versioning process - namely, it’s a clone and not a policy being generated for the fist time into the system.
|
attributeVersion - The version of the record to be inserted.userId - The unique identifier of the user trying to create a new version of the policy. |
N/A. |
FTOS_INSPA_Policy_After_Insert
This script calls the standard FTOS_VersioningHelper versioning library, according to configuration instructions.
FTOS_INSPA_Policy_After_Update
This script calls the standard FTOS_VersioningHelper versioning library, according to configuration instructions.
FTOS_INSQB_PaymentScheduleDetail_Before_Insert
Script used to get the different details of an installment. The following functions are used:
| Function | Input parameters | Output parameters |
|---|---|---|
setPolicyIdOnInstallment()
Sets the policyId lookup on the payment schedule details generated on a new policy version Sets the policyId lookup of the new policy version to reference the payment schedule details, determines the new policyId. The payment schedule of the new installment is used to determine what is the new policyId. |
paymentScheduleId – The unique identifier of a FTOS_INSQB_PaymentSchedule record. |
An
array containing the policyId key.
|
getPaidScheduleDetails()Gets the details of a paid installment. Returns results only if the installment is paid. policyId – id of a policy, used to identify the installment |
policyId – The Id of a policy, used to identify the installment.installmentName - The identification number of the installment. |
An
array containing the installmentId and scheduleId keys. |
getPaidInstallment()Checks if the installment from the referenced policy is in Paid status. Next, it calls the getPaidScheduleDetails function to get details about that payment. Next, it fills the details into the paidPaymentScheduleDetailId and paidPaymentScheduleId attributes of the installment from the new policy version. |
policyId – The Id of a policy, used to identify the installment.installmentName - The identification number of the installment. |
An
array containing the installmentId and scheduleId keys
|
FTOS_INSQB_PaymentScheduleDetail_After_Insert
This script compares the installment amount with the paid amount. Next, it changes the status of the inserted installment from Statement Issued into Paid.
FTOS_INSQB_PaymentScheduleDetail_AfterUpdate_Validations
Script used to recalculate net premium, tax amount and commission amount on an installment, if the installment amount changes
Script used to determine if an installment can be manually updated or not (updated are allowed only if the status of the installment is on time and the status of the policy version draft).
This script uses the following:
FunctiongetStatusPolicyInstallment() - Gets the status of an installment and the status of the policy for which the installment is generated.
Input parameters: installmentId – The Id of a FTOS_INSBQ_PaymentScheduleDetail record.
Output parameters: An array of objects containing the BusinessStatusId key from the FTOS_INSPA_Policy entity and the BusinessStatusId key from the FTOS_INSQB_PaymentScheduleDetail entity.
FTOS_INSPA_FinishPolicyEditValidation
This scrip validates if the sum of the installments amounts is equal to the policy premium amount and if not, throws an exception with localization. The condition that must be respected is that the sum of the installments amounts has to be equal to the premium amount.
FTOS_INSPA_FinishPolicyEdit
Script calling the FTOS_INS_PolicyAdmin library to change the status of the clone from Version Draft to Pending. If, when clicking New Version, the effective date is less than or equal to the current date, the clone will automatically move from Pending to Approved.
Endpoints
This endpoint calls an on demand server side script named FTOS_INSPA_FinishPolicyEditValidation. It also uses the FTOS_INS_PolicyAdmin library.
This endpoint calls an on demand server side script named FTOS_INSPA_FinishPolicyEdit. It also uses the FTOS_INS_PolicyAdmin library.
Server Side Script Libraries
From the FTOS_INS_PolicyAdmin library, the PolicyVersioning() function is used for the versioning process. The PolicyVersioning() function calls the following four other functions:
| Function | Input parameters | Output parameters |
|---|---|---|
getAmounts()Gets the policy premium amount and the sum installment amount for the referenced policy. |
policyId - The unique identifier of a record from FTOS_INSPA_Policy entity.
|
N/A. |
finishPolicyEdit()Changes the policy version status from Version Draft to Pending. |
policyId - The unique identifier of a record from FTOS_INSPA_Policy entity.
|
N/A. |
getPolicyLastApprovedVersion()
Gets the details about the last approved version of the policy. |
masterAttributeId - The unique identifier of a master attribute from FTOS_INSPA_Policy entity. |
N/A. |
approvePendingPolicies()Changes the policy version status from Pending to Approved if the effective date is less than or equal to the current date. Next, it closes the previous policy version. |
policyId - The unique identifier of a record from FTOS_INSPA_Policy entity.
|
N/A. |
Scheduled jobs
FTOS_INSPA_ApprovePendingPolicies: job server script to approve policies in pending status, on effective date.