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.
Files changed (40) hide show
  1. package/CLAUDE.md +90 -0
  2. package/README.md +31 -0
  3. package/dist/models/application/application.entity.js +12 -3
  4. package/dist/models/core/product/promotion_org.entity.js +9 -3
  5. package/dist/models/core/product/promotion_product.entity.js +1 -1
  6. package/dist/models/customer/customer_loan_person.entity.js +8 -2
  7. package/dist/models/index.d.ts +2 -0
  8. package/dist/models/index.js +2 -0
  9. package/dist/models/ingenium/index.d.ts +9 -0
  10. package/dist/models/ingenium/index.js +26 -0
  11. package/dist/models/ingenium/tcli.entity.d.ts +41 -0
  12. package/dist/models/ingenium/tcli.entity.js +175 -0
  13. package/dist/models/ingenium/tcvg.entity.d.ts +40 -0
  14. package/dist/models/ingenium/tcvg.entity.js +172 -0
  15. package/dist/models/ingenium/tcvgc.entity.d.ts +14 -0
  16. package/dist/models/ingenium/tcvgc.entity.js +73 -0
  17. package/dist/models/ingenium/tedit.entity.d.ts +12 -0
  18. package/dist/models/ingenium/tedit.entity.js +63 -0
  19. package/dist/models/ingenium/tpol.entity.d.ts +54 -0
  20. package/dist/models/ingenium/tpol.entity.js +230 -0
  21. package/dist/models/ingenium/tpolc.entity.d.ts +15 -0
  22. package/dist/models/ingenium/tpolc.entity.js +78 -0
  23. package/dist/models/ingenium/treqt.entity.d.ts +24 -0
  24. package/dist/models/ingenium/treqt.entity.js +114 -0
  25. package/dist/models/underwriting/index.d.ts +4 -0
  26. package/dist/models/underwriting/index.js +8 -0
  27. package/dist/models/underwriting/uw_case.entity.d.ts +21 -0
  28. package/dist/models/underwriting/uw_case.entity.js +102 -0
  29. package/dist/models/underwriting/uw_case_event.entity.d.ts +16 -0
  30. package/dist/models/underwriting/uw_case_event.entity.js +78 -0
  31. package/dist/types/application.type.d.ts +5 -0
  32. package/dist/types/application.type.js +7 -1
  33. package/dist/types/permission.type.d.ts +3 -1
  34. package/dist/types/permission.type.js +3 -0
  35. package/dist/types/underwriting.type.d.ts +9 -0
  36. package/dist/types/underwriting.type.js +15 -1
  37. package/dist/utils/frontend/data.util.d.ts +27 -1
  38. package/dist/utils/frontend/data.util.js +364 -0
  39. package/package.json +3 -2
  40. package/scripts/wait-for-pg.sh +18 -0
@@ -12,6 +12,32 @@ exports.getOrgTypeDesc = getOrgTypeDesc;
12
12
  exports.getChannelTypeDesc = getChannelTypeDesc;
13
13
  exports.getStaffTypeDesc = getStaffTypeDesc;
14
14
  exports.getStaffStatusDesc = getStaffStatusDesc;
