﻿CREATE TABLE "ACCOUNT" 
   (           "ID" NUMBER(18,0) NOT NULL ENABLE, 
                "ACNT_CONTRACT__OID" NUMBER(18,0), 
                "CODE" VARCHAR2(32 BYTE), 
                "CURR" VARCHAR2(3 BYTE), 
                "ACAT" VARCHAR2(1 BYTE), 
                "DUE_TYPE" VARCHAR2(1 BYTE), 
                "ACCOUNT_TYPE" NUMBER(18,0), 
                "ACCOUNT_NAME" VARCHAR2(255 BYTE), 
                "ACCOUNT_NUMBER" VARCHAR2(64 BYTE), 
                "GL_NUMBER" VARCHAR2(64 BYTE), 
                "ACC_TEMPL__ID" NUMBER(18,0), 
                "MAIN_ACCOUNT" NUMBER(18,0), 
                "ALTER_ACCOUNT" NUMBER(18,0), 
                "DUE_ACCOUNT" NUMBER(18,0), 
                "ALTER_DUE_ACCOUNT" NUMBER(18,0), 
                "LOW_LIM_ACCOUNT" NUMBER(18,0), 
                "UPP_LIM_ACCOUNT" NUMBER(18,0), 
                "LOW_LIM_AMOUNT" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "UPP_LIM_AMOUNT" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "BEGIN_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "CURRENT_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "TOTAL_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "OWN_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "CHARGE_FOR_OPEN" NUMBER(18,0), 
                "CYCLE_DATE_FROM" DATE, 
                "CYCLE_DATE_TO" DATE, 
                "INTEREST_RATE" NUMBER(15,8) DEFAULT 0 NOT NULL ENABLE, 
                "INTEREST_ACCOUNT" NUMBER(18,0), 
                "IS_AM_AVAILABLE" VARCHAR2(1 BYTE), 
                "PAYMENT_PRIORITY" NUMBER(3,0) DEFAULT 0 NOT NULL ENABLE, 
                "N_OF_CYCLE" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, 
                "TOP_ACCOUNT" NUMBER(18,0), 
                "AGEING_PRIORITY" NUMBER(3,0) DEFAULT 0 NOT NULL ENABLE, 
                "INTEREST_FEE_RATE" NUMBER(15,8) DEFAULT 0 NOT NULL ENABLE, 
                "ON_DATE" DATE, 
                "ON_DATE_BALANCE" NUMBER(28,10), 
                "ROUTING_IDT" VARCHAR2(32 BYTE), 
                "APPLY_DT" DATE, 
                "LOCAL_VERSION" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, 
                "REMOTE_VERSION" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, 
                 CONSTRAINT "PK_ACCOUNT" PRIMARY KEY ("ID")
   );

