plac-micro-common 1.3.77 → 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 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
- ```
@@ -45,6 +45,23 @@ export declare enum UnderwritingBaseQuestionCode {
45
45
  Q_HA_PregnancyComplications = "Q-HA-PREGNANCY-COMPLICATIONS",
46
46
  Q_HA_Details = "Q-HA-DETAILS"
47
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
+ }
48
65
  export type UWDropdownOption = {
49
66
  value: string;
50
67
  label: string;
@@ -1,6 +1,6 @@
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
6
  UnderwritingSIOQuestionCode["Q_USA"] = "Q-SIO-USA";
@@ -55,3 +55,21 @@ var UnderwritingBaseQuestionCode;
55
55
  UnderwritingBaseQuestionCode["Q_HA_PregnancyComplications"] = "Q-HA-PREGNANCY-COMPLICATIONS";
56
56
  UnderwritingBaseQuestionCode["Q_HA_Details"] = "Q-HA-DETAILS";
57
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,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.77",
3
+ "version": "1.3.78",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {