columns_tbl_payment = { '__tablename__': 'tbl_payment', 'policy_id': common_columns.get('integer')(), 'payment_date': common_columns.get('datetime')(), 'registration_date': common_columns.get('datetime')(), 'registration_by_id': common_columns.get('integer')(), 'payment_type_id': common_columns.get('integer')(), 'payment_transaction_type_id': common_columns.get('integer')(), 'currency_id': common_columns.get('integer')(), 'receipt_number': common_columns.get('description')(), 'message': common_columns.get('description')(), 'payment_post_method_id': common_columns.get('integer')(), 'bank_reference': common_columns.get('description')() } Payment = get_phat_table(model_name='Payment', columndict=columns_tbl_payment) columns_tbl_payment_link = { '__tablename__': 'tbl_payment_link', 'payment_id': common_columns.get('integer')(), 'contra_payment_id': common_columns.get('integer')(), } PaymentLink = get_phat_table(model_name='PaymentLink', columndict=columns_tbl_payment_link) columns_tbl_payment_credit = { '__tablename__': 'tbl_payment_credit', 'payment_id': common_columns.get('integer')(), 'amount': common_columns.get('currency')(), } PaymentCredit = get_phat_table(model_name='PaymentCredit', columndict=columns_tbl_payment_credit)
LoaderQuestionPremiumEffectType = get_type_table(model_name='LoaderQuestionPremiumEffect', table_name='loader_question_premium_effect') # None, Percentage, Amount ############################################################################### # Product ############################################################################### columns_tbl_product = { '__tablename__': 'tbl_product', 'product_type_id': common_columns.get('integer')(), 'code': common_columns.get('code_not_nullable')(), 'name': common_columns.get('title_not_nullable')(), 'entity_org_product_owner_id': common_columns.get('integer')(), 'product_state_type_id': common_columns.get('integer')(), # default: Sandbox 'policy_number_prefix': common_columns.get('title')(), } Product = get_phat_table(model_name='Product', columndict=columns_tbl_product) columns_tbl_product_history_link = { '__tablename__': 'tbl_product_history_link', 'product_id': common_columns.get('integer_not_nullable')(), 'previous_product_id': common_columns.get('integer_not_nullable')() } ProductHistoryLink = get_phat_table(model_name='ProductHistoryLink', columndict=columns_tbl_product_history_link) ############################################################################### # Benefit ############################################################################### columns_tbl_benefit = { '__tablename__': 'tbl_benefit', 'product_id': common_columns.get('integer_not_nullable')(),
EntityOrganisationType = get_type_table(model_name='EntityOrganisation', table_name='entity_organisation') EntityOrganisationContactType = get_type_table( model_name='EntityOrganisationContact', table_name='entity_organisation_contact') EntityOrganisationAddressType = get_type_table( model_name='EntityOrganisationAddress', table_name='entity_organisation_address') # ********************* Entity ***********************************# columns_tbl_entity = { '__tablename__': 'tbl_entity', 'entity_type_id': common_columns.get('integer_not_nullable')(), } Entity = get_phat_table(model_name='Entity', columndict=columns_tbl_entity) columns_tbl_entity_person = { '__tablename__': 'tbl_entity_person', 'entity_id': common_columns.get('integer_not_nullable')(), 'person_id': common_columns.get('integer_not_nullable')(), 'identity_number': common_columns.get('description')(), } EntityPerson = get_phat_table(model_name='EntityPerson', columndict=columns_tbl_entity_person) columns_tbl_entity_person_relationship_link = { '__tablename__': 'tbl_entity_person_relationship_link', 'entity_person_id': common_columns.get('integer_not_nullable')(), 'relation_entity_person_id': common_columns.get('integer_not_nullable')(), 'relationship_type_id': common_columns.get('integer_not_nullable')(),
model_name='Product', table_name='product') # Voucher, Traditional, Term Life, Credit Life ProductStateType = get_type_table( model_name='ProductState', table_name='product_state') # Sandbox, Active, Expired columns_tbl_product = { '__tablename__': 'tbl_product', 'product_type_id': common_columns.get('integer')(), 'code': common_columns.get('code')(), 'name': common_columns.get('title_not_nullable')(), 'product_owner_id': common_columns.get('integer')(), 'product_state_id': common_columns.get('integer')(), 'policy_number_prefix': common_columns.get('title')(), } Product = get_phat_table(model_name='Product', columndict=columns_tbl_product) columns_tbl_product_history_link = { '__tablename__': 'tbl_product_history_link', 'product_id': common_columns.get('integer_not_nullable')(), 'previous_product_id': common_columns.get('integer')() } ProductHistoryLink = get_phat_table( model_name='ProductHistoryLink', columndict=columns_tbl_product_history_link) # ---------------------------- Product Premium Increases----------------------------------- # ProductAnnualPremiumIncreaseOption, ProductPremiumFrequencyOption columns_tbl_product_annual_premium_increase_option = {
# ********************* Policy ***********************************# PolicyType = get_type_table(model_name='Policy', table_name='policy') PolicyDateType = get_type_table(model_name='PolicyDate', table_name='policy_date') columns_tbl_policy = { '__tablename__': 'tbl_policy', 'policy_number': common_columns.get('title_not_nullable')(), 'policy_type_id': common_columns.get('integer_not_nullable')(), 'product_id': common_columns.get('integer_not_nullable')(), 'entity_insured_id': common_columns.get('integer_not_nullable')(), 'entity_policy_owner_id': common_columns.get('integer')(), 'application_form_serial_no': common_columns.get('title')(), } Policy = get_phat_table(model_name='Policy', columndict=columns_tbl_policy) columns_tbl_policy_intermediary_link = { '__tablename__': 'tbl_policy_intermediary_link', 'policy_id': common_columns.get('integer_not_nullable')(), 'entity_organisation_intermediary_id': common_columns.get('integer_not_nullable')(), 'entity_organisation_intermediary_agent_id': common_columns.get('integer')(), } PolicyIntermediaryLink = get_phat_table( model_name='PolicyIntermediaryLink', columndict=columns_tbl_policy_intermediary_link)
from sqlalchemy import Table, ForeignKey, Column from sqlalchemy.types import Unicode, Integer, DateTime, Boolean from sqlalchemy.orm import relation, synonym from rocket.model import DeclarativeBase, metadata, DBSession from rocket.lib.model_utils import PhatBase, common_columns, get_type_table, get_phat_table # ---------------------------- Currency ----------------------------------- columns_tbl_currency = { '__tablename__': 'tbl_currency', 'code': common_columns.get('title_not_nullable')(), 'name': common_columns.get('title_not_nullable')(), 'is_home_currency': common_columns.get('boolean_default_false')() } Currency = get_phat_table(model_name='Currency', columndict=columns_tbl_currency) columns_tbl_language = { '__tablename__': 'tbl_language', 'code': common_columns.get('title_not_nullable')(), 'name': common_columns.get('title_not_nullable')() } Language = get_phat_table(model_name='Language', columndict=columns_tbl_language) columns_tbl_mail_merge = { '__tablename__': 'tbl_mail_merge', 'code': common_columns.get('title_not_nullable')(), 'name': common_columns.get('title_not_nullable')() } MailMerge = get_phat_table(model_name='MailMerge',
columns_tbl_batch_import = { '__tablename__': 'tbl_batch_import', 'import_type_id': common_columns.get('integer_not_nullable')(), 'filename': common_columns.get('description_not_nullable')(), 'processed': common_columns.get('datetime')(), 'total_count': common_columns.get('integer')(), 'accepted_count': common_columns.get('integer')(), #pre_purchase_count: common_columns.get('integer_default')(0), # Ask Directors if this functionality is required ???? 14 Jan 2020 Trevor 'rejected_count': common_columns.get('integer')(), 'notes': common_columns.get('description_not_nullable')(), #'is_complete_load': common_columns.get('boolean_default_false')(), #'is_complete_update': common_columns.get('boolean_default_false')(), #'is_successful': common_columns.get('boolean_default_false')(), } BatchImport = get_phat_table(model_name='BatchImport', columndict=columns_tbl_batch_import) columns_tbl_batch_import_audit = { '__tablename__': 'tbl_batch_import_audit', 'batch_import_id': common_columns.get('integer_not_nullable')(), 'audit_date_time': common_columns.get('datetime') (), #: common_columns.get('datetime_default_now')(), 'audit': common_columns.get('description_not_nullable')(), } BatchImportAudit = get_phat_table(model_name='BatchImportAudit', columndict=columns_tbl_batch_import_audit) columns_tbl_batch_import_error = { '__tablename__': 'tbl_batch_import_error', 'batch_import_id': common_columns.get('integer_not_nullable')(), 'message': common_columns.get('longtext_not_nullable')(),
from sqlalchemy import Table, ForeignKey, Column from sqlalchemy.types import Unicode, Integer, DateTime, Boolean from sqlalchemy.orm import relation, synonym from rocket.model import DeclarativeBase, metadata, DBSession from rocket.lib.model_utils import PhatBase, common_columns, get_phat_table, get_type_table # ********************* Claim ***********************************# columns_tbl_claim = { '__tablename__': 'tbl_claim', 'capture_date': common_columns.get('date')(), 'cover_and_exclusion_type_id': common_columns.get('integer_not_nullable')(), } Claim = get_phat_table(model_name='Claim', columndict=columns_tbl_claim) columns_tbl_claim_claimant = { '__tablename__': 'tbl_claim_claimant', 'claim_id': common_columns.get('integer_not_nullable')(), 'person_id': common_columns.get('integer_not_nullable')(), } ClaimClaimant = get_phat_table(model_name='ClaimClaimant', columndict=columns_tbl_claim_claimant) # ********************* Claim Status ***********************************# ClaimStatusType = get_type_table(model_name='ClaimStatus', table_name='claim_status') columns_tbl_claim_status = {
from sqlalchemy import Table, ForeignKey, Column from sqlalchemy.types import Unicode, Integer, DateTime, Boolean from sqlalchemy.orm import relation, synonym from rocket.model import DeclarativeBase, metadata, DBSession from rocket.lib.model_utils import PhatBase, common_columns, get_phat_table, get_type_table # ********************* Member ***********************************# columns_tbl_member = { '__tablename__': 'tbl_member', 'person_id': common_columns.get('integer_unique_not_nullable')(), 'register_date': common_columns.get('date_not_nullable')(), 'external_id': common_columns.get('integer')() } Member = get_phat_table(model_name='Member', columndict=columns_tbl_member) # ********************* Member Comment ***********************************# columns_tbl_member_comment = { '__tablename__': 'tbl_member_comment', 'member_id': common_columns.get('integer_not_nullable')(), 'comment': common_columns.get('longtext_not_nullable')() } MemberComment = get_phat_table(model_name='MemberComment', columndict=columns_tbl_member_comment) # ********************* Member Enrolment ***********************************# columns_tbl_member_enrolment = { '__tablename__': 'tbl_member_enrolment',