CREATE TABLE "ACNT_CONTRACT" 
   (           "AMND_DATE" DATE DEFAULT sysdate, 
                "AMND_STATE" VARCHAR2(1 BYTE) DEFAULT 'A', 
                "AMND_OFFICER" NUMBER(18,0), 
                "AMND_PREV" NUMBER(18,0), 
                "ID" NUMBER(18,0) NOT NULL ENABLE, 
                "PCAT" VARCHAR2(1 BYTE), 
                "CON_CAT" VARCHAR2(1 BYTE), 
                "TERMINAL_CATEGORY" VARCHAR2(1 BYTE), 
                "CCAT" VARCHAR2(1 BYTE), 
                "F_I" NUMBER(18,0), 
                "BRANCH" VARCHAR2(32 BYTE), 
                "SERVICE_GROUP" VARCHAR2(32 BYTE), 
                "CONTRACT_NUMBER" VARCHAR2(64 BYTE), 
                "BASE_RELATION" VARCHAR2(32 BYTE), 
                "CONTRACT_NAME" VARCHAR2(255 BYTE), 
                "COMMENT_TEXT" VARCHAR2(255 BYTE), 
                "RELATION_TAG" VARCHAR2(1 BYTE), 
                "ACNT_CONTRACT__ID" NUMBER(18,0), 
                "CONTR_TYPE" NUMBER(18,0), 
                "CONTR_SUBTYPE__ID" NUMBER(18,0), 
                "SERV_PACK__ID" NUMBER(18,0), 
                "ACC_SCHEME__ID" NUMBER(18,0), 
                "OLD_PACK" NUMBER(18,0), 
                "CHANNEL" VARCHAR2(32 BYTE), 
                "OLD_SCHEME" NUMBER(18,0), 
                "PRODUCT" VARCHAR2(32 BYTE), 
                "PARENT_PRODUCT" VARCHAR2(32 BYTE), 
                "PRODUCT_PREV" VARCHAR2(32 BYTE), 
                "MAIN_PRODUCT" NUMBER(18,0), 
                "LIAB_CATEGORY" VARCHAR2(1 BYTE), 
                "CLIENT__ID" NUMBER(18,0), 
                "CLIENT_TYPE" NUMBER(18,0), 
                "ACNT_CONTRACT__OID" NUMBER(18,0), 
                "LIAB_CONTRACT" NUMBER(18,0), 
                "LIAB_CONTRACT_PREV" NUMBER(18,0), 
                "BILLING_CONTRACT" NUMBER(18,0), 
                "BEHAVIOR_GROUP" NUMBER(18,0), 
                "BEHAVIOR_TYPE" NUMBER(18,0), 
                "BEHAVIOR_TYPE_PREV" NUMBER(18,0), 
                "CHECK_AVAILABLE" VARCHAR2(1 BYTE), 
                "CHECK_USAGE" VARCHAR2(1 BYTE) DEFAULT 'N', 
                "CURR" VARCHAR2(3 BYTE), 
                "OLD_CURR" VARCHAR2(3 BYTE), 
                "AUTH_LIMIT_AMOUNT" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "BASE_AUTH_LIMIT" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "LIAB_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "LIAB_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "OWN_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "OWN_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "SUB_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "SUB_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "TOTAL_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "TOTAL_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "SHARED_BALANCE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "SHARED_BLOCKED" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "AMOUNT_AVAILABLE" NUMBER(28,10) DEFAULT 0 NOT NULL ENABLE, 
                "DATE_OPEN" DATE, 
                "DATE_EXPIRE" DATE, 
                "LAST_BILLING_DATE" DATE, 
                "NEXT_BILLING_DATE" DATE, 
                "LAST_SCAN" DATE, 
                "CARD_EXPIRE" VARCHAR2(4 BYTE), 
                "PRODUCTION_STATUS" VARCHAR2(1 BYTE), 
                "RBS_MEMBER_ID" VARCHAR2(32 BYTE), 
                "RBS_NUMBER" VARCHAR2(64 BYTE), 
                "REPORT_TYPE" VARCHAR2(32 BYTE), 
                "MAX_PIN_ATTEMPTS" NUMBER(3,0) DEFAULT 3 NOT NULL ENABLE, 
                "PIN_ATTEMPTS" NUMBER(3,0) DEFAULT 0 NOT NULL ENABLE, 
                "RISK_SCHEME" NUMBER(18,0), 
                "CHIP_SCHEME" NUMBER(18,0), 
                "RISK_FACTOR" NUMBER(7,3) DEFAULT 1 NOT NULL ENABLE, 
                "RISK_FACTOR_PREV" NUMBER(7,3) DEFAULT 1 NOT NULL ENABLE, 
                "CONTR_STATUS" NUMBER(18,0), 
                "MERCHANT_ID" VARCHAR2(255 BYTE), 
                "TR_TITLE" NUMBER(18,0), 
                "TR_COMPANY" VARCHAR2(32 BYTE), 
                "TR_COUNTRY" VARCHAR2(3 BYTE), 
                "TR_FIRST_NAM" VARCHAR2(32 BYTE), 
                "TR_LAST_NAM" VARCHAR2(32 BYTE), 
                "TR_SIC" VARCHAR2(4 BYTE), 
                "ADD_INFO_01" VARCHAR2(255 BYTE), 
                "ADD_INFO_02" VARCHAR2(255 BYTE), 
                "ADD_INFO_03" VARCHAR2(255 BYTE), 
                "ADD_INFO_04" VARCHAR2(255 BYTE), 
                "CONTRACT_LEVEL" VARCHAR2(255 BYTE), 
                "EXT_DATA" VARCHAR2(4000 BYTE), 
                "REPORT_ADDRESS" NUMBER(18,0), 
                "SHARE_BALANCE" VARCHAR2(1 BYTE), 
                "IS_MULTYCURRENCY" VARCHAR2(1 BYTE), 
                "ENABLES_ITEM" VARCHAR2(1 BYTE), 
                "CYCLE_LENGTH" NUMBER(3,0) DEFAULT 0 NOT NULL ENABLE, 
                "INTERVAL_TYPE" VARCHAR2(1 BYTE) DEFAULT 'M', 
                "STATUS_CATEGORY" VARCHAR2(1 BYTE), 
                "LIMIT_IS_ACTIVE" VARCHAR2(1 BYTE), 
                "IS_READY" VARCHAR2(1 BYTE) DEFAULT 'N', 
                "SETTLEMENT_TYPE" VARCHAR2(1 BYTE), 
                "AUTH_SEQ_N" NUMBER(18,0), 
                "ROUTING_IDT" VARCHAR2(32 BYTE), 
                "APPLY_DT" DATE, 
                "LOCAL_VERSION" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, 
                "REMOTE_VERSION" NUMBER(9,0) DEFAULT 0 NOT NULL ENABLE, 
                 CONSTRAINT "PK_ACNT_CONTRACT" PRIMARY KEY ("ID")
   );
