FNOL API
The following server automation script is used:
This script is called with an object as data and calls the insertFnol function from the FTOS_FNOL_API server automation script library.
The server automation script library contains the following script:
This script creates a new FNOL (first notification of loss) based on the object received from the FTOS_FNOL_API_Call script. The script contains the following functions:
This function fetches (with fluentQuery) the customer's personal info based on the the personal numeric number CNP or PIN, only if the customer exists in database.
Input parameters:
-
cnp -- (string) -- The customer's PIN/CNP.
Output parameters:
-
The customer info or null if the customer does not exists in the database.
This function returns the ID of the person type based on the personType received from the API call.
Input parameters:
-
typeString –(string)- the person type (example: “Individual person”).
Output parameters:
-
The ID of the person type.
This function checks if the customer is insured for the claimed risk.
Input parameters:
-
policyId –(string)- The policy Id
-
ojbInsuranceRisk –(string)- The name of the risk(example: Aircraft fall);
Output parameters:
-
Insured risk ID and name, or null if the risk is not covered.
This function returns the policy item name, if the name exists in the database.
Input parameters:
-
riskName – (string) – The name of the policy item
-
insuranceRiskId – (string) – The risk ID returned from the getInsuredRisk(); function
-
policyId – (string) – The policy ID.
Output parameters:
Returns an object with the following data, or null if there are no entries to match the query:
-
riskCurrencyId from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
currentValueLimit from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
currentCountLimit from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
FTOS_INSPA_PolicyInsItemXCoveredRiskid from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
policyInsuranceItemId from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
insuranceRiskId from
FTOS_INSPA_PolicyInsItemXCoveredRisk. -
FTOS_INSPA_PolicyInsuranceItemid from
FTOS_INSPA_PolicyInsuranceItem. -
insuredObjectId from
FTOS_INSPA_PolicyInsuranceItem. -
name from
FTOS_INSPA_PolicyInsuranceItem.
This function verifies that the given date is before or the current date.
Input parameters:
-
selectedDate – (string) – The date.
Output parameters:
-
Returns the given date, or false if the date is in the future.
This function checks if there is any policy with the given id.
Input parameters:
-
policyId – (string) – The policyid.
Output parameters:
An object with the following data, or null if there is no policy with the given ID.
-
FTOS_INSPA_Policyid from FTOS_INSPA_Policy
-
policyNo from FTOS_INSPA_Policy
-
issuedDate from FTOS_INSPA_Policy
-
policyBeginDate from FTOS_INSPA_Policy
-
policyEndDate from FTOS_INSPA_Policy
-
businessStatusId from FTOS_INSPA_Policy
-
insuranceTypeId from FTOS_INSPA_Policy
-
beneficiaryId from FTOS_INSPA_Policy
-
accountId from FTOS_INSPA_Policy.
This function returns the address of the insured object, based on the given policy ID.
Input parameters:
-
policyId – (string) – The policy id.
Output parameters:
Returns an object with the following data, or null if there are no entries for the given policy ID.
-
FTOS_INSPA_Policyid from FTOS_INSPA_Policy
-
accountId from FTOS_INSPA_Policy
-
insuredId from FTOS_INSPA_Policy
-
insuranceTypeId from FTOS_INSPA_Policy
-
beneficiaryId from FTOS_INSPA_Policy
-
wording from FTOS_INSPA_Policy
-
policyPDF from FTOS_INSPA_Policy
-
streetNo from FTOS_INSQB_Address
-
postalCode from FTOS_INSQB_Address
-
buildingNo from FTOS_INSQB_Address
-
floorNo from FTOS_INSQB_Address
-
apartmentNo from FTOS_INSQB_Address
-
streetName from FTOS_INSQB_Address
-
istrictId from District
-
cityId from City.
This function inserts a new FNOL based on the given object from the FTOS_FNOL_API_Call server automation script and uses all the functions presented above the fetch different data and to make different validations and also uses the following function from FTOS_INS_Utils:
getIdByAttrib();
This function returns the id of the given attribute.
Input parameters:
-
entityName – (string) – The entity name;
-
searchAttribute – (string) – The name of the attribute;
-
searchValue – (string) – The attribute value.
Output parameters:
-
The ID of the searched value, or null if there are no entries with the searched value.
Beside inserting a new FNOL, this function also inserts the following:
-
Inserts a new customer into the Account entity if the customer does not exist, validation based on the given CNP/PIN;
-
Inserts item/s into FTOS_CLAIM_AffectedItem;
-
Inserts the claimed amount for the claimed risk into FTOS_CLAIM_RiskClaimed;
-
Inserts document/s into FTOS_CLAIM_Document.
Input parameters:
-
Token – (object) – The object received from the FTOS_FNOL_API_Call (server automation script)
Output parameters:
-
The id of the new inserted FNOL