omni-rest-express-example 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json ADDED
@@ -0,0 +1,1627 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "omni-rest-express-example",
5
+ "version": "1.0.0"
6
+ },
7
+ "servers": [
8
+ {
9
+ "url": "http://localhost:3000"
10
+ }
11
+ ],
12
+ "paths": {
13
+ "/api/department": {
14
+ "get": {
15
+ "summary": "List Departments",
16
+ "tags": [
17
+ "Department"
18
+ ],
19
+ "parameters": [
20
+ {
21
+ "name": "page",
22
+ "in": "query",
23
+ "schema": {
24
+ "type": "integer",
25
+ "default": 1
26
+ },
27
+ "description": "Page number"
28
+ },
29
+ {
30
+ "name": "limit",
31
+ "in": "query",
32
+ "schema": {
33
+ "type": "integer",
34
+ "default": 20
35
+ },
36
+ "description": "Items per page"
37
+ },
38
+ {
39
+ "name": "sort",
40
+ "in": "query",
41
+ "schema": {
42
+ "type": "string"
43
+ },
44
+ "description": "e.g. createdAt:desc"
45
+ },
46
+ {
47
+ "name": "include",
48
+ "in": "query",
49
+ "schema": {
50
+ "type": "string"
51
+ },
52
+ "description": "Comma-separated relations"
53
+ },
54
+ {
55
+ "name": "select",
56
+ "in": "query",
57
+ "schema": {
58
+ "type": "string"
59
+ },
60
+ "description": "Comma-separated fields"
61
+ }
62
+ ],
63
+ "responses": {
64
+ "200": {
65
+ "description": "List of Departments",
66
+ "content": {
67
+ "application/json": {
68
+ "schema": {
69
+ "type": "object",
70
+ "properties": {
71
+ "data": {
72
+ "type": "array",
73
+ "items": {
74
+ "$ref": "#/components/schemas/Department"
75
+ }
76
+ },
77
+ "meta": {
78
+ "$ref": "#/components/schemas/PaginationMeta"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "post": {
88
+ "summary": "Create Department",
89
+ "tags": [
90
+ "Department"
91
+ ],
92
+ "requestBody": {
93
+ "required": true,
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "$ref": "#/components/schemas/DepartmentCreate"
98
+ }
99
+ }
100
+ }
101
+ },
102
+ "responses": {
103
+ "201": {
104
+ "description": "Created Department",
105
+ "content": {
106
+ "application/json": {
107
+ "schema": {
108
+ "$ref": "#/components/schemas/Department"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "400": {
114
+ "$ref": "#/components/responses/BadRequest"
115
+ },
116
+ "409": {
117
+ "$ref": "#/components/responses/Conflict"
118
+ }
119
+ }
120
+ }
121
+ },
122
+ "/api/department/{id}": {
123
+ "parameters": [
124
+ {
125
+ "name": "id",
126
+ "in": "path",
127
+ "required": true,
128
+ "schema": {
129
+ "type": "string"
130
+ },
131
+ "description": "Department ID"
132
+ }
133
+ ],
134
+ "get": {
135
+ "summary": "Get Department by ID",
136
+ "tags": [
137
+ "Department"
138
+ ],
139
+ "responses": {
140
+ "200": {
141
+ "description": "Department record",
142
+ "content": {
143
+ "application/json": {
144
+ "schema": {
145
+ "$ref": "#/components/schemas/Department"
146
+ }
147
+ }
148
+ }
149
+ },
150
+ "404": {
151
+ "$ref": "#/components/responses/NotFound"
152
+ }
153
+ }
154
+ },
155
+ "put": {
156
+ "summary": "Update Department",
157
+ "tags": [
158
+ "Department"
159
+ ],
160
+ "requestBody": {
161
+ "required": true,
162
+ "content": {
163
+ "application/json": {
164
+ "schema": {
165
+ "$ref": "#/components/schemas/DepartmentCreate"
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "responses": {
171
+ "200": {
172
+ "description": "Updated Department",
173
+ "content": {
174
+ "application/json": {
175
+ "schema": {
176
+ "$ref": "#/components/schemas/Department"
177
+ }
178
+ }
179
+ }
180
+ },
181
+ "404": {
182
+ "$ref": "#/components/responses/NotFound"
183
+ }
184
+ }
185
+ },
186
+ "patch": {
187
+ "summary": "Partially update Department",
188
+ "tags": [
189
+ "Department"
190
+ ],
191
+ "requestBody": {
192
+ "required": true,
193
+ "content": {
194
+ "application/json": {
195
+ "schema": {
196
+ "$ref": "#/components/schemas/DepartmentUpdate"
197
+ }
198
+ }
199
+ }
200
+ },
201
+ "responses": {
202
+ "200": {
203
+ "description": "Updated Department",
204
+ "content": {
205
+ "application/json": {
206
+ "schema": {
207
+ "$ref": "#/components/schemas/Department"
208
+ }
209
+ }
210
+ }
211
+ },
212
+ "404": {
213
+ "$ref": "#/components/responses/NotFound"
214
+ }
215
+ }
216
+ },
217
+ "delete": {
218
+ "summary": "Delete Department",
219
+ "tags": [
220
+ "Department"
221
+ ],
222
+ "responses": {
223
+ "204": {
224
+ "description": "Deleted successfully"
225
+ },
226
+ "404": {
227
+ "$ref": "#/components/responses/NotFound"
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "/api/department/bulk/update": {
233
+ "patch": {
234
+ "summary": "Bulk update Departments",
235
+ "tags": [
236
+ "Department"
237
+ ],
238
+ "requestBody": {
239
+ "required": true,
240
+ "description": "Array of Department objects with id field to update",
241
+ "content": {
242
+ "application/json": {
243
+ "schema": {
244
+ "type": "array",
245
+ "items": {
246
+ "$ref": "#/components/schemas/DepartmentUpdate"
247
+ }
248
+ }
249
+ }
250
+ }
251
+ },
252
+ "responses": {
253
+ "200": {
254
+ "description": "Bulk update result",
255
+ "content": {
256
+ "application/json": {
257
+ "schema": {
258
+ "type": "object",
259
+ "properties": {
260
+ "updated": {
261
+ "type": "integer"
262
+ },
263
+ "records": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "#/components/schemas/Department"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
273
+ },
274
+ "400": {
275
+ "$ref": "#/components/responses/BadRequest"
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "/api/department/bulk/delete": {
281
+ "delete": {
282
+ "summary": "Bulk delete Departments",
283
+ "tags": [
284
+ "Department"
285
+ ],
286
+ "requestBody": {
287
+ "required": true,
288
+ "description": "Array of IDs to delete",
289
+ "content": {
290
+ "application/json": {
291
+ "schema": {
292
+ "type": "array",
293
+ "items": {
294
+ "type": "string"
295
+ }
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "responses": {
301
+ "200": {
302
+ "description": "Bulk delete result",
303
+ "content": {
304
+ "application/json": {
305
+ "schema": {
306
+ "type": "object",
307
+ "properties": {
308
+ "deleted": {
309
+ "type": "integer"
310
+ }
311
+ }
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "400": {
317
+ "$ref": "#/components/responses/BadRequest"
318
+ }
319
+ }
320
+ }
321
+ },
322
+ "/api/category": {
323
+ "get": {
324
+ "summary": "List Categorys",
325
+ "tags": [
326
+ "Category"
327
+ ],
328
+ "parameters": [
329
+ {
330
+ "name": "page",
331
+ "in": "query",
332
+ "schema": {
333
+ "type": "integer",
334
+ "default": 1
335
+ },
336
+ "description": "Page number"
337
+ },
338
+ {
339
+ "name": "limit",
340
+ "in": "query",
341
+ "schema": {
342
+ "type": "integer",
343
+ "default": 20
344
+ },
345
+ "description": "Items per page"
346
+ },
347
+ {
348
+ "name": "sort",
349
+ "in": "query",
350
+ "schema": {
351
+ "type": "string"
352
+ },
353
+ "description": "e.g. createdAt:desc"
354
+ },
355
+ {
356
+ "name": "include",
357
+ "in": "query",
358
+ "schema": {
359
+ "type": "string"
360
+ },
361
+ "description": "Comma-separated relations"
362
+ },
363
+ {
364
+ "name": "select",
365
+ "in": "query",
366
+ "schema": {
367
+ "type": "string"
368
+ },
369
+ "description": "Comma-separated fields"
370
+ }
371
+ ],
372
+ "responses": {
373
+ "200": {
374
+ "description": "List of Categorys",
375
+ "content": {
376
+ "application/json": {
377
+ "schema": {
378
+ "type": "object",
379
+ "properties": {
380
+ "data": {
381
+ "type": "array",
382
+ "items": {
383
+ "$ref": "#/components/schemas/Category"
384
+ }
385
+ },
386
+ "meta": {
387
+ "$ref": "#/components/schemas/PaginationMeta"
388
+ }
389
+ }
390
+ }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ },
396
+ "post": {
397
+ "summary": "Create Category",
398
+ "tags": [
399
+ "Category"
400
+ ],
401
+ "requestBody": {
402
+ "required": true,
403
+ "content": {
404
+ "application/json": {
405
+ "schema": {
406
+ "$ref": "#/components/schemas/CategoryCreate"
407
+ }
408
+ }
409
+ }
410
+ },
411
+ "responses": {
412
+ "201": {
413
+ "description": "Created Category",
414
+ "content": {
415
+ "application/json": {
416
+ "schema": {
417
+ "$ref": "#/components/schemas/Category"
418
+ }
419
+ }
420
+ }
421
+ },
422
+ "400": {
423
+ "$ref": "#/components/responses/BadRequest"
424
+ },
425
+ "409": {
426
+ "$ref": "#/components/responses/Conflict"
427
+ }
428
+ }
429
+ }
430
+ },
431
+ "/api/category/{id}": {
432
+ "parameters": [
433
+ {
434
+ "name": "id",
435
+ "in": "path",
436
+ "required": true,
437
+ "schema": {
438
+ "type": "string"
439
+ },
440
+ "description": "Category ID"
441
+ }
442
+ ],
443
+ "get": {
444
+ "summary": "Get Category by ID",
445
+ "tags": [
446
+ "Category"
447
+ ],
448
+ "responses": {
449
+ "200": {
450
+ "description": "Category record",
451
+ "content": {
452
+ "application/json": {
453
+ "schema": {
454
+ "$ref": "#/components/schemas/Category"
455
+ }
456
+ }
457
+ }
458
+ },
459
+ "404": {
460
+ "$ref": "#/components/responses/NotFound"
461
+ }
462
+ }
463
+ },
464
+ "put": {
465
+ "summary": "Update Category",
466
+ "tags": [
467
+ "Category"
468
+ ],
469
+ "requestBody": {
470
+ "required": true,
471
+ "content": {
472
+ "application/json": {
473
+ "schema": {
474
+ "$ref": "#/components/schemas/CategoryCreate"
475
+ }
476
+ }
477
+ }
478
+ },
479
+ "responses": {
480
+ "200": {
481
+ "description": "Updated Category",
482
+ "content": {
483
+ "application/json": {
484
+ "schema": {
485
+ "$ref": "#/components/schemas/Category"
486
+ }
487
+ }
488
+ }
489
+ },
490
+ "404": {
491
+ "$ref": "#/components/responses/NotFound"
492
+ }
493
+ }
494
+ },
495
+ "patch": {
496
+ "summary": "Partially update Category",
497
+ "tags": [
498
+ "Category"
499
+ ],
500
+ "requestBody": {
501
+ "required": true,
502
+ "content": {
503
+ "application/json": {
504
+ "schema": {
505
+ "$ref": "#/components/schemas/CategoryUpdate"
506
+ }
507
+ }
508
+ }
509
+ },
510
+ "responses": {
511
+ "200": {
512
+ "description": "Updated Category",
513
+ "content": {
514
+ "application/json": {
515
+ "schema": {
516
+ "$ref": "#/components/schemas/Category"
517
+ }
518
+ }
519
+ }
520
+ },
521
+ "404": {
522
+ "$ref": "#/components/responses/NotFound"
523
+ }
524
+ }
525
+ },
526
+ "delete": {
527
+ "summary": "Delete Category",
528
+ "tags": [
529
+ "Category"
530
+ ],
531
+ "responses": {
532
+ "204": {
533
+ "description": "Deleted successfully"
534
+ },
535
+ "404": {
536
+ "$ref": "#/components/responses/NotFound"
537
+ }
538
+ }
539
+ }
540
+ },
541
+ "/api/category/bulk/update": {
542
+ "patch": {
543
+ "summary": "Bulk update Categorys",
544
+ "tags": [
545
+ "Category"
546
+ ],
547
+ "requestBody": {
548
+ "required": true,
549
+ "description": "Array of Category objects with id field to update",
550
+ "content": {
551
+ "application/json": {
552
+ "schema": {
553
+ "type": "array",
554
+ "items": {
555
+ "$ref": "#/components/schemas/CategoryUpdate"
556
+ }
557
+ }
558
+ }
559
+ }
560
+ },
561
+ "responses": {
562
+ "200": {
563
+ "description": "Bulk update result",
564
+ "content": {
565
+ "application/json": {
566
+ "schema": {
567
+ "type": "object",
568
+ "properties": {
569
+ "updated": {
570
+ "type": "integer"
571
+ },
572
+ "records": {
573
+ "type": "array",
574
+ "items": {
575
+ "$ref": "#/components/schemas/Category"
576
+ }
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+ },
583
+ "400": {
584
+ "$ref": "#/components/responses/BadRequest"
585
+ }
586
+ }
587
+ }
588
+ },
589
+ "/api/category/bulk/delete": {
590
+ "delete": {
591
+ "summary": "Bulk delete Categorys",
592
+ "tags": [
593
+ "Category"
594
+ ],
595
+ "requestBody": {
596
+ "required": true,
597
+ "description": "Array of IDs to delete",
598
+ "content": {
599
+ "application/json": {
600
+ "schema": {
601
+ "type": "array",
602
+ "items": {
603
+ "type": "string"
604
+ }
605
+ }
606
+ }
607
+ }
608
+ },
609
+ "responses": {
610
+ "200": {
611
+ "description": "Bulk delete result",
612
+ "content": {
613
+ "application/json": {
614
+ "schema": {
615
+ "type": "object",
616
+ "properties": {
617
+ "deleted": {
618
+ "type": "integer"
619
+ }
620
+ }
621
+ }
622
+ }
623
+ }
624
+ },
625
+ "400": {
626
+ "$ref": "#/components/responses/BadRequest"
627
+ }
628
+ }
629
+ }
630
+ },
631
+ "/api/product": {
632
+ "get": {
633
+ "summary": "List Products",
634
+ "tags": [
635
+ "Product"
636
+ ],
637
+ "parameters": [
638
+ {
639
+ "name": "page",
640
+ "in": "query",
641
+ "schema": {
642
+ "type": "integer",
643
+ "default": 1
644
+ },
645
+ "description": "Page number"
646
+ },
647
+ {
648
+ "name": "limit",
649
+ "in": "query",
650
+ "schema": {
651
+ "type": "integer",
652
+ "default": 20
653
+ },
654
+ "description": "Items per page"
655
+ },
656
+ {
657
+ "name": "sort",
658
+ "in": "query",
659
+ "schema": {
660
+ "type": "string"
661
+ },
662
+ "description": "e.g. createdAt:desc"
663
+ },
664
+ {
665
+ "name": "include",
666
+ "in": "query",
667
+ "schema": {
668
+ "type": "string"
669
+ },
670
+ "description": "Comma-separated relations"
671
+ },
672
+ {
673
+ "name": "select",
674
+ "in": "query",
675
+ "schema": {
676
+ "type": "string"
677
+ },
678
+ "description": "Comma-separated fields"
679
+ }
680
+ ],
681
+ "responses": {
682
+ "200": {
683
+ "description": "List of Products",
684
+ "content": {
685
+ "application/json": {
686
+ "schema": {
687
+ "type": "object",
688
+ "properties": {
689
+ "data": {
690
+ "type": "array",
691
+ "items": {
692
+ "$ref": "#/components/schemas/Product"
693
+ }
694
+ },
695
+ "meta": {
696
+ "$ref": "#/components/schemas/PaginationMeta"
697
+ }
698
+ }
699
+ }
700
+ }
701
+ }
702
+ }
703
+ }
704
+ },
705
+ "post": {
706
+ "summary": "Create Product",
707
+ "tags": [
708
+ "Product"
709
+ ],
710
+ "requestBody": {
711
+ "required": true,
712
+ "content": {
713
+ "application/json": {
714
+ "schema": {
715
+ "$ref": "#/components/schemas/ProductCreate"
716
+ }
717
+ }
718
+ }
719
+ },
720
+ "responses": {
721
+ "201": {
722
+ "description": "Created Product",
723
+ "content": {
724
+ "application/json": {
725
+ "schema": {
726
+ "$ref": "#/components/schemas/Product"
727
+ }
728
+ }
729
+ }
730
+ },
731
+ "400": {
732
+ "$ref": "#/components/responses/BadRequest"
733
+ },
734
+ "409": {
735
+ "$ref": "#/components/responses/Conflict"
736
+ }
737
+ }
738
+ }
739
+ },
740
+ "/api/product/{id}": {
741
+ "parameters": [
742
+ {
743
+ "name": "id",
744
+ "in": "path",
745
+ "required": true,
746
+ "schema": {
747
+ "type": "string"
748
+ },
749
+ "description": "Product ID"
750
+ }
751
+ ],
752
+ "get": {
753
+ "summary": "Get Product by ID",
754
+ "tags": [
755
+ "Product"
756
+ ],
757
+ "responses": {
758
+ "200": {
759
+ "description": "Product record",
760
+ "content": {
761
+ "application/json": {
762
+ "schema": {
763
+ "$ref": "#/components/schemas/Product"
764
+ }
765
+ }
766
+ }
767
+ },
768
+ "404": {
769
+ "$ref": "#/components/responses/NotFound"
770
+ }
771
+ }
772
+ },
773
+ "put": {
774
+ "summary": "Update Product",
775
+ "tags": [
776
+ "Product"
777
+ ],
778
+ "requestBody": {
779
+ "required": true,
780
+ "content": {
781
+ "application/json": {
782
+ "schema": {
783
+ "$ref": "#/components/schemas/ProductCreate"
784
+ }
785
+ }
786
+ }
787
+ },
788
+ "responses": {
789
+ "200": {
790
+ "description": "Updated Product",
791
+ "content": {
792
+ "application/json": {
793
+ "schema": {
794
+ "$ref": "#/components/schemas/Product"
795
+ }
796
+ }
797
+ }
798
+ },
799
+ "404": {
800
+ "$ref": "#/components/responses/NotFound"
801
+ }
802
+ }
803
+ },
804
+ "patch": {
805
+ "summary": "Partially update Product",
806
+ "tags": [
807
+ "Product"
808
+ ],
809
+ "requestBody": {
810
+ "required": true,
811
+ "content": {
812
+ "application/json": {
813
+ "schema": {
814
+ "$ref": "#/components/schemas/ProductUpdate"
815
+ }
816
+ }
817
+ }
818
+ },
819
+ "responses": {
820
+ "200": {
821
+ "description": "Updated Product",
822
+ "content": {
823
+ "application/json": {
824
+ "schema": {
825
+ "$ref": "#/components/schemas/Product"
826
+ }
827
+ }
828
+ }
829
+ },
830
+ "404": {
831
+ "$ref": "#/components/responses/NotFound"
832
+ }
833
+ }
834
+ },
835
+ "delete": {
836
+ "summary": "Delete Product",
837
+ "tags": [
838
+ "Product"
839
+ ],
840
+ "responses": {
841
+ "204": {
842
+ "description": "Deleted successfully"
843
+ },
844
+ "404": {
845
+ "$ref": "#/components/responses/NotFound"
846
+ }
847
+ }
848
+ }
849
+ },
850
+ "/api/product/bulk/update": {
851
+ "patch": {
852
+ "summary": "Bulk update Products",
853
+ "tags": [
854
+ "Product"
855
+ ],
856
+ "requestBody": {
857
+ "required": true,
858
+ "description": "Array of Product objects with id field to update",
859
+ "content": {
860
+ "application/json": {
861
+ "schema": {
862
+ "type": "array",
863
+ "items": {
864
+ "$ref": "#/components/schemas/ProductUpdate"
865
+ }
866
+ }
867
+ }
868
+ }
869
+ },
870
+ "responses": {
871
+ "200": {
872
+ "description": "Bulk update result",
873
+ "content": {
874
+ "application/json": {
875
+ "schema": {
876
+ "type": "object",
877
+ "properties": {
878
+ "updated": {
879
+ "type": "integer"
880
+ },
881
+ "records": {
882
+ "type": "array",
883
+ "items": {
884
+ "$ref": "#/components/schemas/Product"
885
+ }
886
+ }
887
+ }
888
+ }
889
+ }
890
+ }
891
+ },
892
+ "400": {
893
+ "$ref": "#/components/responses/BadRequest"
894
+ }
895
+ }
896
+ }
897
+ },
898
+ "/api/product/bulk/delete": {
899
+ "delete": {
900
+ "summary": "Bulk delete Products",
901
+ "tags": [
902
+ "Product"
903
+ ],
904
+ "requestBody": {
905
+ "required": true,
906
+ "description": "Array of IDs to delete",
907
+ "content": {
908
+ "application/json": {
909
+ "schema": {
910
+ "type": "array",
911
+ "items": {
912
+ "type": "string"
913
+ }
914
+ }
915
+ }
916
+ }
917
+ },
918
+ "responses": {
919
+ "200": {
920
+ "description": "Bulk delete result",
921
+ "content": {
922
+ "application/json": {
923
+ "schema": {
924
+ "type": "object",
925
+ "properties": {
926
+ "deleted": {
927
+ "type": "integer"
928
+ }
929
+ }
930
+ }
931
+ }
932
+ }
933
+ },
934
+ "400": {
935
+ "$ref": "#/components/responses/BadRequest"
936
+ }
937
+ }
938
+ }
939
+ },
940
+ "/api/city": {
941
+ "get": {
942
+ "summary": "List Citys",
943
+ "tags": [
944
+ "City"
945
+ ],
946
+ "parameters": [
947
+ {
948
+ "name": "page",
949
+ "in": "query",
950
+ "schema": {
951
+ "type": "integer",
952
+ "default": 1
953
+ },
954
+ "description": "Page number"
955
+ },
956
+ {
957
+ "name": "limit",
958
+ "in": "query",
959
+ "schema": {
960
+ "type": "integer",
961
+ "default": 20
962
+ },
963
+ "description": "Items per page"
964
+ },
965
+ {
966
+ "name": "sort",
967
+ "in": "query",
968
+ "schema": {
969
+ "type": "string"
970
+ },
971
+ "description": "e.g. createdAt:desc"
972
+ },
973
+ {
974
+ "name": "include",
975
+ "in": "query",
976
+ "schema": {
977
+ "type": "string"
978
+ },
979
+ "description": "Comma-separated relations"
980
+ },
981
+ {
982
+ "name": "select",
983
+ "in": "query",
984
+ "schema": {
985
+ "type": "string"
986
+ },
987
+ "description": "Comma-separated fields"
988
+ }
989
+ ],
990
+ "responses": {
991
+ "200": {
992
+ "description": "List of Citys",
993
+ "content": {
994
+ "application/json": {
995
+ "schema": {
996
+ "type": "object",
997
+ "properties": {
998
+ "data": {
999
+ "type": "array",
1000
+ "items": {
1001
+ "$ref": "#/components/schemas/City"
1002
+ }
1003
+ },
1004
+ "meta": {
1005
+ "$ref": "#/components/schemas/PaginationMeta"
1006
+ }
1007
+ }
1008
+ }
1009
+ }
1010
+ }
1011
+ }
1012
+ }
1013
+ },
1014
+ "post": {
1015
+ "summary": "Create City",
1016
+ "tags": [
1017
+ "City"
1018
+ ],
1019
+ "requestBody": {
1020
+ "required": true,
1021
+ "content": {
1022
+ "application/json": {
1023
+ "schema": {
1024
+ "$ref": "#/components/schemas/CityCreate"
1025
+ }
1026
+ }
1027
+ }
1028
+ },
1029
+ "responses": {
1030
+ "201": {
1031
+ "description": "Created City",
1032
+ "content": {
1033
+ "application/json": {
1034
+ "schema": {
1035
+ "$ref": "#/components/schemas/City"
1036
+ }
1037
+ }
1038
+ }
1039
+ },
1040
+ "400": {
1041
+ "$ref": "#/components/responses/BadRequest"
1042
+ },
1043
+ "409": {
1044
+ "$ref": "#/components/responses/Conflict"
1045
+ }
1046
+ }
1047
+ }
1048
+ },
1049
+ "/api/city/{id}": {
1050
+ "parameters": [
1051
+ {
1052
+ "name": "id",
1053
+ "in": "path",
1054
+ "required": true,
1055
+ "schema": {
1056
+ "type": "string"
1057
+ },
1058
+ "description": "City ID"
1059
+ }
1060
+ ],
1061
+ "get": {
1062
+ "summary": "Get City by ID",
1063
+ "tags": [
1064
+ "City"
1065
+ ],
1066
+ "responses": {
1067
+ "200": {
1068
+ "description": "City record",
1069
+ "content": {
1070
+ "application/json": {
1071
+ "schema": {
1072
+ "$ref": "#/components/schemas/City"
1073
+ }
1074
+ }
1075
+ }
1076
+ },
1077
+ "404": {
1078
+ "$ref": "#/components/responses/NotFound"
1079
+ }
1080
+ }
1081
+ },
1082
+ "put": {
1083
+ "summary": "Update City",
1084
+ "tags": [
1085
+ "City"
1086
+ ],
1087
+ "requestBody": {
1088
+ "required": true,
1089
+ "content": {
1090
+ "application/json": {
1091
+ "schema": {
1092
+ "$ref": "#/components/schemas/CityCreate"
1093
+ }
1094
+ }
1095
+ }
1096
+ },
1097
+ "responses": {
1098
+ "200": {
1099
+ "description": "Updated City",
1100
+ "content": {
1101
+ "application/json": {
1102
+ "schema": {
1103
+ "$ref": "#/components/schemas/City"
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ "404": {
1109
+ "$ref": "#/components/responses/NotFound"
1110
+ }
1111
+ }
1112
+ },
1113
+ "patch": {
1114
+ "summary": "Partially update City",
1115
+ "tags": [
1116
+ "City"
1117
+ ],
1118
+ "requestBody": {
1119
+ "required": true,
1120
+ "content": {
1121
+ "application/json": {
1122
+ "schema": {
1123
+ "$ref": "#/components/schemas/CityUpdate"
1124
+ }
1125
+ }
1126
+ }
1127
+ },
1128
+ "responses": {
1129
+ "200": {
1130
+ "description": "Updated City",
1131
+ "content": {
1132
+ "application/json": {
1133
+ "schema": {
1134
+ "$ref": "#/components/schemas/City"
1135
+ }
1136
+ }
1137
+ }
1138
+ },
1139
+ "404": {
1140
+ "$ref": "#/components/responses/NotFound"
1141
+ }
1142
+ }
1143
+ },
1144
+ "delete": {
1145
+ "summary": "Delete City",
1146
+ "tags": [
1147
+ "City"
1148
+ ],
1149
+ "responses": {
1150
+ "204": {
1151
+ "description": "Deleted successfully"
1152
+ },
1153
+ "404": {
1154
+ "$ref": "#/components/responses/NotFound"
1155
+ }
1156
+ }
1157
+ }
1158
+ },
1159
+ "/api/city/bulk/update": {
1160
+ "patch": {
1161
+ "summary": "Bulk update Citys",
1162
+ "tags": [
1163
+ "City"
1164
+ ],
1165
+ "requestBody": {
1166
+ "required": true,
1167
+ "description": "Array of City objects with id field to update",
1168
+ "content": {
1169
+ "application/json": {
1170
+ "schema": {
1171
+ "type": "array",
1172
+ "items": {
1173
+ "$ref": "#/components/schemas/CityUpdate"
1174
+ }
1175
+ }
1176
+ }
1177
+ }
1178
+ },
1179
+ "responses": {
1180
+ "200": {
1181
+ "description": "Bulk update result",
1182
+ "content": {
1183
+ "application/json": {
1184
+ "schema": {
1185
+ "type": "object",
1186
+ "properties": {
1187
+ "updated": {
1188
+ "type": "integer"
1189
+ },
1190
+ "records": {
1191
+ "type": "array",
1192
+ "items": {
1193
+ "$ref": "#/components/schemas/City"
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+ }
1199
+ }
1200
+ },
1201
+ "400": {
1202
+ "$ref": "#/components/responses/BadRequest"
1203
+ }
1204
+ }
1205
+ }
1206
+ },
1207
+ "/api/city/bulk/delete": {
1208
+ "delete": {
1209
+ "summary": "Bulk delete Citys",
1210
+ "tags": [
1211
+ "City"
1212
+ ],
1213
+ "requestBody": {
1214
+ "required": true,
1215
+ "description": "Array of IDs to delete",
1216
+ "content": {
1217
+ "application/json": {
1218
+ "schema": {
1219
+ "type": "array",
1220
+ "items": {
1221
+ "type": "string"
1222
+ }
1223
+ }
1224
+ }
1225
+ }
1226
+ },
1227
+ "responses": {
1228
+ "200": {
1229
+ "description": "Bulk delete result",
1230
+ "content": {
1231
+ "application/json": {
1232
+ "schema": {
1233
+ "type": "object",
1234
+ "properties": {
1235
+ "deleted": {
1236
+ "type": "integer"
1237
+ }
1238
+ }
1239
+ }
1240
+ }
1241
+ }
1242
+ },
1243
+ "400": {
1244
+ "$ref": "#/components/responses/BadRequest"
1245
+ }
1246
+ }
1247
+ }
1248
+ }
1249
+ },
1250
+ "components": {
1251
+ "schemas": {
1252
+ "Department": {
1253
+ "type": "object",
1254
+ "properties": {
1255
+ "id": {
1256
+ "type": "integer",
1257
+ "format": "int32"
1258
+ },
1259
+ "name": {
1260
+ "type": "string"
1261
+ },
1262
+ "description": {
1263
+ "type": "string"
1264
+ },
1265
+ "createdAt": {
1266
+ "type": "string",
1267
+ "format": "date-time"
1268
+ },
1269
+ "updatedAt": {
1270
+ "type": "string",
1271
+ "format": "date-time"
1272
+ }
1273
+ }
1274
+ },
1275
+ "DepartmentCreate": {
1276
+ "type": "object",
1277
+ "properties": {
1278
+ "name": {
1279
+ "type": "string"
1280
+ },
1281
+ "description": {
1282
+ "type": "string"
1283
+ },
1284
+ "createdAt": {
1285
+ "type": "string",
1286
+ "format": "date-time"
1287
+ },
1288
+ "updatedAt": {
1289
+ "type": "string",
1290
+ "format": "date-time"
1291
+ }
1292
+ },
1293
+ "required": [
1294
+ "name",
1295
+ "createdAt",
1296
+ "updatedAt"
1297
+ ]
1298
+ },
1299
+ "DepartmentUpdate": {
1300
+ "type": "object",
1301
+ "properties": {
1302
+ "name": {
1303
+ "type": "string"
1304
+ },
1305
+ "description": {
1306
+ "type": "string"
1307
+ },
1308
+ "createdAt": {
1309
+ "type": "string",
1310
+ "format": "date-time"
1311
+ },
1312
+ "updatedAt": {
1313
+ "type": "string",
1314
+ "format": "date-time"
1315
+ }
1316
+ },
1317
+ "required": []
1318
+ },
1319
+ "Category": {
1320
+ "type": "object",
1321
+ "properties": {
1322
+ "id": {
1323
+ "type": "integer",
1324
+ "format": "int32"
1325
+ },
1326
+ "name": {
1327
+ "type": "string"
1328
+ },
1329
+ "departmentId": {
1330
+ "type": "integer",
1331
+ "format": "int32"
1332
+ },
1333
+ "createdAt": {
1334
+ "type": "string",
1335
+ "format": "date-time"
1336
+ },
1337
+ "updatedAt": {
1338
+ "type": "string",
1339
+ "format": "date-time"
1340
+ }
1341
+ }
1342
+ },
1343
+ "CategoryCreate": {
1344
+ "type": "object",
1345
+ "properties": {
1346
+ "name": {
1347
+ "type": "string"
1348
+ },
1349
+ "departmentId": {
1350
+ "type": "integer",
1351
+ "format": "int32"
1352
+ },
1353
+ "createdAt": {
1354
+ "type": "string",
1355
+ "format": "date-time"
1356
+ },
1357
+ "updatedAt": {
1358
+ "type": "string",
1359
+ "format": "date-time"
1360
+ }
1361
+ },
1362
+ "required": [
1363
+ "name",
1364
+ "departmentId",
1365
+ "createdAt",
1366
+ "updatedAt"
1367
+ ]
1368
+ },
1369
+ "CategoryUpdate": {
1370
+ "type": "object",
1371
+ "properties": {
1372
+ "name": {
1373
+ "type": "string"
1374
+ },
1375
+ "departmentId": {
1376
+ "type": "integer",
1377
+ "format": "int32"
1378
+ },
1379
+ "createdAt": {
1380
+ "type": "string",
1381
+ "format": "date-time"
1382
+ },
1383
+ "updatedAt": {
1384
+ "type": "string",
1385
+ "format": "date-time"
1386
+ }
1387
+ },
1388
+ "required": []
1389
+ },
1390
+ "Product": {
1391
+ "type": "object",
1392
+ "properties": {
1393
+ "id": {
1394
+ "type": "integer",
1395
+ "format": "int32"
1396
+ },
1397
+ "name": {
1398
+ "type": "string"
1399
+ },
1400
+ "price": {
1401
+ "type": "number",
1402
+ "format": "float"
1403
+ },
1404
+ "categoryId": {
1405
+ "type": "integer",
1406
+ "format": "int32"
1407
+ },
1408
+ "cityId": {
1409
+ "type": "integer",
1410
+ "format": "int32"
1411
+ },
1412
+ "createdAt": {
1413
+ "type": "string",
1414
+ "format": "date-time"
1415
+ },
1416
+ "updatedAt": {
1417
+ "type": "string",
1418
+ "format": "date-time"
1419
+ }
1420
+ }
1421
+ },
1422
+ "ProductCreate": {
1423
+ "type": "object",
1424
+ "properties": {
1425
+ "name": {
1426
+ "type": "string"
1427
+ },
1428
+ "price": {
1429
+ "type": "number",
1430
+ "format": "float"
1431
+ },
1432
+ "categoryId": {
1433
+ "type": "integer",
1434
+ "format": "int32"
1435
+ },
1436
+ "cityId": {
1437
+ "type": "integer",
1438
+ "format": "int32"
1439
+ },
1440
+ "createdAt": {
1441
+ "type": "string",
1442
+ "format": "date-time"
1443
+ },
1444
+ "updatedAt": {
1445
+ "type": "string",
1446
+ "format": "date-time"
1447
+ }
1448
+ },
1449
+ "required": [
1450
+ "name",
1451
+ "price",
1452
+ "categoryId",
1453
+ "createdAt",
1454
+ "updatedAt"
1455
+ ]
1456
+ },
1457
+ "ProductUpdate": {
1458
+ "type": "object",
1459
+ "properties": {
1460
+ "name": {
1461
+ "type": "string"
1462
+ },
1463
+ "price": {
1464
+ "type": "number",
1465
+ "format": "float"
1466
+ },
1467
+ "categoryId": {
1468
+ "type": "integer",
1469
+ "format": "int32"
1470
+ },
1471
+ "cityId": {
1472
+ "type": "integer",
1473
+ "format": "int32"
1474
+ },
1475
+ "createdAt": {
1476
+ "type": "string",
1477
+ "format": "date-time"
1478
+ },
1479
+ "updatedAt": {
1480
+ "type": "string",
1481
+ "format": "date-time"
1482
+ }
1483
+ },
1484
+ "required": []
1485
+ },
1486
+ "City": {
1487
+ "type": "object",
1488
+ "properties": {
1489
+ "id": {
1490
+ "type": "integer",
1491
+ "format": "int32"
1492
+ },
1493
+ "name": {
1494
+ "type": "string"
1495
+ },
1496
+ "country": {
1497
+ "type": "string"
1498
+ },
1499
+ "createdAt": {
1500
+ "type": "string",
1501
+ "format": "date-time"
1502
+ },
1503
+ "updatedAt": {
1504
+ "type": "string",
1505
+ "format": "date-time"
1506
+ }
1507
+ }
1508
+ },
1509
+ "CityCreate": {
1510
+ "type": "object",
1511
+ "properties": {
1512
+ "name": {
1513
+ "type": "string"
1514
+ },
1515
+ "country": {
1516
+ "type": "string"
1517
+ },
1518
+ "createdAt": {
1519
+ "type": "string",
1520
+ "format": "date-time"
1521
+ },
1522
+ "updatedAt": {
1523
+ "type": "string",
1524
+ "format": "date-time"
1525
+ }
1526
+ },
1527
+ "required": [
1528
+ "name",
1529
+ "country",
1530
+ "createdAt",
1531
+ "updatedAt"
1532
+ ]
1533
+ },
1534
+ "CityUpdate": {
1535
+ "type": "object",
1536
+ "properties": {
1537
+ "name": {
1538
+ "type": "string"
1539
+ },
1540
+ "country": {
1541
+ "type": "string"
1542
+ },
1543
+ "createdAt": {
1544
+ "type": "string",
1545
+ "format": "date-time"
1546
+ },
1547
+ "updatedAt": {
1548
+ "type": "string",
1549
+ "format": "date-time"
1550
+ }
1551
+ },
1552
+ "required": []
1553
+ },
1554
+ "PaginationMeta": {
1555
+ "type": "object",
1556
+ "properties": {
1557
+ "total": {
1558
+ "type": "integer"
1559
+ },
1560
+ "page": {
1561
+ "type": "integer"
1562
+ },
1563
+ "limit": {
1564
+ "type": "integer"
1565
+ },
1566
+ "totalPages": {
1567
+ "type": "integer"
1568
+ }
1569
+ }
1570
+ },
1571
+ "Error": {
1572
+ "type": "object",
1573
+ "properties": {
1574
+ "error": {
1575
+ "type": "string"
1576
+ }
1577
+ }
1578
+ }
1579
+ },
1580
+ "responses": {
1581
+ "NotFound": {
1582
+ "description": "Record not found",
1583
+ "content": {
1584
+ "application/json": {
1585
+ "schema": {
1586
+ "$ref": "#/components/schemas/Error"
1587
+ }
1588
+ }
1589
+ }
1590
+ },
1591
+ "BadRequest": {
1592
+ "description": "Bad request",
1593
+ "content": {
1594
+ "application/json": {
1595
+ "schema": {
1596
+ "$ref": "#/components/schemas/Error"
1597
+ }
1598
+ }
1599
+ }
1600
+ },
1601
+ "Conflict": {
1602
+ "description": "Unique constraint violation",
1603
+ "content": {
1604
+ "application/json": {
1605
+ "schema": {
1606
+ "$ref": "#/components/schemas/Error"
1607
+ }
1608
+ }
1609
+ }
1610
+ }
1611
+ }
1612
+ },
1613
+ "tags": [
1614
+ {
1615
+ "name": "Department"
1616
+ },
1617
+ {
1618
+ "name": "Category"
1619
+ },
1620
+ {
1621
+ "name": "Product"
1622
+ },
1623
+ {
1624
+ "name": "City"
1625
+ }
1626
+ ]
1627
+ }