plac-micro-common 1.2.40 → 1.2.42

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.
@@ -1,6 +1,6 @@
1
- import { _BaseEntity } from '../_base_entity';
2
- import { ApplicationStatus, AppPhLaRelation } from '../../types';
3
- import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity } from '../core';
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { ApplicationStatus, AppPhLaRelation } from "../../types";
3
+ import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity } from "../core";
4
4
  export declare class ApplicationEntity extends _BaseEntity {
5
5
  id: string;
6
6
  application_no: string;
@@ -19,7 +19,7 @@ export declare class ApplicationEntity extends _BaseEntity {
19
19
  rejected_at?: Date | null;
20
20
  rejection_reason?: string | null;
21
21
  transferred_at?: Date | null;
22
- product_id: string;
22
+ product_id?: string | null;
23
23
  product_plan_id?: string | null;
24
24
  currency?: string | null;
25
25
  sum_assured?: number | null;
@@ -18,174 +18,174 @@ let ApplicationEntity = class ApplicationEntity extends _base_entity_1._BaseEnti
18
18
  };
19
19
  exports.ApplicationEntity = ApplicationEntity;
20
20
  __decorate([
21
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
22
  __metadata("design:type", String)
23
23
  ], ApplicationEntity.prototype, "id", void 0);
24
24
  __decorate([
25
25
  (0, typeorm_1.Index)(),
26
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, unique: true }),
26
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, unique: true }),
27
27
  __metadata("design:type", String)
28
28
  ], ApplicationEntity.prototype, "application_no", void 0);
29
29
  __decorate([
30
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: types_1.AppPhLaRelation.SamePerson }),
30
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, default: types_1.AppPhLaRelation.SamePerson }),
31
31
  __metadata("design:type", String)
32
32
  ], ApplicationEntity.prototype, "ph_la_relation", void 0);
33
33
  __decorate([
34
34
  (0, typeorm_1.Index)(),
35
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
35
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
36
36
  __metadata("design:type", Object)
37
37
  ], ApplicationEntity.prototype, "external_ref", void 0);
