-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathddl.sql
executable file
·1700 lines (1539 loc) · 65 KB
/
ddl.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- This SQL DDL script was generated by Microsoft Visual Studio (Release Date: LOCAL BUILD).
-- Driver Used : Microsoft Visual Studio - Oracle Server Driver.
-- Document : C:\Projects\ratanet\Documentation\00-Inception\business requirements\BusinessModel\DBModel2002.vsd.
-- Time Created: 30 August 2010 �. 14:38.
-- Operation : From Visio Generate Wizard.
-- Connected data source : No connection.
-- Connected server : No connection.
-- Connected database : Not applicable.
-- Create a database.
connect internal ;
startup nomount pfile= ;
spool create_db_a ;
create database A;
create rollback segment a_r0 tablespace system ;
alter rollback segment a_r0 online ;
-- Create Oracle exception file.
create table exceptions ( row_id rowid, owner varchar2(30), table_name varchar2(30), constraint varchar2(30)) ;
-- Create new table INSUR_PRODUCT_GROUP.
-- INSUR_PRODUCT_GROUP : Table of Insur_Product_Group
-- ID : id identifies Insur_Product_Group
-- NAME : name is of Insur_Product_Group
-- ISMANDATORY : isMandatory is of Insur_Product_Group
create table INSUR_PRODUCT_GROUP (
ID INTEGER not null,
NAME VARCHAR2(100) not null,
ISMANDATORY CHAR(1) not null, constraint INSUR_PRODUCT_GROUP_PK primary key (ID) );
-- Create new table INSUR_TYPE_INSUR_GROUP.
-- INSUR_TYPE_INSUR_GROUP : Table of Insur_Type_Insur_Group
-- ID : id identifies Insur_Type_Insur_Group
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_Type_Insur_Group
-- ID_INSUR_GROUP : ID_Insur_Group is of Insur_Type_Insur_Group
create table INSUR_TYPE_INSUR_GROUP (
ID INTEGER not null,
ID_INSUR_TYPE INTEGER not null,
ID_INSUR_GROUP INTEGER not null, constraint INSUR_TYPE_INSUR_GROUP_PK primary key (ID) );
-- Create new table POWEROFATTORNEY.
-- POWEROFATTORNEY : Table of PowerOfAttorney
-- ID : id identifies PowerOfAttorney
-- ID_USER : ID_User is of PowerOfAttorney
-- DICTIONARY_TYPE_OF_ATTORNEY : Dictionary_Type_of_attorney is of PowerOfAttorney
-- ATTORNEY_NUMBER : attorney_number is of PowerOfAttorney
-- ATTORNEY_DATE_START : attorney_date_start is of PowerOfAttorney
-- ATTORNEY_DATE_FINISH : attorney_date_finish is of PowerOfAttorney
-- DICTIONARY_TYPE_PURPOSE : Dictionary_Type_Purpose is of PowerOfAttorney
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of PowerOfAttorney
create table POWEROFATTORNEY (
ID INTEGER not null,
ID_USER INTEGER not null,
DICTIONARY_TYPE_OF_ATTORNEY VARCHAR2(30) null,
ATTORNEY_NUMBER VARCHAR2(300) null,
ATTORNEY_DATE_START DATE null,
ATTORNEY_DATE_FINISH DATE null,
DICTIONARY_TYPE_PURPOSE VARCHAR2(30) null,
ID_EXTERNALDISTRIBUTOR INTEGER null, constraint POWEROFATTORNEY_PK primary key (ID) );
-- Create new table INSUR_FORMULA.
-- INSUR_FORMULA : Table of Insur_Formula
-- ID : id identifies Insur_Formula
-- ID_FORMULA : id_formula is of Insur_Formula
-- NAME : Name is of Insur_Formula
-- ID_INSUR_BAREME : ID_Insur_Bareme is of Insur_Formula
create table INSUR_FORMULA (
ID INTEGER not null,
ID_FORMULA VARCHAR2(100) null,
NAME VARCHAR2(250) null,
ID_INSUR_BAREME INTEGER not null, constraint INSUR_FORMULA_PK primary key (ID) );
-- Create new table INSUR_BAREME.
-- INSUR_BAREME : Table of Insur_Bareme
-- ID : id identifies Insur_Bareme
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_Bareme
-- NAME : name is of Insur_Bareme
-- DATESTART : DateStart is of Insur_Bareme
-- DATEFINISH : DateFinish is of Insur_Bareme
-- DICTIONARY_STATUS_PRICING : Dictionary_Status_pricing is of Insur_Bareme
-- DURATIONMIN : DurationMin is of Insur_Bareme
-- DURATIONMAX : DurationMax is of Insur_Bareme
-- AMOUNTMIN : AmountMin is of Insur_Bareme
-- AMOUNTMAX : AmountMax is of Insur_Bareme
-- AGEMIN : AgeMin is of Insur_Bareme
-- AGEMAX : AgeMax is of Insur_Bareme
-- DICTIONARY_INS_PEOPLE_NUM : Dictionary_ins_people_num is of Insur_Bareme
-- PERCENTAGE : Percentage is of Insur_Bareme
-- DICTIONARY_BASE_PERCENTAGE : Dictionary_Base_percentage is of Insur_Bareme
-- FIXED_AMOUNT : Fixed_amount is of Insur_Bareme
-- COMISSION_PREMIUM : Comission_premium is of Insur_Bareme
-- DICTIONARY_INSURANCE_OBJECT : Dictionary_Insurance_Object is of Insur_Bareme
create table INSUR_BAREME (
ID INTEGER not null,
ID_INSUR_TYPE INTEGER not null,
NAME VARCHAR2(100) null,
DATESTART DATE null,
DATEFINISH DATE null,
DICTIONARY_STATUS_PRICING VARCHAR2(30) null,
DURATIONMIN INTEGER null,
DURATIONMAX INTEGER null,
AMOUNTMIN NUMBER(20,6) null,
AMOUNTMAX NUMBER(20,6) null,
AGEMIN INTEGER null,
AGEMAX INTEGER null,
DICTIONARY_INS_PEOPLE_NUM VARCHAR2(30) null,
PERCENTAGE NUMBER(20,6) null,
DICTIONARY_BASE_PERCENTAGE VARCHAR2(30) null,
FIXED_AMOUNT NUMBER(20,6) null,
COMISSION_PREMIUM NUMBER(20,6) null,
DICTIONARY_INSURANCE_OBJECT VARCHAR2(30) not null,
LAST_UPDATE DATE null, constraint INSUR_BAREME_PK primary key (ID) );
-- Create new table INSUR_GROUP.
-- INSUR_GROUP : Table of Insur_Group
-- ID : id identifies Insur_Group
-- ISMANDATORY : IsMandatory is of Insur_Group
-- NAME : name is of Insur_Group
create table INSUR_GROUP (
ID INTEGER not null,
ISMANDATORY CHAR(1) not null,
NAME VARCHAR2(100) not null, constraint INSUR_GROUP_PK primary key (ID) );
-- Create new table INSUR_PEOPLE_NUMBER.
-- INSUR_PEOPLE_NUMBER : Table of Insur_People_number
-- ID : id identifies Insur_People_number
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_People_number
-- DICTIONARY_INS_PEOPLE_NUM : Dictionary_ins_people_num is of Insur_People_number
create table INSUR_PEOPLE_NUMBER (
ID INTEGER not null,
ID_INSUR_TYPE INTEGER not null,
DICTIONARY_INS_PEOPLE_NUM VARCHAR2(30) null, constraint INSUR_PEOPLE_NUMBER_PK primary key (ID) );
-- Create new table INSUR_TYPEOBJECT.
-- INSUR_TYPEOBJECT : Table of Insur_TypeObject
-- ID : id identifies Insur_TypeObject
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_TypeObject
-- DICTIONARY_INSURANCE_OBJECT : Dictionary_Insurance_Object is of Insur_TypeObject
create table INSUR_TYPEOBJECT (
ID INTEGER not null,
ID_INSUR_TYPE INTEGER not null,
DICTIONARY_INSURANCE_OBJECT VARCHAR2(30) null, constraint INSUR_TYPEOBJECT_PK primary key (ID) );
-- Create new table INSUR_TYPE_PROFESSION.
-- INSUR_TYPE_PROFESSION : Table of Insur_Type_Profession
-- ID : id identifies Insur_Type_Profession
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_Type_Profession
-- DICTIONARY_PROFESSION : Dictionary_Profession is of Insur_Type_Profession
create table INSUR_TYPE_PROFESSION (
ID INTEGER not null,
ID_INSUR_TYPE INTEGER not null,
DICTIONARY_PROFESSION VARCHAR2(30) null, constraint INSUR_TYPE_PROFESSION_PK primary key (ID) );
-- Create new table INSUR_CONTRACT.
-- INSUR_CONTRACT : Table of Insur_Contract
-- ID : id identifies Insur_Contract
-- CODE_INSURANCE_CONTRACT : code_insurance_contract is of Insur_Contract
-- NAME : name is of Insur_Contract
-- ID_INSUR_TYPE : ID_Insur_Type is of Insur_Contract
-- VERSIONNUMBER : VersionNumber is of Insur_Contract
-- VERSIONDATE : VersionDate is of Insur_Contract
-- ISVERSIONACTIVE : IsVersionActive is of Insur_Contract
create table INSUR_CONTRACT (
ID INTEGER not null,
CODE_INSURANCE_CONTRACT VARCHAR2(100) not null,
NAME VARCHAR2(100) null,
ID_INSUR_TYPE INTEGER not null,
VERSIONNUMBER VARCHAR2(10) null,
VERSIONDATE DATE null,
ISVERSIONACTIVE CHAR(1) null, constraint INSUR_CONTRACT_PK primary key (ID) );
-- Create new table INSUR_TYPE.
-- INSUR_TYPE : Table of Insur_Type
-- ID : id identifies Insur_Type
-- ID_INSUR_PRODUCT : ID_Insur_Product is of Insur_Type
-- NAME : name is of Insur_Type
-- NAMESCREEN : NameScreen is of Insur_Type
-- DESCRIPTION : Description is of Insur_Type
-- DATESTART : DateStart is of Insur_Type
-- DATEFINISH : DateFinish is of Insur_Type
-- DICTIONARY_STATUS_PRICING : Dictionary_Status_pricing is of Insur_Type
-- DICTIONARY_TYPE_INSURANCE : Dictionary_Type_Insurance is of Insur_Type
-- ID_INSURANCE_COMPANY : id_insurance_company is of Insur_Type
-- DURATIONMIN : DurationMin is of Insur_Type
-- DURATIONMAX : DurationMax is of Insur_Type
-- AMOUNTMIN : AmountMin is of Insur_Type
-- AMOUNTMAX : AmountMax is of Insur_Type
-- AGEMIN : AgeMin is of Insur_Type
-- AGEMAX : AgeMax is of Insur_Type
-- ISPROFESSION : IsProfession is of Insur_Type
-- CODE_OF_INSURANCE_PROG_CARDIFF : code_of_insurance_prog_cardiff is of Insur_Type
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of Insur_Type
-- DICTIONARY_POLICY_INSURANCE : Dictionary_Policy_Insurance is of Insur_Type
create table INSUR_TYPE (
ID INTEGER not null,
ID_INSUR_PRODUCT INTEGER not null,
NAME VARCHAR2(100) null,
NAMESCREEN VARCHAR2(100) null,
DESCRIPTION VARCHAR2(500) null,
DATESTART DATE null,
DATEFINISH DATE null,
DICTIONARY_STATUS_PRICING VARCHAR2(30) null,
DICTIONARY_TYPE_INSURANCE VARCHAR2(30) null,
ID_INSURANCE_COMPANY VARCHAR2(100) null,
DURATIONMIN INTEGER null,
DURATIONMAX INTEGER null,
AMOUNTMIN NUMBER(20,6) null,
AMOUNTMAX NUMBER(20,6) null,
AGEMIN INTEGER null,
AGEMAX INTEGER null,
ISPROFESSION CHAR(1) null,
CODE_OF_INSURANCE_PROG_CARDIFF VARCHAR2(100) null,
ID_EXTERNALDISTRIBUTOR INTEGER not null,
DICTIONARY_POLICY_INSURANCE VARCHAR2(30) null,
LAST_UPDATE DATE null, constraint INSUR_TYPE_PK primary key (ID) );
-- Create new table INSUR_PRODUCT_PRODUCT.
-- INSUR_PRODUCT_PRODUCT : Table of Insur_Product_Product
-- ID : id identifies Insur_Product_Product
-- ID_INSUR_PRODUCT_GROUP : ID_Insur_Product_Group is of Insur_Product_Product
-- IS_MANDATORY : isMandatory is of Insur_Product_Product
-- ID_INSUR_PRODUCT : ID_insur_product is of Insur_Product_Product
create table INSUR_PRODUCT_PRODUCT (
ID INTEGER not null,
ID_INSUR_PRODUCT_GROUP INTEGER not null,
IS_MANDATORY CHAR(1) not null,
ID_INSUR_PRODUCT INTEGER not null, constraint INSUR_PRODUCT_PRODUCT_PK primary key (ID) );
-- Create new table INSUR_PRODUCT.
-- INSUR_PRODUCT : Table of Insur_Product
-- ID : id identifies Insur_Product
-- NAME : Name is of Insur_Product
-- NAMESCREEN : NameScreen is of Insur_Product
-- DESCRIPTION : Description is of Insur_Product
-- DICTIONARY_TYPE_OF_PRODUCT : Dictionary_Type_Of_Product is of Insur_Product
-- DICTIONARY_TYPE_PROD_CONTENT : Dictionary_Type_Prod_Content is of Insur_Product
-- DATESTART : DateStart is of Insur_Product
-- DATEFINISH : DateFinish is of Insur_Product
-- DICTIONARY_STATUS_PRICING : Dictionary_Status_pricing is of Insur_Product
-- DICTIONARY_CURRENCY : Dictionary_Currency is of Insur_Product
create table INSUR_PRODUCT (
ID INTEGER not null,
NAME VARCHAR2(100) not null,
NAMESCREEN VARCHAR2(100) not null,
DESCRIPTION VARCHAR2(500) null,
DICTIONARY_TYPE_OF_PRODUCT VARCHAR2(30) null,
DICTIONARY_TYPE_PROD_CONTENT VARCHAR2(30) null,
DATESTART DATE null,
DATEFINISH DATE null,
DICTIONARY_STATUS_PRICING VARCHAR2(30) null,
DICTIONARY_CURRENCY VARCHAR2(30) null,
LAST_UPDATE DATE null, constraint INSUR_PRODUCT_PK primary key (ID) );
-- Create new table INSUR_OBJECT_ED.
-- INSUR_OBJECT_ED : Table of Insur_Object_ED
-- ID : id identifies Insur_Object_ED
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of Insur_Object_ED
-- DICTIONARY_INSURANCE_OBJECT : Dictionary_Insurance_Object is of Insur_Object_ED
create table INSUR_OBJECT_ED (
ID INTEGER not null,
ID_EXTERNALDISTRIBUTOR INTEGER not null,
DICTIONARY_INSURANCE_OBJECT VARCHAR2(30) null, constraint INSUR_OBJECT_ED_PK primary key (ID) );
-- Create new table INSUR_COEFFICIENTS
-- INSUR_COEFFICIENTS :
-- INSURANCE_TYPE_RID :
-- DICTIONARY_ID :
-- OWNER_DICTIONARY_ID :
-- VALUE :
-- COEFFICIENT_RID :
create table INSUR_COEFFICIENTS (
INSURANCE_TYPE_RID NUMBER(19,0) not null,
DICTIONARY_ID VARCHAR2(255) not null,
OWNER_DICTIONARY_ID VARCHAR2(255) not null,
VALUE NUMBER(19,2) not null,
COEFFICIENT_RID NUMBER(19,0) null, constraint primary key (INSURANCE_TYPE_RID, DICTIONARY_ID, OWNER_DICTIONARY_ID) );
-- Create new table AU_AUDIT.
-- AU_AUDIT : Table of AU_AUDIT
-- ACTION_DATE : action_date is of AU_AUDIT
-- INITIATOR_ID : initiator_id is of AU_AUDIT
-- INITIATOR_LOGIN : initiator_login is of AU_AUDIT
-- AUDIT_TYPE : audit_type is of AU_AUDIT
-- SUBSYS_TYPE : subsys_type is of AU_AUDIT
-- SUBSYS_ID : subsys_id is of AU_AUDIT
-- SUBSYS_NAME : subsys_name is of AU_AUDIT
-- ACTION_TYPE : action_type is of AU_AUDIT
-- DESCRIPTION : description is of AU_AUDIT
-- EXTENSION_FIELD : extension_field is of AU_AUDIT
-- REFERENCE : reference is of AU_AUDIT
-- ID : id identifies AU_AUDIT
create table AU_AUDIT (
ACTION_DATE DATE null,
INITIATOR_ID INTEGER null,
INITIATOR_LOGIN VARCHAR2(32) null,
AUDIT_TYPE INTEGER null,
SUBSYS_TYPE INTEGER null,
SUBSYS_ID INTEGER null,
SUBSYS_NAME VARCHAR2(32) null,
ACTION_TYPE INTEGER null,
DESCRIPTION VARCHAR2(256) null,
EXTENSION_FIELD VARCHAR2(256) null,
REFERENCE INTEGER null,
ID INTEGER not null, constraint AU_AUDIT_PK primary key (ID) );
-- Create new table AU_ACTION_TYPE.
-- AU_ACTION_TYPE : Table of AU_ACTION_TYPE
-- ID : id identifies AU_ACTION_TYPE
-- SHOWNAME : showname is of AU_ACTION_TYPE
-- DESCRIPTION : description is of AU_ACTION_TYPE
create table AU_ACTION_TYPE (
ID INTEGER not null,
SHOWNAME VARCHAR2(32) null,
DESCRIPTION VARCHAR2(256) null, constraint AU_ACTION_TYPE_PK primary key (ID) );
-- Create new table AU_SUBSYS_TYPE.
-- AU_SUBSYS_TYPE : Table of AU_SUBSYS_TYPE
-- ID : id identifies AU_SUBSYS_TYPE
-- SHOWNAME : showname is of AU_SUBSYS_TYPE
-- DESCRIPTION : description is of AU_SUBSYS_TYPE
create table AU_SUBSYS_TYPE (
ID INTEGER not null,
SHOWNAME VARCHAR2(32) null,
DESCRIPTION VARCHAR2(256) null, constraint AU_SUBSYS_TYPE_PK primary key (ID) );
-- Create new table AU_AUDIT_TYPE.
-- AU_AUDIT_TYPE : Table of AU_AUDIT_TYPE
-- ID : id identifies AU_AUDIT_TYPE
-- SHOWNAME : showname is of AU_AUDIT_TYPE
-- DESCRIPTION : description is of AU_AUDIT_TYPE
create table AU_AUDIT_TYPE (
ID INTEGER not null,
SHOWNAME VARCHAR2(32) null,
DESCRIPTION VARCHAR2(256) null, constraint AU_AUDIT_TYPE_PK primary key (ID) );
-- Create new table DUEDAYS.
-- DUEDAYS : Table of DueDays
-- ID : id identifies DueDays
-- ID_CREDITTYPE : ID_CreditType is of DueDays
-- DUEDAY : DueDay is of DueDays
create table DUEDAYS (
ID INTEGER not null,
ID_CREDITTYPE INTEGER not null,
DUEDAY INTEGER not null, constraint DUEDAYS_PK primary key (ID) );
-- Create new table CREDITTYPEBAREME.
-- CREDITTYPEBAREME : Table of CreditTypeBareme
-- ID : id identifies CreditTypeBareme
-- ID_CREDITTYPE : id_credittype is of CreditTypeBareme
-- BAREME_CODE : bareme_code is of CreditTypeBareme
create table CREDITTYPEBAREME (
ID INTEGER not null,
ID_CREDITTYPE INTEGER not null,
BAREME_CODE INTEGER not null,
LAST_UPDATE DATE null, constraint CREDITTYPEBAREME_PK primary key (ID) );
-- Create new table EXTERNALDISTRIBUTORDOCUMENT.
-- EXTERNALDISTRIBUTORDOCUMENT : Table of ExternalDistributorDocument
-- ID : id identifies ExternalDistributorDocument
-- EXTERNALDISTRIBUTOR_ID : ExternalDistributor_id is of ExternalDistributorDocument
-- DOCUMENT_TYPE : Document_type is of ExternalDistributorDocument
-- DOCUMENT_NAME : Document_name is of ExternalDistributorDocument
create table EXTERNALDISTRIBUTORDOCUMENT (
ID INTEGER not null,
EXTERNALDISTRIBUTOR_ID INTEGER not null,
DOCUMENT_TYPE VARCHAR2(50) null,
DOCUMENT_NAME VARCHAR2(50) null, constraint EXTERNALDISTRIBUTORDOCUMENT_PK primary key (ID) );
-- Create new table DICTIONARY_RATA.
-- DICTIONARY_RATA : Table of Dictionary_rata
-- ID : id identifies Dictionary_rata
-- NAME : name partly identifies Dictionary_rata
-- "LANGUAGE" : language is of Dictionary_rata
-- "KEY" : key partly identifies Dictionary_rata
-- "VALUE" : value is of Dictionary_rata
-- EXPKEY : expKey is of Dictionary_rata
-- FROMDATE : fromDate is of Dictionary_rata
-- TODATE : toDate is of Dictionary_rata
-- VALID : valid is of Dictionary_rata
-- LASTMODIFICATIONDATE : lastModificationDate is of Dictionary_rata
-- PARENT_KEY : parent_key is of Dictionary_rata
create table DICTIONARY_RATA (
ID INTEGER not null,
NAME VARCHAR2(30) null,
"LANGUAGE" VARCHAR2(30) null,
"KEY" VARCHAR2(50) null,
"VALUE" VARCHAR2(1000) null,
EXPKEY VARCHAR2(30) null,
FROMDATE DATE null,
TODATE DATE null,
VALID NUMBER(10,2) null,
LASTMODIFICATIONDATE DATE null,
PARENT_KEY VARCHAR2(30) null,
LAST_UPDATE DATE null, constraint DICTIONARY_RATA_PK primary key (ID) );
-- Create new table BALANCEUNIT.
-- BALANCEUNIT : Table of BalanceUnit
-- ID : ID identifies BalanceUnit
-- NAME : Name is of BalanceUnit
-- ISSEPARATEACCOUNTING : IsSeparateAccounting is of BalanceUnit
-- ISSEPARATEDATA : IsSeparateData is of BalanceUnit
-- DESCRIPTION : Description is of BalanceUnit
create table BALANCEUNIT (
ID INTEGER not null,
NAME VARCHAR2(10) null,
ISSEPARATEACCOUNTING CHAR(1) null,
ISSEPARATEDATA CHAR(1) null,
DESCRIPTION VARCHAR2(10) null, constraint BALANCEUNIT_PK primary key (ID) );
-- Create new table LINKEDHIERARCHY.
-- LINKEDHIERARCHY : Table of LinkEDHierarchy
-- ID : ID identifies LinkEDHierarchy
-- ID_HIERARCHY : ID_Hierarchy is of LinkEDHierarchy
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor partly identifies LinkEDHierarchy
-- ID_EXTERNALDISTRIBUTORPARENT : ID_ExternalDistributorParent is of LinkEDHierarchy
create table LINKEDHIERARCHY (
ID INTEGER not null,
ID_HIERARCHY INTEGER null,
ID_EXTERNALDISTRIBUTOR INTEGER null,
ID_EXTERNALDISTRIBUTORPARENT INTEGER null, constraint LINKEDHIERARCHY_PK primary key (ID) );
-- Create new table HIERARCHY.
-- HIERARCHY : Table of Hierarchy
-- ID : ID identifies Hierarchy
-- NAME : Name is of Hierarchy
-- DESCRIPTION : Description is of Hierarchy
-- DICTIONARY_HIERARCHY_PURPOSE : Dictionary_Hierarchy_Purpose is of Hierarchy
create table HIERARCHY (
ID INTEGER not null,
NAME VARCHAR2(30) null,
DESCRIPTION VARCHAR2(100) null,
DICTIONARY_HIERARCHY_PURPOSE VARCHAR2(100) null, constraint HIERARCHY_PK primary key (ID) );
-- Create new table CREDITTYPEEXTERNALDISTRIBUTOR.
-- CREDITTYPEEXTERNALDISTRIBUTOR : Table of CreditTypeExternalDistributor
-- ID : ID identifies CreditTypeExternalDistributor
-- ID_CREDITTYPE : ID_CreditType is of CreditTypeExternalDistributor
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of CreditTypeExternalDistributor
create table CREDITTYPEEXTERNALDISTRIBUTOR (
ID INTEGER not null,
ID_CREDITTYPE INTEGER null,
ID_EXTERNALDISTRIBUTOR INTEGER not null, constraint CREDITTYPEED_PK primary key (ID) );
-- Create new table GOODPARTNERGOODLINK.
-- GOODPARTNERGOODLINK : Table of GoodPartnerGoodLink
-- ID : ID identifies GoodPartnerGoodLink
-- ID_GOODEXTERNALDISTRIBUTOR : ID_GoodExternalDistributor is of GoodPartnerGoodLink
-- ID_GOODPARTNERCLASSIFICATION : ID_GoodPartnerClassification is of GoodPartnerGoodLink
create table GOODPARTNERGOODLINK (
ID INTEGER not null,
ID_GOODEXTERNALDISTRIBUTOR INTEGER null,
ID_GOODPARTNERCLASSIFICATION INTEGER null, constraint GOODPARTNERGOODLINK_PK primary key (ID) );
-- Create new table GOODEXTERNALDISTRIBUTOR.
-- GOODEXTERNALDISTRIBUTOR : Table of GoodExternalDistributor
-- ID : ID identifies GoodExternalDistributor
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of GoodExternalDistributor
-- ID_ACCOUNTFINANCE : ID_AccountFinance is of GoodExternalDistributor
-- ID_ACCOUNTCOMISSION : ID_AccountComission is of GoodExternalDistributor
-- DICTIONARY_GOOD : Dictionary_Good is of GoodExternalDistributor
create table GOODEXTERNALDISTRIBUTOR (
ID INTEGER not null,
ID_EXTERNALDISTRIBUTOR INTEGER not null,
ID_ACCOUNTFINANCE INTEGER null,
ID_ACCOUNTCOMISSION INTEGER null,
DICTIONARY_GOOD VARCHAR2(30) null, constraint GOODEXTERNALDISTRIBUTOR_PK primary key (ID) );
-- Create new table CARBRANDEXTERNALDISTRIBUTOR.
-- CARBRANDEXTERNALDISTRIBUTOR : Table of CarBrandExternalDistributor
-- ID : ID identifies CarBrandExternalDistributor
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of CarBrandExternalDistributor
-- ID_ACCOUNTFINANCE : ID_AccountFinance is of CarBrandExternalDistributor
-- ID_ACCOUNTCOMISSION : ID_AccountComission is of CarBrandExternalDistributor
-- DICTIONARY_BRAND : Dictionary_Brand is of CarBrandExternalDistributor
create table CARBRANDEXTERNALDISTRIBUTOR (
ID INTEGER not null,
ID_EXTERNALDISTRIBUTOR INTEGER not null,
ID_ACCOUNTFINANCE INTEGER null,
ID_ACCOUNTCOMISSION INTEGER null,
DICTIONARY_BRAND VARCHAR2(30) null, constraint CARBRANDEXTERNALDISTRIBUTOR_PK primary key (ID) );
-- Create new table CARMODELEXTERNALDISTRIBUTOR.
-- CARMODELEXTERNALDISTRIBUTOR : Table of CarModelExternalDistributor
-- ID : ID identifies CarModelExternalDistributor
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of CarModelExternalDistributor
-- DICTIONARY_MODEL : Dictionary_Model is of CarModelExternalDistributor
create table CARMODELEXTERNALDISTRIBUTOR (
ID INTEGER not null,
ID_EXTERNALDISTRIBUTOR INTEGER not null,
DICTIONARY_MODEL VARCHAR2(30) null, constraint CARMODELEXTERNALDISTRIBUTOR_PK primary key (ID) );
-- Create new table GOODPARTNERCLASSIFICATION.
-- GOODPARTNERCLASSIFICATION : Table of GoodPartnerClassification
-- ID : ID identifies GoodPartnerClassification
-- NAME : Name is of GoodPartnerClassification
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of GoodPartnerClassification
create table GOODPARTNERCLASSIFICATION (
ID INTEGER not null,
NAME VARCHAR2(30) null,
ID_EXTERNALDISTRIBUTOR INTEGER null, constraint GOODPARTNERCLASSIFICATION_PK primary key (ID) );
-- Create new table BANKACCOUNT.
-- BANKACCOUNT : Table of BankAccount
-- ID : ID identifies BankAccount
-- MFO : MFO is of BankAccount
-- ACCOUNT : Account is of BankAccount
-- BANKNAME : BankName is of BankAccount
-- DICTIONARY_PURPOSE_PAYMENT : Dictionary_Purpose_payment is of BankAccount
-- ISACCOUNTACTIVE : IsAccountActive is of BankAccount
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of BankAccount
create table BANKACCOUNT (
ID INTEGER not null,
MFO VARCHAR2(6) null,
ACCOUNT VARCHAR2(14) null,
BANKNAME VARCHAR2(100) null,
DICTIONARY_PURPOSE_PAYMENT VARCHAR2(30) null,
ISACCOUNTACTIVE CHAR(1) null,
ID_EXTERNALDISTRIBUTOR INTEGER null,
ACCOUNT_GROUP INTEGER null,
LAST_UPDATE DATE null, constraint BANKACCOUNT_PK primary key (ID) );
-- Create new table EMPLOYEE.
-- EMPLOYEE : Table of Employee
-- ID : ID identifies Employee
-- "POSITION" : Position is of Employee
-- SURNAME : Surname is of Employee
-- NAME : Name is of Employee
-- PHONE1 : Phone1 is of Employee
-- PHONE2 : Phone2 is of Employee
-- EMAIL : Email is of Employee
-- ID_EXTERNAL_DISTRIBUTOR : ID_External_Distributor is of Employee
create table EMPLOYEE (
ID INTEGER not null,
"POSITION" VARCHAR2(10) null,
SURNAME VARCHAR2(10) null,
NAME VARCHAR2(10) null,
PHONE1 VARCHAR2(10) null,
PHONE2 VARCHAR2(10) null,
EMAIL VARCHAR2(10) null,
ID_EXTERNAL_DISTRIBUTOR INTEGER null, constraint EMPLOYEE_PK primary key (ID) );
-- Create new table EXTERNALDISTRIBUTOR.
-- EXTERNALDISTRIBUTOR : Table of ExternalDistributor
-- ID : id identifies ExternalDistributor
-- NAME : Name is of ExternalDistributor
-- DICTIONARY_TYPE_ED : Dictionary_Type_ED is of ExternalDistributor
-- DICTIONARY_TYPE_ORGANIZATION : Dictionary_Type_Organization is of ExternalDistributor
-- ISLEGALENTITY : IsLegalEntity is of ExternalDistributor
-- DATEAGREEMENT : DateAgreement is of ExternalDistributor
-- NUMBERAGREEMENT : NumberAgreement is of ExternalDistributor
-- PHCITY : PhCity is of ExternalDistributor
-- PHPROVICE : PhProvice is of ExternalDistributor
-- PHSTREET : PhStreet is of ExternalDistributor
-- PHHOUSE : PhHouse is of ExternalDistributor
-- PHADDITIONAL : PhAdditional is of ExternalDistributor
-- PHZIPCODE : PhZipCode is of ExternalDistributor
-- OFFCITY : OffCity is of ExternalDistributor
-- OFFPROVINCE : OffProvince is of ExternalDistributor
-- OFFSTREET : OffStreet is of ExternalDistributor
-- OFFHOUSE : OffHouse is of ExternalDistributor
-- OFFADDITIONAL : OffAdditional is of ExternalDistributor
-- OFFZIPCODE : OffZipCode is of ExternalDistributor
-- EDRPOU : EDRPOU is of ExternalDistributor
-- ID_EXTERNALDISTRIBUTORCOMISION : ID_ExternalDistributorComision is of ExternalDistributor
-- ID_EXTERNALDISTRIBUTORFINANCE : ID_ExternalDistributorFinance is of ExternalDistributor
-- LIMIT : Limit is of ExternalDistributor
-- ISOWNGOODCLASSIFICATION : IsOwnGoodClassification is of ExternalDistributor
-- ISINDEPENDENTBAREME : IsIndependentBareme is of ExternalDistributor
-- EMAIL : Email is of ExternalDistributor
-- LOGO : Logo is of ExternalDistributor
-- ADVERTISEMENTPICTURE : AdvertisementPicture is of ExternalDistributor
-- ISSHOWINTERNALNUMBERGOOD : IsShowInternalNumberGood is of ExternalDistributor
-- TRANSITACCOUNTFINANCING : TransitAccountFinancing is of ExternalDistributor
-- TRANSITACCOUNTCOMMISSION : TransitAccountCommission is of ExternalDistributor
-- ID_BALANCEUNIT : ID_BalanceUnit is of ExternalDistributor
-- VERSIONNUMBER : VersionNumber is of ExternalDistributor
-- VERSIONDATE : VersionDate is of ExternalDistributor
-- ISVERSIONACTIVE : IsVersionActive is of ExternalDistributor
-- BAREME_CODE : Bareme_code is of ExternalDistributor
-- DICTIONARY_SECTORECONOM : Dictionary_SectorEconom is of ExternalDistributor
-- DICTIONARY_LEGALFORM : Dictionary_LegalForm is of ExternalDistributor
-- DICTIONARY_TDUSB : Dictionary_tdUsb is of ExternalDistributor
-- DICTIONARY_ECONOMICACTIVITY : Dictionary_EconomicActivity is of ExternalDistributor
-- DICTIONARY_FORMOWNERSHIP : Dictionary_FormOwnership is of ExternalDistributor
-- DICTIONARY_TYPESETLGOODRET : Field Dictionay_TypeSettlementsGoodReturn is of ExternalDistributor
-- DICTIONARY_PERIODGOODRETPAY : Field Dictionary_PeriodicityGoodReturnPayments is of ExternalDistributor
-- DICTIONARY_TYPEGOOD : Dictionary_TypeGood is of ExternalDistributor
-- DICTIONARY_ADDITIONALCLASS1 : Field Dictionary_AdditionalClassification1 is of ExternalDistributor
-- DICTIONARY_ADDITIONALCLASS2 : Field Dictionary_AdditionalClassification2 is of ExternalDistributor
-- DICTIONARY_STATUS_ED : Dictionary_Status_ed is of ExternalDistributor
-- SAP_BP_ID : SAP_BP_ID is of ExternalDistributor
-- SAP_BRANCH_ID : SAP_BRANCH_ID is of ExternalDistributor
-- PHONE1 : Phone1 is of ExternalDistributor
-- PHONE2 : Phone2 is of ExternalDistributor
-- DATE_OF_FINISH_AGREEMENT : Date_of_finish_agreement is of ExternalDistributor
-- DICTIONARY_SCHEMEOFCOMMISSION : Dictionary_SchemeOfCommission is of ExternalDistributor
-- DICTIONARY_TYPE_PAYMENT : Dictionary_Type_payment is of ExternalDistributor
-- DICTIONARY_TYPE_SETLMNT_COMMIS : Dictionary_Type_setlmnt_commis is of ExternalDistributor
-- PURPOSE_OF_PAYMENT : Purpose_of_payment is of ExternalDistributor
-- DICTIONARY_MODE_OF_CALCULATION : Dictionary_Mode_of_calculation is of ExternalDistributor
-- NUMBER_DAYS_CHARGING_PENALTY : Number_days_charging_penalty is of ExternalDistributor
-- DICTIONARY_TYPE_SETLMNT_SUBS : Dictionary_Type_setlmnt_subs is of ExternalDistributor
-- ISSUBSIDY_RETURN : IsSubsidy_return is of ExternalDistributor
-- DICTIONARY_START_POINT_CALC : Dictionary_start_point_calc is of ExternalDistributor
-- DICTIONARY_TYPE_SUBS_RET : Dictionary_Type_subs_ret is of ExternalDistributor
-- ISCOMISSION_RETURNED_GOOD_RET : IsComission_returned_good_ret is of ExternalDistributor
-- DICTIONARY_TYPE_COMIS_RET : Dictionary_Type_comis_ret is of ExternalDistributor
-- SIZE_OF_PENALTY : Size_of_penalty is of ExternalDistributor
-- ACCOUNT_GOODS_RETURN : Account_goods_return is of ExternalDistributor
-- BRANCH_ID : Branch_ID is of ExternalDistributor
-- ED_CODE_BY_PARTNER : Ed_code_by_partner is of ExternalDistributor
-- DICTIONARY_RDUSB : Dictionary_rdusb is of ExternalDistributor
create table EXTERNALDISTRIBUTOR (
ID INTEGER not null,
NAME VARCHAR2(100) not null,
DICTIONARY_TYPE_ED VARCHAR2(30) not null,
DICTIONARY_TYPE_ORGANIZATION VARCHAR2(30) not null,
ISLEGALENTITY CHAR(1) not null,
DATEAGREEMENT DATE null,
NUMBERAGREEMENT VARCHAR2(10) null,
PHCITY VARCHAR2(100) not null,
PHPROVICE VARCHAR2(100) null,
PHSTREET VARCHAR2(200) not null,
PHHOUSE VARCHAR2(20) null,
PHADDITIONAL VARCHAR2(20) null,
PHZIPCODE VARCHAR2(5) not null,
OFFCITY VARCHAR2(100) not null,
OFFPROVINCE VARCHAR2(100) null,
OFFSTREET VARCHAR2(200) not null,
OFFHOUSE VARCHAR2(20) null,
OFFADDITIONAL VARCHAR2(20) null,
OFFZIPCODE VARCHAR2(5) not null,
EDRPOU VARCHAR2(10) null,
ID_EXTERNALDISTRIBUTORCOMISION INTEGER null,
ID_EXTERNALDISTRIBUTORFINANCE INTEGER null,
LIMIT NUMBER(20,6) null,
ISOWNGOODCLASSIFICATION CHAR(1) null,
ISINDEPENDENTBAREME CHAR(1) null,
EMAIL VARCHAR2(10) null,
LOGO VARCHAR2(100) null,
ADVERTISEMENTPICTURE VARCHAR2(100) null,
ISSHOWINTERNALNUMBERGOOD CHAR(1) null,
TRANSITACCOUNTFINANCING VARCHAR2(14) null,
TRANSITACCOUNTCOMMISSION VARCHAR2(14) null,
ID_BALANCEUNIT INTEGER null,
VERSIONNUMBER VARCHAR2(10) null,
VERSIONDATE DATE null,
ISVERSIONACTIVE CHAR(1) null,
BAREME_CODE INTEGER null,
DICTIONARY_SECTORECONOM VARCHAR2(30) null,
DICTIONARY_LEGALFORM VARCHAR2(30) null,
DICTIONARY_TDUSB VARCHAR2(30) not null,
DICTIONARY_ECONOMICACTIVITY VARCHAR2(30) null,
DICTIONARY_FORMOWNERSHIP VARCHAR2(30) null,
DICTIONARY_TYPESETLGOODRET VARCHAR2(30) null,
DICTIONARY_PERIODGOODRETPAY VARCHAR2(30) null,
DICTIONARY_TYPEGOOD VARCHAR2(30) null,
DICTIONARY_ADDITIONALCLASS1 VARCHAR2(30) null,
DICTIONARY_ADDITIONALCLASS2 VARCHAR2(30) null,
DICTIONARY_STATUS_ED VARCHAR2(30) not null,
SAP_BP_ID VARCHAR2(30) null,
SAP_BRANCH_ID VARCHAR2(30) null,
PHONE1 VARCHAR2(10) null,
PHONE2 VARCHAR2(10) null,
DATE_OF_FINISH_AGREEMENT DATE null,
DICTIONARY_SCHEMEOFCOMMISSION VARCHAR2(30) null,
DICTIONARY_TYPE_PAYMENT VARCHAR2(30) null,
DICTIONARY_TYPE_SETLMNT_COMMIS VARCHAR2(30) null,
PURPOSE_OF_PAYMENT VARCHAR2(160) null,
DICTIONARY_MODE_OF_CALCULATION VARCHAR2(30) null,
NUMBER_DAYS_CHARGING_PENALTY INTEGER null,
DICTIONARY_TYPE_SETLMNT_SUBS VARCHAR2(30) null,
ISSUBSIDY_RETURN CHAR(1) not null,
DICTIONARY_START_POINT_CALC VARCHAR2(30) null,
DICTIONARY_TYPE_SUBS_RET VARCHAR2(30) null,
ISCOMISSION_RETURNED_GOOD_RET CHAR(1) not null,
DICTIONARY_TYPE_COMIS_RET VARCHAR2(30) null,
SIZE_OF_PENALTY NUMBER(20,6) null,
ACCOUNT_GOODS_RETURN VARCHAR2(13) null,
BRANCH_ID VARCHAR2(4) null,
ED_CODE_BY_PARTNER VARCHAR2(10) null,
DICTIONARY_RDUSB VARCHAR2(10) null,
NETWORKNAME VARCHAR2(10) null,
LAST_UPDATE DATE null, constraint EXTERNALDISTRIBUTOR_PK primary key (ID),
ED_NAME_ENG VARCHAR2(50) null,
ID_TYPE_OF_PARTNER INTEGER null,
ID_NETWORK_NAME_GEN INTEGER null,
ID_CHANNEL_OF_SALES INTEGER null,
ID_TECHNOLOGY_OF_SALES INTEGER null,
ID_PARENT_CHANNEL INTEGER null,
ID_PARENT_PARTNER INTEGER null,
ED_PERMANENT_POS INTEGER null,
LIBRA_PILOT VARCHAR2(10) null,
DATE_BEG DATE null,
DATE_END DATE null,
DATE_CHANGED DATE null,
ID_NETWORK_NAME INTEGER null,
ID_NETWORK_SIGN INTEGER null,
ED_START_POINT_REAL_DATE DATE null,
ED_CLOSED_POINT_REAL_DATE DATE null,
TU_CITY VARCHAR2(500) null,
ED_ADDITIONAL_PERMANENT_POS INTEGER null,
DICTIONARY_METHOD_OF_SALES INTEGER null
);
-- Create new table PERSONS.
-- PERSONS : Table of Persons
-- ID : ID identifies BalanceUnit
-- TAB_NUMBER : Tabel number
-- ID_EMPLOYEE_POSITION : employee position
-- FIRST_NAME : first name
-- LAST_NAME : last name
create table PERSONS (
ID INTEGER not null,
TAB_NUMBER INTEGER not null,
ID_EMPLOYEE_POSITION INTEGER not null,
FIRST_NAME VARCHAR2(50) not null,
LAST_NAME VARCHAR2(50) not null, constraint PERSONS_PK primary key (ID) );
-- Create new table ED_MANAGERS_LINK.
-- PERSONS : external distributor link to persons
-- ID : ID identifies BalanceUnit
-- ID_EXTERNAL_DISTRIBUTOR : corresponding to ExternalDistributor.ID
-- TAB_NUMBER : corresponding to Persons.TAB_NUMBER
-- BONUS : if bonus exists - true
create table ED_MANAGERS_LINK (
ID INTEGER not null,
ID_EXTERNAL_DISTRIBUTOR INTEGER null,
TAB_NUMBER INTEGER null,
BONUS CHAR(1) null, constraint ED_MANAGERS_LINK_PK primary key (ID) );
-- Create new table RECEIVERCOMMISSION.
-- RECEIVERCOMMISSION : Table of ReceiverCommission
-- ID : ID identifies ReceiverCommission
-- PERCENTAGE : Percentage is of ReceiverCommission
-- ID_EXTERNALDISTRIBUTORRECEIVER : ID_ExternalDistributorReceiver is of ReceiverCommission
-- ID_EXTERNALDISTRIBUTOR : ID_ExternalDistributor is of ReceiverCommission
create table RECEIVERCOMMISSION (
ID INTEGER not null,
PERCENTAGE NUMBER(20,6) null,
ID_EXTERNALDISTRIBUTORRECEIVER INTEGER not null,
ID_EXTERNALDISTRIBUTOR INTEGER not null, constraint RECEIVERCOMMISSION_PK primary key (ID) );
-- Create new table COMMISSIONSCALE.
-- COMMISSIONSCALE : Table of CommissionScale
-- ID : ID identifies CommissionScale
-- AMOUNTMIN : AmountMin is of CommissionScale
-- AMOUNTMAX : AmountMax is of CommissionScale
-- VALUECOMMISSION : ValueCommission is of CommissionScale
-- ID_COMMISSION : ID_Commission is of CommissionScale
create table COMMISSIONSCALE (
ID INTEGER not null,
AMOUNTMIN NUMBER(20,6) null,
AMOUNTMAX NUMBER(20,6) null,
VALUECOMMISSION VARCHAR2(10) null,
ID_COMMISSION INTEGER null, constraint COMMISSIONSCALE_PK primary key (ID) );
-- Create new table COMMISSION.
-- COMMISSION : Table of Commission
-- ID : ID identifies Commission
-- NAME : Name is of Commission
-- DATESTART : DateStart is of Commission
-- DATEFINISH : DateFinish is of Commission
-- VALUECOMMISSION : ValueCommission is of Commission
-- DICTIONARY_PAYMENTPERIOD : Dictionary_PaymentPeriod is of Commission
-- DICTIONARY_CALCULATIONBASE : Dictionary_CalculationBase is of Commission
-- DICTIONARY_TYPECOMMISSION : Dictionary_TypeCommission is of Commission
create table COMMISSION (
ID INTEGER not null,
NAME VARCHAR2(10) null,
DATESTART DATE null,
DATEFINISH DATE null,
VALUECOMMISSION VARCHAR2(10) null,
DICTIONARY_PAYMENTPERIOD VARCHAR2(10) null,
DICTIONARY_CALCULATIONBASE VARCHAR2(10) null,
DICTIONARY_TYPECOMMISSION VARCHAR2(10) null, constraint COMMISSION_PK primary key (ID) );
-- Create new table BAREME.
-- BAREME : Table of Bareme
-- ID : ID identifies Bareme
-- NAME : Name is of Bareme
-- BAREME_CODE : Bareme_code is of Bareme - for Expert System
-- BAREME_CODE_ES : Bareme_code_ES is of Bareme
-- DATESTART : DateStart is of Bareme
-- DATEFINISH : DateFinish is of Bareme
-- DATEPRODUCTION : DateProduction is of Bareme
-- DURATIONMIN : DurationMin is of Bareme
-- DURATIONMAX : DurationMax is of Bareme
-- TOTALPRICEMIN : TotalPriceMin is of Bareme
-- TOTALPRICEMAX : TotalPriceMax is of Bareme
-- DOWNPAYMENTMIN : DownpaymentMin is of Bareme
-- DOWNPAYMENTMAX : DownpaymentMax is of Bareme
-- VALUEINTERESTRATE : ValueInterestRate is of Bareme
-- ISOPENINGFEE : IsOpeningFee is of Bareme
-- VALUEOPENINGFEE : ValueOpeningFee is of Bareme
-- ISMONTHLYFEE : IsMonthlyFee is of Bareme
-- VALUEMONTHLYFEE : ValueMonthlyFee is of Bareme
-- ISSUBSIDY : IsSubsidy is of Bareme
-- VALUESUBSIDY : ValueSubsidy is of Bareme
-- ISCOMMISSION : IsCommission is of Bareme
-- ID_COMMISSION : ID_Commission is of Bareme
-- DICTIONARY_MODELCAR : Dictionary_ModelCar is of Bareme
-- DICTIONARY_TYPEOPENINGPAYING : Dictionary_TypeOpeningPaying is of Bareme
-- DICTIONARY_TYPESUBSIDY : Dictionary_TypeSubsidy is of Bareme
-- DICTIONARY_TYPEMOTHLYFEE : Dictionary_TypeMothlyFee is of Bareme
-- DICTIONARY_TYPEOPENINGFEE : Dictionary_TypeOpeningFee is of Bareme
-- DICTIONARY_STATUS_PRICING : Dictionary_Status_pricing is of Bareme
-- DICTIONARY_PRODUCERCAR : Dictionary_ProducerCar is of Bareme
-- MINIMUM_SUBSIDY_RATE : minimum_subsidy_rate is of Bareme
-- VALUESUBSIDY : value of subsidy in percent
create table BAREME (
ID INTEGER not null,
NAME VARCHAR2(100) not null,
BAREME_CODE INTEGER not null,
BAREME_CODE_ES VARCHAR2(3) null,
DATESTART DATE not null,
DATEFINISH DATE null,
DATEPRODUCTION DATE null,
DURATIONMIN INTEGER not null,
DURATIONMAX INTEGER not null,
TOTALPRICEMIN NUMBER(20,6) not null,
TOTALPRICEMAX NUMBER(20,6) not null,
DOWNPAYMENTMIN NUMBER(20,6) not null,
DOWNPAYMENTMAX NUMBER(20,6) not null,
VALUEINTERESTRATE NUMBER(20,6) not null,
ISOPENINGFEE CHAR(1) not null,
VALUEOPENINGFEE NUMBER(20,6) null,
ISMONTHLYFEE CHAR(1) not null,
VALUEMONTHLYFEE NUMBER(20,6) null,
ISSUBSIDY CHAR(1) not null,
VALUESUBSIDY NUMBER(20,6) null,
ISCOMMISSION CHAR(1) not null,
ID_COMMISSION INTEGER null,
DICTIONARY_MODELCAR VARCHAR2(30) null,
DICTIONARY_TYPEOPENINGPAYING VARCHAR2(30) null,
DICTIONARY_TYPESUBSIDY VARCHAR2(30) null,
DICTIONARY_TYPEMOTHLYFEE VARCHAR2(30) null,
DICTIONARY_TYPEOPENINGFEE VARCHAR2(30) null,
DICTIONARY_STATUS_PRICING VARCHAR2(30) null,
DICTIONARY_PRODUCERCAR VARCHAR2(30) null,
MINIMUM_SUBSIDY_RATE NUMBER(20,6) null,
VALUECOMMISSION NUMBER(20,6) null,
LAST_UPDATE DATE null, constraint BAREME_PK primary key (ID) );
-- Create new table CREDITTYPEACTIONCODE.
-- CREDITTYPEACTIONCODE : Table of CreditTypeActionCode
-- ID : ID identifies CreditTypeActionCode
-- ID_CREDITTYPE : ID_CreditType is of CreditTypeActionCode
-- ACTIONCODE : ActionCode is of CreditTypeActionCode
create table CREDITTYPEACTIONCODE (
ID INTEGER not null,
ID_CREDITTYPE INTEGER null,
ACTIONCODE VARCHAR2(13) null, constraint CREDITTYPEACTIONCODE_PK primary key (ID) );
-- Create new table CREDITTYPEGOOD.
-- CREDITTYPEGOOD : Table of CreditTypeGood
-- ID : ID identifies CreditTypeGood
-- ID_CREDITTYPE : ID_CreditType is of CreditTypeGood
-- NUMBER : Number is of CreditTypeGood
-- DICTIONARY_GOOD : Dictionary_Good is of CreditTypeGood
create table CREDITTYPEGOOD (
ID INTEGER not null,
ID_CREDITTYPE INTEGER null,
NUMBER INTEGER not null,
DICTIONARY_GOOD VARCHAR2(30) null, constraint CREDITTYPEGOOD_PK primary key (ID) );
-- Create new table CREDITTYPEPROFESSION.
-- CREDITTYPEPROFESSION : Table of CreditTypeProfession
-- ID : ID identifies CreditTypeProfession
-- ID_CREDITTYPE : ID_CreditType is of CreditTypeProfession
-- DICTIONARY_PROFESSION : Dictionary_Profession is of CreditTypeProfession
create table CREDITTYPEPROFESSION (
ID INTEGER not null,
ID_CREDITTYPE INTEGER null,
DICTIONARY_PROFESSION VARCHAR2(30) null, constraint CREDITTYPEPROFESSION_PK primary key (ID) );
-- Create new table CREDITTYPEMANDATORYDOCUMENTLNK.
-- CREDITTYPEMANDATORYDOCUMENTLNK : Table of CreditTypeMandatoryDocumentLnk
-- ID : ID identifies CreditTypeMandatoryDocumentLnk
-- ID_CREDITTYPE : ID_CreditType is of CreditTypeMandatoryDocumentLnk
-- DICTIONARY_MANDATORYDOCUMENT : Dictionary_MandatoryDocument is of CreditTypeMandatoryDocumentLnk
create table CREDITTYPEMANDATORYDOCUMENTLNK (
ID INTEGER not null,
ID_CREDITTYPE INTEGER null,
DICTIONARY_MANDATORYDOCUMENT VARCHAR2(30) null, constraint CREDITTYPEMANDATDOCUMENTLNK_PK primary key (ID) );
-- Create new table CREDITTYPE.
-- CREDITTYPE : Table of CreditType
-- ID : ID identifies CreditType
-- NAME : Name is of CreditType
-- NAMESCREEN : NameScreen is of CreditType
-- DESCRIPTION : Description is of CreditType
-- DATESTART : DateStart is of CreditType
-- DATEFINISH : DateFinish is of CreditType
-- ISCOUNTERPROPOSAL : IsCounterProposal is of CreditType
-- ISINDEPENDENTBAREME : IsIndependentBareme is of CreditType
-- DATEPRODUCTION : DateProduction is of CreditType
-- ISPOSTPONEMENT : IsPostponement is of CreditType
-- DURATIONPOSTPONEMENTMIN : DurationPostponementMin is of CreditType
-- DURATIONPOSTPONEMENTMAX : DurationPostponementMax is of CreditType
-- DURATIONMIN : DurationMin is of CreditType
-- DURATIONMAX : DurationMax is of CreditType
-- TOTALPRICEMIN : TotalPriceMin is of CreditType
-- TOTALPRICEMAX : TotalPriceMax is of CreditType
-- DOWNPAYMENTMIN : DownpaymentMin is of CreditType
-- DOWNPAYMENTMAX : DownpaymentMax is of CreditType
-- ISAGE : IsAge is of CreditType
-- AGEMIN : AgeMin is of CreditType
-- AGEMAX : AgeMax is of CreditType
-- ISPROFESSION : IsProfession is of CreditType
-- ISACTIONCODE : IsActionCode is of CreditType
-- VERSIONNUMBER : VersionNumber is of CreditType
-- VERSIONDATE : VersionDate is of CreditType
-- ISVERSIONACTIVE : IsVersionActive is of CreditType
-- ID_PRODUCT : ID_Product is of CreditType
-- DICTIONARY_TYPECREDITTYPE : Dictionary_TypeCreditType is of CreditType
-- DICTIONARY_DAYFIRSTDUEDATE : Dictionary_DayFirstDueDate is of CreditType
-- DICTIONARY_TYPECREDITTYPERISK : Dictionary_TypeCreditTypeRisk is of CreditType
-- DICTIONARY_TYPEFIRSTDUEDATECAL : Field Dictionary_TypeFirstDueDateCalculation is of CreditType
-- DICTIONARY_UNITPOSTPONEMENT : Dictionary_UnitPostponement is of CreditType
-- DICTIONARY_TYPEDOWNPAYMENT : Dictionary_TypeDownpayment is of CreditType
-- DICTIONARY_STATUS_PRICING : Dictionary_Status_pricing is of CreditType
-- ES_CPRO : ES_CPRO is of CreditType
-- ES_NUMSCORE : ES_numscore is of CreditType
-- ID_INSUR_GROUP : ID_Insur_Group is of CreditType
-- ISINSURANCE : IsInsurance is of CreditType
-- DICTIONARY_PROMONONPROMO : Dictionary_PromoNonPromo is of CreditType
create table CREDITTYPE (
ID INTEGER not null,
NAME VARCHAR2(100) not null,
NAMESCREEN VARCHAR2(100) not null,
DESCRIPTION VARCHAR2(500) null,
DATESTART DATE not null,
DATEFINISH DATE null,
ISCOUNTERPROPOSAL CHAR(1) not null,
ISINDEPENDENTBAREME CHAR(1) not null,
DATEPRODUCTION DATE null,
ISPOSTPONEMENT CHAR(1) not null,
DURATIONPOSTPONEMENTMIN INTEGER null,
DURATIONPOSTPONEMENTMAX INTEGER null,
DURATIONMIN INTEGER not null,
DURATIONMAX INTEGER not null,
TOTALPRICEMIN NUMBER(20,6) not null,
TOTALPRICEMAX NUMBER(20,6) not null,
DOWNPAYMENTMIN NUMBER(20,6) not null,
DOWNPAYMENTMAX NUMBER(20,6) not null,
ISAGE CHAR(1) not null,
AGEMIN INTEGER not null,
AGEMAX INTEGER not null,
ISPROFESSION CHAR(1) not null,
ISACTIONCODE CHAR(1) not null,
VERSIONNUMBER VARCHAR2(10) null,
VERSIONDATE DATE null,
ISVERSIONACTIVE CHAR(1) not null,
ID_PRODUCT INTEGER not null,
DICTIONARY_TYPECREDITTYPE VARCHAR2(30) null,
DICTIONARY_DAYFIRSTDUEDATE VARCHAR2(30) null,
DICTIONARY_TYPECREDITTYPERISK VARCHAR2(30) null,
DICTIONARY_TYPEFIRSTDUEDATECAL VARCHAR2(30) null,
DICTIONARY_UNITPOSTPONEMENT VARCHAR2(30) null,
DICTIONARY_TYPEDOWNPAYMENT VARCHAR2(30) null,
DICTIONARY_STATUS_PRICING VARCHAR2(30) null,
ES_CPRO VARCHAR2(3) not null,
ES_NUMSCORE VARCHAR2(3) null,
ID_INSUR_GROUP INTEGER null,
ISINSURANCE CHAR(1) not null,
DICTIONARY_PROMONONPROMO VARCHAR2(30) null,
ENDGRACEPERIOD INTEGER null,
LAST_UPDATE DATE null,constraint CREDITTYPE_PK primary key (ID) );
-- Create new table CREDITTYPECONDITION.
-- CREDITTYPECONDITION : Table of CreditType Condition
-- ID : ID identifies CreditType
-- NAME : Name is of CreditType
--id car_production risk_category min_ammount max_ammount max_duration min_downpayment is_addeq
create table CREDITTYPECONDITION (
ID INTEGER not null,
DICTIONARY_CAR_PRODUCER VARCHAR2(30) not null,
RISKCATEGORY INTEGER not null,
TOTALPRICEMIN NUMBER(20,6) not null,
TOTALPRICEMAX NUMBER(20,6) not null,
DURATIONMAX INTEGER not null,
DOWNPAYMENTMIN NUMBER(20,6) not null,
ISADDEQUIPMENT CHAR(1) not null,
DESCRIPTION VARCHAR2(500) null,
LAST_UPDATE DATE null,constraint CREDITTYPE_PK primary key (ID) );
-- Create new table PRODUCT.
-- PRODUCT : Table of Product
-- ID : ID identifies Product
-- NAME : Name is of Product