@open-mercato/core 0.6.1-develop.3287.1.450f4ffb56 → 0.6.1-develop.3306.1.9ad9ff2526

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 (122) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/AGENTS.md +14 -0
  3. package/dist/modules/auth/backend/roles/[id]/edit/page.js +2 -1
  4. package/dist/modules/auth/backend/roles/[id]/edit/page.js.map +2 -2
  5. package/dist/modules/auth/backend/users/[id]/edit/page.js +2 -5
  6. package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
  7. package/dist/modules/catalog/ai-agents.js +47 -5
  8. package/dist/modules/catalog/ai-agents.js.map +2 -2
  9. package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js +2 -5
  10. package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js.map +2 -2
  11. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +4 -3
  12. package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
  13. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -9
  14. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  15. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +2 -9
  16. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
  17. package/dist/modules/customers/ai-agents.js +174 -1
  18. package/dist/modules/customers/ai-agents.js.map +2 -2
  19. package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +196 -0
  20. package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +7 -0
  21. package/dist/modules/customers/ai-tools.js +3 -1
  22. package/dist/modules/customers/ai-tools.js.map +2 -2
  23. package/dist/modules/customers/backend/customers/companies/page.js +11 -1
  24. package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
  25. package/dist/modules/customers/backend/customers/deals/page.js +11 -1
  26. package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
  27. package/dist/modules/customers/backend/customers/people/page.js +11 -1
  28. package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
  29. package/dist/modules/customers/commands/companies.js +37 -15
  30. package/dist/modules/customers/commands/companies.js.map +2 -2
  31. package/dist/modules/customers/components/detail/AiActionChips.js +2 -2
  32. package/dist/modules/customers/components/detail/AiActionChips.js.map +2 -2
  33. package/dist/modules/customers/components/detail/ChangelogTab.js +3 -9
  34. package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
  35. package/dist/modules/customers/components/detail/changelogValues.js +35 -0
  36. package/dist/modules/customers/components/detail/changelogValues.js.map +7 -0
  37. package/dist/modules/customers/components/detail/customFieldUtils.js +1 -1
  38. package/dist/modules/customers/components/detail/customFieldUtils.js.map +1 -1
  39. package/dist/modules/customers/components/formConfig.js +3 -2
  40. package/dist/modules/customers/components/formConfig.js.map +2 -2
  41. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +4 -9
  42. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
  43. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js +302 -0
  44. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js.map +7 -0
  45. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js +17 -0
  46. package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js.map +7 -0
  47. package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js +2 -2
  48. package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js.map +2 -2
  49. package/dist/modules/customers/widgets/injection-table.js +2 -2
  50. package/dist/modules/customers/widgets/injection-table.js.map +2 -2
  51. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js +2 -5
  52. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js.map +2 -2
  53. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js +2 -5
  54. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js.map +2 -2
  55. package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -5
  56. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
  57. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +2 -25
  58. package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
  59. package/dist/modules/sales/components/channels/ChannelOfferForm.js +2 -43
  60. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
  61. package/dist/modules/sales/components/documents/LineItemDialog.js +162 -42
  62. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  63. package/dist/modules/sales/components/documents/customFieldHelpers.js +4 -31
  64. package/dist/modules/sales/components/documents/customFieldHelpers.js.map +2 -2
  65. package/package.json +15 -6
  66. package/src/modules/auth/backend/roles/[id]/edit/page.tsx +2 -1
  67. package/src/modules/auth/backend/users/[id]/edit/page.tsx +2 -5
  68. package/src/modules/business_rules/migrations/.snapshot-open-mercato.json +746 -394
  69. package/src/modules/catalog/ai-agents.ts +62 -4
  70. package/src/modules/catalog/backend/catalog/categories/[id]/edit/page.tsx +2 -5
  71. package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -3
  72. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -12
  73. package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +2 -10
  74. package/src/modules/catalog/migrations/.snapshot-open-mercato.json +2519 -1307
  75. package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +828 -834
  76. package/src/modules/customers/AGENTS.md +6 -1
  77. package/src/modules/customers/ai-agents.ts +213 -6
  78. package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +286 -0
  79. package/src/modules/customers/ai-tools.ts +2 -0
  80. package/src/modules/customers/backend/customers/companies/page.tsx +10 -0
  81. package/src/modules/customers/backend/customers/deals/page.tsx +10 -0
  82. package/src/modules/customers/backend/customers/people/page.tsx +10 -0
  83. package/src/modules/customers/commands/companies.ts +38 -14
  84. package/src/modules/customers/components/detail/AiActionChips.tsx +2 -2
  85. package/src/modules/customers/components/detail/ChangelogTab.tsx +3 -10
  86. package/src/modules/customers/components/detail/changelogValues.ts +42 -0
  87. package/src/modules/customers/components/detail/customFieldUtils.ts +1 -1
  88. package/src/modules/customers/components/formConfig.tsx +3 -2
  89. package/src/modules/customers/i18n/de.json +7 -0
  90. package/src/modules/customers/i18n/en.json +7 -0
  91. package/src/modules/customers/i18n/es.json +7 -0
  92. package/src/modules/customers/i18n/pl.json +7 -0
  93. package/src/modules/customers/migrations/.snapshot-open-mercato.json +2313 -2336
  94. package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +4 -6
  95. package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.tsx +358 -0
  96. package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.ts +34 -0
  97. package/src/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.tsx +2 -2
  98. package/src/modules/customers/widgets/injection-table.ts +12 -9
  99. package/src/modules/data_sync/migrations/.snapshot-open-mercato.json +554 -210
  100. package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +146 -146
  101. package/src/modules/directory/backend/directory/organizations/[id]/edit/page.tsx +2 -5
  102. package/src/modules/directory/backend/directory/tenants/[id]/edit/page.tsx +2 -5
  103. package/src/modules/directory/migrations/.snapshot-open-mercato.json +273 -140
  104. package/src/modules/feature_toggles/migrations/.snapshot-open-mercato.json +242 -137
  105. package/src/modules/integrations/migrations/.snapshot-open-mercato.json +498 -195
  106. package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +158 -157
  107. package/src/modules/perspectives/migrations/.snapshot-open-mercato.json +274 -129
  108. package/src/modules/planner/migrations/.snapshot-open-mercato.json +327 -157
  109. package/src/modules/progress/AGENTS.md +72 -0
  110. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +2 -5
  111. package/src/modules/resources/migrations/.snapshot-open-mercato.json +920 -470
  112. package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +2 -27
  113. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +2 -49
  114. package/src/modules/sales/components/documents/LineItemDialog.tsx +214 -78
  115. package/src/modules/sales/components/documents/customFieldHelpers.ts +4 -43
  116. package/src/modules/sales/i18n/de.json +3 -0
  117. package/src/modules/sales/i18n/en.json +3 -0
  118. package/src/modules/sales/i18n/es.json +3 -0
  119. package/src/modules/sales/i18n/pl.json +3 -0
  120. package/src/modules/sales/migrations/.snapshot-open-mercato.json +4740 -4778
  121. package/src/modules/shipping_carriers/migrations/.snapshot-open-mercato.json +340 -81
  122. package/src/modules/staff/migrations/.snapshot-open-mercato.json +1439 -729
@@ -1,66 +1,52 @@
1
1
  {
2
+ "name": "public",
2
3
  "namespaces": [
3
4
  "public"
4
5
  ],
5
- "name": "public",
6
6
  "tables": [
7
7
  {
8
+ "name": "dictionaries",
9
+ "schema": "public",
8
10
  "columns": {
9
- "id": {
10
- "name": "id",
11
- "type": "uuid",
12
- "unsigned": false,
13
- "autoincrement": false,
14
- "primary": true,
15
- "nullable": false,
16
- "unique": false,
17
- "length": null,
18
- "precision": null,
19
- "scale": null,
20
- "default": "gen_random_uuid()",
21
- "comment": null,
22
- "enumItems": [],
23
- "mappedType": "uuid"
24
- },
25
- "organization_id": {
26
- "name": "organization_id",
27
- "type": "uuid",
11
+ "created_at": {
12
+ "name": "created_at",
13
+ "type": "timestamptz(6)",
28
14
  "unsigned": false,
29
15
  "autoincrement": false,
30
16
  "primary": false,
31
17
  "nullable": false,
32
18
  "unique": false,
33
- "length": null,
19
+ "length": 6,
34
20
  "precision": null,
35
21
  "scale": null,
36
22
  "default": null,
37
23
  "comment": null,
38
24
  "enumItems": [],
39
- "mappedType": "uuid"
25
+ "mappedType": "datetime"
40
26
  },
41
- "tenant_id": {
42
- "name": "tenant_id",
43
- "type": "uuid",
27
+ "deleted_at": {
28
+ "name": "deleted_at",
29
+ "type": "timestamptz(6)",
44
30
  "unsigned": false,
45
31
  "autoincrement": false,
46
32
  "primary": false,
47
- "nullable": false,
33
+ "nullable": true,
48
34
  "unique": false,
49
- "length": null,
35
+ "length": 6,
50
36
  "precision": null,
51
37
  "scale": null,
52
38
  "default": null,
53
39
  "comment": null,
54
40
  "enumItems": [],
55
- "mappedType": "uuid"
41
+ "mappedType": "datetime"
56
42
  },
57
- "key": {
58
- "name": "key",
43
+ "description": {
44
+ "name": "description",
59
45
  "type": "text",
60
46
  "unsigned": false,
61
47
  "autoincrement": false,
62
48
  "primary": false,
63
- "nullable": false,
49
+ "nullable": true,
64
50
  "unique": false,
65
51
  "length": null,
66
52
  "precision": null,
@@ -70,37 +56,37 @@
70
56
  "enumItems": [],
71
57
  "mappedType": "text"
72
58
  },
73
- "name": {
74
- "name": "name",
75
- "type": "text",
59
+ "id": {
60
+ "name": "id",
61
+ "type": "uuid",
76
62
  "unsigned": false,
77
63
  "autoincrement": false,
78
- "primary": false,
64
+ "primary": true,
79
65
  "nullable": false,
80
66
  "unique": false,
81
67
  "length": null,
82
68
  "precision": null,
83
69
  "scale": null,
84
- "default": null,
70
+ "default": "gen_random_uuid()",
85
71
  "comment": null,
86
72
  "enumItems": [],
87
- "mappedType": "text"
73
+ "mappedType": "uuid"
88
74
  },
89
- "description": {
90
- "name": "description",
91
- "type": "text",
75
+ "is_active": {
76
+ "name": "is_active",
77
+ "type": "boolean",
92
78
  "unsigned": false,
93
79
  "autoincrement": false,
94
80
  "primary": false,
95
- "nullable": true,
81
+ "nullable": false,
96
82
  "unique": false,
97
83
  "length": null,
98
84
  "precision": null,
99
85
  "scale": null,
100
- "default": null,
86
+ "default": "true",
101
87
  "comment": null,
102
88
  "enumItems": [],
103
- "mappedType": "text"
89
+ "mappedType": "boolean"
104
90
  },
105
91
  "is_system": {
106
92
  "name": "is_system",
@@ -118,9 +104,9 @@
118
104
  "enumItems": [],
119
105
  "mappedType": "boolean"
120
106
  },
121
- "is_active": {
122
- "name": "is_active",
123
- "type": "boolean",
107
+ "key": {
108
+ "name": "key",
109
+ "type": "text",
124
110
  "unsigned": false,
125
111
  "autoincrement": false,
126
112
  "primary": false,
@@ -129,10 +115,10 @@
129
115
  "length": null,
130
116
  "precision": null,
131
117
  "scale": null,
132
- "default": "true",
118
+ "default": null,
133
119
  "comment": null,
134
120
  "enumItems": [],
135
- "mappedType": "boolean"
121
+ "mappedType": "text"
136
122
  },
137
123
  "manager_visibility": {
138
124
  "name": "manager_visibility",
@@ -150,45 +136,61 @@
150
136
  "enumItems": [],
151
137
  "mappedType": "text"
152
138
  },
153
- "created_at": {
154
- "name": "created_at",
155
- "type": "timestamptz",
139
+ "name": {
140
+ "name": "name",
141
+ "type": "text",
156
142
  "unsigned": false,
157
143
  "autoincrement": false,
158
144
  "primary": false,
159
145
  "nullable": false,
160
146
  "unique": false,
161
- "length": 6,
147
+ "length": null,
162
148
  "precision": null,
163
149
  "scale": null,
164
150
  "default": null,
165
151
  "comment": null,
166
152
  "enumItems": [],
167
- "mappedType": "datetime"
153
+ "mappedType": "text"
168
154
  },
169
- "updated_at": {
170
- "name": "updated_at",
171
- "type": "timestamptz",
155
+ "organization_id": {
156
+ "name": "organization_id",
157
+ "type": "uuid",
158
+ "unsigned": false,
159
+ "autoincrement": false,
160
+ "primary": false,
161
+ "nullable": false,
162
+ "unique": true,
163
+ "length": null,
164
+ "precision": null,
165
+ "scale": null,
166
+ "default": null,
167
+ "comment": null,
168
+ "enumItems": [],
169
+ "mappedType": "uuid"
170
+ },
171
+ "tenant_id": {
172
+ "name": "tenant_id",
173
+ "type": "uuid",
172
174
  "unsigned": false,
173
175
  "autoincrement": false,
174
176
  "primary": false,
175
177
  "nullable": false,
176
178
  "unique": false,
177
- "length": 6,
179
+ "length": null,
178
180
  "precision": null,
179
181
  "scale": null,
180
182
  "default": null,
181
183
  "comment": null,
182
184
  "enumItems": [],
183
- "mappedType": "datetime"
185
+ "mappedType": "uuid"
184
186
  },
185
- "deleted_at": {
186
- "name": "deleted_at",
187
- "type": "timestamptz",
187
+ "updated_at": {
188
+ "name": "updated_at",
189
+ "type": "timestamptz(6)",
188
190
  "unsigned": false,
189
191
  "autoincrement": false,
190
192
  "primary": false,
191
- "nullable": true,
193
+ "nullable": false,
192
194
  "unique": false,
193
195
  "length": 6,
194
196
  "precision": null,
@@ -199,78 +201,78 @@
199
201
  "mappedType": "datetime"
200
202
  }
201
203
  },
202
- "name": "dictionaries",
203
- "schema": "public",
204
204
  "indexes": [
205
205
  {
206
- "keyName": "dictionaries_scope_key_unique",
207
206
  "columnNames": [
208
- "organization_id",
209
- "tenant_id",
210
- "key"
207
+ "id"
211
208
  ],
212
- "composite": true,
209
+ "composite": false,
213
210
  "constraint": true,
214
- "primary": false,
211
+ "keyName": "dictionaries_pkey",
212
+ "primary": true,
215
213
  "unique": true
216
214
  },
217
215
  {
218
- "keyName": "dictionaries_pkey",
219
216
  "columnNames": [
220
- "id"
217
+ "organization_id",
218
+ "tenant_id",
219
+ "key"
221
220
  ],
222
- "composite": false,
221
+ "composite": true,
223
222
  "constraint": true,
224
- "primary": true,
223
+ "keyName": "dictionaries_scope_key_unique",
224
+ "primary": false,
225
225
  "unique": true
226
226
  }
227
227
  ],
228
228
  "checks": [],
229
229
  "foreignKeys": {},
230
- "nativeEnums": {}
230
+ "comment": null
231
231
  },
232
232
  {
233
+ "name": "dictionary_entries",
234
+ "schema": "public",
233
235
  "columns": {
234
- "id": {
235
- "name": "id",
236
- "type": "uuid",
236
+ "color": {
237
+ "name": "color",
238
+ "type": "text",
237
239
  "unsigned": false,
238
240
  "autoincrement": false,
239
- "primary": true,
240
- "nullable": false,
241
+ "primary": false,
242
+ "nullable": true,
241
243
  "unique": false,
242
244
  "length": null,
243
245
  "precision": null,
244
246
  "scale": null,
245
- "default": "gen_random_uuid()",
247
+ "default": null,
246
248
  "comment": null,
247
249
  "enumItems": [],
248
- "mappedType": "uuid"
250
+ "mappedType": "text"
249
251
  },
250
- "dictionary_id": {
251
- "name": "dictionary_id",
252
- "type": "uuid",
252
+ "created_at": {
253
+ "name": "created_at",
254
+ "type": "timestamptz(6)",
253
255
  "unsigned": false,
254
256
  "autoincrement": false,
255
257
  "primary": false,
256
258
  "nullable": false,
257
259
  "unique": false,
258
- "length": null,
260
+ "length": 6,
259
261
  "precision": null,
260
262
  "scale": null,
261
263
  "default": null,
262
264
  "comment": null,
263
265
  "enumItems": [],
264
- "mappedType": "uuid"
266
+ "mappedType": "datetime"
265
267
  },
266
- "organization_id": {
267
- "name": "organization_id",
268
+ "dictionary_id": {
269
+ "name": "dictionary_id",
268
270
  "type": "uuid",
269
271
  "unsigned": false,
270
272
  "autoincrement": false,
271
273
  "primary": false,
272
274
  "nullable": false,
273
- "unique": false,
275
+ "unique": true,
274
276
  "length": null,
275
277
  "precision": null,
276
278
  "scale": null,
@@ -279,13 +281,13 @@
279
281
  "enumItems": [],
280
282
  "mappedType": "uuid"
281
283
  },
282
- "tenant_id": {
283
- "name": "tenant_id",
284
- "type": "uuid",
284
+ "icon": {
285
+ "name": "icon",
286
+ "type": "text",
285
287
  "unsigned": false,
286
288
  "autoincrement": false,
287
289
  "primary": false,
288
- "nullable": false,
290
+ "nullable": true,
289
291
  "unique": false,
290
292
  "length": null,
291
293
  "precision": null,
@@ -293,27 +295,27 @@
293
295
  "default": null,
294
296
  "comment": null,
295
297
  "enumItems": [],
296
- "mappedType": "uuid"
298
+ "mappedType": "text"
297
299
  },
298
- "value": {
299
- "name": "value",
300
- "type": "text",
300
+ "id": {
301
+ "name": "id",
302
+ "type": "uuid",
301
303
  "unsigned": false,
302
304
  "autoincrement": false,
303
- "primary": false,
305
+ "primary": true,
304
306
  "nullable": false,
305
307
  "unique": false,
306
308
  "length": null,
307
309
  "precision": null,
308
310
  "scale": null,
309
- "default": null,
311
+ "default": "gen_random_uuid()",
310
312
  "comment": null,
311
313
  "enumItems": [],
312
- "mappedType": "text"
314
+ "mappedType": "uuid"
313
315
  },
314
- "normalized_value": {
315
- "name": "normalized_value",
316
- "type": "text",
316
+ "is_default": {
317
+ "name": "is_default",
318
+ "type": "boolean",
317
319
  "unsigned": false,
318
320
  "autoincrement": false,
319
321
  "primary": false,
@@ -322,10 +324,10 @@
322
324
  "length": null,
323
325
  "precision": null,
324
326
  "scale": null,
325
- "default": null,
327
+ "default": "false",
326
328
  "comment": null,
327
329
  "enumItems": [],
328
- "mappedType": "text"
330
+ "mappedType": "boolean"
329
331
  },
330
332
  "label": {
331
333
  "name": "label",
@@ -343,13 +345,13 @@
343
345
  "enumItems": [],
344
346
  "mappedType": "text"
345
347
  },
346
- "color": {
347
- "name": "color",
348
+ "normalized_value": {
349
+ "name": "normalized_value",
348
350
  "type": "text",
349
351
  "unsigned": false,
350
352
  "autoincrement": false,
351
353
  "primary": false,
352
- "nullable": true,
354
+ "nullable": false,
353
355
  "unique": false,
354
356
  "length": null,
355
357
  "precision": null,
@@ -359,13 +361,13 @@
359
361
  "enumItems": [],
360
362
  "mappedType": "text"
361
363
  },
362
- "icon": {
363
- "name": "icon",
364
- "type": "text",
364
+ "organization_id": {
365
+ "name": "organization_id",
366
+ "type": "uuid",
365
367
  "unsigned": false,
366
368
  "autoincrement": false,
367
369
  "primary": false,
368
- "nullable": true,
370
+ "nullable": false,
369
371
  "unique": false,
370
372
  "length": null,
371
373
  "precision": null,
@@ -373,7 +375,7 @@
373
375
  "default": null,
374
376
  "comment": null,
375
377
  "enumItems": [],
376
- "mappedType": "text"
378
+ "mappedType": "uuid"
377
379
  },
378
380
  "position": {
379
381
  "name": "position",
@@ -391,9 +393,9 @@
391
393
  "enumItems": [],
392
394
  "mappedType": "integer"
393
395
  },
394
- "is_default": {
395
- "name": "is_default",
396
- "type": "boolean",
396
+ "tenant_id": {
397
+ "name": "tenant_id",
398
+ "type": "uuid",
397
399
  "unsigned": false,
398
400
  "autoincrement": false,
399
401
  "primary": false,
@@ -402,14 +404,14 @@
402
404
  "length": null,
403
405
  "precision": null,
404
406
  "scale": null,
405
- "default": "false",
407
+ "default": null,
406
408
  "comment": null,
407
409
  "enumItems": [],
408
- "mappedType": "boolean"
410
+ "mappedType": "uuid"
409
411
  },
410
- "created_at": {
411
- "name": "created_at",
412
- "type": "timestamptz",
412
+ "updated_at": {
413
+ "name": "updated_at",
414
+ "type": "timestamptz(6)",
413
415
  "unsigned": false,
414
416
  "autoincrement": false,
415
417
  "primary": false,
@@ -423,28 +425,35 @@
423
425
  "enumItems": [],
424
426
  "mappedType": "datetime"
425
427
  },
426
- "updated_at": {
427
- "name": "updated_at",
428
- "type": "timestamptz",
428
+ "value": {
429
+ "name": "value",
430
+ "type": "text",
429
431
  "unsigned": false,
430
432
  "autoincrement": false,
431
433
  "primary": false,
432
434
  "nullable": false,
433
435
  "unique": false,
434
- "length": 6,
436
+ "length": null,
435
437
  "precision": null,
436
438
  "scale": null,
437
439
  "default": null,
438
440
  "comment": null,
439
441
  "enumItems": [],
440
- "mappedType": "datetime"
442
+ "mappedType": "text"
441
443
  }
442
444
  },
443
- "name": "dictionary_entries",
444
- "schema": "public",
445
445
  "indexes": [
446
446
  {
447
- "keyName": "dictionary_entries_scope_idx",
447
+ "columnNames": [
448
+ "id"
449
+ ],
450
+ "composite": false,
451
+ "constraint": true,
452
+ "keyName": "dictionary_entries_pkey",
453
+ "primary": true,
454
+ "unique": true
455
+ },
456
+ {
448
457
  "columnNames": [
449
458
  "dictionary_id",
450
459
  "organization_id",
@@ -452,11 +461,11 @@
452
461
  ],
453
462
  "composite": true,
454
463
  "constraint": false,
464
+ "keyName": "dictionary_entries_scope_idx",
455
465
  "primary": false,
456
466
  "unique": false
457
467
  },
458
468
  {
459
- "keyName": "dictionary_entries_unique",
460
469
  "columnNames": [
461
470
  "dictionary_id",
462
471
  "organization_id",
@@ -465,37 +474,28 @@
465
474
  ],
466
475
  "composite": true,
467
476
  "constraint": true,
477
+ "keyName": "dictionary_entries_unique",
468
478
  "primary": false,
469
479
  "unique": true
470
- },
471
- {
472
- "keyName": "dictionary_entries_pkey",
473
- "columnNames": [
474
- "id"
475
- ],
476
- "composite": false,
477
- "constraint": true,
478
- "primary": true,
479
- "unique": true
480
480
  }
481
481
  ],
482
482
  "checks": [],
483
483
  "foreignKeys": {
484
484
  "dictionary_entries_dictionary_id_foreign": {
485
- "constraintName": "dictionary_entries_dictionary_id_foreign",
486
485
  "columnNames": [
487
486
  "dictionary_id"
488
487
  ],
488
+ "constraintName": "dictionary_entries_dictionary_id_foreign",
489
489
  "localTableName": "public.dictionary_entries",
490
490
  "referencedColumnNames": [
491
491
  "id"
492
492
  ],
493
- "referencedTableName": "public.dictionaries",
494
- "updateRule": "cascade"
493
+ "referencedTableName": "public.dictionaries"
495
494
  }
496
495
  },
497
- "nativeEnums": {}
496
+ "comment": null
498
497
  }
499
498
  ],
499
+ "views": [],
500
500
  "nativeEnums": {}
501
- }
501
+ }
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  import * as React from 'react'
3
3
  import { useT } from '@open-mercato/shared/lib/i18n/context'
4
+ import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
4
5
  import { E } from '#generated/entities.ids.generated'
5
6
  import { OrganizationSelect } from '@open-mercato/core/modules/directory/components/OrganizationSelect'
6
7
  import { TenantSelect } from '@open-mercato/core/modules/directory/components/TenantSelect'
@@ -124,11 +125,7 @@ export default function EditOrganizationPage({ params }: { params?: { id?: strin
124
125
  setChildSummary(childrenDetails)
125
126
  setOriginalChildIds(Array.isArray(record.childIds) ? record.childIds : [])
126
127
 
127
- const customValues: Record<string, unknown> = {}
128
- for (const [key, value] of Object.entries(record as Record<string, unknown>)) {
129
- if (key.startsWith('cf_')) customValues[key] = value
130
- else if (key.startsWith('cf:')) customValues[`cf_${key.slice(3)}`] = value
131
- }
128
+ const customValues = extractCustomFieldEntries(record as Record<string, unknown>)
132
129
  setInitialValues({
133
130
  id: record.id,
134
131
  name: record.name,
@@ -8,6 +8,7 @@ import { updateCrud } from '@open-mercato/ui/backend/utils/crud'
8
8
  import { raiseCrudError } from '@open-mercato/ui/backend/utils/serverErrors'
9
9
  import { readApiResultOrThrow, apiCall } from '@open-mercato/ui/backend/utils/apiCall'
10
10
  import { useT } from '@open-mercato/shared/lib/i18n/context'
11
+ import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
11
12
 
12
13
  type TenantFormValues = {
13
14
  id: string
@@ -45,11 +46,7 @@ export default function EditTenantPage({ params }: { params?: { id?: string } })
45
46
  const rows = Array.isArray(data?.items) ? data.items : []
46
47
  const row = rows[0]
47
48
  if (!row) throw new Error(t('directory.tenants.form.errors.notFound', 'Tenant not found'))
48
- const cfValues: Record<string, unknown> = {}
49
- for (const [key, value] of Object.entries(row as Record<string, unknown>)) {
50
- if (key.startsWith('cf_')) cfValues[key] = value
51
- else if (key.startsWith('cf:')) cfValues[`cf_${key.slice(3)}`] = value
52
- }
49
+ const cfValues = extractCustomFieldEntries(row as Record<string, unknown>)
53
50
  const values: TenantFormValues = {
54
51
  id: String(row.id),
55
52
  name: String(row.name),