plac-micro-common 1.3.71 → 1.3.72

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.
@@ -3,16 +3,19 @@ import { ApplicationEntity } from "./application.entity";
3
3
  import { AppCoverageEntity } from "./app_coverage.entity";
4
4
  import { UnderwritingQuestionEntity } from "./underwriting_question.entity";
5
5
  import { AppPersonEntity } from "./app_person.entity";
6
+ import { UnderwritingQuestionComponentEntity } from "./underwriting_question_components.entity";
6
7
  export declare class AppUnderwritingAnswerEntity extends _BaseEntity {
7
8
  id: string;
8
9
  application_id: string;
9
10
  application_person_id: string | null;
10
11
  app_coverage_id: string | null;
11
12
  question_id: string;
13
+ question_component_id?: string | null;
12
14
  value: string | null;
13
15
  remark?: string | null;
14
16
  application?: ApplicationEntity;
15
17
  application_person?: AppPersonEntity | null;
16
18
  app_coverage?: AppCoverageEntity | null;
17
19
  question?: UnderwritingQuestionEntity;
20
+ question_component?: UnderwritingQuestionComponentEntity | null;
18
21
  }
@@ -16,6 +16,7 @@ const application_entity_1 = require("./application.entity");
16
16
  const app_coverage_entity_1 = require("./app_coverage.entity");
17
17
  const underwriting_question_entity_1 = require("./underwriting_question.entity");
18
18
  const app_person_entity_1 = require("./app_person.entity");
19
+ const underwriting_question_components_entity_1 = require("./underwriting_question_components.entity");
19
20
  let AppUnderwritingAnswerEntity = class AppUnderwritingAnswerEntity extends _base_entity_1._BaseEntity {
20
21
  };
21
22
  exports.AppUnderwritingAnswerEntity = AppUnderwritingAnswerEntity;
