plac-micro-common 1.3.117 → 1.3.119
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/CLAUDE.md +90 -0
- package/README.md +31 -0
- package/dist/models/application/application.entity.js +12 -3
- package/dist/models/core/product/promotion_org.entity.js +9 -3
- package/dist/models/core/product/promotion_product.entity.js +1 -1
- package/dist/models/customer/customer_loan_person.entity.js +8 -2
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/ingenium/index.d.ts +9 -0
- package/dist/models/ingenium/index.js +26 -0
- package/dist/models/ingenium/tcli.entity.d.ts +41 -0
- package/dist/models/ingenium/tcli.entity.js +175 -0
- package/dist/models/ingenium/tcvg.entity.d.ts +40 -0
- package/dist/models/ingenium/tcvg.entity.js +172 -0
- package/dist/models/ingenium/tcvgc.entity.d.ts +14 -0
- package/dist/models/ingenium/tcvgc.entity.js +73 -0
- package/dist/models/ingenium/tedit.entity.d.ts +12 -0
- package/dist/models/ingenium/tedit.entity.js +63 -0
- package/dist/models/ingenium/tpol.entity.d.ts +54 -0
- package/dist/models/ingenium/tpol.entity.js +230 -0
- package/dist/models/ingenium/tpolc.entity.d.ts +15 -0
- package/dist/models/ingenium/tpolc.entity.js +78 -0
- package/dist/models/ingenium/treqt.entity.d.ts +24 -0
- package/dist/models/ingenium/treqt.entity.js +114 -0
- package/dist/models/underwriting/index.d.ts +4 -0
- package/dist/models/underwriting/index.js +8 -0
- package/dist/models/underwriting/uw_case.entity.d.ts +21 -0
- package/dist/models/underwriting/uw_case.entity.js +102 -0
- package/dist/models/underwriting/uw_case_event.entity.d.ts +16 -0
- package/dist/models/underwriting/uw_case_event.entity.js +78 -0
- package/dist/types/application.type.d.ts +5 -0
- package/dist/types/application.type.js +7 -1
- package/dist/types/permission.type.d.ts +3 -1
- package/dist/types/permission.type.js +3 -0
- package/dist/types/underwriting.type.d.ts +9 -0
- package/dist/types/underwriting.type.js +15 -1
- package/dist/utils/frontend/data.util.d.ts +27 -1
- package/dist/utils/frontend/data.util.js +364 -0
- package/package.json +3 -2
- package/scripts/wait-for-pg.sh +18 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
`plac-micro-common` is a shared TypeScript library published to npm (`plac-micro-common`) and consumed by all PLAC microservices (see the sibling `_apis` working directory). It centralizes TypeORM entities, DTOs/types, NestJS HTTP building blocks (guards, decorators, interceptors, filters), and cross-cutting utilities so each microservice doesn't reimplement them.
|
|
8
|
+
|
|
9
|
+
This is a library, not a runnable service — there is no server to start here; changes are consumed by other repos via `plac-micro-common` after being published or linked.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
- Build: `npm run build` (runs `tsc`, emits to `dist/`)
|
|
14
|
+
- There is no test suite configured (`npm test` is a stub that exits with an error) — do not assume Jest/Vitest is present.
|
|
15
|
+
- Version bump: `npm run v:patch` / `v:minor` / `v:major` (bumps `package.json`, which triggers `.github/workflows/publish.yml` to publish to npm when merged to `main`).
|
|
16
|
+
- Publish manually: `npm run publish:public`.
|
|
17
|
+
|
|
18
|
+
### Database migrations (TypeORM, Postgres)
|
|
19
|
+
|
|
20
|
+
Migrations live in `src/database/migrations/`, driven by `src/database/data-source.ts`, which registers `CORE_ENTITIES`, `QUOTATION_ENTITIES`, `APPLICATION_ENTITIES`, `CUSTOMER_ENTITIES`. All commands accept `ENV_FILE=<path>` to target a different env file (default `.env`; see `.env.example`, and `.env.dev-shared` for the shared dev DB). See `command.txt` for copy-paste examples.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
MIGRATION_NAME=your_migration_name npm run migration:generate # generate only
|
|
24
|
+
npm run migration:run # apply pending migrations
|
|
25
|
+
MIGRATION_NAME=your_migration_name npm run migration:apply # generate + run
|
|
26
|
+
npm run migration:revert # revert last migration
|
|
27
|
+
npm run migration:show # show migration status
|
|
28
|
+
npm run migration:reset-shadow # spin up disposable Docker Postgres seeded from your branch's migrations
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Always generate new migrations against the shadow DB, never against `.env`/`.env.dev-shared` directly** — those may be drifted, which can bake wrong/duplicate statements into the generated file. Workflow: rebase onto `main` → `migration:reset-shadow` → `MIGRATION_NAME=... ENV_FILE=.env.shadow migration:generate` → review the diff → `ENV_FILE=.env.shadow migration:run` to confirm it applies cleanly → commit migration + entity change together. Full details in `README.md`. Declare explicit FK/unique constraint names on entities (matching existing hand-written migration names) to stop `migration:generate` from proposing spurious rename diffs.
|
|
32
|
+
|
|
33
|
+
`migration-check.yml` runs on every PR touching `src/models/**` or `src/database/migrations/**`: applies all migrations to a fresh database and fails on entity/migration drift. `migrate-uat.yml` and `migrate-production.yml` apply migrations to UAT/production (manual `workflow_dispatch` only, using `pnpm`).
|
|
34
|
+
|
|
35
|
+
The earliest tables predate migration tracking (created via `synchronize: true`); `1000000000001-Baseline.ts` squashes the 20 migrations that tried to reconstruct that state into one idempotent (`IF NOT EXISTS`/guarded) migration generated from current entities, so it fully bootstraps an empty database and no-ops on one that already has the schema. See `README.md` for details before touching early migration history.
|
|
36
|
+
|
|
37
|
+
## Package entry points
|
|
38
|
+
|
|
39
|
+
The package exposes four subpath exports, each backed by an `index.ts` barrel (see `package.json` `exports` and `tsconfig.json` `rootDir: src`). When adding a new module, export it from the right barrel(s) — getting this wrong means consuming services can't import it, or a browser bundle accidentally pulls in Node/TypeORM code:
|
|
40
|
+
|
|
41
|
+
| Import path | Source | Contains |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `plac-micro-common` | `src/index.ts` | http, libs, models, types, utils, constants — the default/full surface, safe for backend use |
|
|
44
|
+
| `plac-micro-common/backend` | `src/backend/index.ts` | http, libs, models, utils, constants — same as root but without a direct `types` re-export |
|
|
45
|
+
| `plac-micro-common/browser` | `src/browser/index.ts` | components, types, `utils/frontend`, constants — browser-safe only, must not import TypeORM/Node-only code |
|
|
46
|
+
| `plac-micro-common/shared` | `src/shared/index.ts` | types, constants, `libs/pdf-form` |
|
|
47
|
+
|
|
48
|
+
Keep browser-safe code (React components, frontend utils) isolated under `components/`, `utils/frontend/`, and out of anything re-exported from `browser/index.ts` — never import TypeORM entities or Node built-ins into that path.
|
|
49
|
+
|
|
50
|
+
## Architecture
|
|
51
|
+
|
|
52
|
+
### Entities (`src/models/`)
|
|
53
|
+
|
|
54
|
+
Domain entities are grouped by bounded context, each with an `index.ts` exporting a `*_ENTITIES` array consumed by `data-source.ts` and by each microservice's TypeORM config:
|
|
55
|
+
|
|
56
|
+
- `core/` — reference/lookup data and org structure (geo hierarchy, organizations/branches/staff, occupations, relationships, source tracking) plus two nested groups: `core/product/` (products, plans, riders, terms, premium rates, promotions) and `core/finance/` (exchange rates and sync logs). Combined into `CORE_ENTITIES`.
|
|
57
|
+
- `application/` — insurance application workflow (application, beneficiaries, coverage, documents, payments, underwriting Q&A). `APPLICATION_ENTITIES`.
|
|
58
|
+
- `customer/` — customer profile data (individual/corporate profiles, contacts, addresses, employment, identifiers, loans). `CUSTOMER_ENTITIES`.
|
|
59
|
+
- `quotation/` — quotation and calculation logs. `QUOTATION_ENTITIES`.
|
|
60
|
+
|
|
61
|
+
All entities extend one of three abstract base classes in `src/models/`:
|
|
62
|
+
- `_BaseEntity` — audit columns only (`created_by`, `updated_by`, `created_at`, `updated_at`).
|
|
63
|
+
- `_BaseGeneralEntity` — extends `_BaseEntity`, adds `id` (uuid PK), `name`, `name_kh`, `description`, `is_active`. Used for most lookup/reference entities.
|
|
64
|
+
- `_baseOwnershipEntity` — extends `_BaseEntity`, adds indexed `partner_id`, `staff_id`, `branch_id` for row-level ownership scoping.
|
|
65
|
+
|
|
66
|
+
When adding a new entity, pick the base class that matches the pattern rather than redeclaring these columns, and add it to the relevant context's `*_ENTITIES` array and barrel export.
|
|
67
|
+
|
|
68
|
+
### HTTP layer (`src/http/`)
|
|
69
|
+
|
|
70
|
+
Shared NestJS building blocks used by every microservice's API layer:
|
|
71
|
+
|
|
72
|
+
- **Auth flow**: `JwtAuthGuard` (`guards/jwt_auth.guard.ts`) verifies the `Authorization: Bearer` token via `JwtVerifierService` (RS256, `JWT_ACCESS_PUBLIC_KEY` env var), then populates `req.auth`, `req.current_user`, `req.current_app`, `req.current_app_client`, `req.current_roles`, `req.current_permissions` directly on the request object. Routes/controllers opt out with the `@Public()` decorator (checked via `IS_PUBLIC_KEY` reflector metadata).
|
|
73
|
+
- **Permissions**: `@RequirePermissions(...)` decorator sets `REQUIRE_PERMISSIONS_KEY` metadata; `PermissionsGuard` reads it and checks against `req.current_permissions` populated by `JwtAuthGuard` — requires ALL listed permissions. Guards run in sequence (auth guard must run before the permissions guard).
|
|
74
|
+
- **Org/staff scoping**: `OrgStaffContextGuard` enforces that `req.current_user` has both `org_id` and `org_staff_id` set — used on routes that require an organizational context.
|
|
75
|
+
- **Internal service calls**: `InternalServiceGuard` checks a shared-secret header `x-internal-secret` against `INTERNAL_SERVICE_SECRET` env var, for service-to-service (not user-facing) endpoints.
|
|
76
|
+
- **Request context propagation**: `RequestContextAlsInterceptor` snapshots auth/user/app/client info into an `AsyncLocalStorage` (`RequestContext` in `request_context.store.ts`), so downstream code (services, logging) can read the current request's context without threading it through every function call.
|
|
77
|
+
- **Response shape**: `ResponseTransformInterceptor` wraps all non-error responses into `{ success, statusCode, data, trace_id, timestamp }`; `AllExceptionsFilter` normalizes all thrown errors into `{ success: false, statusCode, message, error: { code, message, details }, trace_id, timestamp }`. Both attach/reuse a trace id header (`getOrCreateTraceId`/`TRACE_HEADER` from `utils`).
|
|
78
|
+
- **`auth_client/`** — a `DynamicModule` (`AuthClientModule.register(options)`) wrapping an `AuthClientService` that calls an external auth service's `/internal/user-info/*` endpoints (authenticated via `client-id` + `x-internal-secret` headers) to resolve user info by id(s) from other services.
|
|
79
|
+
|
|
80
|
+
### Other shared code
|
|
81
|
+
|
|
82
|
+
- `src/libs/redis/` — a Redis module/service for services that need shared caching.
|
|
83
|
+
- `src/libs/pdf-form/` — PDF generation templates (cover notes, receipts, SIO forms in English/Khmer, underwriting letters) plus embedded Khmer font and logo assets, exposed via `plac-micro-common/shared`.
|
|
84
|
+
- `src/utils/` — general/http/pagination/query helpers for backend use; `src/utils/frontend/` is the browser-safe subset (app/data utils), exposed only via `plac-micro-common/browser`.
|
|
85
|
+
- `src/components/` — shared React components (e.g. `permission_guard.component.tsx`), browser-only.
|
|
86
|
+
- `src/types/` — shared TS types/interfaces (auth payloads, API response shapes, request context, pdf-form and report types), consumed by both backend and browser builds.
|
|
87
|
+
|
|
88
|
+
## Working across repos
|
|
89
|
+
|
|
90
|
+
This package is a dependency of other microservices (in sibling directories, e.g. `_apis`). After changing shared entities/types/guards here, consumers need the updated package (via a version bump + publish, or a local link) before they see the change — a local edit alone does not affect running services elsewhere.
|
package/README.md
CHANGED
|
@@ -18,3 +18,34 @@ 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
|
+
This repo owns every TypeORM entity and migration for the whole system (schemas: `core`, `application`, `customer`, `quotation`), consumed against several different Postgres databases:
|
|
25
|
+
|
|
26
|
+
- `.env` — your personal local dev DB (copy from `.env.example`)
|
|
27
|
+
- `.env.dev-shared` — the team's shared dev DB — treat as read-only unless you know no one else is mid-migration
|
|
28
|
+
- `.env.uat` (create locally, not committed) — for manual UAT runs, mirrors the secret used by `migrate-uat.yml` in CI
|
|
29
|
+
|
|
30
|
+
All `migration:*` scripts accept `ENV_FILE=<path>`, defaulting to `.env`.
|
|
31
|
+
|
|
32
|
+
### Adding a new migration (always follow this order)
|
|
33
|
+
|
|
34
|
+
`migration:generate` diffs your entities against whatever live DB `ENV_FILE` points at — if that DB has drifted from "main's migrations and nothing else" (a manual tweak, a half-merged branch), the generated migration can silently bake in wrong or duplicate statements that only fail later on a different DB. To avoid this, always generate against a disposable, guaranteed-clean database:
|
|
35
|
+
|
|
36
|
+
1. Rebase your branch onto `main` first — the shadow DB below is seeded from your branch's migration folder, not just main's, so stale branches produce stale diffs.
|
|
37
|
+
2. `pnpm run migration:reset-shadow` — spins up a disposable Postgres (Docker) seeded only from migrations already on your (rebased) branch.
|
|
38
|
+
3. `MIGRATION_NAME=DescriptiveName ENV_FILE=.env.shadow pnpm migration:generate`
|
|
39
|
+
4. Read the generated file. It should contain only statements for your intended entity change — unrelated FK/constraint statements mean something is out of sync; don't commit blindly.
|
|
40
|
+
5. `ENV_FILE=.env.shadow pnpm migration:run` to confirm it applies cleanly.
|
|
41
|
+
6. Commit the migration together with the entity change in the same PR.
|
|
42
|
+
|
|
43
|
+
Never generate directly against `.env` or `.env.dev-shared` — they may be drifted. A `migration-check.yml` CI workflow also runs on every PR touching `src/models/**` or `src/database/migrations/**`: it applies all migrations to a fresh database and fails if there's any remaining drift between entities and migrations.
|
|
44
|
+
|
|
45
|
+
If two branches both add migrations, whoever merges second should rebase onto the updated `main` and regenerate (steps above) rather than hand-editing generated SQL or timestamps to resolve conflicts.
|
|
46
|
+
|
|
47
|
+
### Baseline migration (2026-09-17)
|
|
48
|
+
|
|
49
|
+
The earliest tables in this schema were created via TypeORM's `synchronize: true` before migration tracking was adopted, so the individual incremental migrations alone couldn't rebuild a schema from an empty database (only from a DB that already had that unrecorded starting state). `1000000000001-Baseline.ts` replaces those 20 earlier incremental migration files (still viewable via `git log` on this file's introducing commit) with one migration generated directly from the current entities, made idempotent (`IF NOT EXISTS` / guarded constraint checks) so it safely no-ops on any database that already has this schema. `AddCustomerLoanPersons` was kept as its own file since it contains a real one-time data backfill, not just schema changes.
|
|
50
|
+
|
|
51
|
+
If your local DB predates this change, just run `migration:run` as usual — `Baseline` will no-op on anything it finds already in place and only create what's actually missing.
|
|
@@ -326,7 +326,10 @@ __decorate([
|
|
|
326
326
|
], ApplicationEntity.prototype, "org", void 0);
|
|
327
327
|
__decorate([
|
|
328
328
|
(0, typeorm_1.ManyToOne)(() => core_1.SourceTypeEntity, { nullable: true, onDelete: "SET NULL" }),
|
|
329
|
-
(0, typeorm_1.JoinColumn)({
|
|
329
|
+
(0, typeorm_1.JoinColumn)({
|
|
330
|
+
name: "source_type_id",
|
|
331
|
+
foreignKeyConstraintName: "FK_applications_source_type",
|
|
332
|
+
}),
|
|
330
333
|
__metadata("design:type", Object)
|
|
331
334
|
], ApplicationEntity.prototype, "source_type_ref", void 0);
|
|
332
335
|
__decorate([
|
|
@@ -334,12 +337,18 @@ __decorate([
|
|
|
334
337
|
nullable: true,
|
|
335
338
|
onDelete: "SET NULL",
|
|
336
339
|
}),
|
|
337
|
-
(0, typeorm_1.JoinColumn)({
|
|
340
|
+
(0, typeorm_1.JoinColumn)({
|
|
341
|
+
name: "source_sub_type_id",
|
|
342
|
+
foreignKeyConstraintName: "FK_applications_source_sub_type",
|
|
343
|
+
}),
|
|
338
344
|
__metadata("design:type", Object)
|
|
339
345
|
], ApplicationEntity.prototype, "source_sub_type", void 0);
|
|
340
346
|
__decorate([
|
|
341
347
|
(0, typeorm_1.ManyToOne)(() => core_1.SourceCodeEntity, { nullable: true, onDelete: "SET NULL" }),
|
|
342
|
-
(0, typeorm_1.JoinColumn)({
|
|
348
|
+
(0, typeorm_1.JoinColumn)({
|
|
349
|
+
name: "source_code_id",
|
|
350
|
+
foreignKeyConstraintName: "FK_applications_source_code",
|
|
351
|
+
}),
|
|
343
352
|
__metadata("design:type", Object)
|
|
344
353
|
], ApplicationEntity.prototype, "source_code", void 0);
|
|
345
354
|
__decorate([
|
|
@@ -35,15 +35,21 @@ __decorate([
|
|
|
35
35
|
], PromotionOrgEntity.prototype, "is_active", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, typeorm_1.ManyToOne)(() => promotion_entity_1.PromotionEntity, { onDelete: "CASCADE" }),
|
|
38
|
-
(0, typeorm_1.JoinColumn)({
|
|
38
|
+
(0, typeorm_1.JoinColumn)({
|
|
39
|
+
name: "promotion_id",
|
|
40
|
+
foreignKeyConstraintName: "FK_promotion_orgs_promotion_rollback",
|
|
41
|
+
}),
|
|
39
42
|
__metadata("design:type", promotion_entity_1.PromotionEntity)
|
|
40
43
|
], PromotionOrgEntity.prototype, "promotion", void 0);
|
|
41
44
|
__decorate([
|
|
42
45
|
(0, typeorm_1.ManyToOne)(() => organization_entity_1.OrganizationEntity, { onDelete: "CASCADE" }),
|
|
43
|
-
(0, typeorm_1.JoinColumn)({
|
|
46
|
+
(0, typeorm_1.JoinColumn)({
|
|
47
|
+
name: "org_id",
|
|
48
|
+
foreignKeyConstraintName: "FK_promotion_orgs_org_rollback",
|
|
49
|
+
}),
|
|
44
50
|
__metadata("design:type", organization_entity_1.OrganizationEntity)
|
|
45
51
|
], PromotionOrgEntity.prototype, "org", void 0);
|
|
46
52
|
exports.PromotionOrgEntity = PromotionOrgEntity = __decorate([
|
|
47
53
|
(0, typeorm_1.Entity)({ schema: "core", name: "promotion_orgs" }),
|
|
48
|
-
(0, typeorm_1.
|
|
54
|
+
(0, typeorm_1.Unique)("UQ_promotion_orgs_rollback", ["promotion_id", "org_id"])
|
|
49
55
|
], PromotionOrgEntity);
|
|
@@ -65,5 +65,5 @@ __decorate([
|
|
|
65
65
|
], PromotionProductEntity.prototype, "is_active", void 0);
|
|
66
66
|
exports.PromotionProductEntity = PromotionProductEntity = __decorate([
|
|
67
67
|
(0, typeorm_1.Entity)({ schema: "core", name: "promotion_products" }),
|
|
68
|
-
(0, typeorm_1.
|
|
68
|
+
(0, typeorm_1.Unique)("UQ_promotion_products_rollback", ["promotion_id", "product_id"])
|
|
69
69
|
], PromotionProductEntity);
|
|
@@ -51,14 +51,20 @@ __decorate([
|
|
|
51
51
|
(0, typeorm_1.ManyToOne)(() => customer_loan_info_entity_1.CustomerLoanInfoEntity, (loanInfo) => loanInfo.persons, {
|
|
52
52
|
onDelete: "CASCADE",
|
|
53
53
|
}),
|
|
54
|
-
(0, typeorm_1.JoinColumn)({
|
|
54
|
+
(0, typeorm_1.JoinColumn)({
|
|
55
|
+
name: "loan_info_id",
|
|
56
|
+
foreignKeyConstraintName: "FK_customer_loan_persons_loan_info_id",
|
|
57
|
+
}),
|
|
55
58
|
__metadata("design:type", customer_loan_info_entity_1.CustomerLoanInfoEntity)
|
|
56
59
|
], CustomerLoanPersonEntity.prototype, "loan_info", void 0);
|
|
57
60
|
__decorate([
|
|
58
61
|
(0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (customer) => customer.loan_persons, {
|
|
59
62
|
onDelete: "CASCADE",
|
|
60
63
|
}),
|
|
61
|
-
(0, typeorm_1.JoinColumn)({
|
|
64
|
+
(0, typeorm_1.JoinColumn)({
|
|
65
|
+
name: "customer_id",
|
|
66
|
+
foreignKeyConstraintName: "FK_customer_loan_persons_customer_id",
|
|
67
|
+
}),
|
|
62
68
|
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
63
69
|
], CustomerLoanPersonEntity.prototype, "customer", void 0);
|
|
64
70
|
exports.CustomerLoanPersonEntity = CustomerLoanPersonEntity = __decorate([
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -21,3 +21,5 @@ __exportStar(require("./core"), exports);
|
|
|
21
21
|
__exportStar(require("./application"), exports);
|
|
22
22
|
__exportStar(require("./customer"), exports);
|
|
23
23
|
__exportStar(require("./quotation"), exports);
|
|
24
|
+
__exportStar(require("./ingenium"), exports);
|
|
25
|
+
__exportStar(require("./underwriting"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TCliEntity } from "./tcli.entity";
|
|
2
|
+
import { TCvgEntity } from "./tcvg.entity";
|
|
3
|
+
import { TCvgcEntity } from "./tcvgc.entity";
|
|
4
|
+
import { TEditEntity } from "./tedit.entity";
|
|
5
|
+
import { TPolEntity } from "./tpol.entity";
|
|
6
|
+
import { TPolcEntity } from "./tpolc.entity";
|
|
7
|
+
import { TReqtEntity } from "./treqt.entity";
|
|
8
|
+
export declare const INGENIUM_ENTITIES: readonly [typeof TPolEntity, typeof TPolcEntity, typeof TCvgEntity, typeof TCvgcEntity, typeof TCliEntity, typeof TReqtEntity, typeof TEditEntity];
|
|
9
|
+
export { TPolEntity, TPolcEntity, TCvgEntity, TCvgcEntity, TCliEntity, TReqtEntity, TEditEntity, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEditEntity = exports.TReqtEntity = exports.TCliEntity = exports.TCvgcEntity = exports.TCvgEntity = exports.TPolcEntity = exports.TPolEntity = exports.INGENIUM_ENTITIES = void 0;
|
|
4
|
+
const tcli_entity_1 = require("./tcli.entity");
|
|
5
|
+
Object.defineProperty(exports, "TCliEntity", { enumerable: true, get: function () { return tcli_entity_1.TCliEntity; } });
|
|
6
|
+
const tcvg_entity_1 = require("./tcvg.entity");
|
|
7
|
+
Object.defineProperty(exports, "TCvgEntity", { enumerable: true, get: function () { return tcvg_entity_1.TCvgEntity; } });
|
|
8
|
+
const tcvgc_entity_1 = require("./tcvgc.entity");
|
|
9
|
+
Object.defineProperty(exports, "TCvgcEntity", { enumerable: true, get: function () { return tcvgc_entity_1.TCvgcEntity; } });
|
|
10
|
+
const tedit_entity_1 = require("./tedit.entity");
|
|
11
|
+
Object.defineProperty(exports, "TEditEntity", { enumerable: true, get: function () { return tedit_entity_1.TEditEntity; } });
|
|
12
|
+
const tpol_entity_1 = require("./tpol.entity");
|
|
13
|
+
Object.defineProperty(exports, "TPolEntity", { enumerable: true, get: function () { return tpol_entity_1.TPolEntity; } });
|
|
14
|
+
const tpolc_entity_1 = require("./tpolc.entity");
|
|
15
|
+
Object.defineProperty(exports, "TPolcEntity", { enumerable: true, get: function () { return tpolc_entity_1.TPolcEntity; } });
|
|
16
|
+
const treqt_entity_1 = require("./treqt.entity");
|
|
17
|
+
Object.defineProperty(exports, "TReqtEntity", { enumerable: true, get: function () { return treqt_entity_1.TReqtEntity; } });
|
|
18
|
+
exports.INGENIUM_ENTITIES = [
|
|
19
|
+
tpol_entity_1.TPolEntity,
|
|
20
|
+
tpolc_entity_1.TPolcEntity,
|
|
21
|
+
tcvg_entity_1.TCvgEntity,
|
|
22
|
+
tcvgc_entity_1.TCvgcEntity,
|
|
23
|
+
tcli_entity_1.TCliEntity,
|
|
24
|
+
treqt_entity_1.TReqtEntity,
|
|
25
|
+
tedit_entity_1.TEditEntity,
|
|
26
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
export declare class TCliEntity extends _BaseEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
CO_ID: string;
|
|
5
|
+
CLI_ID: string;
|
|
6
|
+
CLI_SUR_NM?: string | null;
|
|
7
|
+
CLI_GIV_NM?: string | null;
|
|
8
|
+
CLI_MID_INIT_NM?: string | null;
|
|
9
|
+
CLI_SFX_NM?: string | null;
|
|
10
|
+
CLI_MAIL_TITL_TXT?: string | null;
|
|
11
|
+
CLI_NM_CHNG_DT?: string | null;
|
|
12
|
+
CLI_CO_NM?: string | null;
|
|
13
|
+
CLI_BTH_DT?: string | null;
|
|
14
|
+
CLI_SEX_CD?: string | null;
|
|
15
|
+
CLI_SMKR_CD?: string | null;
|
|
16
|
+
CLI_MARIT_STAT_CD?: string | null;
|
|
17
|
+
CLI_LANG_CD?: string | null;
|
|
18
|
+
CLI_BTH_LOC_CD?: string | null;
|
|
19
|
+
CLI_AGE_PROOF_IND?: string | null;
|
|
20
|
+
CLI_DTH_DT?: string | null;
|
|
21
|
+
CLI_DTH_REASN_CD?: string | null;
|
|
22
|
+
CLI_TAX_ID?: string | null;
|
|
23
|
+
CLI_OCCP_CLAS_CD?: string | null;
|
|
24
|
+
OCCP_ID?: string | null;
|
|
25
|
+
CLI_INCM_EARN_CD?: string | null;
|
|
26
|
+
CLI_SELF_EMPL_IND?: string | null;
|
|
27
|
+
CLI_EMPLR_NM?: string | null;
|
|
28
|
+
CLI_HT?: number | null;
|
|
29
|
+
CLI_WGT?: number | null;
|
|
30
|
+
CLI_UWGDECN_CD?: string | null;
|
|
31
|
+
CLI_UWGDECN_TYP_CD?: string | null;
|
|
32
|
+
CLI_UWGDECN_DT?: string | null;
|
|
33
|
+
CLI_PRST_RT?: number | null;
|
|
34
|
+
CLI_PREV_DCLN_IND?: string | null;
|
|
35
|
+
CLI_PREV_DCLN_DT?: string | null;
|
|
36
|
+
CLI_CLAS_CD?: string | null;
|
|
37
|
+
CLI_CNFD_IND?: string | null;
|
|
38
|
+
PREV_UPDT_USER_ID?: string | null;
|
|
39
|
+
PREV_UPDT_DT?: string | null;
|
|
40
|
+
synced_at?: Date | null;
|
|
41
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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.TCliEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
let TCliEntity = class TCliEntity extends _base_entity_1._BaseEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.TCliEntity = TCliEntity;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], TCliEntity.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5 }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], TCliEntity.prototype, "CO_ID", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Index)(),
|
|
28
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20 }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], TCliEntity.prototype, "CLI_ID", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Index)(),
|
|
33
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], TCliEntity.prototype, "CLI_SUR_NM", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], TCliEntity.prototype, "CLI_GIV_NM", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], TCliEntity.prototype, "CLI_MID_INIT_NM", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], TCliEntity.prototype, "CLI_SFX_NM", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], TCliEntity.prototype, "CLI_MAIL_TITL_TXT", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], TCliEntity.prototype, "CLI_NM_CHNG_DT", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], TCliEntity.prototype, "CLI_CO_NM", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], TCliEntity.prototype, "CLI_BTH_DT", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], TCliEntity.prototype, "CLI_SEX_CD", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], TCliEntity.prototype, "CLI_SMKR_CD", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], TCliEntity.prototype, "CLI_MARIT_STAT_CD", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], TCliEntity.prototype, "CLI_LANG_CD", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], TCliEntity.prototype, "CLI_BTH_LOC_CD", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], TCliEntity.prototype, "CLI_AGE_PROOF_IND", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], TCliEntity.prototype, "CLI_DTH_DT", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], TCliEntity.prototype, "CLI_DTH_REASN_CD", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30, nullable: true }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], TCliEntity.prototype, "CLI_TAX_ID", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], TCliEntity.prototype, "CLI_OCCP_CLAS_CD", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true }),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], TCliEntity.prototype, "OCCP_ID", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 10, nullable: true }),
|
|
110
|
+
__metadata("design:type", Object)
|
|
111
|
+
], TCliEntity.prototype, "CLI_INCM_EARN_CD", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], TCliEntity.prototype, "CLI_SELF_EMPL_IND", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], TCliEntity.prototype, "CLI_EMPLR_NM", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.Column)({ type: "numeric", precision: 5, scale: 1, nullable: true }),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], TCliEntity.prototype, "CLI_HT", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.Column)({ type: "numeric", precision: 5, scale: 1, nullable: true }),
|
|
126
|
+
__metadata("design:type", Object)
|
|
127
|
+
], TCliEntity.prototype, "CLI_WGT", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], TCliEntity.prototype, "CLI_UWGDECN_CD", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], TCliEntity.prototype, "CLI_UWGDECN_TYP_CD", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
138
|
+
__metadata("design:type", Object)
|
|
139
|
+
], TCliEntity.prototype, "CLI_UWGDECN_DT", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
142
|
+
__metadata("design:type", Object)
|
|
143
|
+
], TCliEntity.prototype, "CLI_PRST_RT", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
146
|
+
__metadata("design:type", Object)
|
|
147
|
+
], TCliEntity.prototype, "CLI_PREV_DCLN_IND", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
150
|
+
__metadata("design:type", Object)
|
|
151
|
+
], TCliEntity.prototype, "CLI_PREV_DCLN_DT", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
|
|
154
|
+
__metadata("design:type", Object)
|
|
155
|
+
], TCliEntity.prototype, "CLI_CLAS_CD", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
158
|
+
__metadata("design:type", Object)
|
|
159
|
+
], TCliEntity.prototype, "CLI_CNFD_IND", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, nullable: true }),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], TCliEntity.prototype, "PREV_UPDT_USER_ID", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
166
|
+
__metadata("design:type", Object)
|
|
167
|
+
], TCliEntity.prototype, "PREV_UPDT_DT", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, typeorm_1.Column)({ type: "timestamptz", nullable: true }),
|
|
170
|
+
__metadata("design:type", Object)
|
|
171
|
+
], TCliEntity.prototype, "synced_at", void 0);
|
|
172
|
+
exports.TCliEntity = TCliEntity = __decorate([
|
|
173
|
+
(0, typeorm_1.Entity)({ schema: "ingenium", name: "TCLI" }),
|
|
174
|
+
(0, typeorm_1.Unique)("uq_tcli_co_cli", ["CO_ID", "CLI_ID"])
|
|
175
|
+
], TCliEntity);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
export declare class TCvgEntity extends _BaseEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
CO_ID: string;
|
|
5
|
+
POL_ID: string;
|
|
6
|
+
CVG_NUM: string;
|
|
7
|
+
PLAN_ID?: string | null;
|
|
8
|
+
REL_CVG_NUM?: string | null;
|
|
9
|
+
CVG_INS_TYP_CD?: string | null;
|
|
10
|
+
CVG_CSTAT_CD?: string | null;
|
|
11
|
+
CVG_ISS_EFF_DT?: string | null;
|
|
12
|
+
CVG_MAT_XPRY_DT?: string | null;
|
|
13
|
+
CVG_APP_RECV_DT?: string | null;
|
|
14
|
+
CVG_SEX_CD?: string | null;
|
|
15
|
+
CVG_SMKR_CD?: string | null;
|
|
16
|
+
CVG_RT_AGE?: string | null;
|
|
17
|
+
CVG_OCCP_CLAS_CD?: string | null;
|
|
18
|
+
CVG_FACE_AMT?: number | null;
|
|
19
|
+
CVG_MPREM_AMT?: number | null;
|
|
20
|
+
CVG_BP_DUR?: string | null;
|
|
21
|
+
CVG_BASIC_PREM_AMT?: number | null;
|
|
22
|
+
CVG_PFEE_AMT?: number | null;
|
|
23
|
+
CVG_FE_PREM_AMT?: number | null;
|
|
24
|
+
CVG_FE_UPREM_AMT?: number | null;
|
|
25
|
+
CVG_FE_DUR?: number | null;
|
|
26
|
+
CVG_FE_REASN_CD?: string | null;
|
|
27
|
+
CVG_ME_PREM_AMT?: number | null;
|
|
28
|
+
CVG_ME_FCT?: number | null;
|
|
29
|
+
CVG_ME_DUR?: number | null;
|
|
30
|
+
CVG_ME_RAT_CD?: string | null;
|
|
31
|
+
CVG_ME_REASN_CD?: string | null;
|
|
32
|
+
CVG_AD_PREM_AMT?: number | null;
|
|
33
|
+
CVG_WP_PREM_AMT?: number | null;
|
|
34
|
+
CVG_WP_IND?: string | null;
|
|
35
|
+
CVG_UWGDECN_CD?: string | null;
|
|
36
|
+
CVG_PRST_RAT_PCT?: string | null;
|
|
37
|
+
PREV_UPDT_USER_ID?: string | null;
|
|
38
|
+
PREV_UPDT_DT?: string | null;
|
|
39
|
+
synced_at?: Date | null;
|
|
40
|
+
}
|