15
+ exports.getAppFormTypeDesc = getAppFormTypeDesc;
16
+ exports.getAppVisibilityScopeDesc = getAppVisibilityScopeDesc;
17
+ exports.getApplicationStatusDesc = getApplicationStatusDesc;
18
+ exports.getAppPersonRoleDesc = getAppPersonRoleDesc;
19
+ exports.getAppCoverageTypeDesc = getAppCoverageTypeDesc;
20
+ exports.getUwAnswerValueTypeDesc = getUwAnswerValueTypeDesc;
21
+ exports.getAppPaymentTypeDesc = getAppPaymentTypeDesc;
22
+ exports.getAppPaymentStatusDesc = getAppPaymentStatusDesc;
23
+ exports.getDocumentTypeDesc = getDocumentTypeDesc;
24
+ exports.getMaritalStatusDesc = getMaritalStatusDesc;
25
+ exports.getResetScopeDesc = getResetScopeDesc;
26
+ exports.getYesNoDesc = getYesNoDesc;
27
+ exports.getFileStorageProviderDesc = getFileStorageProviderDesc;
28
+ exports.getOccupationLevelDesc = getOccupationLevelDesc;
29
+ exports.getReportingLineTypeDesc = getReportingLineTypeDesc;
30
+ exports.getCurrencyTypeDesc = getCurrencyTypeDesc;
31
+ exports.getExchangeRateSourceTypeDesc = getExchangeRateSourceTypeDesc;
32
+ exports.getExchangeRateSyncStatusDesc = getExchangeRateSyncStatusDesc;
33
+ exports.getCustomerTypeDesc = getCustomerTypeDesc;
34
+ exports.getCustomerStatusDesc = getCustomerStatusDesc;
35
+ exports.getDiscountTypeDesc = getDiscountTypeDesc;
36
+ exports.getQuotationStatusDesc = getQuotationStatusDesc;
37
+ exports.getBorrowerTypeDesc = getBorrowerTypeDesc;
38
+ exports.getUWDecisionTypeDesc = getUWDecisionTypeDesc;
39
+ exports.getDeclinedBenefitTypeDesc = getDeclinedBenefitTypeDesc;
40
+ exports.getPartnerTypeDesc = getPartnerTypeDesc;
15
41
  const types_1 = require("../../types");