@@ -43,6 +44,10 @@ __decorate([
43
44
  (0, typeorm_1.Column)({ type: "uuid" }),
44
45
  __metadata("design:type", String)
45
46
  ], AppUnderwritingAnswerEntity.prototype, "question_id", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
49
+ __metadata("design:type", Object)
50
+ ], AppUnderwritingAnswerEntity.prototype, "question_component_id", void 0);
46
51
  __decorate([
47
52
  (0, typeorm_1.Column)({ type: "varchar", length: 2000 }),
48
53
  __metadata("design:type", Object)
@@ -71,6 +76,13 @@ __decorate([
71
76
  (0, typeorm_1.JoinColumn)({ name: "question_id" }),
72
77
  __metadata("design:type", underwriting_question_entity_1.UnderwritingQuestionEntity)
73
78
  ], AppUnderwritingAnswerEntity.prototype, "question", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.ManyToOne)(() => underwriting_question_components_entity_1.UnderwritingQuestionComponentEntity, {
81
+ onDelete: "RESTRICT",
82
+ }),
83
+ (0, typeorm_1.JoinColumn)({ name: "question_component_id" }),
84
+ __metadata("design:type", Object)
85
+ ], AppUnderwritingAnswerEntity.prototype, "question_component", void 0);
74
86
  exports.AppUnderwritingAnswerEntity = AppUnderwritingAnswerEntity = __decorate([
75
87
  (0, typeorm_1.Entity)({ schema: "application", name: "app_underwriting_answers" }),
76
88
  (0, typeorm_1.Unique)("uq_app_uw_ans_scope_question", [
@@ -1,8 +1,10 @@
1
1
  import { _BaseEntity } from "../_base_entity";
2
2
  import { AppFormType, UwAnswerValueType } from "../../types";
3
+ import { UnderwritingQuestionComponentEntity } from "./underwriting_question_components.entity";
3
4
  export declare class UnderwritingQuestionEntity extends _BaseEntity {
4
5
  id: string;
5
6
  question_app_form_type: AppFormType;
7
+ group_code?: string;
6
8
  question_code: string;
7
9
  question_text: string;
8
10
  question_text_kh?: string;
@@ -14,4 +16,5 @@ export declare class UnderwritingQuestionEntity extends _BaseEntity {
14
16
  sequence_no: number;
15
17
  meta?: Record<string, any>;
16
18
  is_active: boolean;
19
+ components?: UnderwritingQuestionComponentEntity[];
17
20
  }
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const _base_entity_1 = require("../_base_entity");
15
15
  const types_1 = require("../../types");
16
16
  const utils_1 = require("../../utils");
17
+ const underwriting_question_components_entity_1 = require("./underwriting_question_components.entity");
17
18
  let UnderwritingQuestionEntity = class UnderwritingQuestionEntity extends _base_entity_1._BaseEntity {
18
19
  };
19
20
  exports.UnderwritingQuestionEntity = UnderwritingQuestionEntity;
@@ -30,6 +31,11 @@ __decorate([
30
31
  }),
31
32
  __metadata("design:type", String)
32
33
  ], UnderwritingQuestionEntity.prototype, "question_app_form_type", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Index)(),
36
+ (0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
37
+ __metadata("design:type", String)
38
+ ], UnderwritingQuestionEntity.prototype, "group_code", void 0);
33
39
  __decorate([
34
40
  (0, typeorm_1.Index)(),
35
41
  (0, typeorm_1.Column)({ type: "varchar", length: 50, unique: true }),
@@ -79,6 +85,10 @@ __decorate([
79
85
  (0, typeorm_1.Column)({ type: "boolean", default: true }),
80
86
  __metadata("design:type", Boolean)
81
87
  ], UnderwritingQuestionEntity.prototype, "is_active", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.OneToMany)(() => underwriting_question_components_entity_1.UnderwritingQuestionComponentEntity, (c) => c.question),
90
+ __metadata("design:type", Array)
91
+ ], UnderwritingQuestionEntity.prototype, "components", void 0);
82
92
  exports.UnderwritingQuestionEntity = UnderwritingQuestionEntity = __decorate([
83
93
  (0, typeorm_1.Entity)({ schema: "application", name: "underwriting_questions" })
84
94
  ], UnderwritingQuestionEntity);
@@ -0,0 +1,16 @@
1
+ import { UwAnswerValueType } from "../../types";
2
+ import { _BaseEntity } from "../_base_entity";
3
+ import { UnderwritingQuestionEntity } from "./underwriting_question.entity";
4
+ export declare class UnderwritingQuestionComponentEntity extends _BaseEntity {
5
+ id: string;
6
+ question_id: string;
7
+ component_code: string;
8
+ label: string;
9
+ label_kh?: string;
10
+ value_type: UwAnswerValueType;
11
+ is_required: boolean;
12
+ sequence_no: number;
13
+ meta?: Record<string, any>;
14
+ is_active: boolean;
15
+ question?: UnderwritingQuestionEntity;
16
+ }
@@ -0,0 +1,75 @@
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.UnderwritingQuestionComponentEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const utils_1 = require("../../utils");
15
+ const types_1 = require("../../types");
16
+ const _base_entity_1 = require("../_base_entity");
17
+ const underwriting_question_entity_1 = require("./underwriting_question.entity");
18
+ let UnderwritingQuestionComponentEntity = class UnderwritingQuestionComponentEntity extends _base_entity_1._BaseEntity {
19
+ };
20
+ exports.UnderwritingQuestionComponentEntity = UnderwritingQuestionComponentEntity;
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
23
+ __metadata("design:type", String)
24
+ ], UnderwritingQuestionComponentEntity.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Index)(),
27
+ (0, typeorm_1.Column)({ type: "uuid" }),
28
+ __metadata("design:type", String)
29
+ ], UnderwritingQuestionComponentEntity.prototype, "question_id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: "varchar", length: 50 }),
32
+ __metadata("design:type", String)
33
+ ], UnderwritingQuestionComponentEntity.prototype, "component_code", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: "text" }),
36
+ __metadata("design:type", String)
37
+ ], UnderwritingQuestionComponentEntity.prototype, "label", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
40
+ __metadata("design:type", String)
41
+ ], UnderwritingQuestionComponentEntity.prototype, "label_kh", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ type: "varchar",
45
+ length: 20,
46
+ comment: (0, utils_1.enumToCommentString)(types_1.UwAnswerValueType),
47
+ }),
48
+ __metadata("design:type", String)
49
+ ], UnderwritingQuestionComponentEntity.prototype, "value_type", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: "boolean", default: false }),
52
+ __metadata("design:type", Boolean)
53
+ ], UnderwritingQuestionComponentEntity.prototype, "is_required", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ type: "integer", default: 1 }),
56
+ __metadata("design:type", Number)
57
+ ], UnderwritingQuestionComponentEntity.prototype, "sequence_no", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], UnderwritingQuestionComponentEntity.prototype, "meta", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ type: "boolean", default: true }),
64
+ __metadata("design:type", Boolean)
65
+ ], UnderwritingQuestionComponentEntity.prototype, "is_active", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.ManyToOne)(() => underwriting_question_entity_1.UnderwritingQuestionEntity, (q) => q.id, {
68
+ onDelete: "CASCADE",
69
+ }),
70
+ (0, typeorm_1.JoinColumn)({ name: "question_id" }),
71
+ __metadata("design:type", underwriting_question_entity_1.UnderwritingQuestionEntity)
72
+ ], UnderwritingQuestionComponentEntity.prototype, "question", void 0);
73
+ exports.UnderwritingQuestionComponentEntity = UnderwritingQuestionComponentEntity = __decorate([
74
+ (0, typeorm_1.Entity)({ schema: "application", name: "underwriting_question_components" })
75
+ ], UnderwritingQuestionComponentEntity);
@@ -50,9 +50,11 @@ export declare enum AppCoverageType {
50
50
  }
51
51
  export declare enum UwAnswerValueType {
52
52
  Boolean = "boolean",
53
- Text = "text",
54
- Number = "number",
55
53
  Date = "date",
54
+ Dropdown = "dropdown",
55
+ Number = "number",
56
+ Text = "text",
57
+ TextArea = "text_area",
56
58
  YesOrNo = "yesno"
57
59
  }
58
60
  export declare enum AppDocumentType {
@@ -60,9 +60,11 @@ var AppCoverageType;
60
60
  var UwAnswerValueType;
61
61
  (function (UwAnswerValueType) {
62
62
  UwAnswerValueType["Boolean"] = "boolean";
63
- UwAnswerValueType["Text"] = "text";
64
- UwAnswerValueType["Number"] = "number";
65
63
  UwAnswerValueType["Date"] = "date";
64
+ UwAnswerValueType["Dropdown"] = "dropdown";
65
+ UwAnswerValueType["Number"] = "number";
66
+ UwAnswerValueType["Text"] = "text";
67
+ UwAnswerValueType["TextArea"] = "text_area";
66
68
  UwAnswerValueType["YesOrNo"] = "yesno";
67
69
  })(UwAnswerValueType || (exports.UwAnswerValueType = UwAnswerValueType = {}));
68
70
  var AppDocumentType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.71",
3
+ "version": "1.3.72",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {