Open source Insurance Policy Life Cycle Management
Project description
PoLZy Back-End App
PoLZy is a flexible tool for insurance companies to deal with standard business processes during the life cycle of a policy.
Here you can find the PoLZy back-end application.
Currently, it is available only a development installation
Custom Elements
As we mention above, PoLZy is a flexible system. You may adjust it by your specific environment by developing custom subclasses.
Policy
A policy class is responsible for fetching policy data from Policy Management System and providing it to the front-end app. It inherits class Policy from base.policy
and overrides the following elements:
fetch(policy_number, effective_date)
The method fetches a policy data from the Policy Management System and reshape it to a JSON
object (dict) of structure that is shown in the figure bellow. The reshaped data is stored in data
property. The method returns True
if it successful, otherwise - False
.
activities_by_state
Property activities_by_state
defines the list of possible policy states and available activities for each state:
activities_by_status = {
'state_1': [
'activity_1',
'activity_2',
],
'state_2': []
}
Policy Attributes
There are several properties that defines policy attribute (see the figure above):
attributes_policy
-- policy attributes (dictionary of<name: description>
records)attributes_insured_person
-- insured person attributes (corresponds to insured object attributes ifis_person: true
-- dictionary of<name: description>
records)attributes_insured_object
-- insured object attributes (corresponds to insured object attributes ifis_person: false
-- dictionary of<name: description>
records)attributes_implementation
-- implementation attributes of an insured object (dictionary of<name: description>
records)attributes_product_line
-- product line attributes (dictionary which keys correspond to the Product Line names and values are dictionary of<name: description>
)attributes_insured_object_type
-- insured object type attributes (corresponds to insured object attributes ifis_person: false
-- dictionary which keys correspond to the Insured Object Types and values are dictionary of<name: description>
)
Activation
Set property CLASSNAME_POLICY
of the config object to point on the policy class to activate it within current PoLZy implementation.
class Config(object):
CLASSNAME_POLICY = 'polzy.SamplePolicy'
Example
Example of policy definition
from base.policy import Policy
class SamplePolicy(Policy):
# policy statuses with corresponded possible activities
activities_by_state = {
'active': [
'cancel',
'suspend',
],
'canceled': [],
'suspended': [
're-activate'
],
}
# policy attribute descriptions
attributes_policy = {
'Policy Attribute 1': 'Description of Policy Attribute 1',
'Policy Attribute 2': 'Description of Policy Attribute 2',
'Policy Attribute 3': 'Description of Policy Attribute 3',
'Policy Attribute 4': 'Description of Policy Attribute 4',
}
# product line attribute descriptions
attributes_product_line = {
'Life': {
'Life Attribute 1': 'Description of Life Attribute 1',
'Life Attribute 2': 'Description of Life Attribute 2',
'Life Attribute 3': 'Description of Life Attribute 3',
},
'Health': {
'Health Attribute 1': 'Description of Health Attribute 1',
'Health Attribute 2': 'Description of Health Attribute 2',
'Health Attribute 3': 'Description of Health Attribute 3',
'Health Attribute 4': 'Description of Health Attribute 4',
'Health Attribute 5': 'Description of Health Attribute 5',
},
'P&C': {
'P&C Attribute 1': 'Description of P&C Attribute 1',
'P&C Attribute 2': 'Description of P&C Attribute 2',
},
'Car': {
'Car Attribute 1': 'Description of Car Attribute 1',
},
}
# insured person attribute descriptions
attributes_insured_person = {
'Insured Object Attribute 1': 'Description of Insured Object Attribute 1',
'Insured Object Attribute 2': 'Description of Insured Object Attribute 2',
'Insured Object Attribute 3': 'Description of Insured Object Attribute 3',
}
# insured object attribute descriptions
attributes_insured_object = {
'Insured Object Attribute 1': 'Description of Insured Object Attribute 1',
'Insured Object Attribute 2': 'Description of Insured Object Attribute 2',
'Insured Object Attribute 3': 'Description of Insured Object Attribute 3',
}
# insured object type attribute descriptions
attributes_insured_object_type = {
'House': {
'Hause Attribute 1': 'Description of House Attribute 1',
},
'Car': {
'Car Attribute 1': 'Description of Car Attribute 1',
'Car Attribute 2': 'Description of Car Attribute 2',
},
'Factory': {
'Factory Attribute 1': 'Description of Factory Attribute 1',
'Factory Attribute 2': 'Description of Factory Attribute 2',
'Factory Attribute 3': 'Description of Factory Attribute 3',
},
'Field': {
'Field Attribute 1': 'Description of Field Attribute 1',
'Field Attribute 2': 'Description of Field Attribute 2',
},
'Forest': {
'Forest Attribute 1': 'Description of Forest Attribute 1',
},
}
# implementation attribute descriptions
attributes_implementation = {
'Implementation Attribute 1': 'Description of Implementation Attribute 1',
'Implementation Attribute 2': 'Description of Implementation Attribute 2',
}
def fetch(self):
# fetch policy data from Policy Management System
data = policy_system.get(self.number, self.effective_date)
if data:
# reshape data if needed
self.data = data
return True
return False
Initialization
First install the dependencies and initiate the database:
pip install -r requirements.py
flask db init
flask db migrate
flask db upgrade
By default, PoLZy uses sqlite3 database polzy.db
located in the app root folder. You may change that by setting the environmental variable DATABASE_URL
.
To migrate database after changing the Value Models, execute:
flask db migrate
flask db upgrade
To populate database with the sample instances, execute:
python populate_db.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file polzybackend-1.0.0.tar.gz
.
File metadata
- Download URL: polzybackend-1.0.0.tar.gz
- Upload date:
- Size: 64.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d14f1e522d1203ff02c7183a7fb85cfe19f1fc84baaf41519289d7663c6c53e7 |
|
MD5 | 5feb6341f1758e902be2cda6e5098ee7 |
|
BLAKE2b-256 | 422a9e4df0d29fa64a92fb6674428a9cd49191a5538a8aed1d44bbd4ab8964a7 |
File details
Details for the file polzybackend-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: polzybackend-1.0.0-py3-none-any.whl
- Upload date:
- Size: 95.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2fc626502c12117aa754d2fc24ee10981a442ce4a30da87781718e5129746f0 |
|
MD5 | 39af4f16482fd7dbd6f0a655122d0513 |
|
BLAKE2b-256 | 58510f84a242a3d6f95bb5460131d39548a57cfd6a66a7bed76ae17397e5fb1d |