16
42
  function getGenderDesc(val) {
17
43
  switch (val) {
@@ -203,3 +229,341 @@ function getStaffStatusDesc(val) {
203
229
  return val;
204
230
  }
205
231
  }
232
+ function getAppFormTypeDesc(val) {
233
+ switch (val) {
234
+ case types_1.AppFormType.Base:
235
+ return "Standard Form";
236
+ case types_1.AppFormType.Simplified:
237
+ return "Simplified Form (SIO)";
238
+ default:
239
+ return val;
240
+ }
241
+ }
242
+ function getAppVisibilityScopeDesc(val) {
243
+ switch (val) {
244
+ case types_1.AppVisibilityScope.Own:
245
+ return "My Own";
246
+ case types_1.AppVisibilityScope.Team:
247
+ return "My Team";
248
+ case types_1.AppVisibilityScope.Org:
249
+ return "Organization";
250
+ default:
251
+ return val;
252
+ }
253
+ }
254
+ function getApplicationStatusDesc(val) {
255
+ switch (val) {
256
+ case types_1.ApplicationStatus.New:
257
+ return "New";
258
+ case types_1.ApplicationStatus.Completed:
259
+ return "Completed";
260
+ case types_1.ApplicationStatus.Submitted:
261
+ return "Submitted";
262
+ case types_1.ApplicationStatus.InReview:
263
+ return "In Review";
264
+ case types_1.ApplicationStatus.EditRequired:
265
+ return "Edit Required";
266
+ case types_1.ApplicationStatus.MoreDocRequired:
267
+ return "More Documents Required";
268
+ case types_1.ApplicationStatus.Resubmitted:
269
+ return "Resubmitted";
270
+ case types_1.ApplicationStatus.Rejected:
271
+ return "Rejected";
272
+ case types_1.ApplicationStatus.Accepted:
273
+ return "Accepted";
274
+ case types_1.ApplicationStatus.Transferred:
275
+ return "Transferred";
276
+ case types_1.ApplicationStatus.Cancelled:
277
+ return "Cancelled";
278
+ default:
279
+ return val;
280
+ }
281
+ }
282
+ function getAppPersonRoleDesc(val) {
283
+ switch (val) {
284
+ case types_1.AppPersonRole.PolicyHolder:
285
+ return "Policy Holder";
286
+ case types_1.AppPersonRole.LifeAssured:
287
+ return "Life Assured";
288
+ default:
289
+ return val;
290
+ }
291
+ }
292
+ function getAppCoverageTypeDesc(val) {
293
+ switch (val) {
294
+ case types_1.AppCoverageType.Base:
295
+ return "Base Plan";
296
+ case types_1.AppCoverageType.Rider:
297
+ return "Rider";
298
+ default:
299
+ return val;
300
+ }
301
+ }
302
+ function getUwAnswerValueTypeDesc(val) {
303
+ switch (val) {
304
+ case types_1.UwAnswerValueType.Boolean:
305
+ return "Boolean";
306
+ case types_1.UwAnswerValueType.Date:
307
+ return "Date";
308
+ case types_1.UwAnswerValueType.Dropdown:
309
+ return "Dropdown";
310
+ case types_1.UwAnswerValueType.Number:
311
+ return "Number";
312
+ case types_1.UwAnswerValueType.Text:
313
+ return "Text";
314
+ case types_1.UwAnswerValueType.TextArea:
315
+ return "Text Area";
316
+ case types_1.UwAnswerValueType.YesOrNo:
317
+ return "Yes/No";
318
+ default:
319
+ return val;
320
+ }
321
+ }
322
+ function getAppPaymentTypeDesc(val) {
323
+ switch (val) {
324
+ case types_1.AppPaymentType.Premium:
325
+ return "Premium";
326
+ case types_1.AppPaymentType.Deposit:
327
+ return "Deposit";
328
+ case types_1.AppPaymentType.Refund:
329
+ return "Refund";
330
+ default:
331
+ return val;
332
+ }
333
+ }
334
+ function getAppPaymentStatusDesc(val) {
335
+ switch (val) {
336
+ case types_1.AppPaymentStatus.Success:
337
+ return "Success";
338
+ case types_1.AppPaymentStatus.Failed:
339
+ return "Failed";
340
+ case types_1.AppPaymentStatus.Pending:
341
+ return "Pending";
342
+ case types_1.AppPaymentStatus.Cancelled:
343
+ return "Cancelled";
344
+ case types_1.AppPaymentStatus.Voided:
345
+ return "Voided";
346
+ default:
347
+ return val;
348
+ }
349
+ }
350
+ function getDocumentTypeDesc(val) {
351
+ switch (val) {
352
+ case types_1.DocumentType.Application:
353
+ return "Application";
354
+ case types_1.DocumentType.Claim:
355
+ return "Claim";
356
+ case types_1.DocumentType.CoverNote:
357
+ return "Cover Note";
358
+ case types_1.DocumentType.OfficialReceipt:
359
+ return "Official Receipt";
360
+ case types_1.DocumentType.Policy:
361
+ return "Policy";
362
+ case types_1.DocumentType.Quotation:
363
+ return "Quotation";
364
+ default:
365
+ return val;
366
+ }
367
+ }
368
+ function getMaritalStatusDesc(val) {
369
+ switch (val) {
370
+ case types_1.MaritalStatus.Single:
371
+ return "Single";
372
+ case types_1.MaritalStatus.Married:
373
+ return "Married";
374
+ case types_1.MaritalStatus.Widowed:
375
+ return "Widowed";
376
+ case types_1.MaritalStatus.Divorced:
377
+ return "Divorced";
378
+ default:
379
+ return val;
380
+ }
381
+ }
382
+ function getResetScopeDesc(val) {
383
+ switch (val) {
384
+ case types_1.ResetScope.None:
385
+ return "Never Resets";
386
+ case types_1.ResetScope.Year:
387
+ return "Yearly";
388
+ case types_1.ResetScope.Month:
389
+ return "Monthly";
390
+ case types_1.ResetScope.Day:
391
+ return "Daily";
392
+ default:
393
+ return val;
394
+ }
395
+ }
396
+ function getYesNoDesc(val) {
397
+ switch (val) {
398
+ case types_1.YesNo.Yes:
399
+ return "Yes";
400
+ case types_1.YesNo.No:
401
+ return "No";
402
+ default:
403
+ return val;
404
+ }
405
+ }
406
+ function getFileStorageProviderDesc(val) {
407
+ switch (val) {
408
+ case types_1.FileStorageProvider.Local:
409
+ return "Local Storage";
410
+ case types_1.FileStorageProvider.S3:
411
+ return "S3";
412
+ case types_1.FileStorageProvider.Legacy:
413
+ return "Legacy";
414
+ default:
415
+ return val;
416
+ }
417
+ }
418
+ function getOccupationLevelDesc(val) {
419
+ switch (val) {
420
+ case types_1.OccupationLevel.Chapter:
421
+ return "Chapter";
422
+ case types_1.OccupationLevel.Division:
423
+ return "Division";
424
+ case types_1.OccupationLevel.Group:
425
+ return "Group";
426
+ case types_1.OccupationLevel.Class:
427
+ return "Class";
428
+ case types_1.OccupationLevel.SubClass:
429
+ return "Sub Class";
430
+ default:
431
+ return val;
432
+ }
433
+ }
434
+ function getReportingLineTypeDesc(val) {
435
+ switch (val) {
436
+ case types_1.ReportingLineType.Solid:
437
+ return "Solid Line";
438
+ case types_1.ReportingLineType.Dotted:
439
+ return "Dotted Line";
440
+ default:
441
+ return val;
442
+ }
443
+ }
444
+ function getCurrencyTypeDesc(val) {
445
+ switch (val) {
446
+ case types_1.CurrencyType.USD:
447
+ return "US Dollar";
448
+ case types_1.CurrencyType.KHR:
449
+ return "Khmer Riel";
450
+ default:
451
+ return val;
452
+ }
453
+ }
454
+ function getExchangeRateSourceTypeDesc(val) {
455
+ switch (val) {
456
+ case types_1.ExchangeRateSourceType.Manual:
457
+ return "Manual";
458
+ case types_1.ExchangeRateSourceType.Api:
459
+ return "API";
460
+ case types_1.ExchangeRateSourceType.NationalBank:
461
+ return "National Bank";
462
+ case types_1.ExchangeRateSourceType.System:
463
+ return "System";
464
+ default:
465
+ return val;
466
+ }
467
+ }
468
+ function getExchangeRateSyncStatusDesc(val) {
469
+ switch (val) {
470
+ case types_1.ExchangeRateSyncStatus.Success:
471
+ return "Success";
472
+ case types_1.ExchangeRateSyncStatus.Failed:
473
+ return "Failed";
474
+ default:
475
+ return val;
476
+ }
477
+ }
478
+ function getCustomerTypeDesc(val) {
479
+ switch (val) {
480
+ case types_1.CustomerType.Individual:
481
+ return "Individual";
482
+ case types_1.CustomerType.Corporate:
483
+ return "Corporate";
484
+ default:
485
+ return val;
486
+ }
487
+ }
488
+ function getCustomerStatusDesc(val) {
489
+ switch (val) {
490
+ case types_1.CustomerStatus.Active:
491
+ return "Active";
492
+ case types_1.CustomerStatus.Inactive:
493
+ return "Inactive";
494
+ case types_1.CustomerStatus.Blacklisted:
495
+ return "Blacklisted";
496
+ default:
497
+ return val;
498
+ }
499
+ }
500
+ function getDiscountTypeDesc(val) {
501
+ switch (val) {
502
+ case types_1.DiscountType.Percentage:
503
+ return "Percentage";
504
+ case types_1.DiscountType.FixedAmount:
505
+ return "Fixed Amount";
506
+ default:
507
+ return val;
508
+ }
509
+ }
510
+ function getQuotationStatusDesc(val) {
511
+ switch (val) {
512
+ case types_1.QuotationStatus.Draft:
513
+ return "Draft";
514
+ case types_1.QuotationStatus.Quoted:
515
+ return "Quoted";
516
+ case types_1.QuotationStatus.Expired:
517
+ return "Expired";
518
+ case types_1.QuotationStatus.Cancelled:
519
+ return "Cancelled";
520
+ case types_1.QuotationStatus.Converted:
521
+ return "Converted";
522
+ default:
523
+ return val;
524
+ }
525
+ }
526
+ function getBorrowerTypeDesc(val) {
527
+ switch (val) {
528
+ case types_1.BorrowerType.MainBorrower:
529
+ return "Main Borrower";
530
+ case types_1.BorrowerType.CoBorrower:
531
+ return "Co-Borrower";
532
+ default:
533
+ return val;
534
+ }
535
+ }
536
+ function getUWDecisionTypeDesc(val) {
537
+ switch (val) {
538
+ case types_1.UWDecisionType.COUNTER_OFFER:
539
+ return "Counter Offer";
540
+ case types_1.UWDecisionType.DECLINED_COVERAGE:
541
+ return "Declined Coverage";
542
+ case types_1.UWDecisionType.REJECTED:
543
+ return "Rejected";
544
+ default:
545
+ return val;
546
+ }
547
+ }
548
+ function getDeclinedBenefitTypeDesc(val) {
549
+ switch (val) {
550
+ case types_1.DeclinedBenefitType.ACCIDENTAL_DEATH:
551
+ return "Accidental Death Benefit";
552
+ case types_1.DeclinedBenefitType.TOTAL_PERMANENT_DISABILITY:
553
+ return "Total & Permanent Disability";
554
+ case types_1.DeclinedBenefitType.CRITICAL_ILLNESS:
555
+ return "Critical Illness";
556
+ default:
557
+ return val;
558
+ }
559
+ }
560
+ function getPartnerTypeDesc(val) {
561
+ switch (val) {
562
+ case types_1.PartnerType.Banca:
563
+ return "Bancassurance";
564
+ case types_1.PartnerType.Broker:
565
+ return "Broker";
566
+ default:
567
+ return val;
568
+ }
569
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.117",
3
+ "version": "1.3.119",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -14,7 +14,8 @@
14
14
  "migration:run": "DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:run -d src/database/data-source.ts",
15
15
  "migration:apply": "DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:generate src/database/migrations/$MIGRATION_NAME -d src/database/data-source.ts && DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:run -d src/database/data-source.ts",
16
16
  "migration:revert": "DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:revert -d src/database/data-source.ts",
17
- "migration:show": "DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:show -d src/database/data-source.ts"
17
+ "migration:show": "DOTENV_CONFIG_PATH=${ENV_FILE:-.env} typeorm-ts-node-commonjs migration:show -d src/database/data-source.ts",
18
+ "migration:reset-shadow": "docker rm -f plac_shadow_pg 2>/dev/null; docker run -d --name plac_shadow_pg -e POSTGRES_PASSWORD=postgres -p 5433:5432 postgres:16-alpine >/dev/null && ./scripts/wait-for-pg.sh 5433 && ENV_FILE=.env.shadow npm run migration:run"
18
19
  },
19
20
  "keywords": [],
20
21
  "author": "",
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+ # Polls a local Postgres port until it accepts connections.
3
+ # Usage: ./scripts/wait-for-pg.sh <port> [host] [timeout_seconds]
4
+ set -euo pipefail
5
+
6
+ PORT="${1:?Usage: wait-for-pg.sh <port> [host] [timeout_seconds]}"
7
+ HOST="${2:-localhost}"
8
+ TIMEOUT="${3:-30}"
9
+
10
+ elapsed=0
11
+ until pg_isready -h "$HOST" -p "$PORT" >/dev/null 2>&1; do
12
+ if [ "$elapsed" -ge "$TIMEOUT" ]; then
13
+ echo "Postgres at $HOST:$PORT did not become ready within ${TIMEOUT}s" >&2
14
+ exit 1
15
+ fi
16
+ sleep 1
17
+ elapsed=$((elapsed + 1))
18
+ done