plac-micro-common 1.3.27 → 1.3.28

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.
@@ -0,0 +1,20 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { AppDocumentType, DocumentStorageProvider } from "../../types";
3
+ export declare class AppDocumentEntity extends _BaseEntity {
4
+ id: string;
5
+ application_id: string;
6
+ document_type: AppDocumentType;
7
+ document_label?: string;
8
+ original_file_name: string;
9
+ stored_file_name: string;
10
+ file_extension: string | null;
11
+ mime_type?: string;
12
+ file_size_bytes?: string;
13
+ storage_provider: DocumentStorageProvider;
14
+ bucket_name?: string | null;
15
+ object_key?: string | null;
16
+ relative_path?: string | null;
17
+ public_url?: string | null;
18
+ uploaded_at: Date;
19
+ uploaded_by_user_id?: string | null;
20
+ }
@@ -0,0 +1,98 @@
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.AppDocumentEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const utils_1 = require("../../utils");
16
+ const types_1 = require("../../types");
17
+ let AppDocumentEntity = class AppDocumentEntity extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.AppDocumentEntity = AppDocumentEntity;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
+ __metadata("design:type", String)
23
+ ], AppDocumentEntity.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "uuid" }),
26
+ __metadata("design:type", String)
27
+ ], AppDocumentEntity.prototype, "application_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({
30
+ type: "varchar",
31
+ length: 50,
32
+ comment: (0, utils_1.enumToCommentString)(types_1.AppDocumentType),
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], AppDocumentEntity.prototype, "document_type", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
38
+ __metadata("design:type", String)
39
+ ], AppDocumentEntity.prototype, "document_label", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
42
+ __metadata("design:type", String)
43
+ ], AppDocumentEntity.prototype, "original_file_name", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
46
+ __metadata("design:type", String)
47
+ ], AppDocumentEntity.prototype, "stored_file_name", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true }),
50
+ __metadata("design:type", Object)
51
+ ], AppDocumentEntity.prototype, "file_extension", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
54
+ __metadata("design:type", String)
55
+ ], AppDocumentEntity.prototype, "mime_type", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: "bigint", nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], AppDocumentEntity.prototype, "file_size_bytes", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ type: "varchar",
63
+ length: 20,
64
+ comment: (0, utils_1.enumToCommentString)(types_1.DocumentStorageProvider),
65
+ }),
66
+ __metadata("design:type", String)
67
+ ], AppDocumentEntity.prototype, "storage_provider", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: "varchar", length: 150, nullable: true }),
70
+ __metadata("design:type", Object)
71
+ ], AppDocumentEntity.prototype, "bucket_name", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], AppDocumentEntity.prototype, "object_key", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
78
+ __metadata("design:type", Object)
79
+ ], AppDocumentEntity.prototype, "relative_path", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
82
+ __metadata("design:type", Object)
83
+ ], AppDocumentEntity.prototype, "public_url", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: "timestamptz" }),
86
+ __metadata("design:type", Date)
87
+ ], AppDocumentEntity.prototype, "uploaded_at", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
90
+ __metadata("design:type", Object)
91
+ ], AppDocumentEntity.prototype, "uploaded_by_user_id", void 0);
92
+ exports.AppDocumentEntity = AppDocumentEntity = __decorate([
93
+ (0, typeorm_1.Entity)({ schema: "application", name: "app_documents" }),
94
+ (0, typeorm_1.Index)("idx_app_documents_application_id", ["application_id"]),
95
+ (0, typeorm_1.Index)("idx_app_documents_document_type", ["document_type"]),
96
+ (0, typeorm_1.Index)("idx_app_documents_storage_provider", ["storage_provider"]),
97
+ (0, typeorm_1.Index)("idx_app_documents_uploaded_at", ["uploaded_at"])
98
+ ], AppDocumentEntity);
@@ -6,5 +6,6 @@ import { AppUnderwritingAnswerEntity } from "./app_underwriting_answer.entity";
6
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
- export declare const APPLICATION_ENTITIES: readonly [typeof ApplicationEntity, typeof AppBeneficiaryEntity, typeof AppCoverageEntity, typeof AppPersonEntity, typeof AppUnderwritingAnswerEntity, typeof AppUnderwritingInfoEntity, typeof AppActivityLogEntity, typeof UnderwritingQuestionEntity];
10
- export { ApplicationEntity, AppBeneficiaryEntity, AppCoverageEntity, AppPersonEntity, AppUnderwritingAnswerEntity, AppUnderwritingInfoEntity, AppActivityLogEntity, UnderwritingQuestionEntity, };
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, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnderwritingQuestionEntity = exports.AppActivityLogEntity = exports.AppUnderwritingInfoEntity = exports.AppUnderwritingAnswerEntity = exports.AppPersonEntity = exports.AppCoverageEntity = exports.AppBeneficiaryEntity = exports.ApplicationEntity = exports.APPLICATION_ENTITIES = void 0;
3
+ exports.UnderwritingQuestionEntity = exports.AppActivityLogEntity = 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");
@@ -17,6 +17,8 @@ const app_activity_log_entity_1 = require("./app_activity_log.entity");
17
17
  Object.defineProperty(exports, "AppActivityLogEntity", { enumerable: true, get: function () { return app_activity_log_entity_1.AppActivityLogEntity; } });
