Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.3 kB
3
Indexable
Never
from typing import Union, List
import random

from calc_engine.models.pius import PIUSLayer, PIUSPolicy, PIUSRatingAEDisciplineSplit, PIUSRatingAEProjectAreaSplit, \
    PIUSRiskDetailsAE

#  Creating objects containing disciplines' info - names and split values:
discipline1 = PIUSRatingAEDisciplineSplit(discipline="Architecture - Higher Risk", split=50.0)
discipline2 = PIUSRatingAEDisciplineSplit(discipline="Structural Engineering - Low", split=50.0)
disciplines = [discipline1, discipline2]

#  Creating objects containing project areas' info - names and split values:
project_area1 = PIUSRatingAEProjectAreaSplit(project_area="Apartments", split=10.0)
project_area2 = PIUSRatingAEProjectAreaSplit(project_area="Convention Centers", split=20.0)
project_area3 = PIUSRatingAEProjectAreaSplit(project_area="Recreation/Sports", split=40.0)
project_area4 = PIUSRatingAEProjectAreaSplit(project_area="Other (High)", split=30.0)
project_areas = [project_area1, project_area2, project_area3, project_area4]

#  Creating an object containing risk details; please note the nesting of information about disciplines, project areas,
#  and services:
risk_details = PIUSRiskDetailsAE(revenue=12000000, sub_contractor=5, non_us_work=5, disciplines=disciplines,
                                 project_areas=project_areas,
                                 uw_walk_claims_exp="None",
                                 uw_walk_risk_management="Satisfactory - some minor weaknesses", uw_walk_other1=30.0)

#  Creating objects containing individual layer details:
layer1 = PIUSLayer(id=1, limit=1000000, limit_basis="AGG", excess=0, deductible=100000,
                   brokerage=10, deductions_total_other=0, ggwp_ccy_premium = random.randint(1,100)*1000, wrt_line = random.randint(1,100))

#  Creating an array object containing all layers
layers = [layer1]

#  Nesting all information into a single object, as this is what the calc_engine should expect to receive;
TEST_POLICY = PIUSPolicy(id=1, insured_name="Magda", product_code="PI US", year_of_account=2020,
                         risk_details=risk_details, layers=layers, policy_length=1,
                         date_inception="2022-01-01", date_expiry="2020-12-31")

print(layers)
print(TEST_POLICY)