@solidxai/core 0.1.11-beta.6 → 0.1.11-beta.8
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/settings.local.json +16 -0
- package/CLAUDE.md +26 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +2 -1
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +32 -0
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +14 -0
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/subscribers/computed-entity-field.subscriber.d.ts.map +1 -1
- package/dist/subscribers/computed-entity-field.subscriber.js +2 -0
- package/dist/subscribers/computed-entity-field.subscriber.js.map +1 -1
- package/package.json +1 -1
- package/src/seeders/module-metadata-seeder.service.ts +2 -1
- package/src/services/1.js +6 -0
- package/src/services/settings/default-settings-provider.service.ts +14 -0
- package/src/subscribers/computed-entity-field.subscriber.ts +2 -1
- package/dist-tests/api/authenticate.spec.js +0 -119
- package/dist-tests/api/authenticate.spec.js.map +0 -1
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +0 -97
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +0 -1
- package/dist-tests/api/ping.spec.js +0 -21
- package/dist-tests/api/ping.spec.js.map +0 -1
- package/dist-tests/helpers/auth.js +0 -41
- package/dist-tests/helpers/auth.js.map +0 -1
- package/dist-tests/helpers/env.js +0 -11
- package/dist-tests/helpers/env.js.map +0 -1
- package/docs/agent-hub-grooming.md +0 -301
- package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +0 -438
- package/docs/dashboards/dashboard-curl-smoke-tests.txt +0 -146
- package/docs/dashboards/delete-legacy-dashboard-metadata.sql +0 -172
- package/docs/datasource-introspection-ddl-analysis.md +0 -326
- package/docs/datasource-introspection-implementation-plan.md +0 -306
- package/docs/grouping-enhancements.md +0 -89
- package/docs/java-spring/README.md +0 -3
- package/docs/java-spring/solid-core-module-deep-dive-report.md +0 -1317
- package/docs/module-package-import-handoff.md +0 -691
- package/docs/seed-changes.md +0 -65
- package/docs/test-data-workflow.md +0 -200
- package/docs/type-declaration-import-issue.md +0 -24
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
BEGIN;
|
|
2
|
-
|
|
3
|
-
-- 0) Scope: solid-core dashboard legacy keys
|
|
4
|
-
-- Models:
|
|
5
|
-
-- dashboard, dashboardVariable, dashboardQuestion, dashboardQuestionSqlDatasetConfig, dashboardLayout
|
|
6
|
-
-- Actions:
|
|
7
|
-
-- dashboard-list-action, dashboardVariable-list-action, dashboardQuestion-list-action,
|
|
8
|
-
-- dashboardLayout-list-action, dashboardQuestionSqlDatasetConfig-list-action
|
|
9
|
-
-- Menus:
|
|
10
|
-
-- dashboardManagement-menu-item, dashboard-menu-item, dashboardQuestion-menu-item, dashboardLayout-menu-item
|
|
11
|
-
-- Views:
|
|
12
|
-
-- dashboard-list-view, dashboard-form-view,
|
|
13
|
-
-- dashboardVariable-list-view, dashboardVariable-form-view,
|
|
14
|
-
-- dashboardQuestion-list-view, dashboardQuestion-form-view,
|
|
15
|
-
-- dashboardQuestionSqlDatasetConfig-list-view, dashboardQuestionSqlDatasetConfig-form-view,
|
|
16
|
-
-- dashboardLayout-list-view, dashboardLayout-form-view
|
|
17
|
-
|
|
18
|
-
-- 1) Remove role<->permission joins for dashboard controller permissions
|
|
19
|
-
-- (table name may vary by naming strategy; this is the common one)
|
|
20
|
-
DELETE FROM ss_role_metadata_permissions_ss_permission_metadata
|
|
21
|
-
WHERE ss_permission_metadata_id IN (
|
|
22
|
-
SELECT id
|
|
23
|
-
FROM ss_permission_metadata
|
|
24
|
-
WHERE name IN (
|
|
25
|
-
'DashboardController.getDefinition',
|
|
26
|
-
'DashboardController.getWidgetData',
|
|
27
|
-
'DashboardController.getDashboardData',
|
|
28
|
-
'DashboardController.getVariableOptions',
|
|
29
|
-
'DashboardController.getLayout',
|
|
30
|
-
'DashboardController.saveLayout'
|
|
31
|
-
)
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
-- 2) Remove dashboard permissions
|
|
35
|
-
DELETE FROM ss_permission_metadata
|
|
36
|
-
WHERE name IN (
|
|
37
|
-
'DashboardController.getDefinition',
|
|
38
|
-
'DashboardController.getWidgetData',
|
|
39
|
-
'DashboardController.getDashboardData',
|
|
40
|
-
'DashboardController.getVariableOptions',
|
|
41
|
-
'DashboardController.getLayout',
|
|
42
|
-
'DashboardController.saveLayout'
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
-- 3) Remove menu<->role joins for dashboard menus
|
|
46
|
-
DELETE FROM ss_menu_item_metadata_roles_ss_role_metadata
|
|
47
|
-
WHERE ss_menu_item_metadata_id IN (
|
|
48
|
-
SELECT m.id
|
|
49
|
-
FROM ss_menu_item_metadata m
|
|
50
|
-
WHERE m.name IN (
|
|
51
|
-
'dashboardManagement-menu-item',
|
|
52
|
-
'dashboard-menu-item',
|
|
53
|
-
'dashboardQuestion-menu-item',
|
|
54
|
-
'dashboardLayout-menu-item'
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
-- 4) Remove dashboard menus
|
|
59
|
-
DELETE FROM ss_menu_item_metadata
|
|
60
|
-
WHERE name IN (
|
|
61
|
-
'dashboardManagement-menu-item',
|
|
62
|
-
'dashboard-menu-item',
|
|
63
|
-
'dashboardQuestion-menu-item',
|
|
64
|
-
'dashboardLayout-menu-item'
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
-- 5) Remove dashboard actions
|
|
68
|
-
DELETE FROM ss_action_metadata
|
|
69
|
-
WHERE name IN (
|
|
70
|
-
'dashboard-list-action',
|
|
71
|
-
'dashboardVariable-list-action',
|
|
72
|
-
'dashboardQuestion-list-action',
|
|
73
|
-
'dashboardLayout-list-action',
|
|
74
|
-
'dashboardQuestionSqlDatasetConfig-list-action'
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
-- 6) Remove user-specific view overrides for dashboard views
|
|
78
|
-
DELETE FROM ss_user_view_metadata
|
|
79
|
-
WHERE view_metadata_id IN (
|
|
80
|
-
SELECT v.id
|
|
81
|
-
FROM ss_view_metadata v
|
|
82
|
-
WHERE v.name IN (
|
|
83
|
-
'dashboard-list-view',
|
|
84
|
-
'dashboard-form-view',
|
|
85
|
-
'dashboardVariable-list-view',
|
|
86
|
-
'dashboardVariable-form-view',
|
|
87
|
-
'dashboardQuestion-list-view',
|
|
88
|
-
'dashboardQuestion-form-view',
|
|
89
|
-
'dashboardQuestionSqlDatasetConfig-list-view',
|
|
90
|
-
'dashboardQuestionSqlDatasetConfig-form-view',
|
|
91
|
-
'dashboardLayout-list-view',
|
|
92
|
-
'dashboardLayout-form-view'
|
|
93
|
-
)
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
-- 7) Remove saved filters tied to dashboard models/views
|
|
97
|
-
DELETE FROM ss_saved_fitlers
|
|
98
|
-
WHERE model_id IN (
|
|
99
|
-
SELECT m.id
|
|
100
|
-
FROM ss_model_metadata m
|
|
101
|
-
JOIN ss_module_metadata mm ON mm.id = m.module_id
|
|
102
|
-
WHERE mm.name = 'solid-core'
|
|
103
|
-
AND m.singular_name IN (
|
|
104
|
-
'dashboard',
|
|
105
|
-
'dashboardVariable',
|
|
106
|
-
'dashboardQuestion',
|
|
107
|
-
'dashboardQuestionSqlDatasetConfig',
|
|
108
|
-
'dashboardLayout'
|
|
109
|
-
)
|
|
110
|
-
)
|
|
111
|
-
OR view_id IN (
|
|
112
|
-
SELECT v.id
|
|
113
|
-
FROM ss_view_metadata v
|
|
114
|
-
WHERE v.name IN (
|
|
115
|
-
'dashboard-list-view',
|
|
116
|
-
'dashboard-form-view',
|
|
117
|
-
'dashboardVariable-list-view',
|
|
118
|
-
'dashboardVariable-form-view',
|
|
119
|
-
'dashboardQuestion-list-view',
|
|
120
|
-
'dashboardQuestion-form-view',
|
|
121
|
-
'dashboardQuestionSqlDatasetConfig-list-view',
|
|
122
|
-
'dashboardQuestionSqlDatasetConfig-form-view',
|
|
123
|
-
'dashboardLayout-list-view',
|
|
124
|
-
'dashboardLayout-form-view'
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
-- 8) Remove security rules attached to dashboard models (if any)
|
|
129
|
-
DELETE FROM ss_security_rule
|
|
130
|
-
WHERE model_metadata_id IN (
|
|
131
|
-
SELECT m.id
|
|
132
|
-
FROM ss_model_metadata m
|
|
133
|
-
JOIN ss_module_metadata mm ON mm.id = m.module_id
|
|
134
|
-
WHERE mm.name = 'solid-core'
|
|
135
|
-
AND m.singular_name IN (
|
|
136
|
-
'dashboard',
|
|
137
|
-
'dashboardVariable',
|
|
138
|
-
'dashboardQuestion',
|
|
139
|
-
'dashboardQuestionSqlDatasetConfig',
|
|
140
|
-
'dashboardLayout'
|
|
141
|
-
)
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
-- 9) Remove dashboard views
|
|
145
|
-
DELETE FROM ss_view_metadata
|
|
146
|
-
WHERE name IN (
|
|
147
|
-
'dashboard-list-view',
|
|
148
|
-
'dashboard-form-view',
|
|
149
|
-
'dashboardVariable-list-view',
|
|
150
|
-
'dashboardVariable-form-view',
|
|
151
|
-
'dashboardQuestion-list-view',
|
|
152
|
-
'dashboardQuestion-form-view',
|
|
153
|
-
'dashboardQuestionSqlDatasetConfig-list-view',
|
|
154
|
-
'dashboardQuestionSqlDatasetConfig-form-view',
|
|
155
|
-
'dashboardLayout-list-view',
|
|
156
|
-
'dashboardLayout-form-view'
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
-- 10) Remove dashboard models (fields should cascade via model_id FK)
|
|
160
|
-
DELETE FROM ss_model_metadata
|
|
161
|
-
WHERE singular_name IN (
|
|
162
|
-
'dashboard',
|
|
163
|
-
'dashboardVariable',
|
|
164
|
-
'dashboardQuestion',
|
|
165
|
-
'dashboardQuestionSqlDatasetConfig',
|
|
166
|
-
'dashboardLayout'
|
|
167
|
-
)
|
|
168
|
-
AND module_id IN (
|
|
169
|
-
SELECT id FROM ss_module_metadata WHERE name = 'solid-core'
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
COMMIT;
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
# Datasource Introspection DDL Analysis
|
|
2
|
-
|
|
3
|
-
## Scope
|
|
4
|
-
- Compared the current `mswipe-erp-solidx` DDL exports under [mswipe-erp-solidx/sql-ddl-statements](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/sql-ddl-statements) against:
|
|
5
|
-
- generated TypeORM entities in [mswipe-erp-solidx/solid-api/src](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src)
|
|
6
|
-
- model metadata JSON files in the same modules
|
|
7
|
-
- Focused on the six SolidX modules currently represented in metadata:
|
|
8
|
-
- `cpm`
|
|
9
|
-
- `frms`
|
|
10
|
-
- `mswipe-masters`
|
|
11
|
-
- `onboarding`
|
|
12
|
-
- `peoples`
|
|
13
|
-
- `reports`
|
|
14
|
-
|
|
15
|
-
## DDL Coverage
|
|
16
|
-
- DDL files available:
|
|
17
|
-
- `mSwipe_SolidXCore.sql`
|
|
18
|
-
- `mSwipe_Applications_script.sql`
|
|
19
|
-
- `mSwipe_Live_Dev_script.sql`
|
|
20
|
-
- `mSwipe_Masters_script.sql`
|
|
21
|
-
- `mSwipe_ERP_Live_Dev_script.sql`
|
|
22
|
-
- Datasource-to-DDL mapping used for this analysis:
|
|
23
|
-
- `default` -> `mSwipe_SolidXCore.sql`
|
|
24
|
-
- `applications` -> `mSwipe_Applications_script.sql`
|
|
25
|
-
- `amextxn` -> `mSwipe_Live_Dev_script.sql`
|
|
26
|
-
- `masters` -> `mSwipe_Masters_script.sql`
|
|
27
|
-
- `dbmtxn` -> `mSwipe_ERP_Live_Dev_script.sql`
|
|
28
|
-
- Total metadata models checked: `114`
|
|
29
|
-
- Models with matching DDL table found: `109`
|
|
30
|
-
- Models without matching DDL table found: `5`
|
|
31
|
-
- `onboarding/mob3PoApplicationService`
|
|
32
|
-
- `onboarding/mob3PoApplBankMaster`
|
|
33
|
-
- `onboarding/mob3PoApplTerminalMaster`
|
|
34
|
-
- `onboarding/mob3PoApplLocationMaster`
|
|
35
|
-
- `onboarding/mob3PoApplicationMaster`
|
|
36
|
-
|
|
37
|
-
## Method Used
|
|
38
|
-
- For legacy strategy analysis, I inferred the table style directly from the DDL:
|
|
39
|
-
- `existing_id` if the table contains `ss_created_at`/other `ss_*` system columns but no `ss_id`
|
|
40
|
-
- `generated_id` if the table contains `ss_*` system columns and `ss_id`
|
|
41
|
-
- `none` if neither legacy pattern is present
|
|
42
|
-
- For field comparison, I used metadata fields that actually carry a `columnName`.
|
|
43
|
-
- This matters because some physical columns are represented as `relation` or `computed` fields, not just scalar fields.
|
|
44
|
-
- I compared:
|
|
45
|
-
- metadata `legacyTableType`
|
|
46
|
-
- entity superclass choice
|
|
47
|
-
- column presence
|
|
48
|
-
- `ormType`
|
|
49
|
-
- `required`
|
|
50
|
-
- `isPrimaryKey`
|
|
51
|
-
|
|
52
|
-
## High-Level Findings
|
|
53
|
-
|
|
54
|
-
### 1. The DDL strongly validates the three superclass meanings
|
|
55
|
-
- `LegacyCommonEntityWithExistingId` is physically visible in DDL as:
|
|
56
|
-
- legacy business columns
|
|
57
|
-
- `ss_created_at`, `ss_updated_at`, `ss_deleted_at`, `ss_deleted_tracker`, `ss_published_at`, `ss_locale_name`, `ss_default_entity_locale_id`, `ss_created_by_id`, `ss_updated_by_id`
|
|
58
|
-
- no `ss_id`
|
|
59
|
-
- `LegacyCommonEntityWithGeneratedId` is physically visible in DDL as:
|
|
60
|
-
- the same `ss_*` columns
|
|
61
|
-
- plus `ss_id`
|
|
62
|
-
- `CommonEntity` / `legacyTableType = none` is visible as:
|
|
63
|
-
- no `ss_*` system columns
|
|
64
|
-
|
|
65
|
-
### 2. Entity code matches the DDL much better than metadata JSON does
|
|
66
|
-
- Metadata `legacyTableType` mismatches against DDL: `34`
|
|
67
|
-
- Entity superclass mismatches against DDL: `1`
|
|
68
|
-
- This is the single most important finding for the introspection feature.
|
|
69
|
-
- Conclusion:
|
|
70
|
-
- the entity superclass pattern is currently a more trustworthy signal than historical metadata JSON
|
|
71
|
-
- introspection should derive legacy strategy from the actual table shape, not from old metadata files
|
|
72
|
-
|
|
73
|
-
### 3. One table clearly shows live DB drift from generated code
|
|
74
|
-
- [SendOTPDetails entity](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/onboarding/entities/send-otp-details.entity.ts) extends `LegacyCommonEntityWithExistingId`
|
|
75
|
-
- metadata also says `legacyTableType = existing_id`
|
|
76
|
-
- but the DDL table `SendOTPDetails` has no `ss_*` columns at all
|
|
77
|
-
- This means:
|
|
78
|
-
- the database still looks `none`
|
|
79
|
-
- the codebase has already been moved to the legacy wrapper convention
|
|
80
|
-
- This is the clearest example that code and database are not always in lockstep.
|
|
81
|
-
|
|
82
|
-
## Representative Table Readings
|
|
83
|
-
|
|
84
|
-
### `existing_id` pattern confirmed by DDL
|
|
85
|
-
- [Account_Categories in mSwipe_Masters_script.sql](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/sql-ddl-statements/mSwipe_Masters_script.sql)
|
|
86
|
-
- business PK: `AcCat_code`
|
|
87
|
-
- legacy fields like `Created_By`, `Created_On`, `RowId`, `Row_Version`
|
|
88
|
-
- SolidX legacy system fields: `ss_created_at` ... `ss_updated_by_id`
|
|
89
|
-
- no `ss_id`
|
|
90
|
-
- [ReportMaster entity](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/reports/entities/report-master.entity.ts)
|
|
91
|
-
- extends `LegacyCommonEntityWithExistingId`
|
|
92
|
-
- [ReportMaster metadata](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/reports/metadata/reports-metadata.json)
|
|
93
|
-
- correctly uses `legacyTableType = existing_id`
|
|
94
|
-
|
|
95
|
-
### `generated_id` pattern confirmed by DDL
|
|
96
|
-
- `frms_lead` in [mSwipe_SolidXCore.sql](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/sql-ddl-statements/mSwipe_SolidXCore.sql)
|
|
97
|
-
- has `ss_*` system fields
|
|
98
|
-
- has `ss_id`
|
|
99
|
-
- `Plan_Master` in the same DDL file also follows that pattern
|
|
100
|
-
- [FrmsLead entity](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/frms/entities/frms-lead.entity.ts)
|
|
101
|
-
- extends `LegacyCommonEntityWithGeneratedId`
|
|
102
|
-
- [ItemMaster entity](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/mswipe-masters/entities/item-master.entity.ts)
|
|
103
|
-
- also extends `LegacyCommonEntityWithGeneratedId`
|
|
104
|
-
|
|
105
|
-
### `none` pattern confirmed by DDL
|
|
106
|
-
- `SendOTPDetails` in [mSwipe_Applications_script.sql](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/sql-ddl-statements/mSwipe_Applications_script.sql)
|
|
107
|
-
- no `ss_*` columns
|
|
108
|
-
- plain identity PK on `Id`
|
|
109
|
-
- This table is important because it proves we cannot assume every entity already matches the live database convention.
|
|
110
|
-
|
|
111
|
-
## Legacy Strategy Mismatch Summary
|
|
112
|
-
|
|
113
|
-
### Metadata says `none`, but DDL clearly says legacy table
|
|
114
|
-
- Common examples:
|
|
115
|
-
- `peoples/employee`
|
|
116
|
-
- `frms/frmsLead`
|
|
117
|
-
- `mswipe-masters/itemMaster`
|
|
118
|
-
- `onboarding/preapplMaster`
|
|
119
|
-
- `onboarding/bankUpiMasterVtb`
|
|
120
|
-
- `cpm/customerTerminal`
|
|
121
|
-
- These are mostly incomplete historical metadata entries rather than DDL ambiguity.
|
|
122
|
-
|
|
123
|
-
### Metadata says legacy, but DDL says `none`
|
|
124
|
-
- Main example:
|
|
125
|
-
- `onboarding/sendOtpDetails`
|
|
126
|
-
- This looks like real drift between live database and generated code.
|
|
127
|
-
|
|
128
|
-
## Column Coverage Findings
|
|
129
|
-
|
|
130
|
-
### Overall
|
|
131
|
-
- Models with at least one physical column gap between DDL and metadata: `51`
|
|
132
|
-
- This is not evenly distributed.
|
|
133
|
-
- Most drift sits in `onboarding`, `frms`, and parts of `cpm`.
|
|
134
|
-
|
|
135
|
-
### Modules with the most drift
|
|
136
|
-
- `onboarding`
|
|
137
|
-
- `64` models total
|
|
138
|
-
- `59` with DDL available
|
|
139
|
-
- `26` legacy-strategy mismatches
|
|
140
|
-
- `34` models with physical column gaps
|
|
141
|
-
- `frms`
|
|
142
|
-
- all `14` models have DDL
|
|
143
|
-
- all `14` show some column gap
|
|
144
|
-
- much of this is because metadata enriches physical columns into `relation` or `computed` fields
|
|
145
|
-
- `cpm`
|
|
146
|
-
- only `1` legacy-strategy mismatch
|
|
147
|
-
- but `17` models have required/nullability drift
|
|
148
|
-
|
|
149
|
-
### Real DDL columns missing from metadata
|
|
150
|
-
- [Employees metadata](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/peoples/metadata/peoples-metadata.json)
|
|
151
|
-
- DDL has extra columns not mapped in metadata:
|
|
152
|
-
- `photo`
|
|
153
|
-
- `VPNUserId`
|
|
154
|
-
- `youareawesome_ch_allow_post`
|
|
155
|
-
- `emergency_name`
|
|
156
|
-
- `emergency_mobile_no`
|
|
157
|
-
- `fse_opt_address`
|
|
158
|
-
- `fse_opt_pincode`
|
|
159
|
-
- `solid_user_id`
|
|
160
|
-
- `Application_Master`
|
|
161
|
-
- extra DDL columns such as `ZigramEntityId`, `CKYC_ReqId`, `MCC_Code_Display_Value`, `mcc_display_value`, `ZigramAMLDetailsS3URL`, `Modified_through`
|
|
162
|
-
- `bank_file_import`
|
|
163
|
-
- extra DDL columns such as `source_by`, `product`, `plan_desc`, `bank_source_id`, `sim`, `sim_required`
|
|
164
|
-
- `bulk_customer_industries`
|
|
165
|
-
- extra DDL columns such as `sample_file_url`, `action`, `approved_by`, `approved_on`, `remarks`, `status`, `is_verified`
|
|
166
|
-
|
|
167
|
-
### Metadata columns missing from DDL
|
|
168
|
-
- Most of the very large misses come from the five missing `MOB3PO_*` tables, so those are blocked until the matching amextxn DDL exists.
|
|
169
|
-
- Outside of that, there are a few genuine metadata issues:
|
|
170
|
-
- [onboarding metadata around `meAcnoHb`](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/onboarding/metadata/onboarding-metadata.json:1936)
|
|
171
|
-
- `columnName` is incorrectly stored as `"shortText"`
|
|
172
|
-
- it should clearly be `ME_Acno_HB`
|
|
173
|
-
- `customerIndustries` carries `legacy_id`
|
|
174
|
-
- `customerIndustriesLimit` carries `IsVISAEx`
|
|
175
|
-
- There are also media fields in metadata without a direct physical column mapping, which should not be treated as DDL errors for introspection.
|
|
176
|
-
|
|
177
|
-
## Type Mapping Findings
|
|
178
|
-
|
|
179
|
-
### Overall
|
|
180
|
-
- Models with at least one `ormType` mismatch: `17`
|
|
181
|
-
|
|
182
|
-
### The mismatches are mostly normalization choices, not deep incompatibilities
|
|
183
|
-
- `numeric` in DDL is frequently modeled as `decimal` in metadata
|
|
184
|
-
- `char` in DDL is frequently widened to `varchar` in metadata
|
|
185
|
-
- `varchar(max)` / `nvarchar(max)` often collapse to the base text family in metadata
|
|
186
|
-
- `varbinary(max)` is sometimes abstracted more semantically
|
|
187
|
-
|
|
188
|
-
### Representative examples
|
|
189
|
-
- `Customer_MDR`
|
|
190
|
-
- several `char` columns are modeled as `varchar`
|
|
191
|
-
- `PreApplication_Master`
|
|
192
|
-
- several `numeric` columns are modeled as `decimal`
|
|
193
|
-
- `varchar(MAX)` is collapsed into plain `varchar`
|
|
194
|
-
- `frms_whatsapp_template`
|
|
195
|
-
- metadata uses `simple-json` where DDL exposes `ntext`
|
|
196
|
-
|
|
197
|
-
### Implication for introspection
|
|
198
|
-
- The mapper should normalize DDL types into SolidX-friendly metadata types.
|
|
199
|
-
- We should not try to preserve every SQL type string literally.
|
|
200
|
-
|
|
201
|
-
## Required / Nullable Findings
|
|
202
|
-
|
|
203
|
-
### Overall
|
|
204
|
-
- Models with at least one `required` mismatch: `59`
|
|
205
|
-
|
|
206
|
-
### This is a major pattern, especially in legacy modules
|
|
207
|
-
- `Customer_MDR`: `46` required mismatches
|
|
208
|
-
- `Customer_Terminal`: `40`
|
|
209
|
-
- `Customer_Bank`: `21`
|
|
210
|
-
- `Customer_Location`: `14`
|
|
211
|
-
- many other `cpm` and `onboarding` models follow the same pattern
|
|
212
|
-
|
|
213
|
-
### Interpretation
|
|
214
|
-
- Current hand-curated metadata is often more permissive than the live DDL.
|
|
215
|
-
- In other words:
|
|
216
|
-
- DDL says `NOT NULL`
|
|
217
|
-
- metadata still says `required = false`
|
|
218
|
-
- This is likely deliberate in at least some cases, especially for legacy tables and import workflows.
|
|
219
|
-
|
|
220
|
-
### Implication for introspection
|
|
221
|
-
- We should not hardcode a single policy.
|
|
222
|
-
- Recommended default:
|
|
223
|
-
- use DDL nullability as the initial suggestion
|
|
224
|
-
- allow the session-level mapping settings to relax `required` flags for legacy imports
|
|
225
|
-
- This is a good candidate for one of the frontend session options.
|
|
226
|
-
|
|
227
|
-
## Primary Key Findings
|
|
228
|
-
|
|
229
|
-
### Overall
|
|
230
|
-
- Models with PK mismatches: `3`
|
|
231
|
-
|
|
232
|
-
### These are important because they affect superclass choice and model identity
|
|
233
|
-
- `frmsLead`
|
|
234
|
-
- physical `lead_id` exists
|
|
235
|
-
- metadata models it as a `computed` field and does not stamp it as primary
|
|
236
|
-
- this is a semantic enrichment that the DDL alone cannot infer
|
|
237
|
-
- `Appl_Bank_Master`
|
|
238
|
-
- DDL primary key is composite: `Appl_No` + `Bank_Code`
|
|
239
|
-
- entity models both as `PrimaryColumn`
|
|
240
|
-
- metadata only marks `Appl_No` as primary
|
|
241
|
-
- `ERP_Appl_SubCategory_Master`
|
|
242
|
-
- metadata marks `SubCat_Code` as primary
|
|
243
|
-
- DDL does not agree
|
|
244
|
-
|
|
245
|
-
### Implication for introspection
|
|
246
|
-
- Composite PK handling must be explicit in the backend interface.
|
|
247
|
-
- We also need a separate concept of:
|
|
248
|
-
- physical primary key
|
|
249
|
-
- chosen user key
|
|
250
|
-
- chosen SolidX framework identity strategy
|
|
251
|
-
|
|
252
|
-
## Important Semantic Enrichment Findings
|
|
253
|
-
|
|
254
|
-
### Some physical columns are intentionally represented as `relation` fields
|
|
255
|
-
- [frmsLead metadata](/Users/harishpatel/Code/javascript/mswipe-erp-solidx/solid-api/src/frms/metadata/frms-metadata.json:500)
|
|
256
|
-
- `stage_id` is represented as a `relation`
|
|
257
|
-
- `disposition_id` is represented as a `relation`
|
|
258
|
-
- This is not a DDL mismatch.
|
|
259
|
-
- It is a semantic upgrade beyond DDL.
|
|
260
|
-
|
|
261
|
-
### Some physical columns are intentionally represented as `computed` fields
|
|
262
|
-
- `frmsLead.leadId`
|
|
263
|
-
- physically stored in `lead_id`
|
|
264
|
-
- metadata marks it as `computed`
|
|
265
|
-
- value provider: `AlphaNumExternalIdComputationProvider`
|
|
266
|
-
- This is another example of behavior that DDL cannot infer on its own.
|
|
267
|
-
|
|
268
|
-
### Implication
|
|
269
|
-
- The first version of datasource introspection should aim to produce safe, physical metadata.
|
|
270
|
-
- Semantic enrichment such as:
|
|
271
|
-
- computed IDs
|
|
272
|
-
- relation promotion
|
|
273
|
-
- media field promotion
|
|
274
|
-
- special selection fields
|
|
275
|
-
should be a second-stage review/edit step, not an implicit guess from raw DDL.
|
|
276
|
-
|
|
277
|
-
## Additional Metadata Hygiene Findings
|
|
278
|
-
- `dataSource` casing is inconsistent in at least one place:
|
|
279
|
-
- `Applications` vs `applications`
|
|
280
|
-
- There are malformed metadata entries such as:
|
|
281
|
-
- `columnName: "shortText"` for `meAcnoHb`
|
|
282
|
-
- These existing inconsistencies reinforce the idea that introspection should write normalized metadata rather than imitating every historical quirk.
|
|
283
|
-
|
|
284
|
-
## What This Means For The Introspection Design
|
|
285
|
-
|
|
286
|
-
### 1. Legacy strategy should be derived from the table, not copied from old metadata
|
|
287
|
-
- Detect:
|
|
288
|
-
- no `ss_*` -> `none`
|
|
289
|
-
- `ss_*` without `ss_id` -> `existing_id`
|
|
290
|
-
- `ss_*` with `ss_id` -> `generated_id`
|
|
291
|
-
|
|
292
|
-
### 2. Model generation should happen in two stages
|
|
293
|
-
- Stage 1: physical mapping
|
|
294
|
-
- tables
|
|
295
|
-
- columns
|
|
296
|
-
- DDL types
|
|
297
|
-
- nullability
|
|
298
|
-
- PK / unique / indexes
|
|
299
|
-
- Stage 2: semantic enrichment
|
|
300
|
-
- relation promotion
|
|
301
|
-
- computed field upgrades
|
|
302
|
-
- media field decisions
|
|
303
|
-
- user-key selection
|
|
304
|
-
- required-flag relaxation
|
|
305
|
-
|
|
306
|
-
### 3. Session-level settings are justified
|
|
307
|
-
- Based on the DDL-vs-metadata drift, the frontend should carry per-session settings for:
|
|
308
|
-
- strict vs relaxed `required` derivation
|
|
309
|
-
- whether to try relation inference
|
|
310
|
-
- whether to preserve numeric as `decimal`
|
|
311
|
-
- how to treat blob/image columns
|
|
312
|
-
- how to choose user key vs generated legacy id
|
|
313
|
-
|
|
314
|
-
### 4. Metadata normalization utility will be useful
|
|
315
|
-
- The feature will likely benefit from a small normalization pass that can:
|
|
316
|
-
- stamp missing `legacyTableType`
|
|
317
|
-
- fix obvious malformed `columnName` values
|
|
318
|
-
- standardize datasource casing
|
|
319
|
-
|
|
320
|
-
## Recommended Next Step
|
|
321
|
-
- We now have enough evidence to proceed with the backend design using:
|
|
322
|
-
- DDL-driven legacy strategy detection
|
|
323
|
-
- a provider interface per database engine
|
|
324
|
-
- a two-stage mapping pipeline
|
|
325
|
-
- Before writing the first implementation, the next design choice to lock down is:
|
|
326
|
-
- how conservative the first auto-mapped metadata output should be for `required`, `relation`, and `computed` fields
|