plac-micro-common 1.3.32 → 1.3.33

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,5 +1,6 @@
1
1
  import { _BaseEntity } from "../_base_entity";
2
2
  import { AppDocumentType, DocumentStorageProvider } from "../../types";
3
+ import { ApplicationEntity } from "./application.entity";
3
4
  export declare class AppDocumentEntity extends _BaseEntity {
4
5
  id: string;
5
6
  application_id: string;
@@ -17,4 +18,5 @@ export declare class AppDocumentEntity extends _BaseEntity {
17
18
  public_url?: string | null;
18
19
  uploaded_at: Date;
19
20
  uploaded_by_user_id?: string | null;
21
+ application?: ApplicationEntity;
20
22
  }
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const _base_entity_1 = require("../_base_entity");
15
15
  const utils_1 = require("../../utils");
16
16
  const types_1 = require("../../types");
17
+ const application_entity_1 = require("./application.entity");
17
18
  let AppDocumentEntity = class AppDocumentEntity extends _base_entity_1._BaseEntity {
18
19
  };
19
20
  exports.AppDocumentEntity = AppDocumentEntity;
@@ -89,6 +90,11 @@ __decorate([
89
90
  (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
90
91
  __metadata("design:type", Object)
91
92
  ], AppDocumentEntity.prototype, "uploaded_by_user_id", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.ManyToOne)(() => application_entity_1.ApplicationEntity, { onDelete: "CASCADE" }),
95
+ (0, typeorm_1.JoinColumn)({ name: "application_id" }),
96
+ __metadata("design:type", application_entity_1.ApplicationEntity)
97
+ ], AppDocumentEntity.prototype, "application", void 0);
92
98
  exports.AppDocumentEntity = AppDocumentEntity = __decorate([
93
99
  (0, typeorm_1.Entity)({ schema: "application", name: "app_documents" }),
94
100
  (0, typeorm_1.Index)("idx_app_documents_application_id", ["application_id"]),
@@ -0,0 +1,18 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { ApplicationEntity } from "./application.entity";
3
+ import { AppPaymentStatus, AppPaymentType } from "../../types";
4
+ export declare class AppPaymentEntity extends _BaseEntity {
5
+ id: string;
6
+ application_id: string;
7
+ payment_no?: string | null;
8
+ payment_datetime: Date;
9
+ payment_type: AppPaymentType;
10
+ payment_status: AppPaymentStatus;
11
+ exchange_rate_value: string;
12
+ amount_paid_usd: number;
13
+ amount_paid_khr: number;
14
+ total_paid_amount: number;
15
+ reference_no?: string | null;
16
+ remark?: string | null;
17
+ application?: ApplicationEntity;
18
+ }
@@ -0,0 +1,94 @@
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.AppPaymentEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const utils_1 = require("../../utils");
16
+ const application_entity_1 = require("./application.entity");
17
+ const types_1 = require("../../types");
18
+ let AppPaymentEntity = class AppPaymentEntity extends _base_entity_1._BaseEntity {
19
+ };
20
+ exports.AppPaymentEntity = AppPaymentEntity;
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
23
+ __metadata("design:type", String)
24
+ ], AppPaymentEntity.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ type: "uuid" }),
27
+ __metadata("design:type", String)
28
+ ], AppPaymentEntity.prototype, "application_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
31
+ __metadata("design:type", Object)
32
+ ], AppPaymentEntity.prototype, "payment_no", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: "timestamptz" }),
35
+ __metadata("design:type", Date)
36
+ ], AppPaymentEntity.prototype, "payment_datetime", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ type: "varchar",
40
+ length: 20,
41
+ comment: (0, utils_1.enumToCommentString)(types_1.AppPaymentType),
42
+ }),
43
+ __metadata("design:type", String)
44
+ ], AppPaymentEntity.prototype, "payment_type", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({
47
+ type: "varchar",
48
+ length: 20,
49
+ comment: (0, utils_1.enumToCommentString)(types_1.AppPaymentStatus),
50
+ default: types_1.AppPaymentStatus.Success,
51
+ }),
52
+ __metadata("design:type", String)
53
+ ], AppPaymentEntity.prototype, "payment_status", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 6 }),
56
+ __metadata("design:type", String)
57
+ ], AppPaymentEntity.prototype, "exchange_rate_value", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 2, default: 0 }),
60
+ __metadata("design:type", Number)
61
+ ], AppPaymentEntity.prototype, "amount_paid_usd", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({
64
+ type: "numeric",
65
+ precision: 18,
66
+ scale: 2,
67
+ default: 0,
68
+ }),
69
+ __metadata("design:type", Number)
70
+ ], AppPaymentEntity.prototype, "amount_paid_khr", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 2 }),
73
+ __metadata("design:type", Number)
74
+ ], AppPaymentEntity.prototype, "total_paid_amount", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
77
+ __metadata("design:type", Object)
78
+ ], AppPaymentEntity.prototype, "reference_no", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
81
+ __metadata("design:type", Object)
82
+ ], AppPaymentEntity.prototype, "remark", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.ManyToOne)(() => application_entity_1.ApplicationEntity, { onDelete: "CASCADE" }),
85
+ (0, typeorm_1.JoinColumn)({ name: "application_id" }),
86
+ __metadata("design:type", application_entity_1.ApplicationEntity)
87
+ ], AppPaymentEntity.prototype, "application", void 0);
88
+ exports.AppPaymentEntity = AppPaymentEntity = __decorate([
89
+ (0, typeorm_1.Entity)({ schema: "application", name: "app_payments" }),
90
+ (0, typeorm_1.Index)("ux_app_payments_payment_no", ["payment_no"], { unique: true }),
91
+ (0, typeorm_1.Index)("ix_app_payments_application_id", ["application_id"]),
92
+ (0, typeorm_1.Index)("ix_app_payments_payment_datetime", ["payment_datetime"]),
93
+ (0, typeorm_1.Index)("ix_app_payments_payment_status", ["payment_status"])
94
+ ], AppPaymentEntity);
@@ -6,6 +6,8 @@ import { AppPersonEntity } from "./app_person.entity";
6
6
  import { AppBeneficiaryEntity } from "./app_beneficiary.entity";