38
38
  __decorate([
39
- (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
39
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
40
40
  __metadata("design:type", Object)
41
41
  ], ApplicationEntity.prototype, "legacy_id", void 0);
42
42
  __decorate([
43
43
  (0, typeorm_1.Index)(),
44
- (0, typeorm_1.Column)({ type: 'uuid' }),
44
+ (0, typeorm_1.Column)({ type: "uuid" }),
45
45
  __metadata("design:type", String)
46
46
  ], ApplicationEntity.prototype, "org_id", void 0);
47
47
  __decorate([
48
48
  (0, typeorm_1.Index)(),
49
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
49
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
50
50
  __metadata("design:type", Object)
51
51
  ], ApplicationEntity.prototype, "org_branch_id", void 0);
52
52
  __decorate([
53
53
  (0, typeorm_1.Index)(),
54
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
54
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
55
55
  __metadata("design:type", Object)
56
56
  ], ApplicationEntity.prototype, "channel_id", void 0);
57
57
  __decorate([
58
58
  (0, typeorm_1.Index)(),
59
- (0, typeorm_1.Column)({ type: 'uuid' }),
59
+ (0, typeorm_1.Column)({ type: "uuid" }),
60
60
  __metadata("design:type", String)
61
61
  ], ApplicationEntity.prototype, "owner_org_staff_id", void 0);
62
62
  __decorate([
63
63
  (0, typeorm_1.Index)(),
64
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
64
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
65
65
  __metadata("design:type", Object)
66
66
  ], ApplicationEntity.prototype, "assigned_org_staff_id", void 0);
67
67
  __decorate([
68
68
  (0, typeorm_1.Index)(),
69
- (0, typeorm_1.Column)({ type: 'varchar', length: 30 }),
69
+ (0, typeorm_1.Column)({ type: "varchar", length: 30 }),
70
70
  __metadata("design:type", String)
71
71
  ], ApplicationEntity.prototype, "status", void 0);
72
72
  __decorate([
73
- (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
73
+ (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
74
74
  __metadata("design:type", Object)
75
75
  ], ApplicationEntity.prototype, "submitted_at", void 0);
76
76
  __decorate([
77
- (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
77
+ (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
78
78
  __metadata("design:type", Object)
79
79
  ], ApplicationEntity.prototype, "review_started_at", void 0);
80
80
  __decorate([
81
- (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
81
+ (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
82
82
  __metadata("design:type", Object)
83
83
  ], ApplicationEntity.prototype, "accepted_at", void 0);
84
84
  __decorate([
85
- (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
85
+ (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
86
86
  __metadata("design:type", Object)
87
87
  ], ApplicationEntity.prototype, "rejected_at", void 0);
88
88
  __decorate([
89
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
89
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
90
90
  __metadata("design:type", Object)
91
91
  ], ApplicationEntity.prototype, "rejection_reason", void 0);
92
92
  __decorate([
93
- (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
93
+ (0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
94
94
  __metadata("design:type", Object)
95
95
  ], ApplicationEntity.prototype, "transferred_at", void 0);
96
96
  __decorate([
97
97
  (0, typeorm_1.Index)(),
98
- (0, typeorm_1.Column)({ type: 'uuid' }),
99
- __metadata("design:type", String)
98
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
99
+ __metadata("design:type", Object)
100
100
  ], ApplicationEntity.prototype, "product_id", void 0);
101
101
  __decorate([
102
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
102
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
103
103
  __metadata("design:type", Object)
104
104
  ], ApplicationEntity.prototype, "product_plan_id", void 0);
105
105
  __decorate([
106
- (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
106
+ (0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
107
107
  __metadata("design:type", Object)
108
108
  ], ApplicationEntity.prototype, "currency", void 0);
109
109
  __decorate([
110
- (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
110
+ (0, typeorm_1.Column)({ type: "numeric", nullable: true }),
111
111
  __metadata("design:type", Object)
112
112
  ], ApplicationEntity.prototype, "sum_assured", void 0);
113
113
  __decorate([
114
- (0, typeorm_1.Column)({ type: 'numeric', nullable: true }),
114
+ (0, typeorm_1.Column)({ type: "numeric", nullable: true }),
115
115
  __metadata("design:type", Object)
116
116
  ], ApplicationEntity.prototype, "mode_premium_amount", void 0);
117
117
  __decorate([
118
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
118
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
119
119
  __metadata("design:type", Object)
120
120
  ], ApplicationEntity.prototype, "product_payment_mode_id", void 0);
121
121
  __decorate([
122
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
122
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
123
123
  __metadata("design:type", Object)
124
124
  ], ApplicationEntity.prototype, "product_policy_term_id", void 0);
125
125
  __decorate([
126
126
  (0, typeorm_1.Index)(),
127
- (0, typeorm_1.Column)({ type: 'uuid' }),
127
+ (0, typeorm_1.Column)({ type: "uuid" }),
128
128
  __metadata("design:type", String)
129
129
  ], ApplicationEntity.prototype, "created_by_user_id", void 0);
130
130
  __decorate([
131
131
  (0, typeorm_1.Index)(),
132
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
132
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
133
133
  __metadata("design:type", Object)
134
134
  ], ApplicationEntity.prototype, "updated_by_user_id", void 0);
135
135
  __decorate([
136
136
  (0, typeorm_1.Index)(),
137
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
137
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
138
138
  __metadata("design:type", Object)
139
139
  ], ApplicationEntity.prototype, "submitted_by_user_id", void 0);
140
140
  __decorate([
141
141
  (0, typeorm_1.Index)(),
142
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
142
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
143
143
  __metadata("design:type", Object)
144
144
  ], ApplicationEntity.prototype, "reviewed_by_user_id", void 0);
145
145
  __decorate([
146
146
  (0, typeorm_1.Index)(),
147
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
147
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
148
148
  __metadata("design:type", Object)
149
149
  ], ApplicationEntity.prototype, "accepted_by_user_id", void 0);
150
150
  __decorate([
151
151
  (0, typeorm_1.Index)(),
152
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
152
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
153
153
  __metadata("design:type", Object)
154
154
  ], ApplicationEntity.prototype, "rejected_by_user_id", void 0);
155
155
  __decorate([
156
156
  (0, typeorm_1.Index)(),
157
- (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
157
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
158
158
  __metadata("design:type", Object)
159
159
  ], ApplicationEntity.prototype, "transferred_by_user_id", void 0);
160
160
  __decorate([
161
- (0, typeorm_1.Column)({ type: 'boolean', default: true }),
161
+ (0, typeorm_1.Column)({ type: "boolean", default: true }),
162
162
  __metadata("design:type", Boolean)
163
163
  ], ApplicationEntity.prototype, "is_active", void 0);
164
164
  __decorate([
165
- (0, typeorm_1.Column)({ type: 'boolean', default: false }),
165
+ (0, typeorm_1.Column)({ type: "boolean", default: false }),
166
166
  __metadata("design:type", Boolean)
167
167
  ], ApplicationEntity.prototype, "is_migrated", void 0);
168
168
  __decorate([
169
- (0, typeorm_1.ManyToOne)(() => core_1.OrganizationEntity, { onDelete: 'RESTRICT' }),
170
- (0, typeorm_1.JoinColumn)({ name: 'org_id' }),
169
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationEntity, { onDelete: "RESTRICT" }),
170
+ (0, typeorm_1.JoinColumn)({ name: "org_id" }),
171
171
  __metadata("design:type", core_1.OrganizationEntity)
172
172
  ], ApplicationEntity.prototype, "org", void 0);
173
173
  __decorate([
174
- (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, { onDelete: 'RESTRICT' }),
175
- (0, typeorm_1.JoinColumn)({ name: 'owner_org_staff_id' }),
174
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, { onDelete: "RESTRICT" }),
175
+ (0, typeorm_1.JoinColumn)({ name: "owner_org_staff_id" }),
176
176
  __metadata("design:type", core_1.OrganizationStaffEntity)
177
177
  ], ApplicationEntity.prototype, "owner_org_staff", void 0);
178
178
  __decorate([
179
- (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, { onDelete: 'SET NULL' }),
180
- (0, typeorm_1.JoinColumn)({ name: 'assigned_org_staff_id' }),
179
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, { onDelete: "SET NULL" }),
180
+ (0, typeorm_1.JoinColumn)({ name: "assigned_org_staff_id" }),
181
181
  __metadata("design:type", Object)
182
182
  ], ApplicationEntity.prototype, "assigned_org_staff", void 0);
183
183
  __decorate([
184
- (0, typeorm_1.ManyToOne)(() => core_1.OrganizationBranchEntity, { onDelete: 'RESTRICT' }),
185
- (0, typeorm_1.JoinColumn)({ name: 'org_branch_id' }),
184
+ (0, typeorm_1.ManyToOne)(() => core_1.OrganizationBranchEntity, { onDelete: "RESTRICT" }),
185
+ (0, typeorm_1.JoinColumn)({ name: "org_branch_id" }),
186
186
  __metadata("design:type", Object)
187
187
  ], ApplicationEntity.prototype, "org_branch", void 0);
188
188
  exports.ApplicationEntity = ApplicationEntity = __decorate([
189
- (0, typeorm_1.Entity)({ schema: 'application', name: 'applications' }),
190
- (0, typeorm_1.Unique)('uq_application_org_app_no', ['org_id', 'application_no'])
189
+ (0, typeorm_1.Entity)({ schema: "application", name: "applications" }),
190
+ (0, typeorm_1.Unique)("uq_application_org_app_no", ["org_id", "application_no"])
191
191
  ], ApplicationEntity);
@@ -12,6 +12,7 @@ export declare class OrganizationStaffEntity extends _BaseEntity {
12
12
  join_date?: string | null;
13
13
  end_date?: string | null;
14
14
  is_active: boolean;
15
+ auth_user_id?: string | null;
15
16
  org: OrganizationEntity;
16
17
  staff: StaffEntity;
17
18
  }
@@ -59,6 +59,11 @@ __decorate([
59
59
  (0, typeorm_1.Column)({ type: "boolean", default: true }),
60
60
  __metadata("design:type", Boolean)
61
61
  ], OrganizationStaffEntity.prototype, "is_active", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Index)(),
64
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
65
+ __metadata("design:type", Object)
66
+ ], OrganizationStaffEntity.prototype, "auth_user_id", void 0);
62
67
  __decorate([
63
68
  (0, typeorm_1.ManyToOne)(() => organization_entity_1.OrganizationEntity, { onDelete: "CASCADE" }),
64
69
  (0, typeorm_1.JoinColumn)({ name: "org_id" }),
@@ -72,5 +77,6 @@ __decorate([
72
77
  exports.OrganizationStaffEntity = OrganizationStaffEntity = __decorate([
73
78
  (0, typeorm_1.Entity)({ schema: "core", name: "org_staffs" }),
74
79
  (0, typeorm_1.Unique)("uq_org_staff_staff_code", ["org_id", "staff_code"]),
75
- (0, typeorm_1.Unique)("uq_org_staff_org_staff", ["org_id", "staff_id"])
80
+ (0, typeorm_1.Unique)("uq_org_staff_org_staff", ["org_id", "staff_id"]),
81
+ (0, typeorm_1.Unique)("uq_org_staff_org_user", ["org_id", "auth_user_id"])
76
82
  ], OrganizationStaffEntity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {