data-primals-engine 1.6.3 → 1.7.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.
Files changed (55) hide show
  1. package/README.md +52 -900
  2. package/client/index.js +3 -0
  3. package/client/package-lock.json +7563 -8811
  4. package/client/package.json +11 -1
  5. package/client/src/App.scss +29 -0
  6. package/client/src/AssistantChat.jsx +369 -362
  7. package/client/src/DataEditor.jsx +383 -383
  8. package/client/src/DataLayout.jsx +54 -20
  9. package/client/src/ModelList.jsx +280 -280
  10. package/client/src/ViewSwitcher.scss +0 -31
  11. package/client/src/_variables.scss +3 -0
  12. package/client/src/constants.js +81 -100
  13. package/client/src/contexts/CommandContext.jsx +274 -259
  14. package/client/vite.config.js +30 -30
  15. package/doc/AI-assistance.md +93 -0
  16. package/doc/Advanced-workflows.md +90 -0
  17. package/doc/Event-system.md +79 -0
  18. package/doc/Packs-gallery.md +73 -0
  19. package/doc/automation-workflows.md +102 -0
  20. package/doc/core-concepts.md +33 -0
  21. package/doc/custom-api-endpoints.md +40 -0
  22. package/doc/dashboards-kpis-charts.md +49 -0
  23. package/doc/data-management.md +120 -0
  24. package/doc/data-models.md +75 -0
  25. package/doc/index.md +14 -0
  26. package/doc/roles-permissions.md +43 -0
  27. package/doc/users.md +30 -0
  28. package/package.json +20 -10
  29. package/src/client.js +6 -4
  30. package/src/constants.js +1 -1
  31. package/src/core.js +31 -12
  32. package/src/defaultModels.js +1 -1
  33. package/src/engine.js +342 -335
  34. package/src/filter.js +72 -173
  35. package/src/migrate.js +1 -1
  36. package/src/modules/assistant/assistant.js +30 -20
  37. package/src/modules/data/data.backup.js +4 -4
  38. package/src/modules/data/data.js +8 -7
  39. package/src/modules/data/data.operations.js +186 -133
  40. package/src/modules/data/data.relations.js +3 -2
  41. package/src/modules/data/data.scheduling.js +1 -1
  42. package/src/modules/mongodb.js +17 -8
  43. package/src/modules/swagger.js +25 -5
  44. package/src/modules/user.js +108 -79
  45. package/src/modules/workflow.js +138 -3
  46. package/src/packs.js +5697 -5697
  47. package/src/profiles.js +19 -0
  48. package/swagger-en.yml +3391 -1550
  49. package/swagger-fr.yml +3385 -2896
  50. package/test/assistant.test.js +2 -2
  51. package/test/core.test.js +341 -0
  52. package/test/data.backup.integration.test.js +3 -1
  53. package/test/data.history.integration.test.js +0 -1
  54. package/test/data.integration.test.js +137 -2
  55. package/test/user.test.js +33 -29