7
7
  import { AppUnderwritingInfoEntity } from "./app_underwriting_info.entity";
8
8
  import { AppUnderwritingAnswerEntity } from "./app_underwriting_answer.entity";
9
+ import { AppDocumentEntity } from "./app_document.entity";
10
+ import { AppPaymentEntity } from "./app_payment.entity";
9
11
  export declare class ApplicationEntity extends _BaseEntity {
10
12
  id: string;
11
13
  application_no: string;
@@ -52,4 +54,6 @@ export declare class ApplicationEntity extends _BaseEntity {
52
54
  app_beneficiaries?: AppBeneficiaryEntity[];
53
55
  app_uw_infos?: AppUnderwritingInfoEntity[];
54
56
  app_uw_answers?: AppUnderwritingAnswerEntity[];
57
+ app_documents?: AppDocumentEntity[];
58
+ app_payments?: AppPaymentEntity[];
55
59
  }
@@ -20,6 +20,8 @@ const app_person_entity_1 = require("./app_person.entity");
20
20
  const app_beneficiary_entity_1 = require("./app_beneficiary.entity");
21
21
  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
+ const app_document_entity_1 = require("./app_document.entity");
24
+ const app_payment_entity_1 = require("./app_payment.entity");
23
25
  let ApplicationEntity = class ApplicationEntity extends _base_entity_1._BaseEntity {
24
26
  };
25
27
  exports.ApplicationEntity = ApplicationEntity;
@@ -250,6 +252,14 @@ __decorate([
250
252
  }),
251
253
  __metadata("design:type", Array)
252
254
  ], ApplicationEntity.prototype, "app_uw_answers", void 0);
255
+ __decorate([
256
+ (0, typeorm_1.OneToMany)(() => app_document_entity_1.AppDocumentEntity, (d) => d.application, { nullable: true }),
257
+ __metadata("design:type", Array)
258
+ ], ApplicationEntity.prototype, "app_documents", void 0);
259
+ __decorate([
260
+ (0, typeorm_1.OneToMany)(() => app_payment_entity_1.AppPaymentEntity, (d) => d.application, { nullable: true }),
261
+ __metadata("design:type", Array)
262
+ ], ApplicationEntity.prototype, "app_payments", void 0);
253
263
  exports.ApplicationEntity = ApplicationEntity = __decorate([
254
264
  (0, typeorm_1.Entity)({ schema: "application", name: "applications" })
255
265
  ], ApplicationEntity);
@@ -7,5 +7,6 @@ import { AppUnderwritingInfoEntity } from "./app_underwriting_info.entity";
7
7
  import { AppActivityLogEntity } from "./app_activity_log.entity";
8
8
  import { UnderwritingQuestionEntity } from "./underwriting_question.entity";
9
9
  import { AppDocumentEntity } from "./app_document.entity";
10
- export declare const APPLICATION_ENTITIES: readonly [typeof ApplicationEntity, typeof AppBeneficiaryEntity, typeof AppCoverageEntity, typeof AppPersonEntity, typeof AppUnderwritingAnswerEntity, typeof AppUnderwritingInfoEntity, typeof AppDocumentEntity, typeof AppActivityLogEntity, typeof UnderwritingQuestionEntity];
11
- export { ApplicationEntity, AppBeneficiaryEntity, AppCoverageEntity, AppPersonEntity, AppUnderwritingAnswerEntity, AppUnderwritingInfoEntity, AppDocumentEntity, AppActivityLogEntity, UnderwritingQuestionEntity, };
10
+ import { AppPaymentEntity } from "./app_payment.entity";
11
+ export declare const APPLICATION_ENTITIES: readonly [typeof ApplicationEntity, typeof AppBeneficiaryEntity, typeof AppCoverageEntity, typeof AppPersonEntity, typeof AppUnderwritingAnswerEntity, typeof AppUnderwritingInfoEntity, typeof AppDocumentEntity, typeof AppPaymentEntity, typeof AppActivityLogEntity, typeof UnderwritingQuestionEntity];
12
+ export { ApplicationEntity, AppBeneficiaryEntity, AppCoverageEntity, AppPersonEntity, AppUnderwritingAnswerEntity, AppUnderwritingInfoEntity, AppDocumentEntity, AppPaymentEntity, AppActivityLogEntity, UnderwritingQuestionEntity, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnderwritingQuestionEntity = exports.AppActivityLogEntity = exports.AppDocumentEntity = exports.AppUnderwritingInfoEntity = exports.AppUnderwritingAnswerEntity = exports.AppPersonEntity = exports.AppCoverageEntity = exports.AppBeneficiaryEntity = exports.ApplicationEntity = exports.APPLICATION_ENTITIES = void 0;
3
+ exports.UnderwritingQuestionEntity = exports.AppActivityLogEntity = exports.AppPaymentEntity = exports.AppDocumentEntity = exports.AppUnderwritingInfoEntity = exports.AppUnderwritingAnswerEntity = exports.AppPersonEntity = exports.AppCoverageEntity = exports.AppBeneficiaryEntity = exports.ApplicationEntity = exports.APPLICATION_ENTITIES = void 0;
4
4
  const application_entity_1 = require("./application.entity");
5
5
  Object.defineProperty(exports, "ApplicationEntity", { enumerable: true, get: function () { return application_entity_1.ApplicationEntity; } });
6
6
  const app_beneficiary_entity_1 = require("./app_beneficiary.entity");
@@ -19,6 +19,8 @@ const underwriting_question_entity_1 = require("./underwriting_question.entity")
19
19
  Object.defineProperty(exports, "UnderwritingQuestionEntity", { enumerable: true, get: function () { return underwriting_question_entity_1.UnderwritingQuestionEntity; } });
20
20
  const app_document_entity_1 = require("./app_document.entity");
21
21
  Object.defineProperty(exports, "AppDocumentEntity", { enumerable: true, get: function () { return app_document_entity_1.AppDocumentEntity; } });
22
+ const app_payment_entity_1 = require("./app_payment.entity");
23
+ Object.defineProperty(exports, "AppPaymentEntity", { enumerable: true, get: function () { return app_payment_entity_1.AppPaymentEntity; } });
22
24
  exports.APPLICATION_ENTITIES = [
23
25
  application_entity_1.ApplicationEntity,
24
26
  app_beneficiary_entity_1.AppBeneficiaryEntity,
@@ -27,6 +29,7 @@ exports.APPLICATION_ENTITIES = [
27
29
  app_underwriting_answer_entity_1.AppUnderwritingAnswerEntity,
28
30
  app_underwriting_info_entity_1.AppUnderwritingInfoEntity,
29
31
  app_document_entity_1.AppDocumentEntity,
32
+ app_payment_entity_1.AppPaymentEntity,
30
33
  app_activity_log_entity_1.AppActivityLogEntity,
31
34
  underwriting_question_entity_1.UnderwritingQuestionEntity,
32
35
  ];
@@ -6,7 +6,7 @@ export declare class ExchangeRateEntity extends _BaseEntity {
6
6
  base_currency_code: string;
7
7
  quote_currency_code: string;
8
8
  rate_date: string;
9
- exchange_rate: string;
9
+ exchange_rate: number;
10
10
  source_type: ExchangeRateSourceType;
11
11
  remarks?: string | null;
12
12
  is_active: boolean;
@@ -36,7 +36,7 @@ __decorate([
36
36
  ], ExchangeRateEntity.prototype, "rate_date", void 0);
37
37
  __decorate([
38
38
  (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 6 }),
39
- __metadata("design:type", String)
39
+ __metadata("design:type", Number)
40
40
  ], ExchangeRateEntity.prototype, "exchange_rate", void 0);
41
41
  __decorate([
42
42
  (0, typeorm_1.Column)({
@@ -58,3 +58,15 @@ export declare enum AppDocumentType {
58
58
  ClaimForm = "claim_form",
59
59
  Other = "other"
60
60
  }
61
+ export declare enum AppPaymentType {
62
+ Premium = "premium",
63
+ Deposit = "deposit",
64
+ Refund = "refund"
65
+ }
66
+ export declare enum AppPaymentStatus {
67
+ Success = "success",
68
+ Failed = "failed",
69
+ Pending = "pending",
70
+ Cancelled = "cancelled",
71
+ Voided = "voided"
72
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppDocumentType = exports.UwAnswerValueType = exports.AppCoverageType = exports.AppPhLaRelation = exports.AppPersonRole = exports.ApplicationActionType = exports.ApplicationStatus = void 0;
3
+ exports.AppPaymentStatus = exports.AppPaymentType = exports.AppDocumentType = exports.UwAnswerValueType = exports.AppCoverageType = exports.AppPhLaRelation = exports.AppPersonRole = exports.ApplicationActionType = exports.ApplicationStatus = void 0;
4
4
  var ApplicationStatus;
5
5
  (function (ApplicationStatus) {
6
6
  ApplicationStatus["New"] = "new";
@@ -78,3 +78,17 @@ var AppDocumentType;
78
78
  // ClaimForm = 'claim_form',
79
79
  AppDocumentType["Other"] = "other";
80
80
  })(AppDocumentType || (exports.AppDocumentType = AppDocumentType = {}));
81
+ var AppPaymentType;
82
+ (function (AppPaymentType) {
83
+ AppPaymentType["Premium"] = "premium";
84
+ AppPaymentType["Deposit"] = "deposit";
85
+ AppPaymentType["Refund"] = "refund";
86
+ })(AppPaymentType || (exports.AppPaymentType = AppPaymentType = {}));
87
+ var AppPaymentStatus;
88
+ (function (AppPaymentStatus) {
89
+ AppPaymentStatus["Success"] = "success";
90
+ AppPaymentStatus["Failed"] = "failed";
91
+ AppPaymentStatus["Pending"] = "pending";
92
+ AppPaymentStatus["Cancelled"] = "cancelled";
93
+ AppPaymentStatus["Voided"] = "voided";
94
+ })(AppPaymentStatus || (exports.AppPaymentStatus = AppPaymentStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.32",
3
+ "version": "1.3.33",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {