data-primals-engine 1.0.11 → 1.1.0
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/client/README.md +8 -0
- package/client/index.html +31 -0
- package/client/index.js +25 -0
- package/client/package-lock.json +11664 -0
- package/client/package.json +70 -0
- package/client/public/demo/26899917-d1ba-4df4-bb33-48d09a8778da.jpg +0 -0
- package/client/public/demo/4b9894c7-12cd-466d-8fd3-a2757b09ec96.jpg +0 -0
- package/client/public/demo/7ed369ac-a1a2-4b45-b0cd-4fd5bcf5a75a.jpg +0 -0
- package/client/public/doc/API.postman_collection.json +214 -0
- package/client/public/github.svg +1 -0
- package/client/public/profilCompany.jpg +0 -0
- package/client/public/profilDeveloper.jpg +0 -0
- package/client/public/profilEngineer.jpg +0 -0
- package/client/public/profilPersonal.jpg +0 -0
- package/client/public/profils .psd +0 -0
- package/client/public/react.svg +9 -0
- package/client/src/APIInfo.jsx +328 -0
- package/client/src/AddWidgetTypeModal.jsx +44 -0
- package/client/src/AddWidgetTypeModal.scss +87 -0
- package/client/src/App.css +42 -0
- package/client/src/App.jsx +586 -0
- package/client/src/App.scss +1466 -0
- package/client/src/AssistantChat.jsx +280 -0
- package/client/src/AssistantChat.scss +229 -0
- package/client/src/Button.jsx +12 -0
- package/client/src/Button.scss +197 -0
- package/client/src/CalculationBuilder.jsx +338 -0
- package/client/src/CalculationStepRow.jsx +199 -0
- package/client/src/CalendarConfigModal.jsx +49 -0
- package/client/src/ChartConfigModal.jsx +402 -0
- package/client/src/ConditionBuilder.jsx +622 -0
- package/client/src/ConditionBuilder.scss +672 -0
- package/client/src/ConditionBuilder2.jsx +757 -0
- package/client/src/ContentView.jsx +274 -0
- package/client/src/CronBuilder.jsx +126 -0
- package/client/src/CronBuilder.scss +128 -0
- package/client/src/CronPartBuilder.jsx +150 -0
- package/client/src/Dashboard.jsx +210 -0
- package/client/src/Dashboard.scss +445 -0
- package/client/src/DashboardChart.jsx +362 -0
- package/client/src/DashboardFlexViewItem.jsx +129 -0
- package/client/src/DashboardView.jsx +554 -0
- package/client/src/DataChart.jsx +349 -0
- package/client/src/DataEditor.jsx +556 -0
- package/client/src/DataLayout.jsx +709 -0
- package/client/src/DataTable.jsx +996 -0
- package/client/src/DataTable.scss +73 -0
- package/client/src/Dialog.jsx +90 -0
- package/client/src/Dialog.scss +117 -0
- package/client/src/DisplayFlexNodeRenderer.jsx +115 -0
- package/client/src/DocumentationPageLayout.jsx +93 -0
- package/client/src/DocumentationPageLayout.scss +262 -0
- package/client/src/Draggable.jsx +222 -0
- package/client/src/Draggable.scss +49 -0
- package/client/src/ExportDialog.jsx +172 -0
- package/client/src/Field.jsx +1558 -0
- package/client/src/FlexBuilder.jsx +269 -0
- package/client/src/FlexBuilder.scss +226 -0
- package/client/src/FlexBuilderControls.jsx +170 -0
- package/client/src/FlexBuilderModal.jsx +75 -0
- package/client/src/FlexBuilderModal.scss +109 -0
- package/client/src/FlexBuilderPreview.jsx +48 -0
- package/client/src/FlexBuilderUtils.js +84 -0
- package/client/src/FlexDataRenderer.jsx +170 -0
- package/client/src/FlexDataRenderer.scss +80 -0
- package/client/src/FlexNode.jsx +290 -0
- package/client/src/FlexTreeUtils.js +129 -0
- package/client/src/HiddenableCell.jsx +46 -0
- package/client/src/HiddenableCell.scss +36 -0
- package/client/src/KPIDialog.jsx +39 -0
- package/client/src/KPIWidget.jsx +139 -0
- package/client/src/KanbanCard.jsx +92 -0
- package/client/src/KanbanColumn.jsx +29 -0
- package/client/src/KanbanConfigModal.jsx +115 -0
- package/client/src/KanbanView.jsx +113 -0
- package/client/src/KanbanView.scss +107 -0
- package/client/src/MessageRotator.jsx +77 -0
- package/client/src/MessageRotator.scss +14 -0
- package/client/src/ModelCreator.jsx +640 -0
- package/client/src/ModelCreator.scss +154 -0
- package/client/src/ModelCreatorField.jsx +810 -0
- package/client/src/ModelImporter.jsx +120 -0
- package/client/src/ModelList.jsx +205 -0
- package/client/src/Notification.jsx +137 -0
- package/client/src/Notification.scss +126 -0
- package/client/src/NotificationProvider.jsx +73 -0
- package/client/src/PackGallery.jsx +211 -0
- package/client/src/PackGallery.scss +156 -0
- package/client/src/Pagination.jsx +141 -0
- package/client/src/RTE.jsx +415 -0
- package/client/src/RTETrans.jsx +103 -0
- package/client/src/RelationField.jsx +247 -0
- package/client/src/RelationValue.jsx +230 -0
- package/client/src/RestoreConfirmationModal.jsx +183 -0
- package/client/src/RestoreDialog.jsx +134 -0
- package/client/src/RestoreDialog.scss +67 -0
- package/client/src/RichTextEditorModal.jsx +34 -0
- package/client/src/RichTextEditorModal.scss +54 -0
- package/client/src/TourSpotlight.jsx +234 -0
- package/client/src/TourSpotlight.scss +100 -0
- package/client/src/TutorialsMenu.jsx +83 -0
- package/client/src/TutorialsMenu.scss +217 -0
- package/client/src/TutorialsRewardModal.jsx +65 -0
- package/client/src/Utils.jsx +78 -0
- package/client/src/ViewSwitcher.jsx +54 -0
- package/client/src/ViewSwitcher.scss +74 -0
- package/client/src/Webpage.jsx +69 -0
- package/client/src/_variables.scss +21 -0
- package/client/src/assets/react.svg +1 -0
- package/client/src/constants.js +68 -0
- package/client/src/contexts/AuthContext.jsx +28 -0
- package/client/src/contexts/ModelContext.jsx +328 -0
- package/client/src/contexts/UIContext.jsx +52 -0
- package/client/src/core/data.js +35 -0
- package/client/src/entry-client.jsx +15 -0
- package/client/src/entry-server.jsx +13 -0
- package/client/src/filter.js +222 -0
- package/client/src/hooks/data.js +101 -0
- package/client/src/hooks/useDebounce.js +20 -0
- package/client/src/hooks/useDragAndDrop.js +59 -0
- package/client/src/hooks/useLocalStorage.js +100 -0
- package/client/src/hooks/useMount.js +42 -0
- package/client/src/hooks/useTutorials.jsx +227 -0
- package/client/src/hooks/useWindowSize.js +24 -0
- package/client/src/i18n.js +47 -0
- package/client/src/index.css +90 -0
- package/client/src/index.js +10 -0
- package/client/src/main.jsx +11 -0
- package/client/src/translations.js +15940 -0
- package/client/src/tutorials.js +112 -0
- package/client/vite.config.js +30 -0
- package/eslint.config.js +50 -0
- package/package.json +48 -27
- package/server.js +9 -0
- package/src/constants.js +12 -23
- package/src/core.js +9 -8
- package/src/data.js +81 -80
- package/src/defaultModels.js +114 -115
- package/src/email.js +8 -9
- package/src/engine.js +5 -5
- package/src/events.js +1 -2
- package/src/i18n.js +212 -211
- package/src/middlewares/middleware-mongodb.js +94 -93
- package/src/migrate.js +24 -24
- package/src/modules/assistant.js +55 -55
- package/src/modules/bucket.js +10 -9
- package/src/modules/data.js +387 -357
- package/src/modules/file.js +3 -6
- package/src/modules/mongodb.js +6 -7
- package/src/modules/user.js +24 -47
- package/src/modules/workflow.js +68 -67
- package/src/openai.jobs.js +2 -2
- package/src/packs.js +30 -31
- package/src/providers.js +101 -3
- package/src/setenv.js +1 -1
- package/src/user.js +0 -17
- package/src/workers/crypto-worker.js +21 -20
- package/src/workers/import-export-worker.js +18 -18
- package/test/data.backup.integration.test.js +7 -12
- package/test/data.integration.test.js +27 -25
- package/test/globalSetup.js +2 -2
- package/test/import_export.integration.test.js +6 -6
- package/test/model.integration.test.js +21 -22
- package/test/workflow.integration.test.js +2 -5
- package/test/workflow.robustness.test.js +6 -13
- package/vitest.config.js +2 -2
package/src/defaultModels.js
CHANGED
|
@@ -20,8 +20,8 @@ export const defaultModels = {
|
|
|
20
20
|
"description": "",
|
|
21
21
|
fields: [
|
|
22
22
|
{ name: 'name', type: 'string_t', required: true, unique: true, color: '#363636' },
|
|
23
|
-
{ name: 'permissions', type: 'relation', multiple: true, relation: 'permission' }
|
|
24
|
-
]
|
|
23
|
+
{ name: 'permissions', type: 'relation', multiple: true, relation: 'permission' }
|
|
24
|
+
]
|
|
25
25
|
},
|
|
26
26
|
user: {
|
|
27
27
|
name: 'user',
|
|
@@ -33,7 +33,7 @@ export const defaultModels = {
|
|
|
33
33
|
{
|
|
34
34
|
"name": "gender",
|
|
35
35
|
"type": "enum",
|
|
36
|
-
"items": ["male", "female", "other", "prefer_not_to_say"]
|
|
36
|
+
"items": ["male", "female", "other", "prefer_not_to_say"]
|
|
37
37
|
},
|
|
38
38
|
{ name: 'contact', type: 'relation', relation: 'contact' },
|
|
39
39
|
{ name: 'roles', type: 'relation', multiple: true, relation: 'role' },
|
|
@@ -41,10 +41,10 @@ export const defaultModels = {
|
|
|
41
41
|
{
|
|
42
42
|
"name": "profilePicture",
|
|
43
43
|
"type": "file",
|
|
44
|
-
"mimeTypes": ["image/jpeg", "image/png"]
|
|
44
|
+
"mimeTypes": ["image/jpeg", "image/png"]
|
|
45
45
|
},
|
|
46
|
-
{ name: 'tokens', type: 'relation', multiple: true, relation: 'token' }
|
|
47
|
-
]
|
|
46
|
+
{ name: 'tokens', type: 'relation', multiple: true, relation: 'token' }
|
|
47
|
+
]
|
|
48
48
|
},
|
|
49
49
|
token: {
|
|
50
50
|
name: 'token',
|
|
@@ -53,7 +53,7 @@ export const defaultModels = {
|
|
|
53
53
|
{ name: 'name', type: 'string' },
|
|
54
54
|
{ name: 'value', type: 'password' },
|
|
55
55
|
{ name: 'lastRefresh', type: 'datetime' }
|
|
56
|
-
]
|
|
56
|
+
]
|
|
57
57
|
},
|
|
58
58
|
translation: {
|
|
59
59
|
name: 'translation',
|
|
@@ -62,7 +62,7 @@ export const defaultModels = {
|
|
|
62
62
|
fields: [
|
|
63
63
|
{ name: 'lang', type: 'relation', 'relation': 'lang', required: true, color: '#4CACCD' },
|
|
64
64
|
{ name: 'key', type: 'string', maxlength: 200, required: true },
|
|
65
|
-
{ name: 'value', type: 'string' }
|
|
65
|
+
{ name: 'value', type: 'string' }
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
lang: {
|
|
@@ -71,7 +71,7 @@ export const defaultModels = {
|
|
|
71
71
|
"description": "",
|
|
72
72
|
fields: [
|
|
73
73
|
{ name: 'name', unique: true, type: 'string_t', maxlength: 200, color: '#4CACCD' },
|
|
74
|
-
{ name: 'code', type: 'string', maxlength: 5 }
|
|
74
|
+
{ name: 'code', type: 'string', maxlength: 5 }
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
currency: {
|
|
@@ -84,7 +84,7 @@ export const defaultModels = {
|
|
|
84
84
|
{ name: 'name', type: 'string_t', required: true, color: '#AE6FA3' },
|
|
85
85
|
{ name: 'exchangeRate', type: 'number', required: false },
|
|
86
86
|
{ name: 'default', type: 'boolean', default: false }
|
|
87
|
-
]
|
|
87
|
+
]
|
|
88
88
|
},
|
|
89
89
|
channel: {
|
|
90
90
|
name: 'channel',
|
|
@@ -92,8 +92,8 @@ export const defaultModels = {
|
|
|
92
92
|
fields: [
|
|
93
93
|
{ name: 'name', type: 'string_t', required: true, unique: true }, // Nom du canal (ex: "email", "SMS")
|
|
94
94
|
{ name: 'description', type: 'string_t' },
|
|
95
|
-
{ name: 'type', type: 'enum', items: ['web', 'mobile', 'email', 'sms', 'push'], required: true }
|
|
96
|
-
]
|
|
95
|
+
{ name: 'type', type: 'enum', items: ['web', 'mobile', 'email', 'sms', 'push'], required: true } // Type de canal
|
|
96
|
+
]
|
|
97
97
|
},
|
|
98
98
|
message: {
|
|
99
99
|
name: 'message',
|
|
@@ -110,8 +110,8 @@ export const defaultModels = {
|
|
|
110
110
|
{ name: 'sentAt', type: 'datetime' },
|
|
111
111
|
{ name: 'readAt', type: 'datetime' },
|
|
112
112
|
{ name: 'type', type: 'string' }, // Type de notification (ex: "commande.miseAJour", "messageForum")
|
|
113
|
-
{ name: 'priority', type: 'enum', items: ['low', 'medium', 'high']}
|
|
114
|
-
]
|
|
113
|
+
{ name: 'priority', type: 'enum', items: ['low', 'medium', 'high']}
|
|
114
|
+
]
|
|
115
115
|
},
|
|
116
116
|
alert: {
|
|
117
117
|
name: "alert",
|
|
@@ -148,7 +148,7 @@ export const defaultModels = {
|
|
|
148
148
|
type: "datetime",
|
|
149
149
|
required: false, // Important: ce champ est géré par le système
|
|
150
150
|
hint: "Timestamp de la dernière notification envoyée pour cette alerte."
|
|
151
|
-
}
|
|
151
|
+
}
|
|
152
152
|
]
|
|
153
153
|
},
|
|
154
154
|
env: {
|
|
@@ -172,8 +172,8 @@ export const defaultModels = {
|
|
|
172
172
|
{ name: 'description', type: 'string' },
|
|
173
173
|
{ name: 'keywords', type: 'relation', relation: 'taxonomy', multiple: true },
|
|
174
174
|
{ name: 'image', type: 'url' },
|
|
175
|
-
{ name: 'category', type: 'relation', relation: 'taxonomy' }
|
|
176
|
-
]
|
|
175
|
+
{ name: 'category', type: 'relation', relation: 'taxonomy' }
|
|
176
|
+
]
|
|
177
177
|
},
|
|
178
178
|
content: {
|
|
179
179
|
name: 'content',
|
|
@@ -188,22 +188,22 @@ export const defaultModels = {
|
|
|
188
188
|
{ name: 'publishedAt', type: 'datetime' },
|
|
189
189
|
{ name: 'author', type: 'relation', relation: 'user' },
|
|
190
190
|
{ name: 'category', type: 'relation', relation: 'taxonomy', "relationFilter": {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
"path": [
|
|
192
|
+
"type"
|
|
193
|
+
],
|
|
194
|
+
"op": "$eq",
|
|
195
|
+
"value": "category"
|
|
196
|
+
} },
|
|
197
197
|
{ name: 'keywords', type: 'relation', relation: 'taxonomy', multiple: true, "relationFilter": {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
"path": [
|
|
199
|
+
"type"
|
|
200
|
+
],
|
|
201
|
+
"op": "$eq",
|
|
202
|
+
"value": "keyword"
|
|
203
|
+
} },
|
|
204
204
|
{ name: 'order', type: 'number', step: 1, default: 0 },
|
|
205
|
-
{ name: 'inSitemap', type: 'boolean', default: false }
|
|
206
|
-
]
|
|
205
|
+
{ name: 'inSitemap', type: 'boolean', default: false }
|
|
206
|
+
]
|
|
207
207
|
},
|
|
208
208
|
resource: {
|
|
209
209
|
name: 'resource',
|
|
@@ -222,8 +222,8 @@ export const defaultModels = {
|
|
|
222
222
|
{ name: 'type', type: 'enum', items: ['keyword', 'category'], color: '#BFBFBF' },
|
|
223
223
|
{ name: 'identifier', type: 'string' },
|
|
224
224
|
{ name: 'order', type: 'number', step: 1, default: 0 },
|
|
225
|
-
{ name: 'description', type: 'richtext' }
|
|
226
|
-
]
|
|
225
|
+
{ name: 'description', type: 'richtext' }
|
|
226
|
+
]
|
|
227
227
|
},
|
|
228
228
|
contact: {
|
|
229
229
|
locked: true,
|
|
@@ -235,7 +235,7 @@ export const defaultModels = {
|
|
|
235
235
|
{ name: 'lastName', type: 'string', asMain: true },
|
|
236
236
|
{ name: 'email', type: 'email', color: '#F4ECE2' },
|
|
237
237
|
{ name: 'phone', type: 'phone', color: '#B4A693' },
|
|
238
|
-
{ name: 'location', type: 'relation', relation: 'location' }
|
|
238
|
+
{ name: 'location', type: 'relation', relation: 'location' }
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
241
|
|
|
@@ -293,7 +293,7 @@ export const defaultModels = {
|
|
|
293
293
|
"name": "longitude",
|
|
294
294
|
"type": "number",
|
|
295
295
|
"unit": "°"
|
|
296
|
-
}
|
|
296
|
+
}
|
|
297
297
|
]
|
|
298
298
|
},
|
|
299
299
|
|
|
@@ -303,8 +303,8 @@ export const defaultModels = {
|
|
|
303
303
|
fields: [
|
|
304
304
|
{ name: 'name', type: 'string', required: true },
|
|
305
305
|
{ name: 'logo', type: 'file' },
|
|
306
|
-
{ name: 'company', type: 'relation', relation: 'contact' }
|
|
307
|
-
]
|
|
306
|
+
{ name: 'company', type: 'relation', relation: 'contact' }
|
|
307
|
+
]
|
|
308
308
|
},
|
|
309
309
|
|
|
310
310
|
product: {
|
|
@@ -321,8 +321,8 @@ export const defaultModels = {
|
|
|
321
321
|
{ name: 'brand', type: 'relation', relation: 'brand' },
|
|
322
322
|
{ name: 'category', type: 'relation', relation: 'taxonomy' },
|
|
323
323
|
{ name: 'seoTitle', type: 'string_t' },
|
|
324
|
-
{ name: 'seoDescription', type: 'string_t' }
|
|
325
|
-
]
|
|
324
|
+
{ name: 'seoDescription', type: 'string_t' }
|
|
325
|
+
]
|
|
326
326
|
},
|
|
327
327
|
productVariant: {
|
|
328
328
|
name: 'productVariant',
|
|
@@ -336,8 +336,8 @@ export const defaultModels = {
|
|
|
336
336
|
{ name: 'currency', type: 'relation', relation: 'currency', required: true },
|
|
337
337
|
{ name: 'stock', type: 'number', default: 0 },
|
|
338
338
|
{ name: 'description', type: 'richtext' },
|
|
339
|
-
{ name: 'image', type: 'url' }
|
|
340
|
-
]
|
|
339
|
+
{ name: 'image', type: 'url' }
|
|
340
|
+
]
|
|
341
341
|
},
|
|
342
342
|
cart: {
|
|
343
343
|
name: 'cart',
|
|
@@ -347,8 +347,8 @@ export const defaultModels = {
|
|
|
347
347
|
{ name: 'items', type: 'relation', relation: 'cartItem', multiple: true },
|
|
348
348
|
{ name: 'creationDate', type: 'datetime', required: true },
|
|
349
349
|
{ name: 'lastUpdate', type: 'datetime', required: true },
|
|
350
|
-
{ name: 'active', type: 'boolean', default: true }
|
|
351
|
-
]
|
|
350
|
+
{ name: 'active', type: 'boolean', default: true }
|
|
351
|
+
]
|
|
352
352
|
},
|
|
353
353
|
cartItem: {
|
|
354
354
|
name: 'cartItem',
|
|
@@ -356,8 +356,8 @@ export const defaultModels = {
|
|
|
356
356
|
fields: [
|
|
357
357
|
{ name: 'product', type: 'relation', relation: 'product', required: true },
|
|
358
358
|
{ name: 'quantity', type: 'number', required: true, min: 1, step: 1 },
|
|
359
|
-
{ name: 'variant', type: 'relation', relation: 'productVariant' }
|
|
360
|
-
]
|
|
359
|
+
{ name: 'variant', type: 'relation', relation: 'productVariant' } // Optionnel, si vous avez des variantes
|
|
360
|
+
]
|
|
361
361
|
},
|
|
362
362
|
discount: {
|
|
363
363
|
name: "discount",
|
|
@@ -373,7 +373,7 @@ export const defaultModels = {
|
|
|
373
373
|
{ "name": "minProductQuantity", "type": "number", min: 0 }, // Montant minimum pour la promotion
|
|
374
374
|
{ "name": "freeProductQuantity", "type": "number", default: null, min: 0 }, // Quantité de produits offerts
|
|
375
375
|
{ "name": "startDate", "type": "datetime" },
|
|
376
|
-
{ "name": "endDate", "type": "datetime" }
|
|
376
|
+
{ "name": "endDate", "type": "datetime" }
|
|
377
377
|
]
|
|
378
378
|
},
|
|
379
379
|
order: {
|
|
@@ -384,7 +384,7 @@ export const defaultModels = {
|
|
|
384
384
|
{ "name": "orderId", "type": "string", "required": true, "unique": true },
|
|
385
385
|
{ "name": "orderDate", "type": "datetime" },
|
|
386
386
|
{ "name": "status", "type": "enum", items: ["pending", "processing", "shipped", "delivered", "cancelled"] },
|
|
387
|
-
{ "name": "products", "type": "relation", "relation": "
|
|
387
|
+
{ "name": "products", "type": "relation", "relation": "cartItem", "required": true, multiple: true },
|
|
388
388
|
{ "name": "customer", "type": "relation", relation: 'user' }, // Relation vers le modèle 'user'
|
|
389
389
|
{ "name": "totalAmount", "type": "number", "required": true },
|
|
390
390
|
{ "name": "currency", "type": "relation", "relation": "currency" },
|
|
@@ -404,8 +404,8 @@ export const defaultModels = {
|
|
|
404
404
|
{ name: 'invoiceId', type: 'string', required: true, unique: true },
|
|
405
405
|
{ name: 'invoiceDate', type: 'datetime', required: true },
|
|
406
406
|
{ name: 'dueDate', type: 'datetime' },
|
|
407
|
-
{ name: 'status', type: 'enum', items: ['paid', 'unpaid', 'partially_paid', 'cancelled'] }
|
|
408
|
-
]
|
|
407
|
+
{ name: 'status', type: 'enum', items: ['paid', 'unpaid', 'partially_paid', 'cancelled'] }
|
|
408
|
+
]
|
|
409
409
|
},
|
|
410
410
|
userSubscription: {
|
|
411
411
|
name: 'userSubscription',
|
|
@@ -424,8 +424,8 @@ export const defaultModels = {
|
|
|
424
424
|
{ name: 'nextBillingDate', type: 'datetime' },
|
|
425
425
|
{ name: 'lastBillingDate', type: 'datetime' },
|
|
426
426
|
{ name: 'cancelReason', type: 'string' },
|
|
427
|
-
{ name: 'autoRenew', type: 'boolean', default: false }
|
|
428
|
-
]
|
|
427
|
+
{ name: 'autoRenew', type: 'boolean', default: false }
|
|
428
|
+
]
|
|
429
429
|
},
|
|
430
430
|
stock: {
|
|
431
431
|
name: 'stock',
|
|
@@ -435,8 +435,8 @@ export const defaultModels = {
|
|
|
435
435
|
{ name: 'variant', type: 'relation', relation: 'productVariant' }, // Optionnel
|
|
436
436
|
{ name: 'warehouse', type: 'relation', relation: 'warehouse', required: true },
|
|
437
437
|
{ name: 'available', type: 'number', default: 0 },
|
|
438
|
-
{ name: 'reserved', type: 'number', default: 0 }
|
|
439
|
-
]
|
|
438
|
+
{ name: 'reserved', type: 'number', default: 0 } // Quantité réservée (pour les commandes en cours)
|
|
439
|
+
]
|
|
440
440
|
},
|
|
441
441
|
stockAlert: {
|
|
442
442
|
name: 'stockAlert',
|
|
@@ -444,8 +444,8 @@ export const defaultModels = {
|
|
|
444
444
|
fields: [
|
|
445
445
|
{ name: 'user', type: 'relation', relation: 'user', required: true },
|
|
446
446
|
{ name: 'stock', type: 'relation', relation: 'stock', required: true },
|
|
447
|
-
{ name: 'threshold', type: 'number', required: true, min: 0 }
|
|
448
|
-
]
|
|
447
|
+
{ name: 'threshold', type: 'number', required: true, min: 0 }
|
|
448
|
+
]
|
|
449
449
|
// how to implement unique fields on COMBINATION of multiple columns ?
|
|
450
450
|
},
|
|
451
451
|
shipment: {
|
|
@@ -458,7 +458,7 @@ export const defaultModels = {
|
|
|
458
458
|
{ name: 'status', type: 'enum', items: ['pending', 'in_transit', 'delivered', 'issue'] },
|
|
459
459
|
{ name: 'estimatedDeliveryDate', type: 'datetime' },
|
|
460
460
|
{ name: 'actualDeliveryDate', type: 'datetime' }
|
|
461
|
-
]
|
|
461
|
+
]
|
|
462
462
|
},
|
|
463
463
|
warehouse: {
|
|
464
464
|
name: 'warehouse',
|
|
@@ -466,8 +466,8 @@ export const defaultModels = {
|
|
|
466
466
|
fields: [
|
|
467
467
|
{ name: 'name', type: 'string_t', required: true },
|
|
468
468
|
{ name: 'location', type: 'relation', relation: 'location' },
|
|
469
|
-
{ name: 'capacity', type: 'number' }
|
|
470
|
-
]
|
|
469
|
+
{ name: 'capacity', type: 'number' }
|
|
470
|
+
]
|
|
471
471
|
},
|
|
472
472
|
'return': {
|
|
473
473
|
name: "return",
|
|
@@ -479,7 +479,7 @@ export const defaultModels = {
|
|
|
479
479
|
{ "name": "status", "type": "enum", items: ["pending", "approved", "refunded", "refused"] },
|
|
480
480
|
{ name: 'amount', type: 'number', min: 0 },
|
|
481
481
|
{ name: 'currency', type: 'relation', relation: 'currency' },
|
|
482
|
-
{ name: 'refundDate', type: 'datetime' }
|
|
482
|
+
{ name: 'refundDate', type: 'datetime' }
|
|
483
483
|
]
|
|
484
484
|
},
|
|
485
485
|
returnItem: {
|
|
@@ -491,7 +491,7 @@ export const defaultModels = {
|
|
|
491
491
|
{ name: 'variant', type: 'relation', relation: 'productVariant' },
|
|
492
492
|
{ name: 'quantity', type: 'number', required: true, min: 1 },
|
|
493
493
|
{ name: 'condition', type: 'enum', items: ['new', 'very_good', 'good', 'degraded', 'damaged', 'unusable'] }
|
|
494
|
-
]
|
|
494
|
+
]
|
|
495
495
|
},
|
|
496
496
|
ticket: {
|
|
497
497
|
name: 'ticket',
|
|
@@ -508,7 +508,7 @@ export const defaultModels = {
|
|
|
508
508
|
{ name: 'priority', type: 'enum', items: ['low', 'medium', 'high', 'urgent'] },
|
|
509
509
|
{ name: 'assignedTo', type: 'relation', relation: 'user' },
|
|
510
510
|
{ name: 'createdAt', type: 'datetime', required: true }
|
|
511
|
-
]
|
|
511
|
+
]
|
|
512
512
|
},
|
|
513
513
|
campaign: {
|
|
514
514
|
name: 'campaign',
|
|
@@ -521,7 +521,7 @@ export const defaultModels = {
|
|
|
521
521
|
{ name: 'type', type: 'enum', items: ['email', 'sms', 'advertisement', 'promotion'] },
|
|
522
522
|
{ name: 'status', type: 'enum', items: ['planified', 'in_progress', 'finished', 'cancelled'] },
|
|
523
523
|
{ name: 'budget', type: 'number' }
|
|
524
|
-
]
|
|
524
|
+
]
|
|
525
525
|
},
|
|
526
526
|
review: {
|
|
527
527
|
name: "review",
|
|
@@ -532,7 +532,7 @@ export const defaultModels = {
|
|
|
532
532
|
{ "name": "productVariant", "type": "relation", relation: 'productVariant' },
|
|
533
533
|
{ "name": "comment", "type": "richtext", maxlength: 2048, required: true },
|
|
534
534
|
{ "name": "score", "type": "number" },
|
|
535
|
-
{ "name": "publishedAt", "type": "datetime", required: true }
|
|
535
|
+
{ "name": "publishedAt", "type": "datetime", required: true }
|
|
536
536
|
]
|
|
537
537
|
},
|
|
538
538
|
device: {
|
|
@@ -552,7 +552,7 @@ export const defaultModels = {
|
|
|
552
552
|
{ name: 'companyContact', type: 'relation', relation: 'contact', 'required': true, hint: "Désignation de l'entreprise" },
|
|
553
553
|
{ name: 'companyIdentifier', type: 'string', asMain: true, hint: "SIRET de l'entreprise", unique: true },
|
|
554
554
|
{ name: 'startDate', type: 'date', required: true, asMain: true, hint: "Date de début de l'exercice" },
|
|
555
|
-
{ name: 'endDate', type: 'date', required: true, asMain: true, hint: "Date de clôture de l'exercice" }
|
|
555
|
+
{ name: 'endDate', type: 'date', required: true, asMain: true, hint: "Date de clôture de l'exercice" }
|
|
556
556
|
]
|
|
557
557
|
},
|
|
558
558
|
|
|
@@ -573,7 +573,7 @@ export const defaultModels = {
|
|
|
573
573
|
'effectifs_valeur_ajoutee',
|
|
574
574
|
'capital_social',
|
|
575
575
|
'filiales_participations',
|
|
576
|
-
'resultat_fiscal']
|
|
576
|
+
'resultat_fiscal']
|
|
577
577
|
},
|
|
578
578
|
{ name: 'section', type: 'string_t', required: true, hint: "Section principale (ex: ACTIF IMMOBILISÉ)" },
|
|
579
579
|
{ name: 'subSection', type: 'string_t', hint: "Sous-section (ex: IMMOBILISATIONS INCORPORELLES)" },
|
|
@@ -594,7 +594,7 @@ export const defaultModels = {
|
|
|
594
594
|
"name": "exercise",
|
|
595
595
|
"type": "relation",
|
|
596
596
|
"relation": "accountingExercise",
|
|
597
|
-
"required": true
|
|
597
|
+
"required": true
|
|
598
598
|
},
|
|
599
599
|
{
|
|
600
600
|
"name": "label",
|
|
@@ -606,7 +606,7 @@ export const defaultModels = {
|
|
|
606
606
|
{
|
|
607
607
|
"name": "entryDate",
|
|
608
608
|
"type": "date",
|
|
609
|
-
"required": true
|
|
609
|
+
"required": true
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
612
|
"name": "amount",
|
|
@@ -617,7 +617,7 @@ export const defaultModels = {
|
|
|
617
617
|
"name": "currency",
|
|
618
618
|
"type": "relation",
|
|
619
619
|
"relation": "currency",
|
|
620
|
-
"required": true
|
|
620
|
+
"required": true
|
|
621
621
|
},
|
|
622
622
|
{
|
|
623
623
|
"name": "referenceNumber",
|
|
@@ -674,21 +674,21 @@ export const defaultModels = {
|
|
|
674
674
|
{
|
|
675
675
|
"name": "jobTitle",
|
|
676
676
|
"type": "string",
|
|
677
|
-
"required": true
|
|
677
|
+
"required": true
|
|
678
678
|
},
|
|
679
679
|
{
|
|
680
680
|
"name": "department",
|
|
681
|
-
"type": "string"
|
|
681
|
+
"type": "string"
|
|
682
682
|
},
|
|
683
683
|
{
|
|
684
684
|
"name": "manager",
|
|
685
685
|
"type": "relation",
|
|
686
|
-
"relation": "employee"
|
|
686
|
+
"relation": "employee"
|
|
687
687
|
},
|
|
688
688
|
{
|
|
689
689
|
"name": "workLocation",
|
|
690
690
|
"type": "relation",
|
|
691
|
-
"relation": "location"
|
|
691
|
+
"relation": "location"
|
|
692
692
|
},
|
|
693
693
|
{
|
|
694
694
|
"name": "employmentType",
|
|
@@ -703,7 +703,7 @@ export const defaultModels = {
|
|
|
703
703
|
{
|
|
704
704
|
"name": "homeAddress",
|
|
705
705
|
"type": "relation",
|
|
706
|
-
"relation": "location"
|
|
706
|
+
"relation": "location"
|
|
707
707
|
},
|
|
708
708
|
{
|
|
709
709
|
"name": "dateOfBirth",
|
|
@@ -719,7 +719,7 @@ export const defaultModels = {
|
|
|
719
719
|
},
|
|
720
720
|
{
|
|
721
721
|
"name": "socialSecurityNumber",
|
|
722
|
-
"type": "string"
|
|
722
|
+
"type": "string"
|
|
723
723
|
},
|
|
724
724
|
{
|
|
725
725
|
"name": "taxId",
|
|
@@ -728,11 +728,11 @@ export const defaultModels = {
|
|
|
728
728
|
{
|
|
729
729
|
"name": "startDate",
|
|
730
730
|
"type": "date",
|
|
731
|
-
"required": true
|
|
731
|
+
"required": true
|
|
732
732
|
},
|
|
733
733
|
{
|
|
734
734
|
"name": "endDate",
|
|
735
|
-
"type": "date"
|
|
735
|
+
"type": "date"
|
|
736
736
|
},
|
|
737
737
|
{
|
|
738
738
|
"name": "contractType",
|
|
@@ -740,25 +740,25 @@ export const defaultModels = {
|
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
742
|
"name": "salary",
|
|
743
|
-
"type": "number"
|
|
743
|
+
"type": "number"
|
|
744
744
|
},
|
|
745
745
|
{
|
|
746
746
|
"name": "salaryCurrency",
|
|
747
747
|
"type": "relation",
|
|
748
|
-
"relation": "currency"
|
|
748
|
+
"relation": "currency"
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
751
|
"name": "payFrequency",
|
|
752
752
|
"type": "enum",
|
|
753
|
-
"items": ["weekly", "bi_weekly", "monthly"]
|
|
753
|
+
"items": ["weekly", "bi_weekly", "monthly"]
|
|
754
754
|
},
|
|
755
755
|
{
|
|
756
756
|
"name": "bankAccountNumber",
|
|
757
|
-
"type": "string"
|
|
757
|
+
"type": "string"
|
|
758
758
|
},
|
|
759
759
|
{
|
|
760
760
|
"name": "bankName",
|
|
761
|
-
"type": "string"
|
|
761
|
+
"type": "string"
|
|
762
762
|
},
|
|
763
763
|
{
|
|
764
764
|
"name": "iban",
|
|
@@ -787,7 +787,7 @@ export const defaultModels = {
|
|
|
787
787
|
{
|
|
788
788
|
"name": "skills",
|
|
789
789
|
"type": "array",
|
|
790
|
-
"itemsType": "string"
|
|
790
|
+
"itemsType": "string"
|
|
791
791
|
},
|
|
792
792
|
{
|
|
793
793
|
"name": "notes",
|
|
@@ -801,7 +801,7 @@ export const defaultModels = {
|
|
|
801
801
|
fields: [
|
|
802
802
|
{ name: 'name', type: 'string_t', required: true, hint: "Unique name for the workflow (e.g., 'Order Validation', 'Low Stock Notification')." },
|
|
803
803
|
{ name: 'description', type: 'richtext', hint: "Detailed explanation of the workflow's purpose." },
|
|
804
|
-
{ name: 'startStep', type: 'relation', relation: 'workflowStep', required: false, hint: "The first step to execute when the workflow starts." }
|
|
804
|
+
{ name: 'startStep', type: 'relation', relation: 'workflowStep', required: false, hint: "The first step to execute when the workflow starts." }
|
|
805
805
|
]
|
|
806
806
|
},
|
|
807
807
|
workflowTrigger: {
|
|
@@ -814,26 +814,26 @@ export const defaultModels = {
|
|
|
814
814
|
name: 'type',
|
|
815
815
|
type: 'enum',
|
|
816
816
|
items: ['manual', 'scheduled'],
|
|
817
|
-
required: true
|
|
817
|
+
required: true
|
|
818
818
|
},
|
|
819
819
|
{
|
|
820
820
|
name: 'onEvent',
|
|
821
821
|
type: 'enum',
|
|
822
822
|
items: ['DataAdded', 'DataEdited', 'DataDeleted', 'ModelAdded', 'ModelEdited', 'ModelDeleted'],
|
|
823
|
-
condition: { $eq: ["$type", "manual"] }
|
|
823
|
+
condition: { $eq: ["$type", "manual"] }
|
|
824
824
|
},
|
|
825
825
|
{ name: 'targetModel', type: 'model', condition: { // Condition pour afficher le champ
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
826
|
+
$and: [
|
|
827
|
+
{$eq: ["$type", "manual"]},
|
|
828
|
+
{
|
|
829
|
+
$or: [
|
|
830
|
+
{ path: "onEvent", op: "$eq", value: "DataAdded" },
|
|
831
|
+
{ path: "onEvent", op: "$eq", value: "DataEdited" },
|
|
832
|
+
{ path: "onEvent", op: "$eq", value: "DataDeleted" }
|
|
833
|
+
]
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
}},
|
|
837
837
|
{ name: 'dataFilter', type: 'code', language: 'json', targetModel: '$targetModel', conditionBuilder: true, hint: "Optional conditions checked before executing the step's action.",
|
|
838
838
|
condition: { // Condition pour afficher le champ
|
|
839
839
|
$and: [
|
|
@@ -846,7 +846,7 @@ export const defaultModels = {
|
|
|
846
846
|
]
|
|
847
847
|
}
|
|
848
848
|
]
|
|
849
|
-
}
|
|
849
|
+
}
|
|
850
850
|
},
|
|
851
851
|
{ name: 'env', type: 'code', language: 'json', hint: "Environment variables (JSON key/value pairs)",default: {} },
|
|
852
852
|
{ name: 'isActive', type: 'boolean' },
|
|
@@ -882,21 +882,20 @@ export const defaultModels = {
|
|
|
882
882
|
},
|
|
883
883
|
// For UpdateData / CreateData / DeleteData
|
|
884
884
|
{ name: 'targetModel', condition: {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}, type: 'model', hint: "Model to target" },
|
|
885
|
+
$or: [
|
|
886
|
+
{$eq: ["$type", "CreateData"]},
|
|
887
|
+
{$eq: ["$type", "UpdateData"]},
|
|
888
|
+
{$eq: ["$type", "DeleteData"]}
|
|
889
|
+
]
|
|
890
|
+
}, type: 'model', hint: "Model to target" },
|
|
892
891
|
|
|
893
892
|
// For UpdateData / DeleteData
|
|
894
893
|
{ name: 'targetSelector', targetModel: "$targetModel", conditionBuilder: true, condition: {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
894
|
+
$or: [
|
|
895
|
+
{$eq: ["$type", "UpdateData"]},
|
|
896
|
+
{$eq: ["$type", "DeleteData"]}
|
|
897
|
+
]
|
|
898
|
+
}, type: 'code', language: 'json', hint: "Expression to filter to the target document(s)." },
|
|
900
899
|
|
|
901
900
|
// For UpdateData
|
|
902
901
|
{ name: 'fieldsToUpdate', condition: {$eq: ["$type", "UpdateData"]}, type: 'code', language: 'json', default: {}, hint: "Key-value pairs of fields to update (e.g., { status: 'Validé', lastUpdated: '{now}' })" },
|
|
@@ -958,7 +957,7 @@ export const defaultModels = {
|
|
|
958
957
|
condition: { $eq: ["$type", "GenerateAIContent"] },
|
|
959
958
|
type: 'richtext', // richtext est bien pour les longs prompts
|
|
960
959
|
hint: "Le modèle de prompt. Utilise des variables comme {triggerData.field} ou {context.variable}."
|
|
961
|
-
}
|
|
960
|
+
}
|
|
962
961
|
|
|
963
962
|
]
|
|
964
963
|
},
|
|
@@ -982,7 +981,7 @@ export const defaultModels = {
|
|
|
982
981
|
{ name: 'owner', type: 'relation', relation: 'user', required: false },
|
|
983
982
|
{ name: 'startedAt', type: 'datetime', required: true, hint: "Timestamp when the workflow run began." },
|
|
984
983
|
{ name: 'completedAt', type: 'datetime', hint: "Timestamp when the workflow run finished (successfully or failed)." },
|
|
985
|
-
{ name: 'error', type: 'string', maxlength: 4096, hint: "Error message if the workflow run failed." }
|
|
984
|
+
{ name: 'error', type: 'string', maxlength: 4096, hint: "Error message if the workflow run failed." }
|
|
986
985
|
]
|
|
987
986
|
},
|
|
988
987
|
dashboard:{
|
|
@@ -1153,9 +1152,9 @@ export const defaultModels = {
|
|
|
1153
1152
|
"required": false,
|
|
1154
1153
|
"default": "{}",
|
|
1155
1154
|
condition: { "$or": [
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1155
|
+
{$eq: ["$showTotal", true]},
|
|
1156
|
+
{$eq: ["$showPercentTotal", true]}
|
|
1157
|
+
]}
|
|
1159
1158
|
},
|
|
1160
1159
|
{
|
|
1161
1160
|
name: 'unit', // Optionnel: Unité à afficher avec la valeur
|
|
@@ -1281,7 +1280,7 @@ export const defaultModels = {
|
|
|
1281
1280
|
type: 'array',
|
|
1282
1281
|
itemsType: 'file', // Pour joindre des reçus, factures, etc.
|
|
1283
1282
|
hint: "Pièces jointes (reçus, factures)."
|
|
1284
|
-
}
|
|
1283
|
+
}
|
|
1285
1284
|
]
|
|
1286
1285
|
},
|
|
1287
1286
|
event: {
|