plac-micro-common 1.2.26 → 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ import { Application } from './application.entity';
2
+ import { _BaseEntity } from '../_base_entity';
3
+ import { Gender, IdentifierType } from '../../types';
4
+ export declare class AppBeneficiary extends _BaseEntity {
5
+ id: string;
6
+ application_id: string;
7
+ sequence_no: number;
8
+ first_name: string;
9
+ last_name: string;
10
+ first_name_kh?: string | null;
11
+ last_name_kh?: string | null;
12
+ full_name: string | null;
13
+ full_name_kh?: string | null;
14
+ gender?: Gender | null;
15
+ date_of_birth?: string | null;
16
+ relationship_id?: string | null;
17
+ benefit_percentage: number;
18
+ identifier_type?: IdentifierType | null;
19
+ identifier_no?: string | null;
20
+ is_active: boolean;
21
+ application: Application;
22
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppBeneficiary = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const application_entity_1 = require("./application.entity");
15
+ const _base_entity_1 = require("../_base_entity");
16
+ let AppBeneficiary = class AppBeneficiary extends _base_entity_1._BaseEntity {
17
+ };
18
+ exports.AppBeneficiary = AppBeneficiary;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
+ __metadata("design:type", String)
22
+ ], AppBeneficiary.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Index)(),
25
+ (0, typeorm_1.Column)({ type: 'uuid' }),
26
+ __metadata("design:type", String)
27
+ ], AppBeneficiary.prototype, "application_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'int' }),
30
+ __metadata("design:type", Number)
31
+ ], AppBeneficiary.prototype, "sequence_no", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
34
+ __metadata("design:type", String)
35
+ ], AppBeneficiary.prototype, "first_name", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
38
+ __metadata("design:type", String)
39
+ ], AppBeneficiary.prototype, "last_name", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
42
+ __metadata("design:type", Object)
43
+ ], AppBeneficiary.prototype, "first_name_kh", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
46
+ __metadata("design:type", Object)
47
+ ], AppBeneficiary.prototype, "last_name_kh", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
50
+ __metadata("design:type", Object)
51
+ ], AppBeneficiary.prototype, "full_name", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], AppBeneficiary.prototype, "full_name_kh", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Index)(),
58
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], AppBeneficiary.prototype, "gender", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
63
+ __metadata("design:type", Object)
64
+ ], AppBeneficiary.prototype, "date_of_birth", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
67
+ __metadata("design:type", Object)
68
+ ], AppBeneficiary.prototype, "relationship_id", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'numeric' }),
71
+ __metadata("design:type", Number)
72
+ ], AppBeneficiary.prototype, "benefit_percentage", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Index)(),
75
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
76
+ __metadata("design:type", Object)
77
+ ], AppBeneficiary.prototype, "identifier_type", void 0);
78
+ __decorate([
79
+ (0, typeorm_1.Index)(),
80
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
81
+ __metadata("design:type", Object)
82
+ ], AppBeneficiary.prototype, "identifier_no", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
85
+ __metadata("design:type", Boolean)
86
+ ], AppBeneficiary.prototype, "is_active", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.ManyToOne)(() => application_entity_1.Application, { onDelete: 'CASCADE' }),
89
+ (0, typeorm_1.JoinColumn)({ name: 'application_id' }),
90
+ __metadata("design:type", application_entity_1.Application)
91
+ ], AppBeneficiary.prototype, "application", void 0);
92
+ exports.AppBeneficiary = AppBeneficiary = __decorate([
93
+ (0, typeorm_1.Entity)({ schema: 'application', name: 'app_beneficiaries' }),
94
+ (0, typeorm_1.Unique)('uq_app_beneficiary_seq', ['application_id', 'sequence_no'])
95
+ ], AppBeneficiary);
@@ -0,0 +1,23 @@
1
+ import { Application } from './application.entity';
2
+ import { _BaseEntity } from '../_base_entity';
3
+ import { AppCoverageType, DiscountType } from '../../types';
4
+ export declare class AppCoverage extends _BaseEntity {
5
+ id: string;
6
+ application_id: string;
7
+ coverage_type: AppCoverageType;
8
+ product_id: string;
9
+ product_plan_id?: string | null;
10
+ product_coverage_id?: string | null;
11
+ sequence_no: number;
12
+ currency?: string | null;
13
+ sum_assured?: number | null;
14
+ discount_type?: DiscountType | null;
15
+ discount_value?: number | null;
16
+ discount_premium_amount?: number | null;
17
+ annual_premium_amount?: number | null;
18
+ mode_premium_amount?: number | null;
19
+ product_payment_mode_id?: string | null;
20
+ product_policy_term_id?: string | null;
21
+ is_active: boolean;
22
+ application: Application;
23
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppCoverage = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const application_entity_1 = require("./application.entity");
15
+ const _base_entity_1 = require("../_base_entity");
16
+ const types_1 = require("../../types");
17
+ let AppCoverage = class AppCoverage extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.AppCoverage = AppCoverage;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
+ __metadata("design:type", String)
23
+ ], AppCoverage.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Index)(),
26
+ (0, typeorm_1.Column)({ type: 'uuid' }),
27
+ __metadata("design:type", String)
28
+ ], AppCoverage.prototype, "application_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Index)(),
31
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, default: types_1.AppCoverageType.Base }),
32
+ __metadata("design:type", String)
33
+ ], AppCoverage.prototype, "coverage_type", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Index)(),
36
+ (0, typeorm_1.Column)({ type: 'uuid' }),
37
+ __metadata("design:type", String)
38
+ ], AppCoverage.prototype, "product_id", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Index)(),
41
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
42
+ __metadata("design:type", Object)
43
+ ], AppCoverage.prototype, "product_plan_id", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Index)(),
46
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], AppCoverage.prototype, "product_coverage_id", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'int' }),
51
+ __metadata("design:type", Number)
52
+ ], AppCoverage.prototype, "sequence_no", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], AppCoverage.prototype, "currency", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], AppCoverage.prototype, "sum_assured", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'varchar', length: 25, nullable: true }),
63
+ __metadata("design:type", Object)
64
+ ], AppCoverage.prototype, "discount_type", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
67
+ __metadata("design:type", Object)
68
+ ], AppCoverage.prototype, "discount_value", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
71
+ __metadata("design:type", Object)
72
+ ], AppCoverage.prototype, "discount_premium_amount", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
75
+ __metadata("design:type", Object)
76
+ ], AppCoverage.prototype, "annual_premium_amount", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
79
+ __metadata("design:type", Object)
80
+ ], AppCoverage.prototype, "mode_premium_amount", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
83
+ __metadata("design:type", Object)
84
+ ], AppCoverage.prototype, "product_payment_mode_id", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
87
+ __metadata("design:type", Object)
88
+ ], AppCoverage.prototype, "product_policy_term_id", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
91
+ __metadata("design:type", Boolean)
92
+ ], AppCoverage.prototype, "is_active", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.ManyToOne)(() => application_entity_1.Application, { onDelete: 'CASCADE' }),
95
+ (0, typeorm_1.JoinColumn)({ name: 'application_id' }),
96
+ __metadata("design:type", application_entity_1.Application)
97
+ ], AppCoverage.prototype, "application", void 0);
98
+ exports.AppCoverage = AppCoverage = __decorate([
99
+ (0, typeorm_1.Entity)({ schema: 'application', name: 'app_coverages' }),
100
+ (0, typeorm_1.Unique)('uq_app_coverage_app_seq', ['application_id', 'sequence_no'])
101
+ ], AppCoverage);
@@ -0,0 +1,25 @@
1
+ import { Application } from './application.entity';
2
+ import { _BaseEntity } from '../_base_entity';
3
+ import { AppPersonRole, Gender, IdentifierType } from '../../types';
4
+ export declare class AppPerson extends _BaseEntity {
5
+ id: string;
6
+ application_id: string;
7
+ role: AppPersonRole;
8
+ sequence_no: number;
9
+ first_name?: string | null;
10
+ last_name?: string | null;
11
+ first_name_kh?: string | null;
12
+ last_name_kh?: string | null;
13
+ full_name: string | null;
14
+ full_name_kh?: string | null;
15
+ gender?: Gender | null;
16
+ date_of_birth?: string | null;
17
+ nationality_id?: string | null;
18
+ identifier_type?: IdentifierType | null;
19
+ identifier_no?: string | null;
20
+ phone_number?: string | null;
21
+ email?: string | null;
22
+ relationship_id?: string | null;
23
+ is_active: boolean;
24
+ application: Application;
25
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppPerson = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const application_entity_1 = require("./application.entity");
15
+ const _base_entity_1 = require("../_base_entity");
16
+ const types_1 = require("../../types");
17
+ let AppPerson = class AppPerson extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.AppPerson = AppPerson;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
+ __metadata("design:type", String)
23
+ ], AppPerson.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Index)(),
26
+ (0, typeorm_1.Column)({ type: 'uuid' }),
27
+ __metadata("design:type", String)
28
+ ], AppPerson.prototype, "application_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Index)(),
31
+ (0, typeorm_1.Column)({ type: 'varchar', length: 30 }),
32
+ __metadata("design:type", String)
33
+ ], AppPerson.prototype, "role", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'int', default: 1 }),
36
+ __metadata("design:type", Number)
37
+ ], AppPerson.prototype, "sequence_no", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], AppPerson.prototype, "first_name", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], AppPerson.prototype, "last_name", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], AppPerson.prototype, "first_name_kh", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], AppPerson.prototype, "last_name_kh", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
56
+ __metadata("design:type", Object)
57
+ ], AppPerson.prototype, "full_name", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], AppPerson.prototype, "full_name_kh", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Index)(),
64
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
65
+ __metadata("design:type", Object)
66
+ ], AppPerson.prototype, "gender", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
69
+ __metadata("design:type", Object)
70
+ ], AppPerson.prototype, "date_of_birth", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
73
+ __metadata("design:type", Object)
74
+ ], AppPerson.prototype, "nationality_id", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Index)(),
77
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
78
+ __metadata("design:type", Object)
79
+ ], AppPerson.prototype, "identifier_type", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Index)(),
82
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
83
+ __metadata("design:type", Object)
84
+ ], AppPerson.prototype, "identifier_no", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.Index)(),
87
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
88
+ __metadata("design:type", Object)
89
+ ], AppPerson.prototype, "phone_number", void 0);
90
+ __decorate([
91
+ (0, typeorm_1.Index)(),
92
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
93
+ __metadata("design:type", Object)
94
+ ], AppPerson.prototype, "email", void 0);
95
+ __decorate([
96
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
97
+ __metadata("design:type", Object)
98
+ ], AppPerson.prototype, "relationship_id", void 0);
99
+ __decorate([
100
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
101
+ __metadata("design:type", Boolean)
102
+ ], AppPerson.prototype, "is_active", void 0);
103
+ __decorate([
104
+ (0, typeorm_1.ManyToOne)(() => application_entity_1.Application, { onDelete: 'CASCADE' }),
105
+ (0, typeorm_1.JoinColumn)({ name: 'application_id' }),
106
+ __metadata("design:type", application_entity_1.Application)
107
+ ], AppPerson.prototype, "application", void 0);
108
+ exports.AppPerson = AppPerson = __decorate([
109
+ (0, typeorm_1.Entity)({ schema: 'application', name: 'app_persons' }),
110
+ (0, typeorm_1.Unique)('uq_app_person_role_seq', ['application_id', 'role', 'sequence_no'])
111
+ ], AppPerson);
@@ -0,0 +1,42 @@
1
+ import { _BaseEntity } from '../_base_entity';
2
+ import { ApplicationStatus, AppPhLaRelation } from '../../types';
3
+ import { Organization, OrganizationBranch, OrganizationStaff } from '../core';
4
+ export declare class Application extends _BaseEntity {
5
+ id: string;
6
+ application_no: string;
7
+ ph_la_relation: AppPhLaRelation;
8
+ external_ref?: string | null;
9
+ legacy_id?: string | null;
10
+ org_id: string;
11
+ org_branch_id?: string | null;
12
+ channel_id?: string | null;
13
+ owner_org_staff_id: string;
14
+ assigned_org_staff_id?: string | null;
15
+ status: ApplicationStatus;
16
+ submitted_at?: Date | null;
17
+ review_started_at?: Date | null;
18
+ accepted_at?: Date | null;
19
+ rejected_at?: Date | null;
20
+ rejection_reason?: string | null;
21
+ transferred_at?: Date | null;
22
+ product_id: string;
23
+ product_plan_id?: string | null;
24
+ currency?: string | null;
25
+ sum_assured?: number | null;
26
+ mode_premium_amount?: number | null;
27
+ product_payment_mode_id?: string | null;
28
+ product_policy_term_id?: string | null;
29
+ created_by_user_id: string;
30
+ updated_by_user_id?: string | null;
31
+ submitted_by_user_id?: string | null;
32
+ reviewed_by_user_id?: string | null;
33
+ accepted_by_user_id?: string | null;
34
+ rejected_by_user_id?: string | null;
35
+ transferred_by_user_id?: string | null;
36
+ is_active: boolean;
37
+ is_migrated: boolean;
38
+ org: Organization;
39
+ owner_org_staff: OrganizationStaff;
40
+ assigned_org_staff?: OrganizationStaff | null;
41
+ org_branch?: OrganizationBranch | null;
42
+ }
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Application = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const types_1 = require("../../types");
16
+ const core_1 = require("../core");
17
+ let Application = class Application extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.Application = Application;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
+ __metadata("design:type", String)
23
+ ], Application.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Index)(),
26
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, unique: true }),
27
+ __metadata("design:type", String)
28
+ ], Application.prototype, "application_no", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: types_1.AppPhLaRelation.SamePerson }),
31
+ __metadata("design:type", String)
32
+ ], Application.prototype, "ph_la_relation", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Index)(),
35
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
36
+ __metadata("design:type", Object)
37
+ ], Application.prototype, "external_ref", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], Application.prototype, "legacy_id", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Index)(),
44
+ (0, typeorm_1.Column)({ type: 'uuid' }),
45
+ __metadata("design:type", String)
46
+ ], Application.prototype, "org_id", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Index)(),
49
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
50
+ __metadata("design:type", Object)
51
+ ], Application.prototype, "org_branch_id", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Index)(),
54
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], Application.prototype, "channel_id", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Index)(),
59
+ (0, typeorm_1.Column)({ type: 'uuid' }),
60
+ __metadata("design:type", String)
61
+ ], Application.prototype, "owner_org_staff_id", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Index)(),
64
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
65
+ __metadata("design:type", Object)
66
+ ], Application.prototype, "assigned_org_staff_id", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Index)(),
69
+ (0, typeorm_1.Column)({ type: 'varchar', length: 30 }),
70
+ __metadata("design:type", String)
71
+ ], Application.prototype, "status", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], Application.prototype, "submitted_at", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
78
+ __metadata("design:type", Object)
79
+ ], Application.prototype, "review_started_at", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
82
+ __metadata("design:type", Object)
83
+ ], Application.prototype, "accepted_at", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
86
+ __metadata("design:type", Object)
87
+ ], Application.prototype, "rejected_at", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
90
+ __metadata("design:type", Object)
91
+ ], Application.prototype, "rejection_reason", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
94
+ __metadata("design:type", Object)
95
+ ], Application.prototype, "transferred_at", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Index)(),
98
+ (0, typeorm_1.Column)({ type: 'uuid' }),
99
+ __metadata("design:type", String)
100
+ ], Application.prototype, "product_id", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
103
+ __metadata("design:type", Object)
104
+ ], Application.prototype, "product_plan_id", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
107
+ __metadata("design:type", Object)
108
+ ], Application.prototype, "currency", void 0);
109
+ __decorate([
110
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
111
+ __metadata("design:type", Object)
112
+ ], Application.prototype, "sum_assured", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
115
+ __metadata("design:type", Object)
116
+ ], Application.prototype, "mode_premium_amount", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
119
+ __metadata("design:type", Object)
120
+ ], Application.prototype, "product_payment_mode_id", void 0);
121
+ __decorate([
122
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
123
+ __metadata("design:type", Object)
124
+ ], Application.prototype, "product_policy_term_id", void 0);
125
+ __decorate([
126
+ (0, typeorm_1.Index)(),
127
+ (0, typeorm_1.Column)({ type: 'uuid' }),
128
+ __metadata("design:type", String)
129
+ ], Application.prototype, "created_by_user_id", void 0);
130
+ __decorate([
131
+ (0, typeorm_1.Index)(),
132
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
133
+ __metadata("design:type", Object)
134
+ ], Application.prototype, "updated_by_user_id", void 0);
135
+ __decorate([
136
+ (0, typeorm_1.Index)(),
137
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
138
+ __metadata("design:type", Object)
139
+ ], Application.prototype, "submitted_by_user_id", void 0);
140
+ __decorate([
141
+ (0, typeorm_1.Index)(),
142
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
143
+ __metadata("design:type", Object)
144
+ ], Application.prototype, "reviewed_by_user_id", void 0);
145
+ __decorate([
146
+ (0, typeorm_1.Index)(),
147
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
148
+ __metadata("design:type", Object)
149
+ ], Application.prototype, "accepted_by_user_id", void 0);
150
+ __decorate([
151
+ (0, typeorm_1.Index)(),
152
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
153
+ __metadata("design:type", Object)
154
+ ], Application.prototype, "rejected_by_user_id", void 0);
155
+ __decorate([
156
+ (0, typeorm_1.Index)(),
157
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
158
+ __metadata("design:type", Object)
159
+ ], Application.prototype, "transferred_by_user_id", void 0);
160
+ __decorate([
161
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
162
+ __metadata("design:type", Boolean)
163
+ ], Application.prototype, "is_active", void 0);
164
+ __decorate([
165
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
166
+ __metadata("design:type", Boolean)
167
+ ], Application.prototype, "is_migrated", void 0);
168
+ __decorate([
169
+ (0, typeorm_1.ManyToOne)(() => core_1.Organization, { onDelete: 'RESTRICT' }),
170
+ (0, typeorm_1.JoinColumn)({ name: 'org_id' }),
171
+ __metadata("design:type", core_1.Organization)
172
+ ], Application.prototype, "org", void 0);
173
+ __decorate([
174
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaff, { onDelete: 'RESTRICT' }),
175
+ (0, typeorm_1.JoinColumn)({ name: 'owner_org_staff_id' }),
176
+ __metadata("design:type", core_1.OrganizationStaff)
177
+ ], Application.prototype, "owner_org_staff", void 0);
178
+ __decorate([
179
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaff, { onDelete: 'SET NULL' }),
180
+ (0, typeorm_1.JoinColumn)({ name: 'assigned_org_staff_id' }),
181
+ __metadata("design:type", Object)
182
+ ], Application.prototype, "assigned_org_staff", void 0);
183
+ __decorate([
184
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationBranch, { onDelete: 'RESTRICT' }),
185
+ (0, typeorm_1.JoinColumn)({ name: 'org_branch_id' }),
186
+ __metadata("design:type", Object)
187
+ ], Application.prototype, "org_branch", void 0);
188
+ exports.Application = Application = __decorate([
189
+ (0, typeorm_1.Entity)({ schema: 'application', name: 'applications' }),
190
+ (0, typeorm_1.Unique)('uq_application_org_app_no', ['org_id', 'application_no'])
191
+ ], Application);
@@ -0,0 +1,6 @@
1
+ import { Application } from "./application.entity";
2
+ import { AppBeneficiary } from "./app_beneficiary.entity";
3
+ import { AppCoverage } from "./app_coverage.entity";
4
+ import { AppPerson } from "./app_person.entity";
5
+ export declare const APPLICATION_ENTITIES: readonly [typeof Application, typeof AppBeneficiary, typeof AppCoverage, typeof AppPerson];
6
+ export { Application, AppBeneficiary, AppCoverage, AppPerson };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppPerson = exports.AppCoverage = exports.AppBeneficiary = exports.Application = exports.APPLICATION_ENTITIES = void 0;
4
+ const application_entity_1 = require("./application.entity");
5
+ Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_entity_1.Application; } });
6
+ const app_beneficiary_entity_1 = require("./app_beneficiary.entity");
7
+ Object.defineProperty(exports, "AppBeneficiary", { enumerable: true, get: function () { return app_beneficiary_entity_1.AppBeneficiary; } });
8
+ const app_coverage_entity_1 = require("./app_coverage.entity");
9
+ Object.defineProperty(exports, "AppCoverage", { enumerable: true, get: function () { return app_coverage_entity_1.AppCoverage; } });
10
+ const app_person_entity_1 = require("./app_person.entity");
11
+ Object.defineProperty(exports, "AppPerson", { enumerable: true, get: function () { return app_person_entity_1.AppPerson; } });
12
+ exports.APPLICATION_ENTITIES = [
13
+ application_entity_1.Application,
14
+ app_beneficiary_entity_1.AppBeneficiary,
15
+ app_coverage_entity_1.AppCoverage,
16
+ app_person_entity_1.AppPerson
17
+ ];
@@ -2,4 +2,5 @@ export * from "./_base_entity";
2
2
  export * from "./_base_general_entity";
