Skip to main content

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. Policy JSON Object

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 if is_person: true -- dictionary of <name: description> records)
  • attributes_insured_object -- insured object attributes (corresponds to insured object attributes if is_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 if is_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polzybackend-0.3.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polzybackend-0.3.2-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file polzybackend-0.3.2.tar.gz.

File metadata

  • Download URL: polzybackend-0.3.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for polzybackend-0.3.2.tar.gz
Algorithm Hash digest
SHA256 47f05cd954f9898384e47f97ba7ae5c1555d6f4714c65a6f6c6569c16a28565e
MD5 7e71ccffbe94ccd2c2b55a98078c44c3
BLAKE2b-256 254dd65d97e4afb49f0c87ad3b9dfc98a1cd33c99638b3e51728ed0d0d264a3c

See more details on using hashes here.

File details

Details for the file polzybackend-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: polzybackend-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for polzybackend-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 423111a6257f15c6c8d7e238a1742b4b6d7681e7b2105009c38ee5c12adfd5e5
MD5 f9f796390f8047d535cff942f9980631
BLAKE2b-256 bc801b50789dd4a255f765797bcb436d83b09cd5de5fa18dcb36bd56bd241dcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page