plac-micro-common 1.3.89 → 1.3.91

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.
@@ -8,6 +8,7 @@ import { AppUnderwritingInfoEntity } from "./app_underwriting_info.entity";
8
8
  import { AppUnderwritingAnswerEntity } from "./app_underwriting_answer.entity";
9
9
  import { AppDocumentEntity } from "./app_document.entity";
10
10
  import { AppPaymentEntity } from "./app_payment.entity";
11
+ import { CustomerLoanInfoEntity } from "../customer";
11
12
  export declare class ApplicationEntity extends _BaseEntity {
12
13
  id: string;
13
14
  form_type: AppFormType;
@@ -42,6 +43,7 @@ export declare class ApplicationEntity extends _BaseEntity {
42
43
  uw_decision_by?: string | null;
43
44
  uw_decision_metadata?: UWDecisionMetadata | null;
44
45
  quotation_id?: string | null;
46
+ loan_info_id?: string | null;
45
47
  payment_method_id?: string | null;
46
48
  annual_premium_amount?: number | null;
47
49
  mode_premium_amount?: number | null;
@@ -63,6 +65,7 @@ export declare class ApplicationEntity extends _BaseEntity {
63
65
  assigned_org_staff?: OrganizationStaffEntity | null;
64
66
  org_branch?: OrganizationBranchEntity | null;
65
67
  org_referral?: OrgReferralEntity | null;
68
+ loan_info?: CustomerLoanInfoEntity | null;
66
69
  app_coverages?: AppCoverageEntity[];
67
70
  app_persons?: AppPersonEntity[];
68
71
  app_beneficiaries?: AppBeneficiaryEntity[];
@@ -22,6 +22,7 @@ const app_underwriting_info_entity_1 = require("./app_underwriting_info.entity")
22
22
  const app_underwriting_answer_entity_1 = require("./app_underwriting_answer.entity");
23
23
  const app_document_entity_1 = require("./app_document.entity");
24
24
  const app_payment_entity_1 = require("./app_payment.entity");
25
+ const customer_1 = require("../customer");
25
26
  let ApplicationEntity = class ApplicationEntity extends _base_entity_1._BaseEntity {
26
27
  };
27
28
  exports.ApplicationEntity = ApplicationEntity;
@@ -198,6 +199,11 @@ __decorate([
198
199
  (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
199
200
  __metadata("design:type", Object)
200
201
  ], ApplicationEntity.prototype, "quotation_id", void 0);
202
+ __decorate([
203
+ (0, typeorm_1.Index)(),
204
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
205
+ __metadata("design:type", Object)
206
+ ], ApplicationEntity.prototype, "loan_info_id", void 0);
201
207
  __decorate([
202
208
  (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
203
209
  __metadata("design:type", Object)
@@ -308,6 +314,14 @@ __decorate([
308
314
  (0, typeorm_1.JoinColumn)({ name: "org_referral_id" }),
309
315
  __metadata("design:type", Object)
310
316
  ], ApplicationEntity.prototype, "org_referral", void 0);
317
+ __decorate([
318
+ (0, typeorm_1.ManyToOne)(() => customer_1.CustomerLoanInfoEntity, {
319
+ nullable: true,
320
+ onDelete: "SET NULL",
321
+ }),
322
+ (0, typeorm_1.JoinColumn)({ name: "loan_info_id" }),
323
+ __metadata("design:type", Object)
324
+ ], ApplicationEntity.prototype, "loan_info", void 0);
311
325
  __decorate([
312
326
  (0, typeorm_1.OneToMany)(() => app_coverage_entity_1.AppCoverageEntity, (c) => c.application, { nullable: true }),
313
327
  __metadata("design:type", Array)
@@ -6,7 +6,7 @@ import { CustomerContactEntity } from "./customer_contact.entity";
6
6
  import { CustomerAddressEntity } from "./customer_address.entity";
7
7
  import { CustomerIdentifierEntity } from "./customer_identifier.entity";
8
8
  import { CustomerEmploymentEntity } from "./customer_employment.entity";
9
- import { CustomerLoanInfoEntity } from "./customer_loan_info.entity";
9
+ import { CustomerLoanPersonEntity } from "./customer_loan_person.entity";
10
10
  import { OrganizationEntity, OrganizationStaffEntity } from "../core";
11
11
  export declare class CustomerEntity extends _BaseEntity {
12
12
  id: string;
@@ -27,7 +27,7 @@ export declare class CustomerEntity extends _BaseEntity {
27
27
  addresses?: CustomerAddressEntity[];
28
28
  identifiers?: CustomerIdentifierEntity[];
29
29
  employments?: CustomerEmploymentEntity[];
30
- loan_infos?: CustomerLoanInfoEntity[];
30
+ loan_persons?: CustomerLoanPersonEntity[];
31
31
  org?: OrganizationEntity;
32
32
  created_by_org_staff?: OrganizationStaffEntity;
33
33
  }
@@ -19,7 +19,7 @@ const customer_contact_entity_1 = require("./customer_contact.entity");
19
19
  const customer_address_entity_1 = require("./customer_address.entity");
20
20
  const customer_identifier_entity_1 = require("./customer_identifier.entity");
21
21
  const customer_employment_entity_1 = require("./customer_employment.entity");
22
- const customer_loan_info_entity_1 = require("./customer_loan_info.entity");
22
+ const customer_loan_person_entity_1 = require("./customer_loan_person.entity");
23
23
  const core_1 = require("../core");
24
24
  const utils_1 = require("../../utils");
25
25
  let CustomerEntity = class CustomerEntity extends _base_entity_1._BaseEntity {
@@ -119,11 +119,11 @@ __decorate([
119
119
  __metadata("design:type", Array)
120
120
  ], CustomerEntity.prototype, "employments", void 0);
121
121
  __decorate([
122
- (0, typeorm_1.OneToMany)(() => customer_loan_info_entity_1.CustomerLoanInfoEntity, (l) => l.customer, {
122
+ (0, typeorm_1.OneToMany)(() => customer_loan_person_entity_1.CustomerLoanPersonEntity, (p) => p.customer, {
123
123
  cascade: true,
124
124
  }),
125
125
  __metadata("design:type", Array)
126
- ], CustomerEntity.prototype, "loan_infos", void 0);
126
+ ], CustomerEntity.prototype, "loan_persons", void 0);
127
127
  __decorate([
128
128
  (0, typeorm_1.ManyToOne)(() => core_1.OrganizationEntity, { nullable: true, onDelete: "RESTRICT" }),
129
129
  (0, typeorm_1.JoinColumn)({ name: "org_id" }),
@@ -1,9 +1,8 @@
1
1
  import { _BaseEntity } from "../_base_entity";
2
- import { CustomerEntity } from "./customer.entity";
2
+ import { CustomerLoanPersonEntity } from "./customer_loan_person.entity";
3
3
  export declare class CustomerLoanInfoEntity extends _BaseEntity {
4
4
  id: string;
5
5
  loan_no: string;
6
- customer_id: string;
7
6
  loan_term?: number | null;
8
7
  loan_amount?: number | null;
9
8
  issue_date?: string | null;
@@ -12,5 +11,5 @@ export declare class CustomerLoanInfoEntity extends _BaseEntity {
12
11
  branch_name?: string | null;
13
12
  external_ref?: string | null;
14
13
  metadata?: Record<string, any> | null;
15
- customer: CustomerEntity;
14
+ persons?: CustomerLoanPersonEntity[];
16
15
  }
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CustomerLoanInfoEntity = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const _base_entity_1 = require("../_base_entity");
15
- const customer_entity_1 = require("./customer.entity");
15
+ const customer_loan_person_entity_1 = require("./customer_loan_person.entity");
16
16
  let CustomerLoanInfoEntity = class CustomerLoanInfoEntity extends _base_entity_1._BaseEntity {
17
17
  };
18
18
  exports.CustomerLoanInfoEntity = CustomerLoanInfoEntity;
@@ -24,10 +24,6 @@ __decorate([
24
24
  (0, typeorm_1.Column)({ type: "varchar", length: 50, unique: true }),
25
25
  __metadata("design:type", String)
26
26
  ], CustomerLoanInfoEntity.prototype, "loan_no", void 0);
27
- __decorate([
28
- (0, typeorm_1.Column)({ type: "uuid" }),
29
- __metadata("design:type", String)
30
- ], CustomerLoanInfoEntity.prototype, "customer_id", void 0);
31
27
  __decorate([
32
28
  (0, typeorm_1.Column)({ type: "int", nullable: true }),
33
29
  __metadata("design:type", Object)
@@ -61,15 +57,13 @@ __decorate([
61
57
  __metadata("design:type", Object)
62
58
  ], CustomerLoanInfoEntity.prototype, "metadata", void 0);
63
59
  __decorate([
64
- (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (customer) => customer.loan_infos, {
65
- onDelete: "CASCADE",
60
+ (0, typeorm_1.OneToMany)(() => customer_loan_person_entity_1.CustomerLoanPersonEntity, (person) => person.loan_info, {
61
+ cascade: true,
66
62
  }),
67
- (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
68
- __metadata("design:type", customer_entity_1.CustomerEntity)
69
- ], CustomerLoanInfoEntity.prototype, "customer", void 0);
63
+ __metadata("design:type", Array)
64
+ ], CustomerLoanInfoEntity.prototype, "persons", void 0);
70
65
  exports.CustomerLoanInfoEntity = CustomerLoanInfoEntity = __decorate([
71
66
  (0, typeorm_1.Entity)({ schema: "customer", name: "customer_loans_info" }),
72
- (0, typeorm_1.Index)("idx_customer_loans_info_customer_id", ["customer_id"]),
73
67
  (0, typeorm_1.Index)("idx_customer_loans_info_loan_no", ["loan_no"]),
74
68
  (0, typeorm_1.Index)("idx_customer_loans_info_external_ref", ["external_ref"])
75
69
  ], CustomerLoanInfoEntity);
@@ -0,0 +1,14 @@
1
+ import { BorrowerType } from "../../types";
2
+ import { _BaseEntity } from "../_base_entity";
3
+ import { CustomerEntity } from "./customer.entity";
4
+ import { CustomerLoanInfoEntity } from "./customer_loan_info.entity";
5
+ export declare class CustomerLoanPersonEntity extends _BaseEntity {
6
+ id: string;
7
+ loan_info_id: string;
8
+ customer_id: string;
9
+ borrower_type: BorrowerType;
10
+ sequence_no: number;
11
+ metadata?: Record<string, any> | null;
12
+ loan_info: CustomerLoanInfoEntity;
13
+ customer: CustomerEntity;
14
+ }
@@ -0,0 +1,74 @@
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.CustomerLoanPersonEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const types_1 = require("../../types");
15
+ const utils_1 = require("../../utils");
16
+ const _base_entity_1 = require("../_base_entity");
17
+ const customer_entity_1 = require("./customer.entity");
18
+ const customer_loan_info_entity_1 = require("./customer_loan_info.entity");
19
+ let CustomerLoanPersonEntity = class CustomerLoanPersonEntity extends _base_entity_1._BaseEntity {
20
+ };
21
+ exports.CustomerLoanPersonEntity = CustomerLoanPersonEntity;
22
+ __decorate([
23
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
24
+ __metadata("design:type", String)
25
+ ], CustomerLoanPersonEntity.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: "uuid" }),
28
+ __metadata("design:type", String)
29
+ ], CustomerLoanPersonEntity.prototype, "loan_info_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: "uuid" }),
32
+ __metadata("design:type", String)
33
+ ], CustomerLoanPersonEntity.prototype, "customer_id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({
36
+ type: "varchar",
37
+ length: 30,
38
+ comment: (0, utils_1.enumToCommentString)(types_1.BorrowerType),
39
+ }),
40
+ __metadata("design:type", String)
41
+ ], CustomerLoanPersonEntity.prototype, "borrower_type", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: "int", default: 1 }),
44
+ __metadata("design:type", Number)
45
+ ], CustomerLoanPersonEntity.prototype, "sequence_no", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], CustomerLoanPersonEntity.prototype, "metadata", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.ManyToOne)(() => customer_loan_info_entity_1.CustomerLoanInfoEntity, (loanInfo) => loanInfo.persons, {
52
+ onDelete: "CASCADE",
53
+ }),
54
+ (0, typeorm_1.JoinColumn)({ name: "loan_info_id" }),
55
+ __metadata("design:type", customer_loan_info_entity_1.CustomerLoanInfoEntity)
56
+ ], CustomerLoanPersonEntity.prototype, "loan_info", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (customer) => customer.loan_persons, {
59
+ onDelete: "CASCADE",
60
+ }),
61
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
62
+ __metadata("design:type", customer_entity_1.CustomerEntity)
63
+ ], CustomerLoanPersonEntity.prototype, "customer", void 0);
64
+ exports.CustomerLoanPersonEntity = CustomerLoanPersonEntity = __decorate([
65
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_loan_persons" }),
66
+ (0, typeorm_1.Index)("idx_customer_loan_persons_loan_info_id", ["loan_info_id"]),
67
+ (0, typeorm_1.Index)("idx_customer_loan_persons_customer_id", ["customer_id"]),
68
+ (0, typeorm_1.Index)("idx_customer_loan_persons_borrower_type", ["borrower_type"]),
69
+ (0, typeorm_1.Unique)("uq_customer_loan_person_role_seq", [
70
+ "loan_info_id",
71
+ "borrower_type",
72
+ "sequence_no",
73
+ ])
74
+ ], CustomerLoanPersonEntity);
@@ -6,5 +6,6 @@ import { CustomerIdentifierEntity } from "./customer_identifier.entity";
6
6
  import { CustomerIndividualProfileEntity } from "./customer_individual_profile.entity";
7
7
  import { CustomerEmploymentEntity } from "./customer_employment.entity";
8
8
  import { CustomerLoanInfoEntity } from "./customer_loan_info.entity";
9
- export declare const CUSTOMER_ENTITIES: readonly [typeof CustomerEntity, typeof CustomerAddressEntity, typeof CustomerContactEntity, typeof CustomerCorporateProfileEntity, typeof CustomerIdentifierEntity, typeof CustomerIndividualProfileEntity, typeof CustomerEmploymentEntity, typeof CustomerLoanInfoEntity];
10
- export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, CustomerEmploymentEntity, CustomerLoanInfoEntity, };
9
+ import { CustomerLoanPersonEntity } from "./customer_loan_person.entity";
10
+ export declare const CUSTOMER_ENTITIES: readonly [typeof CustomerEntity, typeof CustomerAddressEntity, typeof CustomerContactEntity, typeof CustomerCorporateProfileEntity, typeof CustomerIdentifierEntity, typeof CustomerIndividualProfileEntity, typeof CustomerEmploymentEntity, typeof CustomerLoanInfoEntity, typeof CustomerLoanPersonEntity];
11
+ export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, CustomerEmploymentEntity, CustomerLoanInfoEntity, CustomerLoanPersonEntity, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomerLoanInfoEntity = exports.CustomerEmploymentEntity = exports.CustomerIndividualProfileEntity = exports.CustomerIdentifierEntity = exports.CustomerCorporateProfileEntity = exports.CustomerContactEntity = exports.CustomerAddressEntity = exports.CustomerEntity = exports.CUSTOMER_ENTITIES = void 0;
3
+ exports.CustomerLoanPersonEntity = exports.CustomerLoanInfoEntity = exports.CustomerEmploymentEntity = exports.CustomerIndividualProfileEntity = exports.CustomerIdentifierEntity = exports.CustomerCorporateProfileEntity = exports.CustomerContactEntity = exports.CustomerAddressEntity = exports.CustomerEntity = exports.CUSTOMER_ENTITIES = void 0;
4
4
  const customer_entity_1 = require("./customer.entity");
5
5
  Object.defineProperty(exports, "CustomerEntity", { enumerable: true, get: function () { return customer_entity_1.CustomerEntity; } });
6
6
  const customer_address_entity_1 = require("./customer_address.entity");
@@ -17,6 +17,8 @@ const customer_employment_entity_1 = require("./customer_employment.entity");
17
17
  Object.defineProperty(exports, "CustomerEmploymentEntity", { enumerable: true, get: function () { return customer_employment_entity_1.CustomerEmploymentEntity; } });
18
18
  const customer_loan_info_entity_1 = require("./customer_loan_info.entity");
19
19
  Object.defineProperty(exports, "CustomerLoanInfoEntity", { enumerable: true, get: function () { return customer_loan_info_entity_1.CustomerLoanInfoEntity; } });
20
+ const customer_loan_person_entity_1 = require("./customer_loan_person.entity");
21
+ Object.defineProperty(exports, "CustomerLoanPersonEntity", { enumerable: true, get: function () { return customer_loan_person_entity_1.CustomerLoanPersonEntity; } });
20
22
  exports.CUSTOMER_ENTITIES = [
21
23
  customer_entity_1.CustomerEntity,
22
24
  customer_address_entity_1.CustomerAddressEntity,
@@ -26,4 +28,5 @@ exports.CUSTOMER_ENTITIES = [
26
28
  customer_individual_profile_entity_1.CustomerIndividualProfileEntity,
27
29
  customer_employment_entity_1.CustomerEmploymentEntity,
28
30
  customer_loan_info_entity_1.CustomerLoanInfoEntity,
31
+ customer_loan_person_entity_1.CustomerLoanPersonEntity,
29
32
  ];
@@ -7,6 +7,7 @@ export * from "./customer.type";
7
7
  export * from "./finance.type";
8
8
  export * from "./general.type";
9
9
  export * from "./http.type";
10
+ export * from "./loan.type";
10
11
  export * from "./pagination.type";
11
12
  export * from "./permission.type";
12
13
  export * from "./product.type";
@@ -23,6 +23,7 @@ __exportStar(require("./customer.type"), exports);
23
23
  __exportStar(require("./finance.type"), exports);
24
24
  __exportStar(require("./general.type"), exports);
25
25
  __exportStar(require("./http.type"), exports);
26
+ __exportStar(require("./loan.type"), exports);
26
27
  __exportStar(require("./pagination.type"), exports);
27
28
  __exportStar(require("./permission.type"), exports);
28
29
  __exportStar(require("./product.type"), exports);
@@ -0,0 +1,4 @@
1
+ export declare enum BorrowerType {
2
+ MainBorrower = "main_borrower",
3
+ CoBorrower = "co_borrower"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BorrowerType = void 0;
4
+ var BorrowerType;
5
+ (function (BorrowerType) {
6
+ BorrowerType["MainBorrower"] = "main_borrower";
7
+ BorrowerType["CoBorrower"] = "co_borrower";
8
+ })(BorrowerType || (exports.BorrowerType = BorrowerType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.89",
3
+ "version": "1.3.91",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {