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 # ********************* Payment ***********************************# PaymentType = get_type_table(model_name='Payment', table_name='payment') PaymentTransactionType = get_type_table(model_name='PaymentTransaction', table_name='payment_transaction') PaymentTransactionDebitCreditType = get_type_table(model_name='PaymentTransactionDebitCredit', table_name='payment_transaction_debit_credit') 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',
BenefitAllocationCalculationType = get_type_table(model_name='BenefitAllocationCalculation', table_name='benefit_allocation_calculation') # Percentage, Amount, Factor BenefitFrequencyType = get_type_table(model_name='BenefitFrequency', table_name='benefit_frequency') # Daily, Weekly, etc. BenefitAssuredLifeRelationshipType = get_type_table(model_name='BenefitAssuredLifeRelationship', table_name='benefit_assured_life_relationship') # Principal, Spouse, etc. BenefitAssetType = get_type_table(model_name='BenefitAsset', table_name='benefit_asset') # Business, Employee, Vehicle, Property # Utilities SystemDocumentType = get_type_table(model_name='SystemDocument', table_name='system_document') # Welcome, Claim, Member, Product 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)
EntityType = get_type_table(model_name='Entity', table_name='entity') 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')(),
from rocket.lib.model_utils import PhatBase, common_columns, get_type_table, get_phat_table # ---------------------------- Product ----------------------------------- # Product, ProductType, ProductState, ProductHistoryLink ProductType = get_type_table( 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',
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 # ********************* 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')(),
import os from datetime import datetime from hashlib import sha256 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 = {
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 # ********************* Batch Import ***********************************# BatchImportType = get_type_table(model_name='BatchImport', table_name='batch_import') 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 = {
import os from datetime import datetime from hashlib import sha256 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 ***********************************#
import os from datetime import datetime from hashlib import sha256 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)