@open-mercato/core 0.6.1-develop.3291.1.6fad645fd0 → 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.
- package/.turbo/turbo-build.log +1 -1
- package/AGENTS.md +14 -0
- package/dist/modules/auth/backend/roles/[id]/edit/page.js +2 -1
- package/dist/modules/auth/backend/roles/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js +2 -5
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/catalog/ai-agents.js +47 -5
- package/dist/modules/catalog/ai-agents.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js +2 -5
- package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +4 -3
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -9
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +2 -9
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/customers/ai-agents.js +174 -1
- package/dist/modules/customers/ai-agents.js.map +2 -2
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +196 -0
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +7 -0
- package/dist/modules/customers/ai-tools.js +3 -1
- package/dist/modules/customers/ai-tools.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +11 -1
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +11 -1
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +11 -1
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +37 -15
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/components/detail/AiActionChips.js +2 -2
- package/dist/modules/customers/components/detail/AiActionChips.js.map +2 -2
- package/dist/modules/customers/components/detail/ChangelogTab.js +3 -9
- package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
- package/dist/modules/customers/components/detail/changelogValues.js +35 -0
- package/dist/modules/customers/components/detail/changelogValues.js.map +7 -0
- package/dist/modules/customers/components/detail/customFieldUtils.js +1 -1
- package/dist/modules/customers/components/detail/customFieldUtils.js.map +1 -1
- package/dist/modules/customers/components/formConfig.js +3 -2
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +4 -9
- package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js +302 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js.map +7 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js +17 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js.map +7 -0
- package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js +2 -2
- package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/injection-table.js +2 -2
- package/dist/modules/customers/widgets/injection-table.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js +2 -5
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js +2 -5
- package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -5
- package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +2 -25
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +2 -43
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +162 -42
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/customFieldHelpers.js +4 -31
- package/dist/modules/sales/components/documents/customFieldHelpers.js.map +2 -2
- package/package.json +15 -6
- package/src/modules/auth/backend/roles/[id]/edit/page.tsx +2 -1
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +2 -5
- package/src/modules/business_rules/migrations/.snapshot-open-mercato.json +746 -394
- package/src/modules/catalog/ai-agents.ts +62 -4
- package/src/modules/catalog/backend/catalog/categories/[id]/edit/page.tsx +2 -5
- package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -3
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -12
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +2 -10
- package/src/modules/catalog/migrations/.snapshot-open-mercato.json +2519 -1307
- package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +828 -834
- package/src/modules/customers/AGENTS.md +6 -1
- package/src/modules/customers/ai-agents.ts +213 -6
- package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +286 -0
- package/src/modules/customers/ai-tools.ts +2 -0
- package/src/modules/customers/backend/customers/companies/page.tsx +10 -0
- package/src/modules/customers/backend/customers/deals/page.tsx +10 -0
- package/src/modules/customers/backend/customers/people/page.tsx +10 -0
- package/src/modules/customers/commands/companies.ts +38 -14
- package/src/modules/customers/components/detail/AiActionChips.tsx +2 -2
- package/src/modules/customers/components/detail/ChangelogTab.tsx +3 -10
- package/src/modules/customers/components/detail/changelogValues.ts +42 -0
- package/src/modules/customers/components/detail/customFieldUtils.ts +1 -1
- package/src/modules/customers/components/formConfig.tsx +3 -2
- package/src/modules/customers/i18n/de.json +7 -0
- package/src/modules/customers/i18n/en.json +7 -0
- package/src/modules/customers/i18n/es.json +7 -0
- package/src/modules/customers/i18n/pl.json +7 -0
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +2313 -2336
- package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +4 -6
- package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.tsx +358 -0
- package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.ts +34 -0
- package/src/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.tsx +2 -2
- package/src/modules/customers/widgets/injection-table.ts +12 -9
- package/src/modules/data_sync/migrations/.snapshot-open-mercato.json +554 -210
- package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +146 -146
- package/src/modules/directory/backend/directory/organizations/[id]/edit/page.tsx +2 -5
- package/src/modules/directory/backend/directory/tenants/[id]/edit/page.tsx +2 -5
- package/src/modules/directory/migrations/.snapshot-open-mercato.json +273 -140
- package/src/modules/feature_toggles/migrations/.snapshot-open-mercato.json +242 -137
- package/src/modules/integrations/migrations/.snapshot-open-mercato.json +498 -195
- package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +158 -157
- package/src/modules/perspectives/migrations/.snapshot-open-mercato.json +274 -129
- package/src/modules/planner/migrations/.snapshot-open-mercato.json +327 -157
- package/src/modules/progress/AGENTS.md +72 -0
- package/src/modules/resources/backend/resources/resources/[id]/page.tsx +2 -5
- package/src/modules/resources/migrations/.snapshot-open-mercato.json +920 -470
- package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +2 -27
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +2 -49
- package/src/modules/sales/components/documents/LineItemDialog.tsx +214 -78
- package/src/modules/sales/components/documents/customFieldHelpers.ts +4 -43
- package/src/modules/sales/i18n/de.json +3 -0
- package/src/modules/sales/i18n/en.json +3 -0
- package/src/modules/sales/i18n/es.json +3 -0
- package/src/modules/sales/i18n/pl.json +3 -0
- package/src/modules/sales/migrations/.snapshot-open-mercato.json +4740 -4778
- package/src/modules/shipping_carriers/migrations/.snapshot-open-mercato.json +340 -81
- 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
|
-
"
|
|
10
|
-
"name": "
|
|
11
|
-
"type": "
|
|
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":
|
|
19
|
+
"length": 6,
|
|
34
20
|
"precision": null,
|
|
35
21
|
"scale": null,
|
|
36
22
|
"default": null,
|
|
37
23
|
"comment": null,
|
|
38
24
|
"enumItems": [],
|
|
39
|
-
"mappedType": "
|
|
25
|
+
"mappedType": "datetime"
|
|
40
26
|
},
|
|
41
|
-
"
|
|
42
|
-
"name": "
|
|
43
|
-
"type": "
|
|
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":
|
|
33
|
+
"nullable": true,
|
|
48
34
|
"unique": false,
|
|
49
|
-
"length":
|
|
35
|
+
"length": 6,
|
|
50
36
|
"precision": null,
|
|
51
37
|
"scale": null,
|
|
52
38
|
"default": null,
|
|
53
39
|
"comment": null,
|
|
54
40
|
"enumItems": [],
|
|
55
|
-
"mappedType": "
|
|
41
|
+
"mappedType": "datetime"
|
|
56
42
|
},
|
|
57
|
-
"
|
|
58
|
-
"name": "
|
|
43
|
+
"description": {
|
|
44
|
+
"name": "description",
|
|
59
45
|
"type": "text",
|
|
60
46
|
"unsigned": false,
|
|
61
47
|
"autoincrement": false,
|
|
62
48
|
"primary": false,
|
|
63
|
-
"nullable":
|
|
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
|
-
"
|
|
74
|
-
"name": "
|
|
75
|
-
"type": "
|
|
59
|
+
"id": {
|
|
60
|
+
"name": "id",
|
|
61
|
+
"type": "uuid",
|
|
76
62
|
"unsigned": false,
|
|
77
63
|
"autoincrement": false,
|
|
78
|
-
"primary":
|
|
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":
|
|
70
|
+
"default": "gen_random_uuid()",
|
|
85
71
|
"comment": null,
|
|
86
72
|
"enumItems": [],
|
|
87
|
-
"mappedType": "
|
|
73
|
+
"mappedType": "uuid"
|
|
88
74
|
},
|
|
89
|
-
"
|
|
90
|
-
"name": "
|
|
91
|
-
"type": "
|
|
75
|
+
"is_active": {
|
|
76
|
+
"name": "is_active",
|
|
77
|
+
"type": "boolean",
|
|
92
78
|
"unsigned": false,
|
|
93
79
|
"autoincrement": false,
|
|
94
80
|
"primary": false,
|
|
95
|
-
"nullable":
|
|
81
|
+
"nullable": false,
|
|
96
82
|
"unique": false,
|
|
97
83
|
"length": null,
|
|
98
84
|
"precision": null,
|
|
99
85
|
"scale": null,
|
|
100
|
-
"default":
|
|
86
|
+
"default": "true",
|
|
101
87
|
"comment": null,
|
|
102
88
|
"enumItems": [],
|
|
103
|
-
"mappedType": "
|
|
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
|
-
"
|
|
122
|
-
"name": "
|
|
123
|
-
"type": "
|
|
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":
|
|
118
|
+
"default": null,
|
|
133
119
|
"comment": null,
|
|
134
120
|
"enumItems": [],
|
|
135
|
-
"mappedType": "
|
|
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
|
-
"
|
|
154
|
-
"name": "
|
|
155
|
-
"type": "
|
|
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":
|
|
147
|
+
"length": null,
|
|
162
148
|
"precision": null,
|
|
163
149
|
"scale": null,
|
|
164
150
|
"default": null,
|
|
165
151
|
"comment": null,
|
|
166
152
|
"enumItems": [],
|
|
167
|
-
"mappedType": "
|
|
153
|
+
"mappedType": "text"
|
|
168
154
|
},
|
|
169
|
-
"
|
|
170
|
-
"name": "
|
|
171
|
-
"type": "
|
|
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":
|
|
179
|
+
"length": null,
|
|
178
180
|
"precision": null,
|
|
179
181
|
"scale": null,
|
|
180
182
|
"default": null,
|
|
181
183
|
"comment": null,
|
|
182
184
|
"enumItems": [],
|
|
183
|
-
"mappedType": "
|
|
185
|
+
"mappedType": "uuid"
|
|
184
186
|
},
|
|
185
|
-
"
|
|
186
|
-
"name": "
|
|
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":
|
|
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
|
-
"
|
|
209
|
-
"tenant_id",
|
|
210
|
-
"key"
|
|
207
|
+
"id"
|
|
211
208
|
],
|
|
212
|
-
"composite":
|
|
209
|
+
"composite": false,
|
|
213
210
|
"constraint": true,
|
|
214
|
-
"
|
|
211
|
+
"keyName": "dictionaries_pkey",
|
|
212
|
+
"primary": true,
|
|
215
213
|
"unique": true
|
|
216
214
|
},
|
|
217
215
|
{
|
|
218
|
-
"keyName": "dictionaries_pkey",
|
|
219
216
|
"columnNames": [
|
|
220
|
-
"
|
|
217
|
+
"organization_id",
|
|
218
|
+
"tenant_id",
|
|
219
|
+
"key"
|
|
221
220
|
],
|
|
222
|
-
"composite":
|
|
221
|
+
"composite": true,
|
|
223
222
|
"constraint": true,
|
|
224
|
-
"
|
|
223
|
+
"keyName": "dictionaries_scope_key_unique",
|
|
224
|
+
"primary": false,
|
|
225
225
|
"unique": true
|
|
226
226
|
}
|
|
227
227
|
],
|
|
228
228
|
"checks": [],
|
|
229
229
|
"foreignKeys": {},
|
|
230
|
-
"
|
|
230
|
+
"comment": null
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
|
+
"name": "dictionary_entries",
|
|
234
|
+
"schema": "public",
|
|
233
235
|
"columns": {
|
|
234
|
-
"
|
|
235
|
-
"name": "
|
|
236
|
-
"type": "
|
|
236
|
+
"color": {
|
|
237
|
+
"name": "color",
|
|
238
|
+
"type": "text",
|
|
237
239
|
"unsigned": false,
|
|
238
240
|
"autoincrement": false,
|
|
239
|
-
"primary":
|
|
240
|
-
"nullable":
|
|
241
|
+
"primary": false,
|
|
242
|
+
"nullable": true,
|
|
241
243
|
"unique": false,
|
|
242
244
|
"length": null,
|
|
243
245
|
"precision": null,
|
|
244
246
|
"scale": null,
|
|
245
|
-
"default":
|
|
247
|
+
"default": null,
|
|
246
248
|
"comment": null,
|
|
247
249
|
"enumItems": [],
|
|
248
|
-
"mappedType": "
|
|
250
|
+
"mappedType": "text"
|
|
249
251
|
},
|
|
250
|
-
"
|
|
251
|
-
"name": "
|
|
252
|
-
"type": "
|
|
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":
|
|
260
|
+
"length": 6,
|
|
259
261
|
"precision": null,
|
|
260
262
|
"scale": null,
|
|
261
263
|
"default": null,
|
|
262
264
|
"comment": null,
|
|
263
265
|
"enumItems": [],
|
|
264
|
-
"mappedType": "
|
|
266
|
+
"mappedType": "datetime"
|
|
265
267
|
},
|
|
266
|
-
"
|
|
267
|
-
"name": "
|
|
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":
|
|
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
|
-
"
|
|
283
|
-
"name": "
|
|
284
|
-
"type": "
|
|
284
|
+
"icon": {
|
|
285
|
+
"name": "icon",
|
|
286
|
+
"type": "text",
|
|
285
287
|
"unsigned": false,
|
|
286
288
|
"autoincrement": false,
|
|
287
289
|
"primary": false,
|
|
288
|
-
"nullable":
|
|
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": "
|
|
298
|
+
"mappedType": "text"
|
|
297
299
|
},
|
|
298
|
-
"
|
|
299
|
-
"name": "
|
|
300
|
-
"type": "
|
|
300
|
+
"id": {
|
|
301
|
+
"name": "id",
|
|
302
|
+
"type": "uuid",
|
|
301
303
|
"unsigned": false,
|
|
302
304
|
"autoincrement": false,
|
|
303
|
-
"primary":
|
|
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":
|
|
311
|
+
"default": "gen_random_uuid()",
|
|
310
312
|
"comment": null,
|
|
311
313
|
"enumItems": [],
|
|
312
|
-
"mappedType": "
|
|
314
|
+
"mappedType": "uuid"
|
|
313
315
|
},
|
|
314
|
-
"
|
|
315
|
-
"name": "
|
|
316
|
-
"type": "
|
|
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":
|
|
327
|
+
"default": "false",
|
|
326
328
|
"comment": null,
|
|
327
329
|
"enumItems": [],
|
|
328
|
-
"mappedType": "
|
|
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
|
-
"
|
|
347
|
-
"name": "
|
|
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":
|
|
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
|
-
"
|
|
363
|
-
"name": "
|
|
364
|
-
"type": "
|
|
364
|
+
"organization_id": {
|
|
365
|
+
"name": "organization_id",
|
|
366
|
+
"type": "uuid",
|
|
365
367
|
"unsigned": false,
|
|
366
368
|
"autoincrement": false,
|
|
367
369
|
"primary": false,
|
|
368
|
-
"nullable":
|
|
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": "
|
|
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
|
-
"
|
|
395
|
-
"name": "
|
|
396
|
-
"type": "
|
|
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":
|
|
407
|
+
"default": null,
|
|
406
408
|
"comment": null,
|
|
407
409
|
"enumItems": [],
|
|
408
|
-
"mappedType": "
|
|
410
|
+
"mappedType": "uuid"
|
|
409
411
|
},
|
|
410
|
-
"
|
|
411
|
-
"name": "
|
|
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
|
-
"
|
|
427
|
-
"name": "
|
|
428
|
-
"type": "
|
|
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":
|
|
436
|
+
"length": null,
|
|
435
437
|
"precision": null,
|
|
436
438
|
"scale": null,
|
|
437
439
|
"default": null,
|
|
438
440
|
"comment": null,
|
|
439
441
|
"enumItems": [],
|
|
440
|
-
"mappedType": "
|
|
442
|
+
"mappedType": "text"
|
|
441
443
|
}
|
|
442
444
|
},
|
|
443
|
-
"name": "dictionary_entries",
|
|
444
|
-
"schema": "public",
|
|
445
445
|
"indexes": [
|
|
446
446
|
{
|
|
447
|
-
"
|
|
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
|
-
"
|
|
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
|
|
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
|
|
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),
|