plac-micro-common 1.3.76 → 1.3.78
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.
- package/README.md +0 -91
- package/dist/models/core/index.d.ts +1 -1
- package/dist/models/core/product/death_benefit.entity.d.ts +9 -0
- package/dist/models/core/product/death_benefit.entity.js +45 -0
- package/dist/models/core/product/index.d.ts +4 -2
- package/dist/models/core/product/index.js +7 -1
- package/dist/models/core/product/product.entity.d.ts +4 -0
- package/dist/models/core/product/product.entity.js +10 -0
- package/dist/models/core/product/surrender_value.entity.d.ts +9 -0
- package/dist/models/core/product/surrender_value.entity.js +45 -0
- package/dist/types/underwriting.type.d.ts +18 -0
- package/dist/types/underwriting.type.js +20 -1
- package/package.json +1 -1
- package/dist/database/data-source.d.ts +0 -2
- package/dist/database/data-source.js +0 -59
- package/dist/database/migrations/1775805048337-AddProductColumn.d.ts +0 -6
- package/dist/database/migrations/1775805048337-AddProductColumn.js +0 -15
package/README.md
CHANGED
|
@@ -18,94 +18,3 @@ import { ... } from 'plac-micro-common/backend' // backend-only helpers
|
|
|
18
18
|
import { ... } from 'plac-micro-common/browser' // browser-only helpers
|
|
19
19
|
import { ... } from 'plac-micro-common/shared' // shared helpers
|
|
20
20
|
```
|
|
21
|
-
|
|
22
|
-
## Database Migrations
|
|
23
|
-
|
|
24
|
-
All services share the same database. Migrations are managed here as the single source of truth for the schema.
|
|
25
|
-
|
|
26
|
-
### Setup
|
|
27
|
-
|
|
28
|
-
Copy `.env.example` and fill in your DB credentials:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
cp .env.example .env
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```env
|
|
35
|
-
DB_HOST=localhost
|
|
36
|
-
DB_PORT=5432
|
|
37
|
-
DB_USERNAME=postgres
|
|
38
|
-
DB_PASSWORD=your_password
|
|
39
|
-
DB_NAME=your_database
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Install dependencies:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
pnpm install
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Commands
|
|
49
|
-
|
|
50
|
-
| Command | Description |
|
|
51
|
-
|---|---|
|
|
52
|
-
| `pnpm migration:generate` | Generate a migration from entity changes |
|
|
53
|
-
| `pnpm migration:run` | Apply all pending migrations |
|
|
54
|
-
| `pnpm migration:apply` | Generate + run in one step |
|
|
55
|
-
| `pnpm migration:revert` | Revert the last applied migration |
|
|
56
|
-
| `pnpm migration:show` | List all migrations and their status |
|
|
57
|
-
|
|
58
|
-
### Generating a migration
|
|
59
|
-
|
|
60
|
-
Always provide a descriptive name:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
MIGRATION_NAME=AddPolicyExpiryDate pnpm migration:generate
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Review the generated file in `src/database/migrations/` before applying it.
|
|
67
|
-
|
|
68
|
-
### Switching between databases
|
|
69
|
-
|
|
70
|
-
Use multiple `.env` files to switch between databases without editing:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Local DB (default)
|
|
74
|
-
pnpm migration:run
|
|
75
|
-
|
|
76
|
-
# Shared dev DB
|
|
77
|
-
ENV_FILE=.env.dev-shared pnpm migration:run
|
|
78
|
-
|
|
79
|
-
# Works with all migration commands
|
|
80
|
-
ENV_FILE=.env.dev-shared MIGRATION_NAME=AddSomething pnpm migration:generate
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Workflow
|
|
84
|
-
|
|
85
|
-
1. Make entity changes
|
|
86
|
-
2. Generate migration: `MIGRATION_NAME=DescriptiveName pnpm migration:generate`
|
|
87
|
-
3. Review the generated file
|
|
88
|
-
4. Apply locally: `pnpm migration:run`
|
|
89
|
-
5. Apply to shared dev DB: `ENV_FILE=.env.dev-shared pnpm migration:run`
|
|
90
|
-
6. Commit both the entity changes and the migration file
|
|
91
|
-
7. Trigger **Migrate UAT Database** from GitHub Actions when ready to deploy to UAT
|
|
92
|
-
|
|
93
|
-
### UAT & Production
|
|
94
|
-
|
|
95
|
-
Migrations for UAT and production are triggered manually via GitHub Actions:
|
|
96
|
-
|
|
97
|
-
- **UAT**: Actions → Migrate UAT Database → Run workflow
|
|
98
|
-
- **Production**: Actions → Migrate Production Database → Run workflow
|
|
99
|
-
|
|
100
|
-
Required GitHub secrets: `UAT_DB_HOST`, `UAT_DB_PORT`, `UAT_DB_USERNAME`, `UAT_DB_PASSWORD`, `UAT_DB_NAME` (and `PROD_*` equivalents for production).
|
|
101
|
-
|
|
102
|
-
## Publishing
|
|
103
|
-
|
|
104
|
-
This package is automatically published to npm when changes to `src/**`, `package.json`, or `tsconfig.json` are pushed to `main`.
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Bump version before pushing
|
|
108
|
-
pnpm v:patch # 1.0.0 → 1.0.1
|
|
109
|
-
pnpm v:minor # 1.0.0 → 1.1.0
|
|
110
|
-
pnpm v:major # 1.0.0 → 2.0.0
|
|
111
|
-
```
|
|
@@ -18,7 +18,7 @@ import { RelationshipEntity } from "./relationship.entity";
|
|
|
18
18
|
import { StaffEntity } from "./staffs.entity";
|
|
19
19
|
import { PaymentMethodEntity } from "./payment_method.entity";
|
|
20
20
|
import { OrgReferralEntity } from "./org_referral.entity";
|
|
21
|
-
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof NumberSeriesEntity, typeof OrganizationEntity, typeof OrganizationBranchEntity, typeof OrganizationChannelEntity, typeof OrganizationDepartmentEntity, typeof OrganizationPositionEntity, typeof OrganizationStaffEntity, typeof OrganizationStaffBranchEntity, typeof OrganizationStaffReportingLineEntity, typeof OrgReferralEntity, typeof OccupationEntity, typeof PaymentMethodEntity, typeof RelationshipEntity, typeof StaffEntity, typeof import("./product").CashValueEntity, typeof import("./product").PaymentModeEntity, typeof import("./product").PremiumRateConditionEntity, typeof import("./product").PremiumRateValueEntity, typeof import("./product").ProductEntity, typeof import("./product").ProductOrgEntity, typeof import("./product").ProductTypeEntity, typeof import("./product").ProductPaymentModeEntity, typeof import("./product").ProductRiderEntity, typeof import("./product").ProductTermEntity, typeof import("./product").ProductPlanEntity, typeof import("./product").PromotionEntity, typeof import("./product").PromotionOrgEntity, typeof import("./product").PromotionProductEntity, typeof import("./product").RiderEntity, typeof import("./product").TermEntity, typeof import("./finance").ExchangeRateEntity, typeof import("./finance").ExchangeRateLogEntity, typeof import("./finance").ExchangeRateSyncLogEntity];
|
|
21
|
+
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof NumberSeriesEntity, typeof OrganizationEntity, typeof OrganizationBranchEntity, typeof OrganizationChannelEntity, typeof OrganizationDepartmentEntity, typeof OrganizationPositionEntity, typeof OrganizationStaffEntity, typeof OrganizationStaffBranchEntity, typeof OrganizationStaffReportingLineEntity, typeof OrgReferralEntity, typeof OccupationEntity, typeof PaymentMethodEntity, typeof RelationshipEntity, typeof StaffEntity, typeof import("./product").CashValueEntity, typeof import("./product").DeathBenefitEntity, typeof import("./product").PaymentModeEntity, typeof import("./product").PremiumRateConditionEntity, typeof import("./product").PremiumRateValueEntity, typeof import("./product").ProductEntity, typeof import("./product").ProductOrgEntity, typeof import("./product").ProductTypeEntity, typeof import("./product").ProductPaymentModeEntity, typeof import("./product").ProductRiderEntity, typeof import("./product").ProductTermEntity, typeof import("./product").ProductPlanEntity, typeof import("./product").PromotionEntity, typeof import("./product").PromotionOrgEntity, typeof import("./product").PromotionProductEntity, typeof import("./product").RiderEntity, typeof import("./product").SurrenderValueEntity, typeof import("./product").TermEntity, typeof import("./finance").ExchangeRateEntity, typeof import("./finance").ExchangeRateLogEntity, typeof import("./finance").ExchangeRateSyncLogEntity];
|
|
22
22
|
export { GeoProvinceEntity, GeoDistrictEntity, GeoCommuneEntity, GeoVillageEntity, MaritalStatusEntity, NationalityEntity, NumberSeriesEntity, OrganizationEntity, OrganizationBranchEntity, OrganizationChannelEntity, OrganizationDepartmentEntity, OrganizationPositionEntity, OrganizationStaffEntity, OrganizationStaffBranchEntity, OrganizationStaffReportingLineEntity, OrgReferralEntity, OccupationEntity, PaymentMethodEntity, RelationshipEntity, StaffEntity, };
|
|
23
23
|
export * from "./product";
|
|
24
24
|
export * from "./finance";
|
|
@@ -0,0 +1,45 @@
|
|
|
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.DeathBenefitEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const product_entity_1 = require("./product.entity");
|
|
15
|
+
let DeathBenefitEntity = class DeathBenefitEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.DeathBenefitEntity = DeathBenefitEntity;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], DeathBenefitEntity.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], DeathBenefitEntity.prototype, "product_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], DeathBenefitEntity.prototype, "year", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], DeathBenefitEntity.prototype, "plan", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 18, scale: 2 }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], DeathBenefitEntity.prototype, "value", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => product_entity_1.ProductEntity),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: "product_id" }),
|
|
41
|
+
__metadata("design:type", product_entity_1.ProductEntity)
|
|
42
|
+
], DeathBenefitEntity.prototype, "product", void 0);
|
|
43
|
+
exports.DeathBenefitEntity = DeathBenefitEntity = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "death_benefits" })
|
|
45
|
+
], DeathBenefitEntity);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CashValueEntity } from "./cash_value.entity";
|
|
2
|
+
import { DeathBenefitEntity } from "./death_benefit.entity";
|
|
2
3
|
import { PaymentModeEntity } from "./payment_mode.entity";
|
|
3
4
|
import { PremiumRateConditionEntity } from "./premium_rate_condition.entity";
|
|
4
5
|
import { PremiumRateValueEntity } from "./premium_rate_value.entity";
|
|
@@ -13,6 +14,7 @@ import { PromotionEntity } from "./promotion.entity";
|
|
|
13
14
|
import { PromotionOrgEntity } from "./promotion_org.entity";
|
|
14
15
|
import { PromotionProductEntity } from "./promotion_product.entity";
|
|
15
16
|
import { RiderEntity } from "./rider.entity";
|
|
17
|
+
import { SurrenderValueEntity } from "./surrender_value.entity";
|
|
16
18
|
import { TermEntity } from "./term.entity";
|
|
17
|
-
export declare const PRODUCT_ENTITIES: readonly [typeof CashValueEntity, typeof PaymentModeEntity, typeof PremiumRateConditionEntity, typeof PremiumRateValueEntity, typeof ProductEntity, typeof ProductOrgEntity, typeof ProductTypeEntity, typeof ProductPaymentModeEntity, typeof ProductRiderEntity, typeof ProductTermEntity, typeof ProductPlanEntity, typeof PromotionEntity, typeof PromotionOrgEntity, typeof PromotionProductEntity, typeof RiderEntity, typeof TermEntity];
|
|
18
|
-
export { CashValueEntity, PaymentModeEntity, PremiumRateConditionEntity, PremiumRateValueEntity, ProductEntity, ProductOrgEntity, ProductTypeEntity, ProductPaymentModeEntity, ProductRiderEntity, ProductTermEntity, ProductPlanEntity, PromotionEntity, PromotionOrgEntity, PromotionProductEntity, RiderEntity, TermEntity, };
|
|
19
|
+
export declare const PRODUCT_ENTITIES: readonly [typeof CashValueEntity, typeof DeathBenefitEntity, typeof PaymentModeEntity, typeof PremiumRateConditionEntity, typeof PremiumRateValueEntity, typeof ProductEntity, typeof ProductOrgEntity, typeof ProductTypeEntity, typeof ProductPaymentModeEntity, typeof ProductRiderEntity, typeof ProductTermEntity, typeof ProductPlanEntity, typeof PromotionEntity, typeof PromotionOrgEntity, typeof PromotionProductEntity, typeof RiderEntity, typeof SurrenderValueEntity, typeof TermEntity];
|
|
20
|
+
export { CashValueEntity, DeathBenefitEntity, PaymentModeEntity, PremiumRateConditionEntity, PremiumRateValueEntity, ProductEntity, ProductOrgEntity, ProductTypeEntity, ProductPaymentModeEntity, ProductRiderEntity, ProductTermEntity, ProductPlanEntity, PromotionEntity, PromotionOrgEntity, PromotionProductEntity, RiderEntity, SurrenderValueEntity, TermEntity, };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TermEntity = exports.RiderEntity = exports.PromotionProductEntity = exports.PromotionOrgEntity = exports.PromotionEntity = exports.ProductPlanEntity = exports.ProductTermEntity = exports.ProductRiderEntity = exports.ProductPaymentModeEntity = exports.ProductTypeEntity = exports.ProductOrgEntity = exports.ProductEntity = exports.PremiumRateValueEntity = exports.PremiumRateConditionEntity = exports.PaymentModeEntity = exports.CashValueEntity = exports.PRODUCT_ENTITIES = void 0;
|
|
3
|
+
exports.TermEntity = exports.SurrenderValueEntity = exports.RiderEntity = exports.PromotionProductEntity = exports.PromotionOrgEntity = exports.PromotionEntity = exports.ProductPlanEntity = exports.ProductTermEntity = exports.ProductRiderEntity = exports.ProductPaymentModeEntity = exports.ProductTypeEntity = exports.ProductOrgEntity = exports.ProductEntity = exports.PremiumRateValueEntity = exports.PremiumRateConditionEntity = exports.PaymentModeEntity = exports.DeathBenefitEntity = exports.CashValueEntity = exports.PRODUCT_ENTITIES = void 0;
|
|
4
4
|
const cash_value_entity_1 = require("./cash_value.entity");
|
|
5
5
|
Object.defineProperty(exports, "CashValueEntity", { enumerable: true, get: function () { return cash_value_entity_1.CashValueEntity; } });
|
|
6
|
+
const death_benefit_entity_1 = require("./death_benefit.entity");
|
|
7
|
+
Object.defineProperty(exports, "DeathBenefitEntity", { enumerable: true, get: function () { return death_benefit_entity_1.DeathBenefitEntity; } });
|
|
6
8
|
const payment_mode_entity_1 = require("./payment_mode.entity");
|
|
7
9
|
Object.defineProperty(exports, "PaymentModeEntity", { enumerable: true, get: function () { return payment_mode_entity_1.PaymentModeEntity; } });
|
|
8
10
|
const premium_rate_condition_entity_1 = require("./premium_rate_condition.entity");
|
|
@@ -31,10 +33,13 @@ const promotion_product_entity_1 = require("./promotion_product.entity");
|
|
|
31
33
|
Object.defineProperty(exports, "PromotionProductEntity", { enumerable: true, get: function () { return promotion_product_entity_1.PromotionProductEntity; } });
|
|
32
34
|
const rider_entity_1 = require("./rider.entity");
|
|
33
35
|
Object.defineProperty(exports, "RiderEntity", { enumerable: true, get: function () { return rider_entity_1.RiderEntity; } });
|
|
36
|
+
const surrender_value_entity_1 = require("./surrender_value.entity");
|
|
37
|
+
Object.defineProperty(exports, "SurrenderValueEntity", { enumerable: true, get: function () { return surrender_value_entity_1.SurrenderValueEntity; } });
|
|
34
38
|
const term_entity_1 = require("./term.entity");
|
|
35
39
|
Object.defineProperty(exports, "TermEntity", { enumerable: true, get: function () { return term_entity_1.TermEntity; } });
|
|
36
40
|
exports.PRODUCT_ENTITIES = [
|
|
37
41
|
cash_value_entity_1.CashValueEntity,
|
|
42
|
+
death_benefit_entity_1.DeathBenefitEntity,
|
|
38
43
|
payment_mode_entity_1.PaymentModeEntity,
|
|
39
44
|
premium_rate_condition_entity_1.PremiumRateConditionEntity,
|
|
40
45
|
premium_rate_value_entity_1.PremiumRateValueEntity,
|
|
@@ -49,5 +54,6 @@ exports.PRODUCT_ENTITIES = [
|
|
|
49
54
|
promotion_org_entity_1.PromotionOrgEntity,
|
|
50
55
|
promotion_product_entity_1.PromotionProductEntity,
|
|
51
56
|
rider_entity_1.RiderEntity,
|
|
57
|
+
surrender_value_entity_1.SurrenderValueEntity,
|
|
52
58
|
term_entity_1.TermEntity,
|
|
53
59
|
];
|
|
@@ -5,6 +5,8 @@ import { ProductTermEntity } from "./product_term.entity";
|
|
|
5
5
|
import { ProductPaymentModeEntity } from "./product_payment_mode.entity";
|
|
6
6
|
import { ProductRiderEntity } from "./product_rider.entity";
|
|
7
7
|
import { ProductOrgEntity } from "./product_org.entity";
|
|
8
|
+
import { DeathBenefitEntity } from "./death_benefit.entity";
|
|
9
|
+
import { SurrenderValueEntity } from "./surrender_value.entity";
|
|
8
10
|
export declare class ProductEntity extends _BaseEntity {
|
|
9
11
|
id: string;
|
|
10
12
|
product_type_id: string;
|
|
@@ -19,4 +21,6 @@ export declare class ProductEntity extends _BaseEntity {
|
|
|
19
21
|
product_payment_modes?: ProductPaymentModeEntity[];
|
|
20
22
|
product_riders?: ProductRiderEntity[];
|
|
21
23
|
product_org?: ProductOrgEntity[];
|
|
24
|
+
death_benefits?: DeathBenefitEntity[];
|
|
25
|
+
surrender_values?: SurrenderValueEntity[];
|
|
22
26
|
}
|
|
@@ -19,6 +19,8 @@ const product_term_entity_1 = require("./product_term.entity");
|
|
|
19
19
|
const product_payment_mode_entity_1 = require("./product_payment_mode.entity");
|
|
20
20
|
const product_rider_entity_1 = require("./product_rider.entity");
|
|
21
21
|
const product_org_entity_1 = require("./product_org.entity");
|
|
22
|
+
const death_benefit_entity_1 = require("./death_benefit.entity");
|
|
23
|
+
const surrender_value_entity_1 = require("./surrender_value.entity");
|
|
22
24
|
let ProductEntity = class ProductEntity extends _base_entity_1._BaseEntity {
|
|
23
25
|
};
|
|
24
26
|
exports.ProductEntity = ProductEntity;
|
|
@@ -85,6 +87,14 @@ __decorate([
|
|
|
85
87
|
(0, typeorm_1.OneToMany)(() => product_org_entity_1.ProductOrgEntity, (x) => x.product),
|
|
86
88
|
__metadata("design:type", Array)
|
|
87
89
|
], ProductEntity.prototype, "product_org", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.OneToMany)(() => death_benefit_entity_1.DeathBenefitEntity, (x) => x.product),
|
|
92
|
+
__metadata("design:type", Array)
|
|
93
|
+
], ProductEntity.prototype, "death_benefits", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.OneToMany)(() => surrender_value_entity_1.SurrenderValueEntity, (x) => x.product),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], ProductEntity.prototype, "surrender_values", void 0);
|
|
88
98
|
exports.ProductEntity = ProductEntity = __decorate([
|
|
89
99
|
(0, typeorm_1.Entity)({ schema: "core", name: "products" }),
|
|
90
100
|
(0, typeorm_1.Index)("ux_products_product_code", ["product_code"], { unique: true })
|
|
@@ -0,0 +1,45 @@
|
|
|
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.SurrenderValueEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const product_entity_1 = require("./product.entity");
|
|
15
|
+
let SurrenderValueEntity = class SurrenderValueEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.SurrenderValueEntity = SurrenderValueEntity;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], SurrenderValueEntity.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], SurrenderValueEntity.prototype, "product_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], SurrenderValueEntity.prototype, "year", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], SurrenderValueEntity.prototype, "plan", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 18, scale: 2 }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], SurrenderValueEntity.prototype, "value", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => product_entity_1.ProductEntity),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: "product_id" }),
|
|
41
|
+
__metadata("design:type", product_entity_1.ProductEntity)
|
|
42
|
+
], SurrenderValueEntity.prototype, "product", void 0);
|
|
43
|
+
exports.SurrenderValueEntity = SurrenderValueEntity = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "surrender_values" })
|
|
45
|
+
], SurrenderValueEntity);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare enum UnderwritingSIOQuestionCode {
|
|
2
|
+
Q_USA = "Q-SIO-USA",
|
|
2
3
|
Q_Smoke = "Q-SIO-SMOKE",
|
|
3
4
|
Q_Drink = "Q-SIO-DRINK",
|
|
4
5
|
Q_Hospitalized = "Q-SIO-HOSPITALIZED",
|
|
@@ -44,6 +45,23 @@ export declare enum UnderwritingBaseQuestionCode {
|
|
|
44
45
|
Q_HA_PregnancyComplications = "Q-HA-PREGNANCY-COMPLICATIONS",
|
|
45
46
|
Q_HA_Details = "Q-HA-DETAILS"
|
|
46
47
|
}
|
|
48
|
+
export declare enum UnderwritingQuestionComponents {
|
|
49
|
+
Q_DRUG_COMP_1 = "Q-DRUG-COMP-1",
|
|
50
|
+
Q_DRUG_COMP_2 = "Q-DRUG-COMP-2",
|
|
51
|
+
Q_DRUG_COMP_3 = "Q-DRUG-COMP-3",
|
|
52
|
+
Q_FAM_COMP_1 = "Q-FAM-COMP-1",
|
|
53
|
+
Q_FAM_COMP_2 = "Q-FAM-COMP-2",
|
|
54
|
+
Q_FAM_COMP_3 = "Q-FAM-COMP-3",
|
|
55
|
+
Q_INS_COMP_1 = "Q-INS-COMP-1",
|
|
56
|
+
Q_INS_COMP_2 = "Q-INS-COMP-2",
|
|
57
|
+
Q_INS_COMP_3 = "Q-INS-COMP-3",
|
|
58
|
+
Q_INS_COMP_4 = "Q-INS-COMP-4",
|
|
59
|
+
Q_INS_COMP_5 = "Q-INS-COMP-5",
|
|
60
|
+
Q_INS_COMP_6 = "Q-INS-COMP-6",
|
|
61
|
+
Q_INS_COMP_7 = "Q-INS-COMP-7",
|
|
62
|
+
Q_USA_COMP_1 = "Q-USA-COMP-1",
|
|
63
|
+
Q_USA_COMP_2 = "Q-USA-COMP-2"
|
|
64
|
+
}
|
|
47
65
|
export type UWDropdownOption = {
|
|
48
66
|
value: string;
|
|
49
67
|
label: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnderwritingBaseQuestionCode = exports.UnderwritingQuestionGroupCode = exports.UnderwritingSIOQuestionCode = void 0;
|
|
3
|
+
exports.UnderwritingQuestionComponents = exports.UnderwritingBaseQuestionCode = exports.UnderwritingQuestionGroupCode = exports.UnderwritingSIOQuestionCode = void 0;
|
|
4
4
|
var UnderwritingSIOQuestionCode;
|
|
5
5
|
(function (UnderwritingSIOQuestionCode) {
|
|
6
|
+
UnderwritingSIOQuestionCode["Q_USA"] = "Q-SIO-USA";
|
|
6
7
|
UnderwritingSIOQuestionCode["Q_Smoke"] = "Q-SIO-SMOKE";
|
|
7
8
|
UnderwritingSIOQuestionCode["Q_Drink"] = "Q-SIO-DRINK";
|
|
8
9
|
UnderwritingSIOQuestionCode["Q_Hospitalized"] = "Q-SIO-HOSPITALIZED";
|
|
@@ -54,3 +55,21 @@ var UnderwritingBaseQuestionCode;
|
|
|
54
55
|
UnderwritingBaseQuestionCode["Q_HA_PregnancyComplications"] = "Q-HA-PREGNANCY-COMPLICATIONS";
|
|
55
56
|
UnderwritingBaseQuestionCode["Q_HA_Details"] = "Q-HA-DETAILS";
|
|
56
57
|
})(UnderwritingBaseQuestionCode || (exports.UnderwritingBaseQuestionCode = UnderwritingBaseQuestionCode = {}));
|
|
58
|
+
var UnderwritingQuestionComponents;
|
|
59
|
+
(function (UnderwritingQuestionComponents) {
|
|
60
|
+
UnderwritingQuestionComponents["Q_DRUG_COMP_1"] = "Q-DRUG-COMP-1";
|
|
61
|
+
UnderwritingQuestionComponents["Q_DRUG_COMP_2"] = "Q-DRUG-COMP-2";
|
|
62
|
+
UnderwritingQuestionComponents["Q_DRUG_COMP_3"] = "Q-DRUG-COMP-3";
|
|
63
|
+
UnderwritingQuestionComponents["Q_FAM_COMP_1"] = "Q-FAM-COMP-1";
|
|
64
|
+
UnderwritingQuestionComponents["Q_FAM_COMP_2"] = "Q-FAM-COMP-2";
|
|
65
|
+
UnderwritingQuestionComponents["Q_FAM_COMP_3"] = "Q-FAM-COMP-3";
|
|
66
|
+
UnderwritingQuestionComponents["Q_INS_COMP_1"] = "Q-INS-COMP-1";
|
|
67
|
+
UnderwritingQuestionComponents["Q_INS_COMP_2"] = "Q-INS-COMP-2";
|
|
68
|
+
UnderwritingQuestionComponents["Q_INS_COMP_3"] = "Q-INS-COMP-3";
|
|
69
|
+
UnderwritingQuestionComponents["Q_INS_COMP_4"] = "Q-INS-COMP-4";
|
|
70
|
+
UnderwritingQuestionComponents["Q_INS_COMP_5"] = "Q-INS-COMP-5";
|
|
71
|
+
UnderwritingQuestionComponents["Q_INS_COMP_6"] = "Q-INS-COMP-6";
|
|
72
|
+
UnderwritingQuestionComponents["Q_INS_COMP_7"] = "Q-INS-COMP-7";
|
|
73
|
+
UnderwritingQuestionComponents["Q_USA_COMP_1"] = "Q-USA-COMP-1";
|
|
74
|
+
UnderwritingQuestionComponents["Q_USA_COMP_2"] = "Q-USA-COMP-2";
|
|
75
|
+
})(UnderwritingQuestionComponents || (exports.UnderwritingQuestionComponents = UnderwritingQuestionComponents = {}));
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.AppDataSource = void 0;
|
|
37
|
-
const dotenv = __importStar(require("dotenv"));
|
|
38
|
-
const typeorm_1 = require("typeorm");
|
|
39
|
-
dotenv.config({ path: process.env.DOTENV_CONFIG_PATH || ".env" });
|
|
40
|
-
const core_1 = require("../models/core");
|
|
41
|
-
const quotation_1 = require("../models/quotation");
|
|
42
|
-
const application_1 = require("../models/application");
|
|
43
|
-
const customer_1 = require("../models/customer");
|
|
44
|
-
exports.AppDataSource = new typeorm_1.DataSource({
|
|
45
|
-
type: "postgres",
|
|
46
|
-
host: process.env.DB_HOST || "localhost",
|
|
47
|
-
port: Number(process.env.DB_PORT) || 5432,
|
|
48
|
-
username: process.env.DB_USERNAME,
|
|
49
|
-
password: process.env.DB_PASSWORD,
|
|
50
|
-
database: process.env.DB_NAME,
|
|
51
|
-
entities: [
|
|
52
|
-
...core_1.CORE_ENTITIES,
|
|
53
|
-
...quotation_1.QUOTATION_ENTITIES,
|
|
54
|
-
...application_1.APPLICATION_ENTITIES,
|
|
55
|
-
...customer_1.CUSTOMER_ENTITIES,
|
|
56
|
-
],
|
|
57
|
-
migrations: ["src/database/migrations/*.ts"],
|
|
58
|
-
migrationsTableName: "typeorm_migrations",
|
|
59
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddProductColumn1775805048337 = void 0;
|
|
4
|
-
class AddProductColumn1775805048337 {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = 'AddProductColumn1775805048337';
|
|
7
|
-
}
|
|
8
|
-
async up(queryRunner) {
|
|
9
|
-
await queryRunner.query(`ALTER TABLE "core"."products" ADD "description" character varying(255)`);
|
|
10
|
-
}
|
|
11
|
-
async down(queryRunner) {
|
|
12
|
-
await queryRunner.query(`ALTER TABLE "core"."products" DROP COLUMN "description"`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.AddProductColumn1775805048337 = AddProductColumn1775805048337;
|