3
3
  export * from "./_base_ownership_entity";
4
4
  export * from "./core";
5
+ export * from './application';
5
6
  export * from "./customer";
@@ -18,4 +18,5 @@ __exportStar(require("./_base_entity"), exports);
18
18
  __exportStar(require("./_base_general_entity"), exports);
19
19
  __exportStar(require("./_base_ownership_entity"), exports);
20
20
  __exportStar(require("./core"), exports);
21
+ __exportStar(require("./application"), exports);
21
22
  __exportStar(require("./customer"), exports);
@@ -10,3 +10,15 @@ export declare enum ApplicationStatus {
10
10
  Transferred = "transferred",// pushed to core successfully
11
11
  Cancelled = "cancelled"
12
12
  }
13
+ export declare enum AppPersonRole {
14
+ PolicyHolder = "policy_holder",
15
+ LifeAssured = "life_assured"
16
+ }
17
+ export declare enum AppPhLaRelation {
18
+ SamePerson = "same_person",
19
+ DifferentPerson = "different_person"
20
+ }
21
+ export declare enum AppCoverageType {
22
+ Base = "base",
23
+ Rider = "rider"
24
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationStatus = void 0;
3
+ exports.AppCoverageType = exports.AppPhLaRelation = exports.AppPersonRole = exports.ApplicationStatus = void 0;
4
4
  var ApplicationStatus;
5
5
  (function (ApplicationStatus) {
6
6
  ApplicationStatus["New"] = "new";
@@ -14,3 +14,18 @@ var ApplicationStatus;
14
14
  ApplicationStatus["Transferred"] = "transferred";
15
15
  ApplicationStatus["Cancelled"] = "cancelled";
16
16
  })(ApplicationStatus || (exports.ApplicationStatus = ApplicationStatus = {}));
17
+ var AppPersonRole;
18
+ (function (AppPersonRole) {
19
+ AppPersonRole["PolicyHolder"] = "policy_holder";
20
+ AppPersonRole["LifeAssured"] = "life_assured";
21
+ })(AppPersonRole || (exports.AppPersonRole = AppPersonRole = {}));
22
+ var AppPhLaRelation;
23
+ (function (AppPhLaRelation) {
24
+ AppPhLaRelation["SamePerson"] = "same_person";
25
+ AppPhLaRelation["DifferentPerson"] = "different_person";
26
+ })(AppPhLaRelation || (exports.AppPhLaRelation = AppPhLaRelation = {}));
27
+ var AppCoverageType;
28
+ (function (AppCoverageType) {
29
+ AppCoverageType["Base"] = "base";
30
+ AppCoverageType["Rider"] = "rider";
31
+ })(AppCoverageType || (exports.AppCoverageType = AppCoverageType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.2.26",
3
+ "version": "1.2.28",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {