Skip to main content

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

Metadata

Release files for polzybackend 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polzybackend 1.0.0
File Size Uploaded Provenance Actions
polzybackend-1.0.0.tar.gz 64.3 kB Without provenance Details for polzybackend-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polzybackend 1.0.0
File Interpreter ABI Platform Actions
polzybackend-1.0.0-py3-none-any.whl Python 3 none any Details for polzybackend-1.0.0-py3-none-any.whl

Total release size: 159.7 kB

Release files / polzybackend-1.0.0.tar.gz

Download URL polzybackend-1.0.0.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d14f1e522d1203ff02c7183a7fb85cfe19f1fc84baaf41519289d7663c6c53e7
BLAKE2b-256 checksum
How to use checksums
422a9e4df0d29fa64a92fb6674428a9cd49191a5538a8aed1d44bbd4ab8964a7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / polzybackend-1.0.0-py3-none-any.whl

Download URL polzybackend-1.0.0-py3-none-any.whl
Size 95.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2fc626502c12117aa754d2fc24ee10981a442ce4a30da87781718e5129746f0
BLAKE2b-256 checksum
How to use checksums
58510f84a242a3d6f95bb5460131d39548a57cfd6a66a7bed76ae17397e5fb1d
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for polzybackend 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page