package/swagger-en.yml CHANGED
@@ -1,1550 +1,3391 @@
1
- openapi: 3.0.0
2
- info:
3
- title: data.primals.net API
4
- description: API for managing custom data, including account verification and generic CRUD operations.
5
- version: 1.0.0
6
- servers:
7
- - url: https://data.primals.net
8
- description: Production server
9
- security:
10
- - BearerAuth: []
11
- tags:
12
- - name: Model Management
13
- description: Operations related to data models.
14
- - name: Data Management
15
- description: Generic CRUD operations for all defined data models.
16
- paths:
17
-
18
- /api/model:
19
- post:
20
- tags:
21
- - Model Management
22
- summary: "Create a new model"
23
- description: "Creates a new data model structure. User must have required permissions."
24
- security:
25
- - BearerAuth: [ ]
26
- parameters:
27
- - name: _user
28
- in: query
29
- required: true
30
- description: "Your username for authentication."
31
- schema:
32
- type: string
33
- requestBody:
34
- required: true
35
- description: "The model definition object to create. The structure must be valid."
36
- content:
37
- application/json:
38
- schema:
39
- type: object
40
- description: "The complete model definition."
41
- example:
42
- name: "newModel"
43
- description: "Description of my new model."
44
- fields:
45
- - name: "title"
46
- type: "string"
47
- required: true
48
- - name: "price"
49
- type: "number"
50
- unit: ""
51
- - name: "category"
52
- type: "relation"
53
- relation: "taxonomy"
54
- responses:
55
- '201':
56
- description: "Model successfully created."
57
- content:
58
- application/json:
59
- schema:
60
- type: object
61
- properties:
62
- success:
63
- type: boolean
64
- example: true
65
- insertedId:
66
- type: string
67
- description: "The ID of the newly created model."
68
- example: "60d0fe4f5311236168a109ca"
69
- '400':
70
- description: "Invalid model definition or name already in use."
71
- content:
72
- application/json:
73
- schema:
74
- $ref: '#/components/schemas/ErrorResponse'
75
- '401':
76
- description: "Unauthorized (missing or invalid token)."
77
- content:
78
- application/json:
79
- schema:
80
- $ref: '#/components/schemas/ErrorResponse'
81
- '403':
82
- description: "Permission denied to create a model."
83
- content:
84
- application/json:
85
- schema:
86
- $ref: '#/components/schemas/ErrorResponse'
87
- delete:
88
- tags:
89
- - Model Management
90
- summary: "Delete a model"
91
- description: "Deletes a data model and all associated data. This action is irreversible."
92
- security:
93
- - BearerAuth: [ ]
94
- parameters:
95
- - name: _user
96
- in: query
97
- required: true
98
- description: "Your username for authentication."
99
- schema:
100
- type: string
101
- - name: name
102
- in: query
103
- required: true
104
- description: "The name of the model to delete."
105
- schema:
106
- type: string
107
- responses:
108
- '200':
109
- description: "Model and associated data successfully deleted."
110
- content:
111
- application/json:
112
- schema:
113
- type: object
114
- properties:
115
- success:
116
- type: boolean
117
- example: true
118
- '400':
119
- description: "Invalid request (e.g., missing 'name' parameter)."
120
- content:
121
- application/json:
122
- schema:
123
- $ref: '#/components/schemas/ErrorResponse'
124
- '401':
125
- description: "Unauthorized (missing or invalid token)."
126
- content:
127
- application/json:
128
- schema:
129
- $ref: '#/components/schemas/ErrorResponse'
130
- '403':
131
- description: "Permission denied to delete this model."
132
- content:
133
- application/json:
134
- schema:
135
- $ref: '#/components/schemas/ErrorResponse'
136
- '404':
137
- description: "Model not found."
138
- content:
139
- application/json:
140
- schema:
141
- $ref: '#/components/schemas/ErrorResponse'
142
-
143
- /api/model/{id}:
144
- put:
145
- tags:
146
- - Model Management
147
- summary: "Update an existing model"
148
- description: "Updates the structure of an existing data model using its ID."
149
- security:
150
- - BearerAuth: [ ]
151
- parameters:
152
- - name: _user
153
- in: query
154
- required: true
155
- description: "Your username for authentication."
156
- schema:
157
- type: string
158
- - name: id
159
- in: path
160
- required: true
161
- description: "The unique identifier (_id) of the model to update."
162
- schema:
163
- type: string
164
- requestBody:
165
- required: true
166
- description: "The complete updated model definition object."
167
- content:
168
- application/json:
169
- schema:
170
- type: object
171
- description: "The complete model definition."
172
- example:
173
- name: "updatedNewModel"
174
- description: "Updated description."
175
- fields:
176
- - name: "title"
177
- type: "string"
178
- required: true
179
- - name: "price"
180
- type: "number"
181
- unit: ""
182
- - name: "status"
183
- type: "enum"
184
- items: [ "active", "inactive" ]
185
- responses:
186
- '200':
187
- description: "Model successfully updated."
188
- content:
189
- application/json:
190
- schema:
191
- type: object
192
- properties:
193
- success:
194
- type: boolean
195
- example: true
196
- data:
197
- type: object
198
- description: "The updated model document."
199
- '400':
200
- description: "Invalid request or model definition."
201
- '401':
202
- description: "Unauthorized (missing or invalid token)."
203
- '403':
204
- description: "Permission denied to modify this model."
205
- '404':
206
- description: "Model not found."
207
- # --- Generic CRUD Endpoints ---
208
- /api/data/search:
209
- post:
210
- tags:
211
- - Data Management
212
- consumes:
213
- - application/json
214
- summary: "Search through data"
215
- description: "Searches across all data of the specified model."
216
- security:
217
- - BearerAuth: []
218
- parameters:
219
- - name: _user
220
- in: query
221
- required: true
222
- description: "Your username for authentication."
223
- schema:
224
- type: string
225
- - in: body
226
- name: model
227
- required: true
228
- description: "The name of the data model (e.g., 'user', 'product')."
229
- schema:
230
- type: string
231
- - name: filter
232
- in: body
233
- description: "MongoDB filter JSON object for the search."
234
- schema:
235
- type: object
236
- example:
237
- { "$and": [ { "lang": { "$find": { "$eq": [ "$$this.code", "fr" ] } }}, { "user": { "$exists": true } } ] }
238
- - name: sort
239
- in: query
240
- description: "Field sorting parameter."
241
- schema:
242
- type: string
243
- example: fieldName:ASC;fieldName2:DESC
244
- - name: limit
245
- in: query
246
- description: "Maximum number of documents to return."
247
- schema:
248
- type: integer
249
- default: 1000
250
- - name: offset
251
- in: query
252
- description: "Number of documents to skip (for pagination)."
253
- schema:
254
- type: integer
255
- default: 0
256
- - name: depth
257
- in: query
258
- description: "Population depth for 'relation' type fields."
259
- schema:
260
- type: integer
261
- default: 1
262
- - name: lang
263
- in: query
264
- description: "Language used for error messages."
265
- schema:
266
- type: string
267
- default: 'en'
268
- requestBody:
269
- required: true
270
- content:
271
- application/json:
272
- schema:
273
- type: array
274
- description: "The returned data. Returned fields correspond to the model definition."
275
- example:
276
- [{ _id: "68624b95e59ff3523e72cfff", _hash: "6537742658626211", name: "New Product", price: 99.99}]
277
- /api/data/{id}:
278
- put:
279
- tags:
280
- - Data Management
281
- summary: "Update a document"
282
- description: "Updates an existing document using its ID."
283
- security:
284
- - BearerAuth: []
285
- parameters:
286
- - name: _user
287
- in: query
288
- required: true
289
- description: "Your username for authentication."
290
- schema:
291
- type: string
292
- - name: id
293
- in: path
294
- required: true
295
- description: "The unique identifier (_id) of the document to update."
296
- schema:
297
- type: string
298
- - name: lang
299
- in: query
300
- description: "Language used for error messages."
301
- schema:
302
- type: string
303
- default: 'en'
304
- - in: body
305
- name: model
306
- required: true
307
- description: "The name of the data model (e.g., 'user', 'product')."
308
- schema:
309
- type: string
310
- - name: data
311
- in: body
312
- required: true
313
- description: "The data to edit. Using the $find operator is recommended to copy relational data by reference."
314
- schema:
315
- type: object
316
- example: {}
317
- responses:
318
- '200':
319
- description: "Document successfully updated."
320
- '400':
321
- description: "Invalid data."
322
- '401':
323
- description: "Unauthorized."
324
- '404':
325
- description: "Document not found."
326
- /api/data:
327
- post:
328
- tags:
329
- - Data Management
330
- summary: "Create one or more documents"
331
- description: "Creates one or more new documents in a specified model."
332
- security:
333
- - BearerAuth: [ ]
334
- parameters:
335
- - name: _user
336
- in: query
337
- required: true
338
- description: "Your username for authentication."
339
- schema:
340
- type: string
341
- - name: model
342
- in: body
343
- required: true
344
- description: "The name of the model in which to create the documents."
345
- schema:
346
- type: string
347
- - name: data
348
- in: body
349
- required: true
350
- description: "The data to insert. Using the $find operator is recommended for relational data."
351
- schema:
352
- type: object
353
- example: {}
354
- - name: lang
355
- in: query
356
- description: "Language used for error messages."
357
- schema:
358
- type: string
359
- default: 'en'
360
- responses:
361
- '201':
362
- description: "Document(s) successfully created."
363
- '400':
364
- description: "Invalid data."
365
- '401':
366
- description: "Unauthorized."
367
- put:
368
- tags:
369
- - Data Management
370
- summary: "Bulk update documents"
371
- description: "Updates an existing document using its ID."
372
- security:
373
- - BearerAuth: []
374
- parameters:
375
- - name: _user
376
- in: query
377
- required: true
378
- description: "Your username for authentication."
379
- schema:
380
- type: string
381
- - in: body
382
- name: model
383
- required: true
384
- description: "The name of the data model (e.g., 'user', 'product')."
385
- schema:
386
- type: string
387
- - name: data
388
- in: body
389
- required: true
390
- description: "The data to edit. Using the $find operator is recommended to copy relational data by reference."
391
- schema:
392
- type: object
393
- example: {}
394
- - name: lang
395
- in: query
396
- description: "Language used for error messages."
397
- schema:
398
- type: string
399
- default: 'en'
400
- responses:
401
- '200':
402
- description: "Document successfully updated."
403
- '400':
404
- description: "Invalid data."
405
- '401':
406
- description: "Unauthorized."
407
- '404':
408
- description: "Document not found."
409
- delete:
410
- tags:
411
- - Data Management
412
- summary: "Delete one or more document(s)"
413
- description: "Permanently deletes a document using its ID."
414
- security:
415
- - BearerAuth: []
416
- parameters:
417
- - name: _user
418
- in: query
419
- required: true
420
- description: "Your username for authentication."
421
- schema:
422
- type: string
423
- - name: ids
424
- in: body
425
- description: "The identifiers of the documents to delete."
426
- schema:
427
- type: string
428
- - name: filter
429
- in: body
430
- description: "The MongoDB JSON filter to apply for bulk deletion."
431
- schema:
432
- type: object
433
- example:
434
- { "$and": [ { "lang": { "$find": { "$eq": [ "$$this.code", "fr" ] } }}, { "user": { "$exists": true } } ] }
435
- - name: lang
436
- in: query
437
- description: "Language used for error messages."
438
- schema:
439
- type: string
440
- default: 'en'
441
- responses:
442
- '200':
443
- description: "Document successfully deleted."
444
- '401':
445
- description: "Unauthorized."
446
- '404':
447
- description: "Document not found."
448
- components:
449
- securitySchemes:
450
- BearerAuth:
451
- type: http
452
- scheme: bearer
453
- bearerFormat: JWT # Assuming JWT tokens are used
454
- schemas:
455
- # --- Common Responses ---
456
- ErrorResponse:
457
- type: object
458
- properties:
459
- success:
460
- type: boolean
461
- example: false
462
- message:
463
- type: string
464
- example: "An internal error occurred."
465
- SuccessResponse:
466
- type: object
467
- properties:
468
- success:
469
- type: boolean
470
- example: true
471
- message:
472
- type: string
473
- example: "Operation successful."
474
- # --- Model Schemas (dynamically generated) ---
475
- permission:
476
- type: object
477
- properties:
478
- _id:
479
- type: string
480
- description: Unique document identifier (MongoDB ObjectId)
481
- readOnly: true
482
- _user:
483
- type: string
484
- description: Identifier of the user owning this document
485
- readOnly: true
486
- _model:
487
- type: string
488
- description: Name of the model this document belongs to
489
- readOnly: true
490
- default: permission
491
- _hash:
492
- type: number
493
- description: Document hash for integrity verification
494
- readOnly: true
495
- _pack:
496
- type: string
497
- description: Name of the pack this document belongs to (if applicable)
498
- readOnly: true
499
- name:
500
- type: string
501
- description: ""
502
- description:
503
- type: string
504
- description: ""
505
- required:
506
- - name
507
- role:
508
- type: object
509
- properties:
510
- _id:
511
- type: string
512
- description: Unique document identifier (MongoDB ObjectId)
513
- readOnly: true
514
- _user:
515
- type: string
516
- description: Identifier of the user owning this document
517
- readOnly: true
518
- _model:
519
- type: string
520
- description: Name of the model this document belongs to
521
- readOnly: true
522
- default: role
523
- _hash:
524
- type: number
525
- description: Document hash for integrity verification
526
- readOnly: true
527
- _pack:
528
- type: string
529
- description: Name of the pack this document belongs to (if applicable)
530
- readOnly: true
531
- name:
532
- type: string
533
- description: ""
534
- permissions:
535
- type: array
536
- items:
537
- type: string
538
- description: ID of a permission document
539
- required:
540
- - name
541
- user:
542
- type: object
543
- properties:
544
- _id:
545
- type: string
546
- description: Unique document identifier (MongoDB ObjectId)
547
- readOnly: true
548
- _user:
549
- type: string
550
- description: Identifier of the user owning this document
551
- readOnly: true
552
- _model:
553
- type: string
554
- description: Name of the model this document belongs to
555
- readOnly: true
556
- default: user
557
- _hash:
558
- type: number
559
- description: Document hash for integrity verification
560
- readOnly: true
561
- _pack:
562
- type: string
563
- description: Name of the pack this document belongs to (if applicable)
564
- readOnly: true
565
- username:
566
- type: string
567
- description: ""
568
- password:
569
- type: string
570
- format: password
571
- description: ""
572
- gender:
573
- type: string
574
- enum:
575
- - male
576
- - female
577
- - other
578
- - prefer_not_to_say
579
- description: ""
580
- contact:
581
- type: string
582
- description: ID of a contact document
583
- roles:
584
- type: array
585
- items:
586
- type: string
587
- description: ID of a role document
588
- lang:
589
- type: string
590
- description: ID of a lang document
591
- profilePicture:
592
- type: string
593
- format: uuid
594
- description: "Mime types: image/jpeg, image/png."
595
- tokens:
596
- type: array
597
- items:
598
- type: string
599
- description: ID of a token document
600
- required:
601
- - username
602
- userPermission:
603
- type: object
604
- properties:
605
- _id:
606
- type: string
607
- description: Unique document identifier (MongoDB ObjectId)
608
- readOnly: true
609
- _user:
610
- type: string
611
- description: Identifier of the user owning this document
612
- readOnly: true
613
- _model:
614
- type: string
615
- description: Name of the model this document belongs to
616
- readOnly: true
617
- default: userPermission
618
- _hash:
619
- type: number
620
- description: Document hash for integrity verification
621
- readOnly: true
622
- _pack:
623
- type: string
624
- description: Name of the pack this document belongs to (if applicable)
625
- readOnly: true
626
- user:
627
- type: string
628
- description: ID of a user document
629
- permission:
630
- type: string
631
- description: ID of a permission document
632
- isGranted:
633
- type: boolean
634
- description: "True to grant the permission, False to revoke it explicitly."
635
- expiresAt:
636
- type: string
637
- format: date-time
638
- description: "If set, the exception (grant or revocation) is temporary."
639
- required:
640
- - user
641
- - permission
642
- - isGranted
643
- token:
644
- type: object
645
- properties:
646
- _id:
647
- type: string
648
- description: Unique document identifier (MongoDB ObjectId)
649
- readOnly: true
650
- _user:
651
- type: string
652
- description: Identifier of the user owning this document
653
- readOnly: true
654
- _model:
655
- type: string
656
- description: Name of the model this document belongs to
657
- readOnly: true
658
- default: token
659
- _hash:
660
- type: number
661
- description: Document hash for integrity verification
662
- readOnly: true
663
- _pack:
664
- type: string
665
- description: Name of the pack this document belongs to (if applicable)
666
- readOnly: true
667
- name:
668
- type: string
669
- description: ""
670
- value:
671
- type: string
672
- format: password
673
- description: ""
674
- lastRefresh:
675
- type: string
676
- format: date-time
677
- description: ""
678
- translation:
679
- type: object
680
- properties:
681
- _id:
682
- type: string
683
- description: Unique document identifier (MongoDB ObjectId)
684
- readOnly: true
685
- _user:
686
- type: string
687
- description: Identifier of the user owning this document
688
- readOnly: true
689
- _model:
690
- type: string
691
- description: Name of the model this document belongs to
692
- readOnly: true
693
- default: translation
694
- _hash:
695
- type: number
696
- description: Document hash for integrity verification
697
- readOnly: true
698
- _pack:
699
- type: string
700
- description: Name of the pack this document belongs to (if applicable)
701
- readOnly: true
702
- lang:
703
- type: string
704
- description: ID of a lang document
705
- key:
706
- type: string
707
- maxLength: 200
708
- description: ""
709
- value:
710
- type: string
711
- description: ""
712
- required:
713
- - lang
714
- - key
715
- lang:
716
- type: object
717
- properties:
718
- _id:
719
- type: string
720
- description: Unique document identifier (MongoDB ObjectId)
721
- readOnly: true
722
- _user:
723
- type: string
724
- description: Identifier of the user owning this document
725
- readOnly: true
726
- _model:
727
- type: string
728
- description: Name of the model this document belongs to
729
- readOnly: true
730
- default: lang
731
- _hash:
732
- type: number
733
- description: Document hash for integrity verification
734
- readOnly: true
735
- _pack:
736
- type: string
737
- description: Name of the pack this document belongs to (if applicable)
738
- readOnly: true
739
- name:
740
- type: string
741
- maxLength: 200
742
- description: ""
743
- code:
744
- type: string
745
- maxLength: 5
746
- description: ""
747
- currency:
748
- type: object
749
- properties:
750
- _id:
751
- type: string
752
- description: Unique document identifier (MongoDB ObjectId)
753
- readOnly: true
754
- _user:
755
- type: string
756
- description: Identifier of the user owning this document
757
- readOnly: true
758
- _model:
759
- type: string
760
- description: Name of the model this document belongs to
761
- readOnly: true
762
- default: currency
763
- _hash:
764
- type: number
765
- description: Document hash for integrity verification
766
- readOnly: true
767
- _pack:
768
- type: string
769
- description: Name of the pack this document belongs to (if applicable)
770
- readOnly: true
771
- symbol:
772
- type: string
773
- maxLength: 5
774
- description: ""
775
- code:
776
- type: string
777
- maxLength: 3
778
- description: ""
779
- name:
780
- type: string
781
- description: ""
782
- exchangeRate:
783
- type: number
784
- description: ""
785
- default:
786
- type: boolean
787
- default: false
788
- description: ""
789
- required:
790
- - symbol
791
- - code
792
- - name
793
- channel:
794
- type: object
795
- properties:
796
- _id:
797
- type: string
798
- description: Unique document identifier (MongoDB ObjectId)
799
- readOnly: true
800
- _user:
801
- type: string
802
- description: Identifier of the user owning this document
803
- readOnly: true
804
- _model:
805
- type: string
806
- description: Name of the model this document belongs to
807
- readOnly: true
808
- default: channel
809
- _hash:
810
- type: number
811
- description: Document hash for integrity verification
812
- readOnly: true
813
- _pack:
814
- type: string
815
- description: Name of the pack this document belongs to (if applicable)
816
- readOnly: true
817
- name:
818
- type: string
819
- description: ""
820
- description:
821
- type: string
822
- description: ""
823
- type:
824
- type: string
825
- enum:
826
- - email
827
- - SMS
828
- - forum
829
- - messaging
830
- - push
831
- - in-app
832
- description: ""
833
- required:
834
- - name
835
- - type
836
- env:
837
- type: object
838
- properties:
839
- _id:
840
- type: string
841
- description: Unique document identifier (MongoDB ObjectId)
842
- readOnly: true
843
- _user:
844
- type: string
845
- description: Identifier of the user owning this document
846
- readOnly: true
847
- _model:
848
- type: string
849
- description: Name of the model this document belongs to
850
- readOnly: true
851
- default: env
852
- _hash:
853
- type: number
854
- description: Document hash for integrity verification
855
- readOnly: true
856
- _pack:
857
- type: string
858
- description: Name of the pack this document belongs to (if applicable)
859
- readOnly: true
860
- name:
861
- type: string
862
- description: ""
863
- value:
864
- type: string
865
- description: ""
866
- required:
867
- - name
868
- - type
869
- message:
870
- type: object
871
- properties:
872
- _id:
873
- type: string
874
- description: Unique document identifier (MongoDB ObjectId)
875
- readOnly: true
876
- _user:
877
- type: string
878
- description: Identifier of the user owning this document
879
- readOnly: true
880
- _model:
881
- type: string
882
- description: Name of the model this document belongs to
883
- readOnly: true
884
- default: message
885
- _hash:
886
- type: number
887
- description: Document hash for integrity verification
888
- readOnly: true
889
- _pack:
890
- type: string
891
- description: Name of the pack this document belongs to (if applicable)
892
- readOnly: true
893
- sender:
894
- type: string
895
- description: ID of a user document
896
- recipient:
897
- type: string
898
- description: ID of a user document
899
- lang:
900
- type: string
901
- description: ID of a lang document
902
- subject:
903
- type: string
904
- description: ""
905
- content:
906
- type: string
907
- description: ""
908
- channels:
909
- type: array
910
- items:
911
- type: string
912
- description: ID of a channel document
913
- status:
914
- type: string
915
- enum:
916
- - pending
917
- - sent
918
- - read
919
- - failed
920
- description: ""
921
- sentAt:
922
- type: string
923
- format: date-time
924
- description: ""
925
- readAt:
926
- type: string
927
- format: date-time
928
- description: ""
929
- type:
930
- type: string
931
- description: ""
932
- priority:
933
- type: string
934
- enum:
935
- - low
936
- - medium
937
- - high
938
- description: ""
939
- required:
940
- - content
941
- alert:
942
- type: object
943
- properties:
944
- _id:
945
- type: string
946
- description: Unique document identifier (MongoDB ObjectId)
947
- readOnly: true
948
- _user:
949
- type: string
950
- description: Identifier of the user owning this document
951
- readOnly: true
952
- _model:
953
- type: string
954
- description: Name of the model this document belongs to
955
- readOnly: true
956
- default: alert
957
- _hash:
958
- type: number
959
- description: Document hash for integrity verification
960
- readOnly: true
961
- _pack:
962
- type: string
963
- description: Name of the pack this document belongs to (if applicable)
964
- readOnly: true
965
- name:
966
- type: string
967
- description: ""
968
- targetModel:
969
- type: string
970
- description: "The name of the model to target."
971
- description:
972
- type: string
973
- description: ""
974
- triggerCondition:
975
- type: string
976
- description: "The condition that, if met, will trigger the alert."
977
- frequency:
978
- type: string
979
- description: "How often to check if the condition is met (CRON format)."
980
- isActive:
981
- type: boolean
982
- default: true
983
- description: ""
984
- sendEmail:
985
- type: boolean
986
- default: false
987
- description: "Check to also send an email notification."
988
- lastNotifiedAt:
989
- type: string
990
- format: date-time
991
- description: "Timestamp of the last notification sent for this alert."
992
- message:
993
- type: string
994
- description: "Custom message for the email. If empty, a default message will be used. You can use variables like {count}, {alert.name}..."
995
- required:
996
- - name
997
- - targetModel
998
- - triggerCondition
999
- - frequency
1000
- webpage:
1001
- type: object
1002
- properties:
1003
- _id:
1004
- type: string
1005
- description: Unique document identifier (MongoDB ObjectId)
1006
- readOnly: true
1007
- _user:
1008
- type: string
1009
- description: Identifier of the user owning this document
1010
- readOnly: true
1011
- _model:
1012
- type: string
1013
- description: Name of the model this document belongs to
1014
- readOnly: true
1015
- default: webpage
1016
- _hash:
1017
- type: number
1018
- description: Document hash for integrity verification
1019
- readOnly: true
1020
- _pack:
1021
- type: string
1022
- description: Name of the pack this document belongs to (if applicable)
1023
- readOnly: true
1024
- title:
1025
- type: string
1026
- description: ""
1027
- path:
1028
- type: string
1029
- description: ""
1030
- html:
1031
- type: string
1032
- description: ""
1033
- published:
1034
- type: boolean
1035
- default: false
1036
- description: ""
1037
- inSitemap:
1038
- type: boolean
1039
- default: true
1040
- description: ""
1041
- description:
1042
- type: string
1043
- description: ""
1044
- keywords:
1045
- type: array
1046
- items:
1047
- type: string
1048
- description: ID of a taxonomy document
1049
- image:
1050
- type: string
1051
- format: uri
1052
- description: ""
1053
- category:
1054
- type: string
1055
- description: ID of a taxonomy document
1056
- required:
1057
- - title
1058
- - path
1059
- content:
1060
- type: object
1061
- properties:
1062
- _id:
1063
- type: string
1064
- description: Unique document identifier (MongoDB ObjectId)
1065
- readOnly: true
1066
- _user:
1067
- type: string
1068
- description: Identifier of the user owning this document
1069
- readOnly: true
1070
- _model:
1071
- type: string
1072
- description: Name of the model this document belongs to
1073
- readOnly: true
1074
- default: content
1075
- _hash:
1076
- type: number
1077
- description: Document hash for integrity verification
1078
- readOnly: true
1079
- _pack:
1080
- type: string
1081
- description: Name of the pack this document belongs to (if applicable)
1082
- readOnly: true
1083
- lang:
1084
- type: string
1085
- description: ID of a lang document
1086
- title:
1087
- type: string
1088
- description: ""
1089
- slug:
1090
- type: string
1091
- description: ""
1092
- html:
1093
- type: string
1094
- description: ""
1095
- image:
1096
- type: string
1097
- format: uuid
1098
- description: "Mime types: image/jpeg, image/png, image/gif, image/webp."
1099
- published:
1100
- type: boolean
1101
- description: ""
1102
- publishedAt:
1103
- type: string
1104
- format: date-time
1105
- description: ""
1106
- author:
1107
- type: string
1108
- description: ID of a user document
1109
- category:
1110
- type: string
1111
- description: ID of a taxonomy document
1112
- keywords:
1113
- type: array
1114
- items:
1115
- type: string
1116
- description: ID of a taxonomy document
1117
- order:
1118
- type: number
1119
- default: 0
1120
- description: ""
1121
- required:
1122
- - title
1123
- resource:
1124
- type: object
1125
- properties:
1126
- _id:
1127
- type: string
1128
- description: Unique document identifier (MongoDB ObjectId)
1129
- readOnly: true
1130
- _user:
1131
- type: string
1132
- description: Identifier of the user owning this document
1133
- readOnly: true
1134
- _model:
1135
- type: string
1136
- description: Name of the model this document belongs to
1137
- readOnly: true
1138
- default: resource
1139
- _hash:
1140
- type: number
1141
- description: Document hash for integrity verification
1142
- readOnly: true
1143
- _pack:
1144
- type: string
1145
- description: Name of the pack this document belongs to (if applicable)
1146
- readOnly: true
1147
- source:
1148
- type: string
1149
- format: uri
1150
- description: ""
1151
- file:
1152
- type: string
1153
- format: uuid
1154
- description: ""
1155
- taxonomy:
1156
- type: object
1157
- properties:
1158
- _id:
1159
- type: string
1160
- description: Unique document identifier (MongoDB ObjectId)
1161
- readOnly: true
1162
- _user:
1163
- type: string
1164
- description: Identifier of the user owning this document
1165
- readOnly: true
1166
- _model:
1167
- type: string
1168
- description: Name of the model this document belongs to
1169
- readOnly: true
1170
- default: taxonomy
1171
- _hash:
1172
- type: number
1173
- description: Document hash for integrity verification
1174
- readOnly: true
1175
- _pack:
1176
- type: string
1177
- description: Name of the pack this document belongs to (if applicable)
1178
- readOnly: true
1179
- name:
1180
- type: string
1181
- description: ""
1182
- parent:
1183
- type: string
1184
- description: ID of a taxonomy document
1185
- type:
1186
- type: string
1187
- enum:
1188
- - keyword
1189
- - category
1190
- description: ""
1191
- identifier:
1192
- type: string
1193
- description: ""
1194
- order:
1195
- type: number
1196
- default: 0
1197
- description: ""
1198
- description:
1199
- type: string
1200
- description: ""
1201
- required:
1202
- - name
1203
- contact:
1204
- type: object
1205
- properties:
1206
- _id:
1207
- type: string
1208
- description: Unique document identifier (MongoDB ObjectId)
1209
- readOnly: true
1210
- _user:
1211
- type: string
1212
- description: Identifier of the user owning this document
1213
- readOnly: true
1214
- _model:
1215
- type: string
1216
- description: Name of the model this document belongs to
1217
- readOnly: true
1218
- default: contact
1219
- _hash:
1220
- type: number
1221
- description: Document hash for integrity verification
1222
- readOnly: true
1223
- _pack:
1224
- type: string
1225
- description: Name of the pack this document belongs to (if applicable)
1226
- readOnly: true
1227
- legalName:
1228
- type: string
1229
- description: ""
1230
- firstName:
1231
- type: string
1232
- description: ""
1233
- lastName:
1234
- type: string
1235
- description: ""
1236
- email:
1237
- type: string
1238
- format: email
1239
- description: ""
1240
- phone:
1241
- type: string
1242
- description: ""
1243
- location:
1244
- type: string
1245
- description: ID of a location document
1246
- location:
1247
- type: object
1248
- properties:
1249
- _id:
1250
- type: string
1251
- description: Unique document identifier (MongoDB ObjectId)
1252
- readOnly: true
1253
- _user:
1254
- type: string
1255
- description: Identifier of the user owning this document
1256
- readOnly: true
1257
- _model:
1258
- type: string
1259
- description: Name of the model this document belongs to
1260
- readOnly: true
1261
- default: location
1262
- _hash:
1263
- type: number
1264
- description: Document hash for integrity verification
1265
- readOnly: true
1266
- _pack:
1267
- type: string
1268
- description: Name of the pack this document belongs to (if applicable)
1269
- readOnly: true
1270
- address_1:
1271
- type: string
1272
- description: ""
1273
- address_2:
1274
- type: string
1275
- description: ""
1276
- address_3:
1277
- type: string
1278
- description: ""
1279
- address_4:
1280
- type: string
1281
- description: ""
1282
- city:
1283
- type: string
1284
- description: ""
1285
- postalCode:
1286
- type: string
1287
- description: ""
1288
- region:
1289
- type: string
1290
- description: ""
1291
- country:
1292
- type: string
1293
- description: ""
1294
- latitude:
1295
- type: number
1296
- description: "Unit: °"
1297
- longitude:
1298
- type: number
1299
- description: "Unit: °"
1300
- brand:
1301
- type: object
1302
- properties:
1303
- _id:
1304
- type: string
1305
- description: Unique document identifier (MongoDB ObjectId)
1306
- readOnly: true
1307
- _user:
1308
- type: string
1309
- description: Identifier of the user owning this document
1310
- readOnly: true
1311
- _model:
1312
- type: string
1313
- description: Name of the model this document belongs to
1314
- readOnly: true
1315
- default: brand
1316
- _hash:
1317
- type: number
1318
- description: Document hash for integrity verification
1319
- readOnly: true
1320
- _pack:
1321
- type: string
1322
- description: Name of the pack this document belongs to (if applicable)
1323
- readOnly: true
1324
- name:
1325
- type: string
1326
- description: ""
1327
- logo:
1328
- type: string
1329
- format: uuid
1330
- description: ""
1331
- company:
1332
- type: string
1333
- description: ID of a contact document
1334
- required:
1335
- - name
1336
- product:
1337
- type: object
1338
- properties:
1339
- _id:
1340
- type: string
1341
- description: Unique document identifier (MongoDB ObjectId)
1342
- readOnly: true
1343
- _user:
1344
- type: string
1345
- description: Identifier of the user owning this document
1346
- readOnly: true
1347
- _model:
1348
- type: string
1349
- description: Name of the model this document belongs to
1350
- readOnly: true
1351
- default: product
1352
- _hash:
1353
- type: number
1354
- description: Document hash for integrity verification
1355
- readOnly: true
1356
- _pack:
1357
- type: string
1358
- description: Name of the pack this document belongs to (if applicable)
1359
- readOnly: true
1360
- name:
1361
- type: string
1362
- description: ""
1363
- description:
1364
- type: string
1365
- description: ""
1366
- image:
1367
- type: array
1368
- items:
1369
- type: string
1370
- format: uuid
1371
- description: "Mime types: image/jpeg, image/png, image/gif, image/webp."
1372
- price:
1373
- type: number
1374
- description: ""
1375
- currency:
1376
- type: string
1377
- description: ID of a currency document
1378
- billingFrequency:
1379
- type: string
1380
- enum:
1381
- - none
1382
- - monthly
1383
- - yearly
1384
- description: ""
1385
- brand:
1386
- type: string
1387
- description: ID of a brand document
1388
- category:
1389
- type: string
1390
- description: ID of a taxonomy document
1391
- required:
1392
- - name
1393
- - price
1394
- - currency
1395
- productVariant:
1396
- type: object
1397
- properties:
1398
- _id:
1399
- type: string
1400
- description: Unique document identifier (MongoDB ObjectId)
1401
- readOnly: true
1402
- _user:
1403
- type: string
1404
- description: Identifier of the user owning this document
1405
- readOnly: true
1406
- _model:
1407
- type: string
1408
- description: Name of the model this document belongs to
1409
- readOnly: true
1410
- default: productVariant
1411
- _hash:
1412
- type: number
1413
- description: Document hash for integrity verification
1414
- readOnly: true
1415
- _pack:
1416
- type: string
1417
- description: Name of the pack this document belongs to (if applicable)
1418
- readOnly: true
1419
- product:
1420
- type: string
1421
- description: ID of a product document
1422
- size:
1423
- type: string
1424
- description: ""
1425
- color:
1426
- type: string
1427
- description: ""
1428
- sku:
1429
- type: string
1430
- description: ""
1431
- price:
1432
- type: number
1433
- description: ""
1434
- currency:
1435
- type: string
1436
- description: ID of a currency document
1437
- stock:
1438
- type: number
1439
- default: 0
1440
- description: ""
1441
- description:
1442
- type: string
1443
- description: ""
1444
- image:
1445
- type: string
1446
- format: uri
1447
- description: ""
1448
- required:
1449
- - product
1450
- - price
1451
- - currency
1452
- cart:
1453
- type: object
1454
- properties:
1455
- _id:
1456
- type: string
1457
- description: Unique document identifier (MongoDB ObjectId)
1458
- readOnly: true
1459
- _user:
1460
- type: string
1461
- description: Identifier of the user owning this document
1462
- readOnly: true
1463
- _model:
1464
- type: string
1465
- description: Name of the model this document belongs to
1466
- readOnly: true
1467
- default: cart
1468
- _hash:
1469
- type: number
1470
- description: Document hash for integrity verification
1471
- readOnly: true
1472
- _pack:
1473
- type: string
1474
- description: Name of the pack this document belongs to (if applicable)
1475
- readOnly: true
1476
- user:
1477
- type: string
1478
- description: ID of a user document
1479
- items:
1480
- type: array
1481
- items:
1482
- type: string
1483
- description: ID of a cartItem document
1484
- creationDate:
1485
- type: string
1486
- format: date-time
1487
- description: ""
1488
- lastUpdate:
1489
- type: string
1490
- format: date-time
1491
- description: ""
1492
- active:
1493
- type: boolean
1494
- default: true
1495
- description: ""
1496
- required:
1497
- - user
1498
- - creationDate
1499
- - lastUpdate
1500
- cartItem:
1501
- type: object
1502
- properties:
1503
- _id:
1504
- type: string
1505
- description: Unique document identifier (MongoDB ObjectId)
1506
- readOnly: true
1507
- _user:
1508
- type: string
1509
- description: Identifier of the user owning this document
1510
- readOnly: true
1511
- _model:
1512
- type: string
1513
- description: Name of the model this document belongs to
1514
- readOnly: true
1515
- default: cartItem
1516
- _hash:
1517
- type: number
1518
- description: Document hash for integrity verification
1519
- readOnly: true
1520
- _pack:
1521
- type: string
1522
- description: Name of the pack this document belongs to (if applicable)
1523
- readOnly: true
1524
- product:
1525
- type: string
1526
- description: ID of a product document
1527
- quantity:
1528
- type: number
1529
- minimum: 1
1530
- description: ""
1531
- variant:
1532
- type: string
1533
- description: ID of a productVariant document
1534
- required:
1535
- - product
1536
- - quantity
1537
- discount:
1538
- type: object
1539
- properties:
1540
- _id:
1541
- type: string
1542
- description: Unique document identifier (MongoDB ObjectId)
1543
- readOnly: true
1544
- _user:
1545
- type: string
1546
- description: Identifier of the user owning this document
1547
- readOnly: true
1548
- _model:
1549
- type: string
1550
- description: Name of the model this document
1
+ openapi: 3.0.0
2
+ info:
3
+ title: data.primals.net API
4
+ description: API for managing custom data, including account verification and generic CRUD operations.
5
+ version: 1.0.0
6
+ servers:
7
+ - url: http://localhost:7633
8
+ description: Local development server
9
+ - url: https://data.primals.net
10
+ description: Production server
11
+ security:
12
+ - BearerAuth: []
13
+ tags:
14
+ - name: Model Management
15
+ description: Operations related to data models.
16
+ - name: Data Management
17
+ description: Generic CRUD operations for all defined data models.
18
+ paths:
19
+
20
+ /api/model:
21
+ post:
22
+ tags:
23
+ - Model Management
24
+ summary: "Create a new model"
25
+ description: "Creates a new data model structure. User must have required permissions."
26
+ security:
27
+ - BearerAuth: [ ]
28
+ parameters:
29
+ - name: _user
30
+ in: query
31
+ required: true
32
+ description: "Your username for authentication."
33
+ schema:
34
+ type: string
35
+ requestBody:
36
+ required: true
37
+ description: "The model definition object to create. The structure must be valid."
38
+ content:
39
+ application/json:
40
+ schema:
41
+ type: object
42
+ description: "The complete model definition."
43
+ example:
44
+ name: "newModel"
45
+ description: "Description of my new model."
46
+ fields:
47
+ - name: "title"
48
+ type: "string"
49
+ required: true
50
+ - name: "price"
51
+ type: "number"
52
+ unit: ""
53
+ - name: "category"
54
+ type: "relation"
55
+ relation: "taxonomy"
56
+ responses:
57
+ '201':
58
+ description: "Model successfully created."
59
+ content:
60
+ application/json:
61
+ schema:
62
+ type: object
63
+ properties:
64
+ success:
65
+ type: boolean
66
+ example: true
67
+ insertedId:
68
+ type: string
69
+ description: "The ID of the newly created model."
70
+ example: "60d0fe4f5311236168a109ca"
71
+ '400':
72
+ description: "Invalid model definition or name already in use."
73
+ content:
74
+ application/json:
75
+ schema:
76
+ $ref: '#/components/schemas/ErrorResponse'
77
+ '401':
78
+ description: "Unauthorized (missing or invalid token)."
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: '#/components/schemas/ErrorResponse'
83
+ '403':
84
+ description: "Permission denied to create a model."
85
+ content:
86
+ application/json:
87
+ schema:
88
+ $ref: '#/components/schemas/ErrorResponse'
89
+ delete:
90
+ tags:
91
+ - Model Management
92
+ summary: "Delete a model"
93
+ description: "Deletes a data model and all associated data. This action is irreversible."
94
+ security:
95
+ - BearerAuth: [ ]
96
+ parameters:
97
+ - name: _user
98
+ in: query
99
+ required: true
100
+ description: "Your username for authentication."
101
+ schema:
102
+ type: string
103
+ - name: name
104
+ in: query
105
+ required: true
106
+ description: "The name of the model to delete."
107
+ schema:
108
+ type: string
109
+ responses:
110
+ '200':
111
+ description: "Model and associated data successfully deleted."
112
+ content:
113
+ application/json:
114
+ schema:
115
+ type: object
116
+ properties:
117
+ success:
118
+ type: boolean
119
+ example: true
120
+ '400':
121
+ description: "Invalid request (e.g., missing 'name' parameter)."
122
+ content:
123
+ application/json:
124
+ schema:
125
+ $ref: '#/components/schemas/ErrorResponse'
126
+ '401':
127
+ description: "Unauthorized (missing or invalid token)."
128
+ content:
129
+ application/json:
130
+ schema:
131
+ $ref: '#/components/schemas/ErrorResponse'
132
+ '403':
133
+ description: "Permission denied to delete this model."
134
+ content:
135
+ application/json:
136
+ schema:
137
+ $ref: '#/components/schemas/ErrorResponse'
138
+ '404':
139
+ description: "Model not found."
140
+ content:
141
+ application/json:
142
+ schema:
143
+ $ref: '#/components/schemas/ErrorResponse'
144
+
145
+ /api/model/{id}:
146
+ put:
147
+ tags:
148
+ - Model Management
149
+ summary: "Update an existing model"
150
+ description: "Updates the structure of an existing data model using its ID."
151
+ security:
152
+ - BearerAuth: [ ]
153
+ parameters:
154
+ - name: _user
155
+ in: query
156
+ required: true
157
+ description: "Your username for authentication."
158
+ schema:
159
+ type: string
160
+ - name: id
161
+ in: path
162
+ required: true
163
+ description: "The unique identifier (_id) of the model to update."
164
+ schema:
165
+ type: string
166
+ requestBody:
167
+ required: true
168
+ description: "The complete updated model definition object."
169
+ content:
170
+ application/json:
171
+ schema:
172
+ type: object
173
+ description: "The complete model definition."
174
+ example:
175
+ name: "updatedNewModel"
176
+ description: "Updated description."
177
+ fields:
178
+ - name: "title"
179
+ type: "string"
180
+ required: true
181
+ - name: "price"
182
+ type: "number"
183
+ unit: ""
184
+ - name: "status"
185
+ type: "enum"
186
+ items: [ "active", "inactive" ]
187
+ responses:
188
+ '200':
189
+ description: "Model successfully updated."
190
+ content:
191
+ application/json:
192
+ schema:
193
+ type: object
194
+ properties:
195
+ success:
196
+ type: boolean
197
+ example: true
198
+ data:
199
+ type: object
200
+ description: "The updated model document."
201
+ '400':
202
+ description: "Invalid request or model definition."
203
+ '401':
204
+ description: "Unauthorized (missing or invalid token)."
205
+ '403':
206
+ description: "Permission denied to modify this model."
207
+ '404':
208
+ description: "Model not found."
209
+ # --- Generic CRUD endpoints ---
210
+ /api/data/search:
211
+ post:
212
+ tags:
213
+ - Data Management
214
+ consumes:
215
+ - application/json
216
+ summary: "Search among data"
217
+ description: "Search across all data of the specified model."
218
+ security:
219
+ - BearerAuth: []
220
+ parameters:
221
+ - name: _user
222
+ in: query
223
+ required: true
224
+ description: "Your username for authentication."
225
+ schema:
226
+ type: string
227
+ - in: body
228
+ name: model
229
+ required: true
230
+ description: "The name of the data model (e.g., 'user', 'product')."
231
+ schema:
232
+ type: string
233
+ - name: filter
234
+ in: body
235
+ description: "MongoDB filter JSON object for the search."
236
+ schema:
237
+ type: object
238
+ example:
239
+ { "$and": [ { "lang": { "$eq": [ "$$this.code", "fr" ] } }, { "user": { "$exists": true } } ] }
240
+ - name: sort
241
+ in: query
242
+ description: "Sort parameter by field."
243
+ schema:
244
+ type: string
245
+ example: fieldName:ASC;fieldName2:DESC
246
+ - name: limit
247
+ in: query
248
+ description: "Maximum number of documents to return."
249
+ schema:
250
+ type: integer
251
+ default: 1000
252
+ - name: offset
253
+ in: query
254
+ description: "Number of documents to skip (for pagination)."
255
+ schema:
256
+ type: integer
257
+ default: 0
258
+ - name: depth
259
+ in: query
260
+ description: "Population depth for 'relation' type fields."
261
+ schema:
262
+ type: integer
263
+ default: 1
264
+ - name: env
265
+ in: query
266
+ description: "Environment filter (e.g. 'production')."
267
+ schema:
268
+ type: string
269
+ - name: lang
270
+ in: query
271
+ description: "Language used for error messages."
272
+ schema:
273
+ type: string
274
+ default: 'en'
275
+ requestBody:
276
+ required: true
277
+ content:
278
+ application/json:
279
+ schema:
280
+ type: array
281
+ description: "The returned data. Returned fields correspond to the model definition."
282
+ example:
283
+ [{ _id: "68624b95e59ff3523e72cfff", _hash: "6537742658626211", name: "New Product", price: 99.99}]
284
+ /api/data/{id}:
285
+ put:
286
+ tags:
287
+ - Data Management
288
+ summary: "Update a document"
289
+ description: "Updates an existing document using its ID."
290
+ security:
291
+ - BearerAuth: []
292
+ parameters:
293
+ - name: _user
294
+ in: query
295
+ required: true
296
+ description: "Your username for authentication."
297
+ schema:
298
+ type: string
299
+ - name: id
300
+ in: path
301
+ required: true
302
+ description: "The unique identifier (_id) of the document to update."
303
+ schema:
304
+ type: string
305
+ - name: lang
306
+ in: query
307
+ description: "Language used for error messages."
308
+ schema:
309
+ type: string
310
+ default: 'en'
311
+ - in: body
312
+ name: model
313
+ required: true
314
+ description: "The name of the data model (e.g., 'user', 'product')."
315
+ schema:
316
+ type: string
317
+ - name: data
318
+ in: body
319
+ required: true
320
+ description: "The data to edit. Using the $find operator is recommended to copy relational data by reference."
321
+ schema:
322
+ type: object
323
+ example: {}
324
+ responses:
325
+ '200':
326
+ description: "Document successfully updated."
327
+ '400':
328
+ description: "Invalid data."
329
+ '401':
330
+ description: "Unauthorized."
331
+ '404':
332
+ description: "Document not found."
333
+ /api/data:
334
+ post:
335
+ tags:
336
+ - Data Management
337
+ summary: "Create one or more documents"
338
+ description: "Creates one or more new documents in a specified model."
339
+ security:
340
+ - BearerAuth: [ ]
341
+ parameters:
342
+ - name: _user
343
+ in: query
344
+ required: true
345
+ description: "Your username for authentication."
346
+ schema:
347
+ type: string
348
+ - name: model
349
+ in: body
350
+ required: true
351
+ description: "The name of the model in which to create the documents."
352
+ schema:
353
+ type: string
354
+ - name: data
355
+ in: body
356
+ required: true
357
+ description: "The data to insert. Using the $find operator is recommended for relational data."
358
+ schema:
359
+ type: object
360
+ example: {}
361
+ - name: lang
362
+ in: query
363
+ description: "Language used for error messages."
364
+ schema:
365
+ type: string
366
+ default: 'en'
367
+ responses:
368
+ '201':
369
+ description: "Document(s) successfully created."
370
+ '400':
371
+ description: "Invalid data."
372
+ '401':
373
+ description: "Unauthorized."
374
+ put:
375
+ tags:
376
+ - Data Management
377
+ summary: "Bulk update documents"
378
+ description: "Updates an existing document using its ID."
379
+ security:
380
+ - BearerAuth: []
381
+ parameters:
382
+ - name: _user
383
+ in: query
384
+ required: true
385
+ description: "Your username for authentication."
386
+ schema:
387
+ type: string
388
+ - in: body
389
+ name: model
390
+ required: true
391
+ description: "The name of the data model (e.g., 'user', 'product')."
392
+ schema:
393
+ type: string
394
+ - name: data
395
+ in: body
396
+ required: true
397
+ description: "The data to edit. Using the $find operator is recommended to copy relational data by reference."
398
+ schema:
399
+ type: object
400
+ example: {}
401
+ - name: lang
402
+ in: query
403
+ description: "Language used for error messages."
404
+ schema:
405
+ type: string
406
+ default: 'en'
407
+ responses:
408
+ '200':
409
+ description: "Document successfully updated."
410
+ '400':
411
+ description: "Invalid data."
412
+ '401':
413
+ description: "Unauthorized."
414
+ '404':
415
+ description: "Document not found."
416
+ delete:
417
+ tags:
418
+ - Data Management
419
+ summary: "Delete one or more document(s)"
420
+ description: "Permanently deletes a document using its ID."
421
+ security:
422
+ - BearerAuth: []
423
+ parameters:
424
+ - name: _user
425
+ in: query
426
+ required: true
427
+ description: "Your username for authentication."
428
+ schema:
429
+ type: string
430
+ - name: ids
431
+ in: body
432
+ description: "The identifiers of the documents to delete."
433
+ schema:
434
+ type: string
435
+ - name: filter
436
+ in: body
437
+ description: "The MongoDB JSON filter to apply for bulk deletion."
438
+ schema:
439
+ type: object
440
+ example:
441
+ { "$and": [ { "lang": { "$eq": [ "$$this.code", "fr" ] } }, { "user": { "$exists": true } } ] }
442
+ - name: lang
443
+ in: query
444
+ description: "Language used for error messages."
445
+ schema:
446
+ type: string
447
+ default: 'en'
448
+ responses:
449
+ '200':
450
+ description: "Document successfully deleted."
451
+ '401':
452
+ description: "Unauthorized."
453
+ '404':
454
+ description: "Document not found."
455
+ components:
456
+ securitySchemes:
457
+ BearerAuth:
458
+ type: http
459
+ scheme: bearer
460
+ bearerFormat: JWT # Assuming JWT token usage
461
+ schemas:
462
+ # --- Common Responses ---
463
+ ErrorResponse:
464
+ type: object
465
+ properties:
466
+ success:
467
+ type: boolean
468
+ example: false
469
+ message:
470
+ type: string
471
+ example: "An internal error occurred."
472
+ SuccessResponse:
473
+ type: object
474
+ properties:
475
+ success:
476
+ type: boolean
477
+ example: true
478
+ message:
479
+ type: string
480
+ example: "Operation successful."
481
+ # --- Model Schemas ---
482
+ userPermission:
483
+ type: object
484
+ properties:
485
+ _id:
486
+ type: string
487
+ description: Unique document identifier (MongoDB ObjectId)
488
+ readOnly: true
489
+ _user:
490
+ type: string
491
+ description: Identifier of the user who owns this document
492
+ readOnly: true
493
+ _model:
494
+ type: string
495
+ description: Name of the model this document belongs to
496
+ readOnly: true
497
+ default: userPermission
498
+ _hash:
499
+ type: number
500
+ description: Document hash for integrity verification
501
+ readOnly: true
502
+ _pack:
503
+ type: string
504
+ description: Name of the pack this document belongs to (if applicable)
505
+ readOnly: true
506
+ user:
507
+ type: string
508
+ description: ID of a user document
509
+ permission:
510
+ type: string
511
+ description: ID of a permission document
512
+ isGranted:
513
+ type: boolean
514
+ description: "True to grant permission, False to explicitly revoke it."
515
+ expiresAt:
516
+ type: string
517
+ format: date-time
518
+ description: "If set, the exception (grant or revocation) is temporary."
519
+ env:
520
+ type: string
521
+ description: ID of a env document
522
+ required:
523
+ - user
524
+ - permission
525
+ - isGranted
526
+ alert:
527
+ type: object
528
+ properties:
529
+ _id:
530
+ type: string
531
+ description: Unique document identifier (MongoDB ObjectId)
532
+ readOnly: true
533
+ _user:
534
+ type: string
535
+ description: Identifier of the user who owns this document
536
+ readOnly: true
537
+ _model:
538
+ type: string
539
+ description: Name of the model this document belongs to
540
+ readOnly: true
541
+ default: alert
542
+ _hash:
543
+ type: number
544
+ description: Document hash for integrity verification
545
+ readOnly: true
546
+ _pack:
547
+ type: string
548
+ description: Name of the pack this document belongs to (if applicable)
549
+ readOnly: true
550
+ name:
551
+ type: string
552
+ description: ""
553
+ targetModel:
554
+ type: string
555
+ description: ""
556
+ description:
557
+ type: string
558
+ description: ""
559
+ triggerCondition:
560
+ type: string
561
+ format: text
562
+ description: "The condition that, if met, will trigger the alert."
563
+ frequency:
564
+ type: string
565
+ description: "How often to check if the condition is met."
566
+ isActive:
567
+ type: boolean
568
+ default: true
569
+ description: ""
570
+ sendEmail:
571
+ type: boolean
572
+ default: false
573
+ description: "Check to also send email notification."
574
+ lastNotifiedAt:
575
+ type: string
576
+ format: date-time
577
+ description: "Timestamp of the last notification sent for this alert."
578
+ message:
579
+ type: string
580
+ description: "Custom message for email. If empty, a default message will be used. You can use variables {count}, {alert.name}...."
581
+ required:
582
+ - name
583
+ - targetModel
584
+ - triggerCondition
585
+ - frequency
586
+ env:
587
+ type: object
588
+ properties:
589
+ _id:
590
+ type: string
591
+ description: Unique document identifier (MongoDB ObjectId)
592
+ readOnly: true
593
+ _user:
594
+ type: string
595
+ description: Identifier of the user who owns this document
596
+ readOnly: true
597
+ _model:
598
+ type: string
599
+ description: Name of the model this document belongs to
600
+ readOnly: true
601
+ default: env
602
+ _hash:
603
+ type: number
604
+ description: Document hash for integrity verification
605
+ readOnly: true
606
+ _pack:
607
+ type: string
608
+ description: Name of the pack this document belongs to (if applicable)
609
+ readOnly: true
610
+ name:
611
+ type: string
612
+ description: ""
613
+ value:
614
+ type: string
615
+ description: ""
616
+ required:
617
+ - name
618
+ kpi:
619
+ type: object
620
+ properties:
621
+ _id:
622
+ type: string
623
+ description: Unique document identifier (MongoDB ObjectId)
624
+ readOnly: true
625
+ _user:
626
+ type: string
627
+ description: Identifier of the user who owns this document
628
+ readOnly: true
629
+ _model:
630
+ type: string
631
+ description: Name of the model this document belongs to
632
+ readOnly: true
633
+ default: kpi
634
+ _hash:
635
+ type: number
636
+ description: Document hash for integrity verification
637
+ readOnly: true
638
+ _pack:
639
+ type: string
640
+ description: Name of the pack this document belongs to (if applicable)
641
+ readOnly: true
642
+ name:
643
+ type: string
644
+ description: "Display name of KPI (e.g., Total Revenue)"
645
+ description:
646
+ type: string
647
+ description: "Additional information about the KPI"
648
+ targetModel:
649
+ type: string
650
+ description: "Name of the model on which to calculate the KPI (e.g., order)"
651
+ aggregationType:
652
+ type: string
653
+ enum:
654
+ - count
655
+ - sum
656
+ - avg
657
+ - min
658
+ - max
659
+ description: "Type of calculation to perform"
660
+ aggregationField:
661
+ type: string
662
+ description: "Name of the numeric field to apply aggregation to (e.g., totalAmount). Not required for 'count'."
663
+ matchFormula:
664
+ type: string
665
+ format: text
666
+ description: "JSON filter (MongoDB $match) to apply before aggregation (e.g., { \"status\": \"delivered\" })"
667
+ showTotal:
668
+ type: boolean
669
+ description: "Show total"
670
+ showPercentTotal:
671
+ type: boolean
672
+ description: "Show total in %"
673
+ totalMatchFormula:
674
+ type: string
675
+ format: text
676
+ description: "Formula for total (% calculation)"
677
+ unit:
678
+ type: string
679
+ description: "Unit to display (e.g., €, $, users)"
680
+ icon:
681
+ type: string
682
+ description: "Icon name (e.g., FaUsers, FaShoppingCart)"
683
+ order:
684
+ type: number
685
+ description: "Display order on dashboard"
686
+ color:
687
+ type: string
688
+ format: color
689
+ description: "Color associated with KPI"
690
+ required:
691
+ - name
692
+ - targetModel
693
+ - aggregationType
694
+ imageGallery:
695
+ type: object
696
+ properties:
697
+ _id:
698
+ type: string
699
+ description: Unique document identifier (MongoDB ObjectId)
700
+ readOnly: true
701
+ _user:
702
+ type: string
703
+ description: Identifier of the user who owns this document
704
+ readOnly: true
705
+ _model:
706
+ type: string
707
+ description: Name of the model this document belongs to
708
+ readOnly: true
709
+ default: imageGallery
710
+ _hash:
711
+ type: number
712
+ description: Document hash for integrity verification
713
+ readOnly: true
714
+ _pack:
715
+ type: string
716
+ description: Name of the pack this document belongs to (if applicable)
717
+ readOnly: true
718
+ name:
719
+ type: string
720
+ description: "The name or title of the image gallery."
721
+ images:
722
+ type: array
723
+ items:
724
+ type: string
725
+ format: uuid
726
+ description: "The image files in this gallery."
727
+ description:
728
+ type: string
729
+ description: "Gallery description (optional)."
730
+ tags:
731
+ type: array
732
+ items:
733
+ type: string
734
+ description: ID of a taxonomy document
735
+ createdAt:
736
+ type: string
737
+ format: date-time
738
+ description: "Gallery creation date (usually managed by system)."
739
+ required:
740
+ - name
741
+ budget:
742
+ type: object
743
+ properties:
744
+ _id:
745
+ type: string
746
+ description: Unique document identifier (MongoDB ObjectId)
747
+ readOnly: true
748
+ _user:
749
+ type: string
750
+ description: Identifier of the user who owns this document
751
+ readOnly: true
752
+ _model:
753
+ type: string
754
+ description: Name of the model this document belongs to
755
+ readOnly: true
756
+ default: budget
757
+ _hash:
758
+ type: number
759
+ description: Document hash for integrity verification
760
+ readOnly: true
761
+ _pack:
762
+ type: string
763
+ description: Name of the pack this document belongs to (if applicable)
764
+ readOnly: true
765
+ name:
766
+ type: string
767
+ description: "Transaction name or description (e.g., Groceries, January Salary)."
768
+ amount:
769
+ type: number
770
+ description: "Transaction amount. Positive for income, negative for expense."
771
+ currency:
772
+ type: string
773
+ description: ID of a currency document
774
+ transactionDate:
775
+ type: string
776
+ format: date-time
777
+ description: "Date when the transaction occurred."
778
+ description:
779
+ type: string
780
+ description: "Additional notes or details about the transaction."
781
+ paymentMethod:
782
+ type: string
783
+ description: "Payment method used (e.g., Credit Card, Cash, Bank Transfer)."
784
+ category:
785
+ type: string
786
+ description: ID of a taxonomy document
787
+ isRecurring:
788
+ type: boolean
789
+ default: false
790
+ description: "Indicates if this transaction is recurring."
791
+ recurringFrequency:
792
+ type: string
793
+ enum:
794
+ - daily
795
+ - weekly
796
+ - monthly
797
+ - yearly
798
+ description: ""
799
+ recurringEndDate:
800
+ type: string
801
+ format: date
802
+ description: ""
803
+ attachments:
804
+ type: array
805
+ items:
806
+ type: string
807
+ format: uuid
808
+ description: "Attachments (receipts, invoices)."
809
+ required:
810
+ - name
811
+ - amount
812
+ - currency
813
+ - transactionDate
814
+ event:
815
+ type: object
816
+ properties:
817
+ _id:
818
+ type: string
819
+ description: Unique document identifier (MongoDB ObjectId)
820
+ readOnly: true
821
+ _user:
822
+ type: string
823
+ description: Identifier of the user who owns this document
824
+ readOnly: true
825
+ _model:
826
+ type: string
827
+ description: Name of the model this document belongs to
828
+ readOnly: true
829
+ default: event
830
+ _hash:
831
+ type: number
832
+ description: Document hash for integrity verification
833
+ readOnly: true
834
+ _pack:
835
+ type: string
836
+ description: Name of the pack this document belongs to (if applicable)
837
+ readOnly: true
838
+ title:
839
+ type: string
840
+ description: "The title of the event"
841
+ description:
842
+ type: string
843
+ description: "A detailed description of the event, including agenda, speakers, and other relevant information."
844
+ startDate:
845
+ type: string
846
+ format: date-time
847
+ description: "The starting date and time of the event"
848
+ endDate:
849
+ type: string
850
+ format: date-time
851
+ description: "The ending date and time of the event"
852
+ location:
853
+ type: string
854
+ description: ID of a location document
855
+ categories:
856
+ type: array
857
+ items:
858
+ type: string
859
+ description: ID of a taxonomy document
860
+ organizer:
861
+ type: string
862
+ description: ID of a contact document
863
+ isOnline:
864
+ type: boolean
865
+ default: false
866
+ description: "Whether the event is online or in-person."
867
+ eventUrl:
868
+ type: string
869
+ format: uri
870
+ description: "A link to the official event webpage or registration page."
871
+ imageUrl:
872
+ type: string
873
+ format: uuid
874
+ description: "URL of the event image or banner."
875
+ status:
876
+ type: string
877
+ enum:
878
+ - scheduled
879
+ - ongoing
880
+ - completed
881
+ - cancelled
882
+ - postponed
883
+ description: "The current status of the event."
884
+ capacity:
885
+ type: number
886
+ description: "The maximum number of attendees allowed for the event."
887
+ price:
888
+ type: number
889
+ description: "The price of admission, if applicable."
890
+ currency:
891
+ type: string
892
+ description: ID of a currency document
893
+ registrationDeadline:
894
+ type: string
895
+ format: date-time
896
+ description: "The date by which attendees must register for the event."
897
+ attendees:
898
+ type: array
899
+ items:
900
+ type: string
901
+ description: ID of a contact document
902
+ sponsors:
903
+ type: array
904
+ items:
905
+ type: string
906
+ description: ID of a contact document
907
+ required:
908
+ - title
909
+ - startDate
910
+ - endDate
911
+ endpoint:
912
+ type: object
913
+ properties:
914
+ _id:
915
+ type: string
916
+ description: Unique document identifier (MongoDB ObjectId)
917
+ readOnly: true
918
+ _user:
919
+ type: string
920
+ description: Identifier of the user who owns this document
921
+ readOnly: true
922
+ _model:
923
+ type: string
924
+ description: Name of the model this document belongs to
925
+ readOnly: true
926
+ default: endpoint
927
+ _hash:
928
+ type: number
929
+ description: Document hash for integrity verification
930
+ readOnly: true
931
+ _pack:
932
+ type: string
933
+ description: Name of the pack this document belongs to (if applicable)
934
+ readOnly: true
935
+ isActive:
936
+ type: boolean
937
+ default: true
938
+ description: "If checked, the endpoint is active and can be called."
939
+ name:
940
+ type: string
941
+ description: "A human-readable name to identify the endpoint."
942
+ path:
943
+ type: string
944
+ description: "The URL path after /api/actions/ (e.g., 'send-welcome-email'). Do not include '/'."
945
+ method:
946
+ type: string
947
+ enum:
948
+ - GET
949
+ - POST
950
+ - PUT
951
+ - PATCH
952
+ - DELETE
953
+ description: "The HTTP method required to call this endpoint."
954
+ code:
955
+ type: string
956
+ format: text
957
+ description: "The script to execute. Must return a value or an object that will be the JSON response."
958
+ isPublic:
959
+ type: boolean
960
+ default: false
961
+ description: "If checked, this endpoint will be accessible without authentication."
962
+ required:
963
+ - isActive
964
+ - name
965
+ - path
966
+ - method
967
+ - code
968
+ permission:
969
+ type: object
970
+ properties:
971
+ _id:
972
+ type: string
973
+ description: Unique document identifier (MongoDB ObjectId)
974
+ readOnly: true
975
+ _user:
976
+ type: string
977
+ description: Identifier of the user who owns this document
978
+ readOnly: true
979
+ _model:
980
+ type: string
981
+ description: Name of the model this document belongs to
982
+ readOnly: true
983
+ default: permission
984
+ _hash:
985
+ type: number
986
+ description: Document hash for integrity verification
987
+ readOnly: true
988
+ _pack:
989
+ type: string
990
+ description: Name of the pack this document belongs to (if applicable)
991
+ readOnly: true
992
+ name:
993
+ type: string
994
+ description: ""
995
+ description:
996
+ type: string
997
+ description: ""
998
+ role:
999
+ type: object
1000
+ properties:
1001
+ _id:
1002
+ type: string
1003
+ description: Unique document identifier (MongoDB ObjectId)
1004
+ readOnly: true
1005
+ _user:
1006
+ type: string
1007
+ description: Identifier of the user who owns this document
1008
+ readOnly: true
1009
+ _model:
1010
+ type: string
1011
+ description: Name of the model this document belongs to
1012
+ readOnly: true
1013
+ default: role
1014
+ _hash:
1015
+ type: number
1016
+ description: Document hash for integrity verification
1017
+ readOnly: true
1018
+ _pack:
1019
+ type: string
1020
+ description: Name of the pack this document belongs to (if applicable)
1021
+ readOnly: true
1022
+ name:
1023
+ type: string
1024
+ description: ""
1025
+ permissions:
1026
+ type: array
1027
+ items:
1028
+ type: string
1029
+ description: ID of a permission document
1030
+ required:
1031
+ - name
1032
+ user:
1033
+ type: object
1034
+ properties:
1035
+ _id:
1036
+ type: string
1037
+ description: Unique document identifier (MongoDB ObjectId)
1038
+ readOnly: true
1039
+ _user:
1040
+ type: string
1041
+ description: Identifier of the user who owns this document
1042
+ readOnly: true
1043
+ _model:
1044
+ type: string
1045
+ description: Name of the model this document belongs to
1046
+ readOnly: true
1047
+ default: user
1048
+ _hash:
1049
+ type: number
1050
+ description: Document hash for integrity verification
1051
+ readOnly: true
1052
+ _pack:
1053
+ type: string
1054
+ description: Name of the pack this document belongs to (if applicable)
1055
+ readOnly: true
1056
+ username:
1057
+ type: string
1058
+ description: ""
1059
+ password:
1060
+ type: string
1061
+ format: password
1062
+ description: ""
1063
+ gender:
1064
+ type: string
1065
+ enum:
1066
+ - male
1067
+ - female
1068
+ - other
1069
+ - prefer_not_to_say
1070
+ description: ""
1071
+ contact:
1072
+ type: string
1073
+ description: ID of a contact document
1074
+ roles:
1075
+ type: array
1076
+ items:
1077
+ type: string
1078
+ description: ID of a role document
1079
+ lang:
1080
+ type: string
1081
+ description: ID of a lang document
1082
+ profilePicture:
1083
+ type: string
1084
+ format: uuid
1085
+ description: "Mime types: image/jpeg, image/png."
1086
+ tokens:
1087
+ type: array
1088
+ items:
1089
+ type: string
1090
+ description: ID of a token document
1091
+ required:
1092
+ - username
1093
+ token:
1094
+ type: object
1095
+ properties:
1096
+ _id:
1097
+ type: string
1098
+ description: Unique document identifier (MongoDB ObjectId)
1099
+ readOnly: true
1100
+ _user:
1101
+ type: string
1102
+ description: Identifier of the user who owns this document
1103
+ readOnly: true
1104
+ _model:
1105
+ type: string
1106
+ description: Name of the model this document belongs to
1107
+ readOnly: true
1108
+ default: token
1109
+ _hash:
1110
+ type: number
1111
+ description: Document hash for integrity verification
1112
+ readOnly: true
1113
+ _pack:
1114
+ type: string
1115
+ description: Name of the pack this document belongs to (if applicable)
1116
+ readOnly: true
1117
+ name:
1118
+ type: string
1119
+ description: ""
1120
+ value:
1121
+ type: string
1122
+ format: password
1123
+ description: ""
1124
+ lastRefresh:
1125
+ type: string
1126
+ format: date-time
1127
+ description: ""
1128
+ translation:
1129
+ type: object
1130
+ properties:
1131
+ _id:
1132
+ type: string
1133
+ description: Unique document identifier (MongoDB ObjectId)
1134
+ readOnly: true
1135
+ _user:
1136
+ type: string
1137
+ description: Identifier of the user who owns this document
1138
+ readOnly: true
1139
+ _model:
1140
+ type: string
1141
+ description: Name of the model this document belongs to
1142
+ readOnly: true
1143
+ default: translation
1144
+ _hash:
1145
+ type: number
1146
+ description: Document hash for integrity verification
1147
+ readOnly: true
1148
+ _pack:
1149
+ type: string
1150
+ description: Name of the pack this document belongs to (if applicable)
1151
+ readOnly: true
1152
+ lang:
1153
+ type: string
1154
+ description: ID of a lang document
1155
+ key:
1156
+ type: string
1157
+ maxLength: 200
1158
+ description: ""
1159
+ value:
1160
+ type: string
1161
+ description: ""
1162
+ required:
1163
+ - lang
1164
+ - key
1165
+ lang:
1166
+ type: object
1167
+ properties:
1168
+ _id:
1169
+ type: string
1170
+ description: Unique document identifier (MongoDB ObjectId)
1171
+ readOnly: true
1172
+ _user:
1173
+ type: string
1174
+ description: Identifier of the user who owns this document
1175
+ readOnly: true
1176
+ _model:
1177
+ type: string
1178
+ description: Name of the model this document belongs to
1179
+ readOnly: true
1180
+ default: lang
1181
+ _hash:
1182
+ type: number
1183
+ description: Document hash for integrity verification
1184
+ readOnly: true
1185
+ _pack:
1186
+ type: string
1187
+ description: Name of the pack this document belongs to (if applicable)
1188
+ readOnly: true
1189
+ name:
1190
+ type: string
1191
+ maxLength: 200
1192
+ description: ""
1193
+ code:
1194
+ type: string
1195
+ maxLength: 5
1196
+ description: ""
1197
+ currency:
1198
+ type: object
1199
+ properties:
1200
+ _id:
1201
+ type: string
1202
+ description: Unique document identifier (MongoDB ObjectId)
1203
+ readOnly: true
1204
+ _user:
1205
+ type: string
1206
+ description: Identifier of the user who owns this document
1207
+ readOnly: true
1208
+ _model:
1209
+ type: string
1210
+ description: Name of the model this document belongs to
1211
+ readOnly: true
1212
+ default: currency
1213
+ _hash:
1214
+ type: number
1215
+ description: Document hash for integrity verification
1216
+ readOnly: true
1217
+ _pack:
1218
+ type: string
1219
+ description: Name of the pack this document belongs to (if applicable)
1220
+ readOnly: true
1221
+ symbol:
1222
+ type: string
1223
+ maxLength: 5
1224
+ description: ""
1225
+ code:
1226
+ type: string
1227
+ maxLength: 3
1228
+ description: ""
1229
+ name:
1230
+ type: string
1231
+ description: ""
1232
+ exchangeRate:
1233
+ type: number
1234
+ description: ""
1235
+ default:
1236
+ type: boolean
1237
+ default: false
1238
+ description: ""
1239
+ required:
1240
+ - symbol
1241
+ - code
1242
+ - name
1243
+ channel:
1244
+ type: object
1245
+ properties:
1246
+ _id:
1247
+ type: string
1248
+ description: Unique document identifier (MongoDB ObjectId)
1249
+ readOnly: true
1250
+ _user:
1251
+ type: string
1252
+ description: Identifier of the user who owns this document
1253
+ readOnly: true
1254
+ _model:
1255
+ type: string
1256
+ description: Name of the model this document belongs to
1257
+ readOnly: true
1258
+ default: channel
1259
+ _hash:
1260
+ type: number
1261
+ description: Document hash for integrity verification
1262
+ readOnly: true
1263
+ _pack:
1264
+ type: string
1265
+ description: Name of the pack this document belongs to (if applicable)
1266
+ readOnly: true
1267
+ name:
1268
+ type: string
1269
+ description: ""
1270
+ description:
1271
+ type: string
1272
+ description: ""
1273
+ type:
1274
+ type: string
1275
+ enum:
1276
+ - email
1277
+ - SMS
1278
+ - forum
1279
+ - messaging
1280
+ - push
1281
+ - in-app
1282
+ description: ""
1283
+ required:
1284
+ - name
1285
+ - type
1286
+ message:
1287
+ type: object
1288
+ properties:
1289
+ _id:
1290
+ type: string
1291
+ description: Unique document identifier (MongoDB ObjectId)
1292
+ readOnly: true
1293
+ _user:
1294
+ type: string
1295
+ description: Identifier of the user who owns this document
1296
+ readOnly: true
1297
+ _model:
1298
+ type: string
1299
+ description: Name of the model this document belongs to
1300
+ readOnly: true
1301
+ default: message
1302
+ _hash:
1303
+ type: number
1304
+ description: Document hash for integrity verification
1305
+ readOnly: true
1306
+ _pack:
1307
+ type: string
1308
+ description: Name of the pack this document belongs to (if applicable)
1309
+ readOnly: true
1310
+ sender:
1311
+ type: string
1312
+ description: ID of a user document
1313
+ recipient:
1314
+ type: string
1315
+ description: ID of a user document
1316
+ lang:
1317
+ type: string
1318
+ description: ID of a lang document
1319
+ subject:
1320
+ type: string
1321
+ description: ""
1322
+ content:
1323
+ type: string
1324
+ description: ""
1325
+ channels:
1326
+ type: array
1327
+ items:
1328
+ type: string
1329
+ description: ID of a channel document
1330
+ status:
1331
+ type: string
1332
+ enum:
1333
+ - pending
1334
+ - sent
1335
+ - read
1336
+ - failed
1337
+ description: ""
1338
+ sentAt:
1339
+ type: string
1340
+ format: date-time
1341
+ description: ""
1342
+ readAt:
1343
+ type: string
1344
+ format: date-time
1345
+ description: ""
1346
+ type:
1347
+ type: string
1348
+ description: ""
1349
+ priority:
1350
+ type: string
1351
+ enum:
1352
+ - low
1353
+ - medium
1354
+ - high
1355
+ description: ""
1356
+ required:
1357
+ - content
1358
+ webpage:
1359
+ type: object
1360
+ properties:
1361
+ _id:
1362
+ type: string
1363
+ description: Unique document identifier (MongoDB ObjectId)
1364
+ readOnly: true
1365
+ _user:
1366
+ type: string
1367
+ description: Identifier of the user who owns this document
1368
+ readOnly: true
1369
+ _model:
1370
+ type: string
1371
+ description: Name of the model this document belongs to
1372
+ readOnly: true
1373
+ default: webpage
1374
+ _hash:
1375
+ type: number
1376
+ description: Document hash for integrity verification
1377
+ readOnly: true
1378
+ _pack:
1379
+ type: string
1380
+ description: Name of the pack this document belongs to (if applicable)
1381
+ readOnly: true
1382
+ title:
1383
+ type: string
1384
+ description: ""
1385
+ path:
1386
+ type: string
1387
+ description: ""
1388
+ html:
1389
+ type: string
1390
+ description: ""
1391
+ published:
1392
+ type: boolean
1393
+ default: false
1394
+ description: ""
1395
+ inSitemap:
1396
+ type: boolean
1397
+ default: true
1398
+ description: ""
1399
+ description:
1400
+ type: string
1401
+ description: ""
1402
+ keywords:
1403
+ type: array
1404
+ items:
1405
+ type: string
1406
+ description: ID of a taxonomy document
1407
+ image:
1408
+ type: string
1409
+ format: uri
1410
+ description: ""
1411
+ category:
1412
+ type: string
1413
+ description: ID of a taxonomy document
1414
+ required:
1415
+ - title
1416
+ - path
1417
+ content:
1418
+ type: object
1419
+ properties:
1420
+ _id:
1421
+ type: string
1422
+ description: Unique document identifier (MongoDB ObjectId)
1423
+ readOnly: true
1424
+ _user:
1425
+ type: string
1426
+ description: Identifier of the user who owns this document
1427
+ readOnly: true
1428
+ _model:
1429
+ type: string
1430
+ description: Name of the model this document belongs to
1431
+ readOnly: true
1432
+ default: content
1433
+ _hash:
1434
+ type: number
1435
+ description: Document hash for integrity verification
1436
+ readOnly: true
1437
+ _pack:
1438
+ type: string
1439
+ description: Name of the pack this document belongs to (if applicable)
1440
+ readOnly: true
1441
+ lang:
1442
+ type: string
1443
+ description: ID of a lang document
1444
+ title:
1445
+ type: string
1446
+ description: ""
1447
+ slug:
1448
+ type: string
1449
+ description: ""
1450
+ html:
1451
+ type: string
1452
+ description: ""
1453
+ image:
1454
+ type: string
1455
+ format: uuid
1456
+ description: "Mime types: image/jpeg, image/png, image/gif, image/webp."
1457
+ published:
1458
+ type: boolean
1459
+ description: ""
1460
+ publishedAt:
1461
+ type: string
1462
+ format: date-time
1463
+ description: ""
1464
+ author:
1465
+ type: string
1466
+ description: ID of a user document
1467
+ category:
1468
+ type: string
1469
+ description: ID of a taxonomy document
1470
+ keywords:
1471
+ type: array
1472
+ items:
1473
+ type: string
1474
+ description: ID of a taxonomy document
1475
+ order:
1476
+ type: number
1477
+ default: 0
1478
+ description: ""
1479
+ required:
1480
+ - title
1481
+ resource:
1482
+ type: object
1483
+ properties:
1484
+ _id:
1485
+ type: string
1486
+ description: Unique document identifier (MongoDB ObjectId)
1487
+ readOnly: true
1488
+ _user:
1489
+ type: string
1490
+ description: Identifier of the user who owns this document
1491
+ readOnly: true
1492
+ _model:
1493
+ type: string
1494
+ description: Name of the model this document belongs to
1495
+ readOnly: true
1496
+ default: resource
1497
+ _hash:
1498
+ type: number
1499
+ description: Document hash for integrity verification
1500
+ readOnly: true
1501
+ _pack:
1502
+ type: string
1503
+ description: Name of the pack this document belongs to (if applicable)
1504
+ readOnly: true
1505
+ source:
1506
+ type: string
1507
+ format: uri
1508
+ description: ""
1509
+ file:
1510
+ type: string
1511
+ format: uuid
1512
+ description: ""
1513
+ taxonomy:
1514
+ type: object
1515
+ properties:
1516
+ _id:
1517
+ type: string
1518
+ description: Unique document identifier (MongoDB ObjectId)
1519
+ readOnly: true
1520
+ _user:
1521
+ type: string
1522
+ description: Identifier of the user who owns this document
1523
+ readOnly: true
1524
+ _model:
1525
+ type: string
1526
+ description: Name of the model this document belongs to
1527
+ readOnly: true
1528
+ default: taxonomy
1529
+ _hash:
1530
+ type: number
1531
+ description: Document hash for integrity verification
1532
+ readOnly: true
1533
+ _pack:
1534
+ type: string
1535
+ description: Name of the pack this document belongs to (if applicable)
1536
+ readOnly: true
1537
+ name:
1538
+ type: string
1539
+ description: ""
1540
+ parent:
1541
+ type: string
1542
+ description: ID of a taxonomy document
1543
+ type:
1544
+ type: string
1545
+ enum:
1546
+ - keyword
1547
+ - category
1548
+ description: ""
1549
+ identifier:
1550
+ type: string
1551
+ description: ""
1552
+ order:
1553
+ type: number
1554
+ default: 0
1555
+ description: ""
1556
+ description:
1557
+ type: string
1558
+ description: ""
1559
+ required:
1560
+ - name
1561
+ contact:
1562
+ type: object
1563
+ properties:
1564
+ _id:
1565
+ type: string
1566
+ description: Unique document identifier (MongoDB ObjectId)
1567
+ readOnly: true
1568
+ _user:
1569
+ type: string
1570
+ description: Identifier of the user who owns this document
1571
+ readOnly: true
1572
+ _model:
1573
+ type: string
1574
+ description: Name of the model this document belongs to
1575
+ readOnly: true
1576
+ default: contact
1577
+ _hash:
1578
+ type: number
1579
+ description: Document hash for integrity verification
1580
+ readOnly: true
1581
+ _pack:
1582
+ type: string
1583
+ description: Name of the pack this document belongs to (if applicable)
1584
+ readOnly: true
1585
+ legalName:
1586
+ type: string
1587
+ description: ""
1588
+ firstName:
1589
+ type: string
1590
+ description: ""
1591
+ lastName:
1592
+ type: string
1593
+ description: ""
1594
+ email:
1595
+ type: string
1596
+ format: email
1597
+ description: ""
1598
+ phone:
1599
+ type: string
1600
+ description: ""
1601
+ location:
1602
+ type: string
1603
+ description: ID of a location document
1604
+ location:
1605
+ type: object
1606
+ properties:
1607
+ _id:
1608
+ type: string
1609
+ description: Unique document identifier (MongoDB ObjectId)
1610
+ readOnly: true
1611
+ _user:
1612
+ type: string
1613
+ description: Identifier of the user who owns this document
1614
+ readOnly: true
1615
+ _model:
1616
+ type: string
1617
+ description: Name of the model this document belongs to
1618
+ readOnly: true
1619
+ default: location
1620
+ _hash:
1621
+ type: number
1622
+ description: Document hash for integrity verification
1623
+ readOnly: true
1624
+ _pack:
1625
+ type: string
1626
+ description: Name of the pack this document belongs to (if applicable)
1627
+ readOnly: true
1628
+ address_1:
1629
+ type: string
1630
+ description: ""
1631
+ address_2:
1632
+ type: string
1633
+ description: ""
1634
+ address_3:
1635
+ type: string
1636
+ description: ""
1637
+ address_4:
1638
+ type: string
1639
+ description: ""
1640
+ city:
1641
+ type: string
1642
+ description: ""
1643
+ postalCode:
1644
+ type: string
1645
+ description: ""
1646
+ region:
1647
+ type: string
1648
+ description: ""
1649
+ country:
1650
+ type: string
1651
+ description: ""
1652
+ latitude:
1653
+ type: number
1654
+ description: "Unit: °"
1655
+ longitude:
1656
+ type: number
1657
+ description: "Unit: °"
1658
+ brand:
1659
+ type: object
1660
+ properties:
1661
+ _id:
1662
+ type: string
1663
+ description: Unique document identifier (MongoDB ObjectId)
1664
+ readOnly: true
1665
+ _user:
1666
+ type: string
1667
+ description: Identifier of the user who owns this document
1668
+ readOnly: true
1669
+ _model:
1670
+ type: string
1671
+ description: Name of the model this document belongs to
1672
+ readOnly: true
1673
+ default: brand
1674
+ _hash:
1675
+ type: number
1676
+ description: Document hash for integrity verification
1677
+ readOnly: true
1678
+ _pack:
1679
+ type: string
1680
+ description: Name of the pack this document belongs to (if applicable)
1681
+ readOnly: true
1682
+ name:
1683
+ type: string
1684
+ description: ""
1685
+ logo:
1686
+ type: string
1687
+ format: uuid
1688
+ description: ""
1689
+ company:
1690
+ type: string
1691
+ description: ID of a contact document
1692
+ required:
1693
+ - name
1694
+ product:
1695
+ type: object
1696
+ properties:
1697
+ _id:
1698
+ type: string
1699
+ description: Unique document identifier (MongoDB ObjectId)
1700
+ readOnly: true
1701
+ _user:
1702
+ type: string
1703
+ description: Identifier of the user who owns this document
1704
+ readOnly: true
1705
+ _model:
1706
+ type: string
1707
+ description: Name of the model this document belongs to
1708
+ readOnly: true
1709
+ default: product
1710
+ _hash:
1711
+ type: number
1712
+ description: Document hash for integrity verification
1713
+ readOnly: true
1714
+ _pack:
1715
+ type: string
1716
+ description: Name of the pack this document belongs to (if applicable)
1717
+ readOnly: true
1718
+ name:
1719
+ type: string
1720
+ description: ""
1721
+ description:
1722
+ type: string
1723
+ description: ""
1724
+ image:
1725
+ type: array
1726
+ items:
1727
+ type: string
1728
+ format: uuid
1729
+ description: "Mime types: image/jpeg, image/png, image/gif, image/webp."
1730
+ price:
1731
+ type: number
1732
+ description: ""
1733
+ currency:
1734
+ type: string
1735
+ description: ID of a currency document
1736
+ billingFrequency:
1737
+ type: string
1738
+ enum:
1739
+ - none
1740
+ - monthly
1741
+ - yearly
1742
+ description: ""
1743
+ brand:
1744
+ type: string
1745
+ description: ID of a brand document
1746
+ category:
1747
+ type: string
1748
+ description: ID of a taxonomy document
1749
+ required:
1750
+ - name
1751
+ - price
1752
+ - currency
1753
+ productVariant:
1754
+ type: object
1755
+ properties:
1756
+ _id:
1757
+ type: string
1758
+ description: Unique document identifier (MongoDB ObjectId)
1759
+ readOnly: true
1760
+ _user:
1761
+ type: string
1762
+ description: Identifier of the user who owns this document
1763
+ readOnly: true
1764
+ _model:
1765
+ type: string
1766
+ description: Name of the model this document belongs to
1767
+ readOnly: true
1768
+ default: productVariant
1769
+ _hash:
1770
+ type: number
1771
+ description: Document hash for integrity verification
1772
+ readOnly: true
1773
+ _pack:
1774
+ type: string
1775
+ description: Name of the pack this document belongs to (if applicable)
1776
+ readOnly: true
1777
+ product:
1778
+ type: string
1779
+ description: ID of a product document
1780
+ size:
1781
+ type: string
1782
+ description: ""
1783
+ color:
1784
+ type: string
1785
+ description: ""
1786
+ sku:
1787
+ type: string
1788
+ description: ""
1789
+ price:
1790
+ type: number
1791
+ description: ""
1792
+ currency:
1793
+ type: string
1794
+ description: ID of a currency document
1795
+ stock:
1796
+ type: number
1797
+ default: 0
1798
+ description: ""
1799
+ description:
1800
+ type: string
1801
+ description: ""
1802
+ image:
1803
+ type: string
1804
+ format: uri
1805
+ description: ""
1806
+ required:
1807
+ - product
1808
+ - price
1809
+ - currency
1810
+ cart:
1811
+ type: object
1812
+ properties:
1813
+ _id:
1814
+ type: string
1815
+ description: Unique document identifier (MongoDB ObjectId)
1816
+ readOnly: true
1817
+ _user:
1818
+ type: string
1819
+ description: Identifier of the user who owns this document
1820
+ readOnly: true
1821
+ _model:
1822
+ type: string
1823
+ description: Name of the model this document belongs to
1824
+ readOnly: true
1825
+ default: cart
1826
+ _hash:
1827
+ type: number
1828
+ description: Document hash for integrity verification
1829
+ readOnly: true
1830
+ _pack:
1831
+ type: string
1832
+ description: Name of the pack this document belongs to (if applicable)
1833
+ readOnly: true
1834
+ user:
1835
+ type: string
1836
+ description: ID of a user document
1837
+ items:
1838
+ type: array
1839
+ items:
1840
+ type: string
1841
+ description: ID of a cartItem document
1842
+ creationDate:
1843
+ type: string
1844
+ format: date-time
1845
+ description: ""
1846
+ lastUpdate:
1847
+ type: string
1848
+ format: date-time
1849
+ description: ""
1850
+ active:
1851
+ type: boolean
1852
+ default: true
1853
+ description: ""
1854
+ required:
1855
+ - user
1856
+ - creationDate
1857
+ - lastUpdate
1858
+ cartItem:
1859
+ type: object
1860
+ properties:
1861
+ _id:
1862
+ type: string
1863
+ description: Unique document identifier (MongoDB ObjectId)
1864
+ readOnly: true
1865
+ _user:
1866
+ type: string
1867
+ description: Identifier of the user who owns this document
1868
+ readOnly: true
1869
+ _model:
1870
+ type: string
1871
+ description: Name of the model this document belongs to
1872
+ readOnly: true
1873
+ default: cartItem
1874
+ _hash:
1875
+ type: number
1876
+ description: Document hash for integrity verification
1877
+ readOnly: true
1878
+ _pack:
1879
+ type: string
1880
+ description: Name of the pack this document belongs to (if applicable)
1881
+ readOnly: true
1882
+ product:
1883
+ type: string
1884
+ description: ID of a product document
1885
+ quantity:
1886
+ type: number
1887
+ minimum: 1
1888
+ description: ""
1889
+ variant:
1890
+ type: string
1891
+ description: ID of a productVariant document
1892
+ required:
1893
+ - product
1894
+ - quantity
1895
+ discount:
1896
+ type: object
1897
+ properties:
1898
+ _id:
1899
+ type: string
1900
+ description: Unique document identifier (MongoDB ObjectId)
1901
+ readOnly: true
1902
+ _user:
1903
+ type: string
1904
+ description: Identifier of the user who owns this document
1905
+ readOnly: true
1906
+ _model:
1907
+ type: string
1908
+ description: Name of the model this document belongs to
1909
+ readOnly: true
1910
+ default: discount
1911
+ _hash:
1912
+ type: number
1913
+ description: Document hash for integrity verification
1914
+ readOnly: true
1915
+ _pack:
1916
+ type: string
1917
+ description: Name of the pack this document belongs to (if applicable)
1918
+ readOnly: true
1919
+ code:
1920
+ type: string
1921
+ description: ""
1922
+ productSelection:
1923
+ type: array
1924
+ items:
1925
+ type: string
1926
+ description: ID of a product document
1927
+ description:
1928
+ type: string
1929
+ description: ""
1930
+ percentAmount:
1931
+ type: number
1932
+ minimum: 0
1933
+ default: null
1934
+ description: ""
1935
+ fixedAmount:
1936
+ type: number
1937
+ minimum: 0
1938
+ default: null
1939
+ description: ""
1940
+ minAmount:
1941
+ type: number
1942
+ minimum: 0
1943
+ default: null
1944
+ description: "Unit: €"
1945
+ minProductQuantity:
1946
+ type: number
1947
+ minimum: 0
1948
+ description: ""
1949
+ freeProductQuantity:
1950
+ type: number
1951
+ minimum: 0
1952
+ default: null
1953
+ description: ""
1954
+ startDate:
1955
+ type: string
1956
+ format: date-time
1957
+ description: ""
1958
+ endDate:
1959
+ type: string
1960
+ format: date-time
1961
+ description: ""
1962
+ required:
1963
+ - code
1964
+ order:
1965
+ type: object
1966
+ properties:
1967
+ _id:
1968
+ type: string
1969
+ description: Unique document identifier (MongoDB ObjectId)
1970
+ readOnly: true
1971
+ _user:
1972
+ type: string
1973
+ description: Identifier of the user who owns this document
1974
+ readOnly: true
1975
+ _model:
1976
+ type: string
1977
+ description: Name of the model this document belongs to
1978
+ readOnly: true
1979
+ default: order
1980
+ _hash:
1981
+ type: number
1982
+ description: Document hash for integrity verification
1983
+ readOnly: true
1984
+ _pack:
1985
+ type: string
1986
+ description: Name of the pack this document belongs to (if applicable)
1987
+ readOnly: true
1988
+ orderId:
1989
+ type: string
1990
+ description: ""
1991
+ orderDate:
1992
+ type: string
1993
+ format: date-time
1994
+ description: ""
1995
+ status:
1996
+ type: string
1997
+ enum:
1998
+ - pending
1999
+ - processing
2000
+ - shipped
2001
+ - delivered
2002
+ - cancelled
2003
+ description: ""
2004
+ products:
2005
+ type: array
2006
+ items:
2007
+ type: string
2008
+ description: ID of a product document
2009
+ customer:
2010
+ type: string
2011
+ description: ID of a user document
2012
+ totalAmount:
2013
+ type: number
2014
+ description: ""
2015
+ currency:
2016
+ type: string
2017
+ description: ID of a currency document
2018
+ paymentMethod:
2019
+ type: string
2020
+ description: ""
2021
+ shippingAddress:
2022
+ type: string
2023
+ description: ID of a location document
2024
+ billingAddress:
2025
+ type: string
2026
+ description: ID of a location document
2027
+ shippedDate:
2028
+ type: string
2029
+ format: date-time
2030
+ description: ""
2031
+ deliveryDate:
2032
+ type: string
2033
+ format: date-time
2034
+ description: ""
2035
+ discount:
2036
+ type: string
2037
+ description: ID of a discount document
2038
+ required:
2039
+ - orderId
2040
+ - products
2041
+ - totalAmount
2042
+ invoice:
2043
+ type: object
2044
+ properties:
2045
+ _id:
2046
+ type: string
2047
+ description: Unique document identifier (MongoDB ObjectId)
2048
+ readOnly: true
2049
+ _user:
2050
+ type: string
2051
+ description: Identifier of the user who owns this document
2052
+ readOnly: true
2053
+ _model:
2054
+ type: string
2055
+ description: Name of the model this document belongs to
2056
+ readOnly: true
2057
+ default: invoice
2058
+ _hash:
2059
+ type: number
2060
+ description: Document hash for integrity verification
2061
+ readOnly: true
2062
+ _pack:
2063
+ type: string
2064
+ description: Name of the pack this document belongs to (if applicable)
2065
+ readOnly: true
2066
+ order:
2067
+ type: string
2068
+ description: ID of a order document
2069
+ invoiceId:
2070
+ type: string
2071
+ description: ""
2072
+ invoiceDate:
2073
+ type: string
2074
+ format: date-time
2075
+ description: ""
2076
+ dueDate:
2077
+ type: string
2078
+ format: date-time
2079
+ description: ""
2080
+ status:
2081
+ type: string
2082
+ enum:
2083
+ - paid
2084
+ - unpaid
2085
+ - partially_paid
2086
+ - cancelled
2087
+ description: ""
2088
+ required:
2089
+ - order
2090
+ - invoiceId
2091
+ - invoiceDate
2092
+ userSubscription:
2093
+ type: object
2094
+ properties:
2095
+ _id:
2096
+ type: string
2097
+ description: Unique document identifier (MongoDB ObjectId)
2098
+ readOnly: true
2099
+ _user:
2100
+ type: string
2101
+ description: Identifier of the user who owns this document
2102
+ readOnly: true
2103
+ _model:
2104
+ type: string
2105
+ description: Name of the model this document belongs to
2106
+ readOnly: true
2107
+ default: userSubscription
2108
+ _hash:
2109
+ type: number
2110
+ description: Document hash for integrity verification
2111
+ readOnly: true
2112
+ _pack:
2113
+ type: string
2114
+ description: Name of the pack this document belongs to (if applicable)
2115
+ readOnly: true
2116
+ user:
2117
+ type: string
2118
+ description: ID of a user document
2119
+ product:
2120
+ type: string
2121
+ description: ID of a product document
2122
+ startDate:
2123
+ type: string
2124
+ format: date-time
2125
+ description: ""
2126
+ endDate:
2127
+ type: string
2128
+ format: date-time
2129
+ description: ""
2130
+ price:
2131
+ type: number
2132
+ description: ""
2133
+ currency:
2134
+ type: string
2135
+ description: ID of a currency document
2136
+ paymentMethod:
2137
+ type: string
2138
+ enum:
2139
+ - credit_card
2140
+ - SEPA_direct_debit
2141
+ description: ""
2142
+ status:
2143
+ type: string
2144
+ enum:
2145
+ - active
2146
+ - inactive
2147
+ - cancelled
2148
+ - expired
2149
+ - pending
2150
+ description: ""
2151
+ billingCycleAnchor:
2152
+ type: string
2153
+ format: date-time
2154
+ description: ""
2155
+ nextBillingDate:
2156
+ type: string
2157
+ format: date-time
2158
+ description: ""
2159
+ lastBillingDate:
2160
+ type: string
2161
+ format: date-time
2162
+ description: ""
2163
+ cancelReason:
2164
+ type: string
2165
+ description: ""
2166
+ autoRenew:
2167
+ type: boolean
2168
+ default: false
2169
+ description: ""
2170
+ required:
2171
+ - user
2172
+ - product
2173
+ - startDate
2174
+ - price
2175
+ - currency
2176
+ stock:
2177
+ type: object
2178
+ properties:
2179
+ _id:
2180
+ type: string
2181
+ description: Unique document identifier (MongoDB ObjectId)
2182
+ readOnly: true
2183
+ _user:
2184
+ type: string
2185
+ description: Identifier of the user who owns this document
2186
+ readOnly: true
2187
+ _model:
2188
+ type: string
2189
+ description: Name of the model this document belongs to
2190
+ readOnly: true
2191
+ default: stock
2192
+ _hash:
2193
+ type: number
2194
+ description: Document hash for integrity verification
2195
+ readOnly: true
2196
+ _pack:
2197
+ type: string
2198
+ description: Name of the pack this document belongs to (if applicable)
2199
+ readOnly: true
2200
+ product:
2201
+ type: string
2202
+ description: ID of a product document
2203
+ variant:
2204
+ type: string
2205
+ description: ID of a productVariant document
2206
+ warehouse:
2207
+ type: string
2208
+ description: ID of a warehouse document
2209
+ available:
2210
+ type: number
2211
+ default: 0
2212
+ description: ""
2213
+ reserved:
2214
+ type: number
2215
+ default: 0
2216
+ description: ""
2217
+ required:
2218
+ - product
2219
+ - warehouse
2220
+ stockAlert:
2221
+ type: object
2222
+ properties:
2223
+ _id:
2224
+ type: string
2225
+ description: Unique document identifier (MongoDB ObjectId)
2226
+ readOnly: true
2227
+ _user:
2228
+ type: string
2229
+ description: Identifier of the user who owns this document
2230
+ readOnly: true
2231
+ _model:
2232
+ type: string
2233
+ description: Name of the model this document belongs to
2234
+ readOnly: true
2235
+ default: stockAlert
2236
+ _hash:
2237
+ type: number
2238
+ description: Document hash for integrity verification
2239
+ readOnly: true
2240
+ _pack:
2241
+ type: string
2242
+ description: Name of the pack this document belongs to (if applicable)
2243
+ readOnly: true
2244
+ user:
2245
+ type: string
2246
+ description: ID of a user document
2247
+ stock:
2248
+ type: string
2249
+ description: ID of a stock document
2250
+ threshold:
2251
+ type: number
2252
+ minimum: 0
2253
+ description: ""
2254
+ required:
2255
+ - user
2256
+ - stock
2257
+ - threshold
2258
+ shipment:
2259
+ type: object
2260
+ properties:
2261
+ _id:
2262
+ type: string
2263
+ description: Unique document identifier (MongoDB ObjectId)
2264
+ readOnly: true
2265
+ _user:
2266
+ type: string
2267
+ description: Identifier of the user who owns this document
2268
+ readOnly: true
2269
+ _model:
2270
+ type: string
2271
+ description: Name of the model this document belongs to
2272
+ readOnly: true
2273
+ default: shipment
2274
+ _hash:
2275
+ type: number
2276
+ description: Document hash for integrity verification
2277
+ readOnly: true
2278
+ _pack:
2279
+ type: string
2280
+ description: Name of the pack this document belongs to (if applicable)
2281
+ readOnly: true
2282
+ order:
2283
+ type: string
2284
+ description: ID of a order document
2285
+ trackingNumber:
2286
+ type: string
2287
+ description: ""
2288
+ carrier:
2289
+ type: string
2290
+ description: ""
2291
+ status:
2292
+ type: string
2293
+ enum:
2294
+ - pending
2295
+ - in_transit
2296
+ - delivered
2297
+ - issue
2298
+ description: ""
2299
+ estimatedDeliveryDate:
2300
+ type: string
2301
+ format: date-time
2302
+ description: ""
2303
+ actualDeliveryDate:
2304
+ type: string
2305
+ format: date-time
2306
+ description: ""
2307
+ required:
2308
+ - order
2309
+ warehouse:
2310
+ type: object
2311
+ properties:
2312
+ _id:
2313
+ type: string
2314
+ description: Unique document identifier (MongoDB ObjectId)
2315
+ readOnly: true
2316
+ _user:
2317
+ type: string
2318
+ description: Identifier of the user who owns this document
2319
+ readOnly: true
2320
+ _model:
2321
+ type: string
2322
+ description: Name of the model this document belongs to
2323
+ readOnly: true
2324
+ default: warehouse
2325
+ _hash:
2326
+ type: number
2327
+ description: Document hash for integrity verification
2328
+ readOnly: true
2329
+ _pack:
2330
+ type: string
2331
+ description: Name of the pack this document belongs to (if applicable)
2332
+ readOnly: true
2333
+ name:
2334
+ type: string
2335
+ description: ""
2336
+ location:
2337
+ type: string
2338
+ description: ID of a location document
2339
+ capacity:
2340
+ type: number
2341
+ description: ""
2342
+ required:
2343
+ - name
2344
+ return:
2345
+ type: object
2346
+ properties:
2347
+ _id:
2348
+ type: string
2349
+ description: Unique document identifier (MongoDB ObjectId)
2350
+ readOnly: true
2351
+ _user:
2352
+ type: string
2353
+ description: Identifier of the user who owns this document
2354
+ readOnly: true
2355
+ _model:
2356
+ type: string
2357
+ description: Name of the model this document belongs to
2358
+ readOnly: true
2359
+ default: return
2360
+ _hash:
2361
+ type: number
2362
+ description: Document hash for integrity verification
2363
+ readOnly: true
2364
+ _pack:
2365
+ type: string
2366
+ description: Name of the pack this document belongs to (if applicable)
2367
+ readOnly: true
2368
+ user:
2369
+ type: string
2370
+ description: ID of a user document
2371
+ reason:
2372
+ type: string
2373
+ maxLength: 2048
2374
+ description: ""
2375
+ channel:
2376
+ type: string
2377
+ description: ID of a channel document
2378
+ status:
2379
+ type: string
2380
+ enum:
2381
+ - pending
2382
+ - approved
2383
+ - refunded
2384
+ - refused
2385
+ description: ""
2386
+ amount:
2387
+ type: number
2388
+ minimum: 0
2389
+ description: ""
2390
+ currency:
2391
+ type: string
2392
+ description: ID of a currency document
2393
+ refundDate:
2394
+ type: string
2395
+ format: date-time
2396
+ description: ""
2397
+ required:
2398
+ - reason
2399
+ returnItem:
2400
+ type: object
2401
+ properties:
2402
+ _id:
2403
+ type: string
2404
+ description: Unique document identifier (MongoDB ObjectId)
2405
+ readOnly: true
2406
+ _user:
2407
+ type: string
2408
+ description: Identifier of the user who owns this document
2409
+ readOnly: true
2410
+ _model:
2411
+ type: string
2412
+ description: Name of the model this document belongs to
2413
+ readOnly: true
2414
+ default: returnItem
2415
+ _hash:
2416
+ type: number
2417
+ description: Document hash for integrity verification
2418
+ readOnly: true
2419
+ _pack:
2420
+ type: string
2421
+ description: Name of the pack this document belongs to (if applicable)
2422
+ readOnly: true
2423
+ return:
2424
+ type: string
2425
+ description: ID of a return document
2426
+ product:
2427
+ type: string
2428
+ description: ID of a product document
2429
+ variant:
2430
+ type: string
2431
+ description: ID of a productVariant document
2432
+ quantity:
2433
+ type: number
2434
+ minimum: 1
2435
+ description: ""
2436
+ condition:
2437
+ type: string
2438
+ enum:
2439
+ - new
2440
+ - very_good_condition
2441
+ - good_condition
2442
+ - damaged
2443
+ - unusable
2444
+ description: ""
2445
+ required:
2446
+ - return
2447
+ - product
2448
+ - quantity
2449
+ ticket:
2450
+ type: object
2451
+ properties:
2452
+ _id:
2453
+ type: string
2454
+ description: Unique document identifier (MongoDB ObjectId)
2455
+ readOnly: true
2456
+ _user:
2457
+ type: string
2458
+ description: Identifier of the user who owns this document
2459
+ readOnly: true
2460
+ _model:
2461
+ type: string
2462
+ description: Name of the model this document belongs to
2463
+ readOnly: true
2464
+ default: ticket
2465
+ _hash:
2466
+ type: number
2467
+ description: Document hash for integrity verification
2468
+ readOnly: true
2469
+ _pack:
2470
+ type: string
2471
+ description: "Name of the pack this document belongs to"
2472
+ order:
2473
+ type: string
2474
+ description: ID of a order document
2475
+ channel:
2476
+ type: string
2477
+ description: ID of a channel document
2478
+ parent:
2479
+ type: string
2480
+ description: ID of a ticket document
2481
+ subject:
2482
+ type: string
2483
+ description: ""
2484
+ message:
2485
+ type: string
2486
+ description: ""
2487
+ status:
2488
+ type: string
2489
+ enum:
2490
+ - open
2491
+ - in_progress
2492
+ - closed
2493
+ priority:
2494
+ type: string
2495
+ enum:
2496
+ - low
2497
+ - medium
2498
+ - high
2499
+ description: ""
2500
+ assignedTo:
2501
+ type: string
2502
+ description: ID of a user document
2503
+ createdAt:
2504
+ type: string
2505
+ format: date-time
2506
+ description: ""
2507
+ required:
2508
+ - user
2509
+ - subject
2510
+ - message
2511
+ - createdAt
2512
+ campaign:
2513
+ type: object
2514
+ properties:
2515
+ _id:
2516
+ type: string
2517
+ description: Unique document identifier (MongoDB ObjectId)
2518
+ readOnly: true
2519
+ _user:
2520
+ type: string
2521
+ description: Identifier of the user who owns this document
2522
+ readOnly: true
2523
+ _model:
2524
+ type: string
2525
+ description: Name of the model this document belongs to
2526
+ readOnly: true
2527
+ default: campaign
2528
+ _hash:
2529
+ type: number
2530
+ description: Document hash for integrity verification
2531
+ readOnly: true
2532
+ _pack:
2533
+ type: string
2534
+ description: Name of the pack this document belongs to (if applicable)
2535
+ readOnly: true
2536
+ name:
2537
+ type: string
2538
+ description: ""
2539
+ description:
2540
+ type: string
2541
+ description: ""
2542
+ startDate:
2543
+ type: string
2544
+ format: date-time
2545
+ description: ""
2546
+ endDate:
2547
+ type: string
2548
+ format: date-time
2549
+ description: ""
2550
+ type:
2551
+ type: string
2552
+ enum:
2553
+ - email
2554
+ - SMS
2555
+ - advertising
2556
+ - promotion
2557
+ description: ""
2558
+ status:
2559
+ type: string
2560
+ enum:
2561
+ - planned
2562
+ - in_progress
2563
+ - completed
2564
+ - cancelled
2565
+ description: ""
2566
+ budget:
2567
+ type: number
2568
+ description: ""
2569
+ required:
2570
+ - name
2571
+ review:
2572
+ type: object
2573
+ properties:
2574
+ _id:
2575
+ type: string
2576
+ description: Unique document identifier (MongoDB ObjectId)
2577
+ readOnly: true
2578
+ _user:
2579
+ type: string
2580
+ description: Identifier of the user who owns this document
2581
+ readOnly: true
2582
+ _model:
2583
+ type: string
2584
+ description: Name of the model this document belongs to
2585
+ readOnly: true
2586
+ default: review
2587
+ _hash:
2588
+ type: number
2589
+ description: Document hash for integrity verification
2590
+ readOnly: true
2591
+ _pack:
2592
+ type: string
2593
+ description: Name of the pack this document belongs to (if applicable)
2594
+ readOnly: true
2595
+ user:
2596
+ type: string
2597
+ description: ID of a user document
2598
+ product:
2599
+ type: string
2600
+ description: ID of a product document
2601
+ productVariant:
2602
+ type: string
2603
+ description: ID of a productVariant document
2604
+ comment:
2605
+ type: string
2606
+ maxLength: 2048
2607
+ description: ""
2608
+ score:
2609
+ type: number
2610
+ description: ""
2611
+ publishedAt:
2612
+ type: string
2613
+ format: date-time
2614
+ description: ""
2615
+ required:
2616
+ - comment
2617
+ - publishedAt
2618
+ device:
2619
+ type: object
2620
+ properties:
2621
+ _id:
2622
+ type: string
2623
+ description: Unique document identifier (MongoDB ObjectId)
2624
+ readOnly: true
2625
+ _user:
2626
+ type: string
2627
+ description: Identifier of the user who owns this document
2628
+ readOnly: true
2629
+ _model:
2630
+ type: string
2631
+ description: Name of the model this document belongs to
2632
+ readOnly: true
2633
+ default: device
2634
+ _hash:
2635
+ type: number
2636
+ description: Document hash for integrity verification
2637
+ readOnly: true
2638
+ _pack:
2639
+ type: string
2640
+ description: Name of the pack this document belongs to (if applicable)
2641
+ readOnly: true
2642
+ location:
2643
+ type: string
2644
+ description: ID of a location document
2645
+ lastLocationUpdate:
2646
+ type: string
2647
+ format: date-time
2648
+ description: ""
2649
+ accountingExercise:
2650
+ type: object
2651
+ properties:
2652
+ _id:
2653
+ type: string
2654
+ description: Unique document identifier (MongoDB ObjectId)
2655
+ readOnly: true
2656
+ _user:
2657
+ type: string
2658
+ description: Identifier of the user who owns this document
2659
+ readOnly: true
2660
+ _model:
2661
+ type: string
2662
+ description: Name of the model this document belongs to
2663
+ readOnly: true
2664
+ default: accountingExercise
2665
+ _hash:
2666
+ type: number
2667
+ description: Document hash for integrity verification
2668
+ readOnly: true
2669
+ _pack:
2670
+ type: string
2671
+ description: Name of the pack this document belongs to (if applicable)
2672
+ readOnly: true
2673
+ name:
2674
+ type: string
2675
+ description: Accounting exercise title
2676
+ companyContact:
2677
+ type: string
2678
+ description: ID of a contact document. Company designation
2679
+ companyIdentifier:
2680
+ type: string
2681
+ description: Company SIRET
2682
+ startDate:
2683
+ type: string
2684
+ format: date
2685
+ description: Exercise start date
2686
+ endDate:
2687
+ type: string
2688
+ format: date
2689
+ description: Exercise closing date
2690
+ required:
2691
+ - name
2692
+ - companyContact
2693
+ - companyIdentifier
2694
+ - startDate
2695
+ - endDate
2696
+ accountingLineItem:
2697
+ type: object
2698
+ properties:
2699
+ _id:
2700
+ type: string
2701
+ description: Unique document identifier (MongoDB ObjectId)
2702
+ readOnly: true
2703
+ _user:
2704
+ type: string
2705
+ description: Identifier of the user who owns this document
2706
+ readOnly: true
2707
+ _model:
2708
+ type: string
2709
+ description: Name of the model this document belongs to
2710
+ readOnly: true
2711
+ default: accountingLineItem
2712
+ _hash:
2713
+ type: number
2714
+ description: Document hash for integrity verification
2715
+ readOnly: true
2716
+ _pack:
2717
+ type: string
2718
+ description: Name of the pack this document belongs to (if applicable)
2719
+ readOnly: true
2720
+ accountingExercise:
2721
+ type: string
2722
+ description: ID of a accountingExercise document
2723
+ code:
2724
+ type: string
2725
+ description: "Unique line code (e.g., 'AA', 'FB', 'HA')"
2726
+ label:
2727
+ type: string
2728
+ description: "Line label (e.g., 'Establishment expenses')"
2729
+ documentType:
2730
+ type: string
2731
+ enum:
2732
+ - balance_sheet_asset
2733
+ - balance_sheet_liability
2734
+ - income_statement
2735
+ - fixed_assets
2736
+ - depreciation
2737
+ - provisions
2738
+ - receivables_debts
2739
+ - deficits
2740
+ - capital_gains_losses
2741
+ - workforce_value_added
2742
+ - share_capital
2743
+ - subsidiaries_participations
2744
+ - fiscal_result
2745
+ description: ""
2746
+ section:
2747
+ type: string
2748
+ description: "Main section (e.g., 'FIXED ASSETS')"
2749
+ subSection:
2750
+ type: string
2751
+ description: "Sub-section (e.g., 'INTANGIBLE ASSETS')"
2752
+ order:
2753
+ type: number
2754
+ description: Display order in section/sub-section
2755
+ calculationFormula:
2756
+ type: string
2757
+ description: Calculation formula (if applicable)
2758
+ values:
2759
+ type: array
2760
+ items:
2761
+ type: number
2762
+ description: Accounting line values
2763
+ notes:
2764
+ type: string
2765
+ description: "Notes or references (e.g., '(1)', '(3)')"
2766
+ required:
2767
+ - accountingExercise
2768
+ - code
2769
+ - label
2770
+ - documentType
2771
+ - section
2772
+ - values
2773
+ accountingEntry:
2774
+ type: object
2775
+ properties:
2776
+ _id:
2777
+ type: string
2778
+ description: Unique document identifier (MongoDB ObjectId)
2779
+ readOnly: true
2780
+ _user:
2781
+ type: string
2782
+ description: Identifier of the user who owns this document
2783
+ readOnly: true
2784
+ _model:
2785
+ type: string
2786
+ description: Name of the model this document belongs to
2787
+ readOnly: true
2788
+ default: accountingEntry
2789
+ _hash:
2790
+ type: number
2791
+ description: Document hash for integrity verification
2792
+ readOnly: true
2793
+ _pack:
2794
+ type: string
2795
+ description: Name of the pack this document belongs to (if applicable)
2796
+ readOnly: true
2797
+ exercise:
2798
+ type: string
2799
+ description: ID of a accountingExercise document
2800
+ label:
2801
+ type: string
2802
+ maxLength: 255
2803
+ description: ""
2804
+ entryDate:
2805
+ type: string
2806
+ format: date
2807
+ description: ""
2808
+ amount:
2809
+ type: number
2810
+ default: 0
2811
+ description: ""
2812
+ currency:
2813
+ type: string
2814
+ description: ID of a currency document
2815
+ referenceNumber:
2816
+ type: string
2817
+ maxLength: 100
2818
+ description: ""
2819
+ notes:
2820
+ type: string
2821
+ description: ""
2822
+ status:
2823
+ type: string
2824
+ enum:
2825
+ - draft
2826
+ - validated
2827
+ - cancelled
2828
+ default: draft
2829
+ description: ""
2830
+ createdBy:
2831
+ type: string
2832
+ description: ID of a user document
2833
+ validatedBy:
2834
+ type: string
2835
+ description: ID of a user document
2836
+ validationDate:
2837
+ type: string
2838
+ format: date-time
2839
+ description: ""
2840
+ attachments:
2841
+ type: array
2842
+ items:
2843
+ type: string
2844
+ format: uuid
2845
+ description: ""
2846
+ required:
2847
+ - exercise
2848
+ - label
2849
+ - entryDate
2850
+ - currency
2851
+ employee:
2852
+ type: object
2853
+ properties:
2854
+ _id:
2855
+ type: string
2856
+ description: Unique document identifier (MongoDB ObjectId)
2857
+ readOnly: true
2858
+ _user:
2859
+ type: string
2860
+ description: Identifier of the user who owns this document
2861
+ readOnly: true
2862
+ _model:
2863
+ type: string
2864
+ description: Name of the model this document belongs to
2865
+ readOnly: true
2866
+ default: employee
2867
+ _hash:
2868
+ type: number
2869
+ description: Document hash for integrity verification
2870
+ readOnly: true
2871
+ _pack:
2872
+ type: string
2873
+ description: Name of the pack this document belongs to (if applicable)
2874
+ readOnly: true
2875
+ employeeId:
2876
+ type: string
2877
+ description: ""
2878
+ personalInfo:
2879
+ type: string
2880
+ description: ID of a user document
2881
+ jobTitle:
2882
+ type: string
2883
+ description: ""
2884
+ department:
2885
+ type: string
2886
+ description: ""
2887
+ manager:
2888
+ type: string
2889
+ description: ID of a employee document
2890
+ workLocation:
2891
+ type: string
2892
+ description: ID of a location document
2893
+ employmentType:
2894
+ type: string
2895
+ enum:
2896
+ - full_time
2897
+ - part_time
2898
+ - contractor
2899
+ - intern
2900
+ - temporary
2901
+ description: ""
2902
+ emergencyContact:
2903
+ type: string
2904
+ description: ID of a contact document
2905
+ homeAddress:
2906
+ type: string
2907
+ description: ID of a location document
2908
+ dateOfBirth:
2909
+ type: string
2910
+ format: date
2911
+ description: ""
2912
+ nationality:
2913
+ type: string
2914
+ description: ""
2915
+ nationalId:
2916
+ type: string
2917
+ description: ""
2918
+ socialSecurityNumber:
2919
+ type: string
2920
+ description: ""
2921
+ taxId:
2922
+ type: string
2923
+ description: ""
2924
+ startDate:
2925
+ type: string
2926
+ format: date
2927
+ description: ""
2928
+ endDate:
2929
+ type: string
2930
+ format: date
2931
+ description: ""
2932
+ contractType:
2933
+ type: string
2934
+ description: ""
2935
+ salary:
2936
+ type: number
2937
+ description: ""
2938
+ salaryCurrency:
2939
+ type: string
2940
+ description: ID of a currency document
2941
+ payFrequency:
2942
+ type: string
2943
+ enum:
2944
+ - weekly
2945
+ - bi_weekly
2946
+ - monthly
2947
+ description: ""
2948
+ bankAccountNumber:
2949
+ type: string
2950
+ description: ""
2951
+ bankName:
2952
+ type: string
2953
+ description: ""
2954
+ iban:
2955
+ type: string
2956
+ description: ""
2957
+ swiftBic:
2958
+ type: string
2959
+ description: ""
2960
+ workPermitNumber:
2961
+ type: string
2962
+ description: ""
2963
+ workPermitExpiry:
2964
+ type: string
2965
+ format: date
2966
+ description: ""
2967
+ visaType:
2968
+ type: string
2969
+ description: ""
2970
+ visaExpiry:
2971
+ type: string
2972
+ format: date
2973
+ description: ""
2974
+ skills:
2975
+ type: array
2976
+ items:
2977
+ type: string
2978
+ description: ""
2979
+ notes:
2980
+ type: string
2981
+ description: ""
2982
+ required:
2983
+ - employeeId
2984
+ - personalInfo
2985
+ - jobTitle
2986
+ - startDate
2987
+ workflow:
2988
+ type: object
2989
+ properties:
2990
+ _id:
2991
+ type: string
2992
+ description: Unique document identifier (MongoDB ObjectId)
2993
+ readOnly: true
2994
+ _user:
2995
+ type: string
2996
+ description: Identifier of the user who owns this document
2997
+ readOnly: true
2998
+ _model:
2999
+ type: string
3000
+ description: Name of the model this document belongs to
3001
+ readOnly: true
3002
+ default: workflow
3003
+ _hash:
3004
+ type: number
3005
+ description: Document hash for integrity verification
3006
+ readOnly: true
3007
+ _pack:
3008
+ type: string
3009
+ description: Name of the pack this document belongs to (if applicable)
3010
+ readOnly: true
3011
+ name:
3012
+ type: string
3013
+ description: "Unique name for the workflow (e.g., 'Order Validation', 'Low Stock Notification')."
3014
+ description:
3015
+ type: string
3016
+ description: "Detailed explanation of the workflow's purpose."
3017
+ startStep:
3018
+ type: string
3019
+ description: "ID of a workflowStep document. The first step to execute when the workflow starts."
3020
+ required:
3021
+ - name
3022
+ workflowTrigger:
3023
+ type: object
3024
+ properties:
3025
+ _id:
3026
+ type: string
3027
+ description: Unique document identifier (MongoDB ObjectId)
3028
+ readOnly: true
3029
+ _user:
3030
+ type: string
3031
+ description: Identifier of the user who owns this document
3032
+ readOnly: true
3033
+ _model:
3034
+ type: string
3035
+ description: Name of the model this document belongs to
3036
+ readOnly: true
3037
+ default: workflowTrigger
3038
+ _hash:
3039
+ type: number
3040
+ description: Document hash for integrity verification
3041
+ readOnly: true
3042
+ _pack:
3043
+ type: string
3044
+ description: Name of the pack this document belongs to (if applicable)
3045
+ readOnly: true
3046
+ workflow:
3047
+ type: string
3048
+ description: "ID of a workflow document. The workflow this step belongs to."
3049
+ name:
3050
+ type: string
3051
+ description: "Descriptive name for the trigger (e.g., 'New Order Created', 'Stock < 5', 'Monday 9 AM Report')."
3052
+ type:
3053
+ type: string
3054
+ enum:
3055
+ - manual
3056
+ - scheduled
3057
+ description: ""
3058
+ onEvent:
3059
+ type: string
3060
+ enum:
3061
+ - DataAdded
3062
+ - DataEdited
3063
+ - DataDeleted
3064
+ - ModelAdded
3065
+ - ModelEdited
3066
+ - ModelDeleted
3067
+ description: ""
3068
+ targetModel:
3069
+ type: string
3070
+ description: Name of the target model
3071
+ dataFilter:
3072
+ type: string
3073
+ format: text
3074
+ description: "Optional conditions checked before executing the step's action."
3075
+ env:
3076
+ type: string
3077
+ format: text
3078
+ default: '{}'
3079
+ description: "Environment variables (JSON key/value pairs)"
3080
+ isActive:
3081
+ type: boolean
3082
+ description: ""
3083
+ cronExpression:
3084
+ type: string
3085
+ description: "Cron expression for scheduling (e.g., '0 9 * * 1' for Monday 9 AM) (used by Scheduled type)."
3086
+ required:
3087
+ - workflow
3088
+ - name
3089
+ - type
3090
+ - onEvent
3091
+ workflowStep:
3092
+ type: object
3093
+ properties:
3094
+ _id:
3095
+ type: string
3096
+ description: Unique document identifier (MongoDB ObjectId)
3097
+ readOnly: true
3098
+ _user:
3099
+ type: string
3100
+ description: Identifier of the user who owns this document
3101
+ readOnly: true
3102
+ _model:
3103
+ type: string
3104
+ description: Name of the model this document belongs to
3105
+ readOnly: true
3106
+ default: workflowStep
3107
+ _hash:
3108
+ type: number
3109
+ description: Document hash for integrity verification
3110
+ readOnly: true
3111
+ _pack:
3112
+ type: string
3113
+ description: Name of the pack this document belongs to (if applicable)
3114
+ readOnly: true
3115
+ workflow:
3116
+ type: string
3117
+ description: "ID of a workflow document. The workflow this step belongs to."
3118
+ name:
3119
+ type: string
3120
+ description: "Optional descriptive name for the step (e.g., 'Check Inventory', 'Send Confirmation Email')."
3121
+ conditions:
3122
+ type: string
3123
+ format: text
3124
+ description: "Optional conditions checked before executing the step's action."
3125
+ actions:
3126
+ type: array
3127
+ items:
3128
+ type: string
3129
+ description: ID of a workflowAction document
3130
+ description: "The main actions performed by this step."
3131
+ onSuccessStep:
3132
+ type: string
3133
+ description: "ID of a workflowStep document. Optional: The next step if this step's action succeeds."
3134
+ onFailureStep:
3135
+ type: string
3136
+ description: "ID of a workflowStep document. Optional: The next step if conditions fail or the action fails."
3137
+ isTerminal:
3138
+ type: boolean
3139
+ default: false
3140
+ description: "Indicates if this step marks the end of a workflow path."
3141
+ required:
3142
+ - workflow
3143
+ - actions
3144
+ workflowAction:
3145
+ type: object
3146
+ properties:
3147
+ _id:
3148
+ type: string
3149
+ description: Unique document identifier (MongoDB ObjectId)
3150
+ readOnly: true
3151
+ _user:
3152
+ type: string
3153
+ description: Identifier of the user who owns this document
3154
+ readOnly: true
3155
+ _model:
3156
+ type: string
3157
+ description: Name of the model this document belongs to
3158
+ readOnly: true
3159
+ default: workflowAction
3160
+ _hash:
3161
+ type: number
3162
+ description: Document hash for integrity verification
3163
+ readOnly: true
3164
+ _pack:
3165
+ type: string
3166
+ description: Name of the pack this document belongs to (if applicable)
3167
+ readOnly: true
3168
+ name:
3169
+ type: string
3170
+ description: "Name of the action (e.g., 'Update Order Status', 'Send Email', 'Call Payment API')."
3171
+ type:
3172
+ type: string
3173
+ enum:
3174
+ - UpdateData
3175
+ - CreateData
3176
+ - DeleteData
3177
+ - ExecuteScript
3178
+ - CallWebhook
3179
+ - Wait
3180
+ description: "The type of operation to perform."
3181
+ targetModel:
3182
+ type: string
3183
+ description: Name of the target model. Model to target
3184
+ targetSelector:
3185
+ type: string
3186
+ format: text
3187
+ description: "Expression to filter to the target document(s)."
3188
+ fieldsToUpdate:
3189
+ type: string
3190
+ format: text
3191
+ default: '{}'
3192
+ description: "Key-value pairs of fields to update (e.g., { status: 'Validé', lastUpdated: '{now}' })"
3193
+ dataToCreate:
3194
+ type: string
3195
+ format: text
3196
+ default: '{}'
3197
+ description: "Object template for the new document to create"
3198
+ script:
3199
+ type: string
3200
+ description: "The script to execute."
3201
+ url:
3202
+ type: string
3203
+ description: "The URL to call."
3204
+ method:
3205
+ type: string
3206
+ enum:
3207
+ - GET
3208
+ - POST
3209
+ - PUT
3210
+ - PATCH
3211
+ - DELETE
3212
+ default: POST
3213
+ description: "HTTP method."
3214
+ headers:
3215
+ type: string
3216
+ format: text
3217
+ default: '{}'
3218
+ description: "HTTP headers as key-value pairs."
3219
+ body:
3220
+ type: string
3221
+ format: text
3222
+ default: '{}'
3223
+ description: "Request body, can include variables."
3224
+ duration:
3225
+ type: number
3226
+ description: "Duration to wait."
3227
+ durationUnit:
3228
+ type: string
3229
+ enum:
3230
+ - milliseconds
3231
+ - seconds
3232
+ - minutes
3233
+ - hours
3234
+ - days
3235
+ default: seconds
3236
+ description: "Unit for the duration."
3237
+ required:
3238
+ - name
3239
+ - type
3240
+ workflowRun:
3241
+ type: object
3242
+ properties:
3243
+ _id:
3244
+ type: string
3245
+ description: Unique document identifier (MongoDB ObjectId)
3246
+ readOnly: true
3247
+ _user:
3248
+ type: string
3249
+ description: Identifier of the user who owns this document
3250
+ readOnly: true
3251
+ _model:
3252
+ type: string
3253
+ description: Name of the model this document belongs to
3254
+ readOnly: true
3255
+ default: workflowRun
3256
+ _hash:
3257
+ type: number
3258
+ description: Document hash for integrity verification
3259
+ readOnly: true
3260
+ _pack:
3261
+ type: string
3262
+ description: Name of the pack this document belongs to (if applicable)
3263
+ readOnly: true
3264
+ workflow:
3265
+ type: string
3266
+ description: "ID of a workflow document. The workflow definition that was executed."
3267
+ contextData:
3268
+ type: string
3269
+ format: text
3270
+ default: '{}'
3271
+ description: "Snapshot of the data or event that triggered this run."
3272
+ status:
3273
+ type: string
3274
+ enum:
3275
+ - pending
3276
+ - running
3277
+ - completed
3278
+ - failed
3279
+ - waiting
3280
+ - cancelled
3281
+ default: pending
3282
+ description: "The current status of the workflow execution."
3283
+ stepExecutionsCount:
3284
+ type: object
3285
+ description: ""
3286
+ currentStep:
3287
+ type: string
3288
+ description: "ID of a workflowStep document. The step currently being executed or waited on."
3289
+ owner:
3290
+ type: string
3291
+ description: ID of a user document
3292
+ startedAt:
3293
+ type: string
3294
+ format: date-time
3295
+ description: "Timestamp when the workflow run began."
3296
+ completedAt:
3297
+ type: string
3298
+ format: date-time
3299
+ description: "Timestamp when the workflow run finished (successfully or failed)."
3300
+ error:
3301
+ type: string
3302
+ maxLength: 4096
3303
+ description: "Error message if the workflow run failed."
3304
+ required:
3305
+ - workflow
3306
+ - status
3307
+ - startedAt
3308
+ dashboard:
3309
+ type: object
3310
+ properties:
3311
+ _id:
3312
+ type: string
3313
+ description: Unique document identifier (MongoDB ObjectId)
3314
+ readOnly: true
3315
+ _user:
3316
+ type: string
3317
+ description: Identifier of the user who owns this document
3318
+ readOnly: true
3319
+ _model:
3320
+ type: string
3321
+ description: Name of the model this document belongs to
3322
+ readOnly: true
3323
+ default: dashboard
3324
+ _hash:
3325
+ type: number
3326
+ description: Document hash for integrity verification
3327
+ readOnly: true
3328
+ _pack:
3329
+ type: string
3330
+ description: Name of the pack this document belongs to (if applicable)
3331
+ readOnly: true
3332
+ name:
3333
+ type: string
3334
+ description: Customizable display name of the dashboard.
3335
+ description:
3336
+ type: string
3337
+ description: Optional description to provide more context to the dashboard.
3338
+ layout:
3339
+ type: string
3340
+ format: text
3341
+ default: '{ "type": "columns", "columns": [] }'
3342
+ description: 'JSON structure describing KPI organization. Example: { "type": "columns", "columns": [ ["kpi_id_1"], ["kpi_id_2", "kpi_id_3"] ] }.'
3343
+ settings:
3344
+ type: string
3345
+ format: text
3346
+ default: '{ "defaultTimeRange": "last_7_days", "refreshInterval": null }'
3347
+ description: 'JSON settings for the dashboard, such as default time range (''defaultTimeRange'') or refresh interval in seconds (''refreshInterval'').'
3348
+ isDefault:
3349
+ type: boolean
3350
+ default: false
3351
+ description: "If 'true', this dashboard is displayed by default for the user."
3352
+ required:
3353
+ - name
3354
+ - layout
3355
+ request:
3356
+ type: object
3357
+ properties:
3358
+ _id:
3359
+ type: string
3360
+ description: Unique document identifier (MongoDB ObjectId)
3361
+ readOnly: true
3362
+ _user:
3363
+ type: string
3364
+ description: Identifier of the user who owns this document
3365
+ readOnly: true
3366
+ _model:
3367
+ type: string
3368
+ description: Name of the model this document belongs to
3369
+ readOnly: true
3370
+ default: request
3371
+ _hash:
3372
+ type: number
3373
+ description: Document hash for integrity verification
3374
+ readOnly: true
3375
+ _pack:
3376
+ type: string
3377
+ description: Name of the pack this document belongs to (if applicable)
3378
+ readOnly: true
3379
+ timestamp:
3380
+ type: string
3381
+ format: date-time
3382
+ description: Exact date and time when the request was received.
3383
+ method:
3384
+ type: string
3385
+ enum:
3386
+ - GET
3387
+ - POST
3388
+ - PUT
3389
+ - DELETE
3390
+ - PATCH
3391
+ - OPTIONS