18
18
  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
+ const app_document_entity_1 = require("./app_document.entity");
21
+ Object.defineProperty(exports, "AppDocumentEntity", { enumerable: true, get: function () { return app_document_entity_1.AppDocumentEntity; } });
20
22
  exports.APPLICATION_ENTITIES = [
21
23
  application_entity_1.ApplicationEntity,
22
24
  app_beneficiary_entity_1.AppBeneficiaryEntity,
@@ -24,6 +26,7 @@ exports.APPLICATION_ENTITIES = [
24
26
  app_person_entity_1.AppPersonEntity,
25
27
  app_underwriting_answer_entity_1.AppUnderwritingAnswerEntity,
26
28
  app_underwriting_info_entity_1.AppUnderwritingInfoEntity,
29
+ app_document_entity_1.AppDocumentEntity,
27
30
  app_activity_log_entity_1.AppActivityLogEntity,
28
31
  underwriting_question_entity_1.UnderwritingQuestionEntity,
29
32
  ];
@@ -50,3 +50,11 @@ export declare enum UwAnswerValueType {
50
50
  Date = "date",
51
51
  YesOrNo = "yesno"
52
52
  }
53
+ export declare enum AppDocumentType {
54
+ NationalId = "nid",
55
+ Passport = "passport",
56
+ ApplicationForm = "application_form",
57
+ QuotationForm = "quotation_form",
58
+ ClaimForm = "claim_form",
59
+ Other = "other"
60
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UwAnswerValueType = exports.AppCoverageType = exports.AppPhLaRelation = exports.AppPersonRole = exports.ApplicationActionType = exports.ApplicationStatus = void 0;
3
+ 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";
@@ -59,3 +59,22 @@ var UwAnswerValueType;
59
59
  UwAnswerValueType["Date"] = "date";
60
60
  UwAnswerValueType["YesOrNo"] = "yesno";
61
61
  })(UwAnswerValueType || (exports.UwAnswerValueType = UwAnswerValueType = {}));
62
+ var AppDocumentType;
63
+ (function (AppDocumentType) {
64
+ AppDocumentType["NationalId"] = "nid";
65
+ AppDocumentType["Passport"] = "passport";
66
+ AppDocumentType["ApplicationForm"] = "application_form";
67
+ AppDocumentType["QuotationForm"] = "quotation_form";
68
+ AppDocumentType["ClaimForm"] = "claim_form";
69
+ // FamilyBook = 'family_book',
70
+ // SalarySlip = 'salary_slip',
71
+ // BankStatement = 'bank_statement',
72
+ // MedicalReport = 'medical_report',
73
+ // IncomeProof = 'income_proof',
74
+ // ProofOfAddress = 'proof_of_address',
75
+ // EmploymentLetter = 'employment_letter',
76
+ // TaxReturn = 'tax_return',
77
+ // InsuranceQuotation = 'insurance_quotation',
78
+ // ClaimForm = 'claim_form',
79
+ AppDocumentType["Other"] = "other";
80
+ })(AppDocumentType || (exports.AppDocumentType = AppDocumentType = {}));
@@ -39,3 +39,7 @@ export declare enum YesNo {
39
39
  Yes = "yes",
40
40
  No = "no"
41
41
  }
42
+ export declare enum DocumentStorageProvider {
43
+ Local = "local",
44
+ S3 = "s3"
45
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YesNo = exports.ResetScope = exports.IdentifierType = exports.AddressType = exports.ContactType = exports.MaritalStatus = exports.Gender = void 0;
3
+ exports.DocumentStorageProvider = exports.YesNo = exports.ResetScope = exports.IdentifierType = exports.AddressType = exports.ContactType = exports.MaritalStatus = exports.Gender = void 0;
4
4
  var Gender;
5
5
  (function (Gender) {
6
6
  Gender["Male"] = "M";
@@ -49,3 +49,8 @@ var YesNo;
49
49
  YesNo["Yes"] = "yes";
50
50
  YesNo["No"] = "no";
51
51
  })(YesNo || (exports.YesNo = YesNo = {}));
52
+ var DocumentStorageProvider;
53
+ (function (DocumentStorageProvider) {
54
+ DocumentStorageProvider["Local"] = "local";
55
+ DocumentStorageProvider["S3"] = "s3";
56
+ })(DocumentStorageProvider || (exports.DocumentStorageProvider = DocumentStorageProvider = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.27",
3
+ "version": "1.3.28",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {