plac-micro-common 1.3.113 → 1.3.115

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
1
  import { _BaseEntity } from "../_base_entity";
2
2
  import { AppFormType, ApplicationStatus, AppPhLaRelation, AppSourceType, UWDecisionMetadata, UWDecisionType } from "../../types";
3
- import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity, OrgReferralEntity } from "../core";
3
+ import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity, OrgReferralEntity, PromotionEntity, SourceCodeEntity, SourceSubTypeEntity, SourceTypeEntity } from "../core";
4
4
  import { AppCoverageEntity } from "./app_coverage.entity";
5
5
  import { AppPersonEntity } from "./app_person.entity";
6
6
  import { AppBeneficiaryEntity } from "./app_beneficiary.entity";
@@ -26,6 +26,7 @@ export declare class ApplicationEntity extends _BaseEntity {
26
26
  org_id: string;
27
27
  org_branch_id?: string | null;
28
28
  channel_id?: string | null;
29
+ promotion_id?: string | null;
29
30
  org_referral_id?: string | null;
30
31
  owner_org_staff_id: string;
31
32
  assigned_org_staff_id?: string | null;
@@ -66,6 +67,9 @@ export declare class ApplicationEntity extends _BaseEntity {
66
67
  is_migrated: boolean;
67
68
  metadata?: Record<string, any> | null;
68
69
  org: OrganizationEntity;
70
+ source_type_ref?: SourceTypeEntity | null;
71
+ source_sub_type?: SourceSubTypeEntity | null;
72
+ source_code?: SourceCodeEntity | null;
69
73
  owner_org_staff: OrganizationStaffEntity;
70
74
  assigned_org_staff?: OrganizationStaffEntity | null;
71
75
  org_branch?: OrganizationBranchEntity | null;
@@ -78,4 +82,5 @@ export declare class ApplicationEntity extends _BaseEntity {
78
82
  app_uw_answers?: AppUnderwritingAnswerEntity[];
79
83
  app_documents?: AppDocumentEntity[];
80
84
  app_payments?: AppPaymentEntity[];
85
+ promotion?: PromotionEntity | null;
81
86
  }
@@ -109,6 +109,11 @@ __decorate([
109
109
  (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
110
110
  __metadata("design:type", Object)
111
111
  ], ApplicationEntity.prototype, "channel_id", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.Index)(),
114
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
115
+ __metadata("design:type", Object)
116
+ ], ApplicationEntity.prototype, "promotion_id", void 0);
112
117
  __decorate([
113
118
  (0, typeorm_1.Index)(),
114
119
  (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
@@ -319,6 +324,24 @@ __decorate([
319
324
  (0, typeorm_1.JoinColumn)({ name: "org_id" }),
320
325
  __metadata("design:type", core_1.OrganizationEntity)
321
326
  ], ApplicationEntity.prototype, "org", void 0);
327
+ __decorate([
328
+ (0, typeorm_1.ManyToOne)(() => core_1.SourceTypeEntity, { nullable: true, onDelete: "SET NULL" }),
329
+ (0, typeorm_1.JoinColumn)({ name: "source_type_id" }),
330
+ __metadata("design:type", Object)
331
+ ], ApplicationEntity.prototype, "source_type_ref", void 0);
332
+ __decorate([
333
+ (0, typeorm_1.ManyToOne)(() => core_1.SourceSubTypeEntity, {
334
+ nullable: true,
335
+ onDelete: "SET NULL",
336
+ }),
337
+ (0, typeorm_1.JoinColumn)({ name: "source_sub_type_id" }),
338
+ __metadata("design:type", Object)
339
+ ], ApplicationEntity.prototype, "source_sub_type", void 0);
340
+ __decorate([
341
+ (0, typeorm_1.ManyToOne)(() => core_1.SourceCodeEntity, { nullable: true, onDelete: "SET NULL" }),
342
+ (0, typeorm_1.JoinColumn)({ name: "source_code_id" }),
343
+ __metadata("design:type", Object)
344
+ ], ApplicationEntity.prototype, "source_code", void 0);
322
345
  __decorate([
323
346
  (0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, { onDelete: "RESTRICT" }),
324
347
  (0, typeorm_1.JoinColumn)({ name: "owner_org_staff_id" }),
@@ -381,6 +404,11 @@ __decorate([
381
404
  (0, typeorm_1.OneToMany)(() => app_payment_entity_1.AppPaymentEntity, (d) => d.application, { nullable: true }),
382
405
  __metadata("design:type", Array)
383
406
  ], ApplicationEntity.prototype, "app_payments", void 0);
407
+ __decorate([
408
+ (0, typeorm_1.ManyToOne)(() => core_1.PromotionEntity, { nullable: true, onDelete: "SET NULL" }),
409
+ (0, typeorm_1.JoinColumn)({ name: "promotion_id" }),
410
+ __metadata("design:type", Object)
411
+ ], ApplicationEntity.prototype, "promotion", void 0);
384
412
  exports.ApplicationEntity = ApplicationEntity = __decorate([
385
413
  (0, typeorm_1.Entity)({ schema: "application", name: "applications" })
386
414
  ], ApplicationEntity);
@@ -1,12 +1,9 @@
1
1
  import { _BaseEntity } from "../../_base_entity";
2
- import { DiscountType } from "../../../types";
3
2
  export declare class PromotionEntity extends _BaseEntity {
4
3
  id: string;
5
4
  promotion_code: string;
6
5
  name: string;
7
6
  name_kh?: string | null;
8
- discount_type: DiscountType;
9
- discount_value: number;
10
7
  is_active: boolean;
11
8
  starts_at?: Date | null;
12
9
  ends_at?: Date | null;
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PromotionEntity = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const _base_entity_1 = require("../../_base_entity");
15
- const types_1 = require("../../../types");
16
15
  let PromotionEntity = class PromotionEntity extends _base_entity_1._BaseEntity {
17
16
  };
18
17
  exports.PromotionEntity = PromotionEntity;
@@ -32,14 +31,6 @@ __decorate([
32
31
  (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
33
32
  __metadata("design:type", Object)
34
33
  ], PromotionEntity.prototype, "name_kh", void 0);
35
- __decorate([
36
- (0, typeorm_1.Column)({ type: "varchar", length: 25, default: types_1.DiscountType.Percentage }),
37
- __metadata("design:type", String)
38
- ], PromotionEntity.prototype, "discount_type", void 0);
39
- __decorate([
40
- (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 2 }),
41
- __metadata("design:type", Number)
42
- ], PromotionEntity.prototype, "discount_value", void 0);
43
34
  __decorate([
44
35
  (0, typeorm_1.Column)({ type: "bool", default: true }),
45
36
  __metadata("design:type", Boolean)
@@ -4,9 +4,11 @@ export declare class PromotionProductEntity extends _BaseEntity {
4
4
  id: string;
5
5
  promotion_id: string;
6
6
  product_id: string;
7
+ rider_id?: string | null;
7
8
  term_year?: number | null;
8
9
  payment_mode_id?: string | null;
9
10
  discount_type?: DiscountType;
10
11
  discount_value?: number | null;
12
+ configuration?: Record<string, any> | null;
11
13
  is_active: boolean;
12
14
  }
@@ -29,6 +29,10 @@ __decorate([
29
29
  (0, typeorm_1.Column)({ type: "uuid" }),
30
30
  __metadata("design:type", String)
31
31
  ], PromotionProductEntity.prototype, "product_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
34
+ __metadata("design:type", Object)
35
+ ], PromotionProductEntity.prototype, "rider_id", void 0);
32
36
  __decorate([
33
37
  (0, typeorm_1.Column)({ type: "int", nullable: true }),
34
38
  __metadata("design:type", Object)
@@ -51,6 +55,10 @@ __decorate([
51
55
  (0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 2, nullable: true }),
52
56
  __metadata("design:type", Object)
53
57
  ], PromotionProductEntity.prototype, "discount_value", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], PromotionProductEntity.prototype, "configuration", void 0);
54
62
  __decorate([
55
63
  (0, typeorm_1.Column)({ default: true }),
56
64
  __metadata("design:type", Boolean)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.113",
3
+ "version": "1.3.115",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {