@acorex-platform/module-location-management-client 0.0.15

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 (50) hide show
  1. package/contracts/datasource.keys.d.ts +6 -0
  2. package/contracts/datasource.keys.js +8 -0
  3. package/contracts/entities/geographic-region/geographic-region.entity.d.ts +2 -0
  4. package/contracts/entities/geographic-region/geographic-region.entity.js +725 -0
  5. package/contracts/entities/geographic-region/geographic-region.types.d.ts +27 -0
  6. package/contracts/entities/geographic-region/geographic-region.types.js +1 -0
  7. package/contracts/entities/geographic-region/index.d.ts +2 -0
  8. package/contracts/entities/geographic-region/index.js +2 -0
  9. package/contracts/entities/index.d.ts +5 -0
  10. package/contracts/entities/index.js +5 -0
  11. package/contracts/entities/location/index.d.ts +2 -0
  12. package/contracts/entities/location/index.js +2 -0
  13. package/contracts/entities/location/location.entity.d.ts +2 -0
  14. package/contracts/entities/location/location.entity.js +1075 -0
  15. package/contracts/entities/location/location.types.d.ts +30 -0
  16. package/contracts/entities/location/location.types.js +1 -0
  17. package/contracts/entities/location-assignment/index.d.ts +2 -0
  18. package/contracts/entities/location-assignment/index.js +2 -0
  19. package/contracts/entities/location-assignment/location-assignment.entity.d.ts +2 -0
  20. package/contracts/entities/location-assignment/location-assignment.entity.js +194 -0
  21. package/contracts/entities/location-assignment/location-assignment.types.d.ts +35 -0
  22. package/contracts/entities/location-assignment/location-assignment.types.js +2 -0
  23. package/contracts/entities/location-role/index.d.ts +2 -0
  24. package/contracts/entities/location-role/index.js +2 -0
  25. package/contracts/entities/location-role/location-role.entity.d.ts +2 -0
  26. package/contracts/entities/location-role/location-role.entity.js +143 -0
  27. package/contracts/entities/location-role/location-role.types.d.ts +6 -0
  28. package/contracts/entities/location-role/location-role.types.js +1 -0
  29. package/contracts/entities/location-type/index.d.ts +2 -0
  30. package/contracts/entities/location-type/index.js +2 -0
  31. package/contracts/entities/location-type/location-type.entity.d.ts +2 -0
  32. package/contracts/entities/location-type/location-type.entity.js +237 -0
  33. package/contracts/entities/location-type/location-type.types.d.ts +8 -0
  34. package/contracts/entities/location-type/location-type.types.js +1 -0
  35. package/contracts/features.keys.d.ts +1 -0
  36. package/contracts/features.keys.js +2 -0
  37. package/contracts/index.d.ts +8 -0
  38. package/contracts/index.js +10 -0
  39. package/contracts/location-assignment.actions.d.ts +8 -0
  40. package/contracts/location-assignment.actions.js +73 -0
  41. package/contracts/location-assignment.utils.d.ts +53 -0
  42. package/contracts/location-assignment.utils.js +145 -0
  43. package/contracts/menu.keys.d.ts +8 -0
  44. package/contracts/menu.keys.js +8 -0
  45. package/contracts/package.json +5 -0
  46. package/contracts/permission.keys.d.ts +33 -0
  47. package/contracts/permission.keys.js +42 -0
  48. package/contracts/root-config.d.ts +42 -0
  49. package/contracts/root-config.js +43 -0
  50. package/package.json +12 -0
@@ -0,0 +1,725 @@
1
+ import { AXPRegionalSetting, AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
+ import { createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';
3
+ import { AXPLocaleManagementDataSourceKeys } from '@acorex-platform/module-locale-management-contracts';
4
+ import { RootConfig } from '../../root-config';
5
+ export async function geographicRegionFactory() {
6
+ const entityDef = {
7
+ module: RootConfig.module.name,
8
+ name: RootConfig.entities.geographicRegion.name,
9
+ parentKey: 'parentId',
10
+ title: RootConfig.entities.geographicRegion.title,
11
+ icon: RootConfig.entities.geographicRegion.icon,
12
+ formats: {
13
+ individual: RootConfig.entities.geographicRegion.title,
14
+ plural: RootConfig.entities.geographicRegion.titlePlural,
15
+ searchResult: {
16
+ title: '{{ name }}',
17
+ description: '{{ context.eval("type") + (context.eval("parentId") ? " (Child)" : "") }}',
18
+ },
19
+ },
20
+ plugins: [{ name: 'archive' }],
21
+ groups: [
22
+ {
23
+ id: 'basic-info',
24
+ title: '@general:terms.interface.basic-info',
25
+ },
26
+ {
27
+ id: 'geographic-data',
28
+ title: '@general:terms.interface.geographic-details',
29
+ },
30
+ {
31
+ id: 'additional-info',
32
+ title: '@general:terms.interface.additional-info',
33
+ },
34
+ {
35
+ id: 'settings',
36
+ title: '@general:terms.interface.settings',
37
+ },
38
+ ],
39
+ properties: [
40
+ {
41
+ name: 'title',
42
+ title: '@general:terms.common.title',
43
+ groupId: 'basic-info',
44
+ options: {
45
+ sort: {
46
+ enabled: true,
47
+ },
48
+ filter: {
49
+ advance: {
50
+ enabled: true,
51
+ },
52
+ inline: {
53
+ enabled: true,
54
+ },
55
+ },
56
+ },
57
+ schema: {
58
+ dataType: 'string',
59
+ interface: {
60
+ type: AXPWidgetsCatalog.text,
61
+ options: {
62
+ placeholder: 'Enter region title',
63
+ },
64
+ },
65
+ },
66
+ validations: [
67
+ {
68
+ rule: 'required',
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ name: 'code',
74
+ title: '@general:terms.common.code',
75
+ groupId: 'basic-info',
76
+ options: {
77
+ sort: {
78
+ enabled: true,
79
+ },
80
+ filter: {
81
+ advance: {
82
+ enabled: true,
83
+ },
84
+ inline: {
85
+ enabled: true,
86
+ },
87
+ },
88
+ },
89
+ schema: {
90
+ dataType: 'string',
91
+ interface: {
92
+ type: AXPWidgetsCatalog.text,
93
+ options: {
94
+ placeholder: 'Region code (e.g., CA, US)',
95
+ },
96
+ },
97
+ },
98
+ },
99
+ {
100
+ name: 'type',
101
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.type',
102
+ groupId: 'basic-info',
103
+ options: {
104
+ sort: {
105
+ enabled: true,
106
+ },
107
+ filter: {
108
+ advance: {
109
+ enabled: true,
110
+ },
111
+ inline: {
112
+ enabled: true,
113
+ },
114
+ },
115
+ },
116
+ schema: {
117
+ dataType: 'string',
118
+ interface: {
119
+ type: AXPWidgetsCatalog.select,
120
+ options: {
121
+ valueField: 'code',
122
+ textField: 'title',
123
+ dataSource: [
124
+ { code: 'country', title: 'Country' },
125
+ { code: 'state', title: 'State/Province' },
126
+ { code: 'city', title: 'City' },
127
+ { code: 'district', title: 'District' },
128
+ { code: 'subdistrict', title: 'Subdistrict' },
129
+ { code: 'territory', title: 'Territory' },
130
+ ],
131
+ },
132
+ },
133
+ },
134
+ validations: [
135
+ {
136
+ rule: 'required',
137
+ },
138
+ ],
139
+ },
140
+ {
141
+ name: 'parentId',
142
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.parent-region',
143
+ groupId: 'basic-info',
144
+ options: {
145
+ filter: {
146
+ advance: {
147
+ enabled: true,
148
+ },
149
+ inline: {
150
+ enabled: true,
151
+ },
152
+ },
153
+ },
154
+ schema: {
155
+ dataType: 'object',
156
+ interface: {
157
+ type: AXPWidgetsCatalog.lookup,
158
+ options: {
159
+ entity: `${RootConfig.module.name}.${RootConfig.entities.geographicRegion.name}`,
160
+ expose: [
161
+ { source: 'id', target: 'parentRegion.id' },
162
+ { source: 'name', target: 'parentRegion.name' },
163
+ { source: 'type', target: 'parentRegion.type' },
164
+ ],
165
+ },
166
+ },
167
+ },
168
+ },
169
+ {
170
+ name: 'coordinates',
171
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.coordinates',
172
+ groupId: 'geographic-data',
173
+ options: {
174
+ filter: {
175
+ advance: {
176
+ enabled: false,
177
+ },
178
+ },
179
+ },
180
+ schema: {
181
+ dataType: 'string',
182
+ interface: {
183
+ type: AXPWidgetsCatalog.map,
184
+ options: {
185
+ hasDraw: true,
186
+ maxPolygon: 0,
187
+ fitToDraw: true,
188
+ },
189
+ },
190
+ },
191
+ },
192
+ {
193
+ name: 'timezone',
194
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.timezone',
195
+ groupId: 'geographic-data',
196
+ options: {
197
+ filter: {
198
+ advance: {
199
+ enabled: true,
200
+ },
201
+ },
202
+ },
203
+ schema: {
204
+ dataType: 'string',
205
+ defaultValue: `{{ settings.get('${AXPRegionalSetting.TimeZone}') }}`,
206
+ interface: {
207
+ type: AXPWidgetsCatalog.select,
208
+ options: {
209
+ allowSearch: true,
210
+ valueField: 'code',
211
+ placeholder: 'e.g., America/New_York',
212
+ dataSource: AXPLocaleManagementDataSourceKeys.Timezones,
213
+ },
214
+ },
215
+ },
216
+ },
217
+ {
218
+ name: 'population',
219
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.population',
220
+ groupId: 'additional-info',
221
+ options: {
222
+ filter: {
223
+ advance: {
224
+ enabled: true,
225
+ },
226
+ },
227
+ },
228
+ schema: {
229
+ dataType: 'number',
230
+ interface: {
231
+ type: AXPWidgetsCatalog.number,
232
+ options: {
233
+ minValue: 0,
234
+ },
235
+ },
236
+ },
237
+ },
238
+ {
239
+ name: 'area',
240
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.area',
241
+ groupId: 'additional-info',
242
+ options: {
243
+ filter: {
244
+ advance: {
245
+ enabled: true,
246
+ },
247
+ },
248
+ },
249
+ schema: {
250
+ dataType: 'number',
251
+ interface: {
252
+ type: AXPWidgetsCatalog.number,
253
+ options: {
254
+ minValue: 0,
255
+ placeholder: 'Area in square kilometers',
256
+ },
257
+ },
258
+ },
259
+ },
260
+ {
261
+ name: 'currencyId',
262
+ title: '@location-management:geographic-regions.entities.geographic-region.fields.currency',
263
+ groupId: 'additional-info',
264
+ options: {
265
+ sort: { enabled: false },
266
+ filter: {
267
+ advance: {
268
+ enabled: true,
269
+ },
270
+ inline: { enabled: false },
271
+ },
272
+ },
273
+ schema: {
274
+ dataType: 'string',
275
+ interface: {
276
+ type: AXPWidgetsCatalog.lookup,
277
+ options: {
278
+ entity: `${"FinancialCore"}.${"Currency"}`,
279
+ multiple: false,
280
+ look: 'select',
281
+ textField: 'code',
282
+ valueField: 'id',
283
+ expose: [
284
+ { source: 'id', target: 'currency.id' },
285
+ { source: 'code', target: 'currency.code' },
286
+ { source: 'title', target: 'currency.title' },
287
+ { source: 'symbol', target: 'currency.symbol' },
288
+ ],
289
+ },
290
+ },
291
+ },
292
+ },
293
+ ],
294
+ columns: [
295
+ { name: 'title', options: { width: '400px', order: 1 } },
296
+ { name: 'code', options: { width: '150px', order: 2 } },
297
+ { name: 'type', options: { width: '150px', dataPath: 'type.title', order: 3 } },
298
+ { name: 'currencyId', options: { width: '150px', dataPath: 'currency.code', order: 4 } },
299
+ ],
300
+ interfaces: {
301
+ master: {
302
+ create: {
303
+ sections: [
304
+ {
305
+ id: 'basic-info',
306
+ },
307
+ {
308
+ id: 'geographic-data',
309
+ },
310
+ {
311
+ id: 'additional-info',
312
+ },
313
+ {
314
+ id: 'settings',
315
+ },
316
+ ],
317
+ properties: [
318
+ {
319
+ name: 'title',
320
+ layout: {
321
+ positions: {
322
+ sm: {
323
+ colSpan: 12,
324
+ },
325
+ md: {
326
+ colSpan: 6,
327
+ },
328
+ },
329
+ },
330
+ },
331
+ {
332
+ name: 'code',
333
+ layout: {
334
+ positions: {
335
+ sm: {
336
+ colSpan: 12,
337
+ },
338
+ md: {
339
+ colSpan: 6,
340
+ },
341
+ },
342
+ },
343
+ },
344
+ {
345
+ name: 'type',
346
+ layout: {
347
+ positions: {
348
+ sm: {
349
+ colSpan: 12,
350
+ },
351
+ md: {
352
+ colSpan: 6,
353
+ },
354
+ },
355
+ },
356
+ },
357
+ {
358
+ name: 'parentId',
359
+ layout: {
360
+ positions: {
361
+ sm: {
362
+ colSpan: 12,
363
+ },
364
+ md: {
365
+ colSpan: 6,
366
+ },
367
+ },
368
+ },
369
+ },
370
+ {
371
+ name: 'coordinates',
372
+ layout: {
373
+ positions: {
374
+ sm: {
375
+ colSpan: 12,
376
+ },
377
+ },
378
+ },
379
+ },
380
+ {
381
+ name: 'timezone',
382
+ layout: {
383
+ positions: {
384
+ sm: {
385
+ colSpan: 12,
386
+ },
387
+ md: {
388
+ colSpan: 4,
389
+ },
390
+ },
391
+ },
392
+ },
393
+ {
394
+ name: 'population',
395
+ layout: {
396
+ positions: {
397
+ sm: {
398
+ colSpan: 12,
399
+ },
400
+ md: {
401
+ colSpan: 4,
402
+ },
403
+ },
404
+ },
405
+ },
406
+ {
407
+ name: 'area',
408
+ layout: {
409
+ positions: {
410
+ sm: {
411
+ colSpan: 12,
412
+ },
413
+ md: {
414
+ colSpan: 4,
415
+ },
416
+ },
417
+ },
418
+ },
419
+ {
420
+ name: 'currencyId',
421
+ layout: {
422
+ positions: {
423
+ sm: {
424
+ colSpan: 12,
425
+ },
426
+ md: {
427
+ colSpan: 4,
428
+ },
429
+ },
430
+ },
431
+ },
432
+ ],
433
+ },
434
+ update: {
435
+ sections: [
436
+ {
437
+ id: 'basic-info',
438
+ },
439
+ {
440
+ id: 'geographic-data',
441
+ },
442
+ {
443
+ id: 'additional-info',
444
+ },
445
+ {
446
+ id: 'settings',
447
+ },
448
+ ],
449
+ properties: [
450
+ {
451
+ name: 'title',
452
+ layout: {
453
+ positions: {
454
+ sm: {
455
+ colSpan: 12,
456
+ },
457
+ md: {
458
+ colSpan: 6,
459
+ },
460
+ },
461
+ },
462
+ },
463
+ {
464
+ name: 'code',
465
+ layout: {
466
+ positions: {
467
+ sm: {
468
+ colSpan: 12,
469
+ },
470
+ md: {
471
+ colSpan: 6,
472
+ },
473
+ },
474
+ },
475
+ },
476
+ {
477
+ name: 'type',
478
+ layout: {
479
+ positions: {
480
+ sm: {
481
+ colSpan: 12,
482
+ },
483
+ md: {
484
+ colSpan: 6,
485
+ },
486
+ },
487
+ },
488
+ },
489
+ {
490
+ name: 'parentId',
491
+ layout: {
492
+ positions: {
493
+ sm: {
494
+ colSpan: 12,
495
+ },
496
+ md: {
497
+ colSpan: 6,
498
+ },
499
+ },
500
+ },
501
+ },
502
+ {
503
+ name: 'coordinates',
504
+ layout: {
505
+ positions: {
506
+ sm: {
507
+ colSpan: 12,
508
+ },
509
+ },
510
+ },
511
+ },
512
+ {
513
+ name: 'timezone',
514
+ layout: {
515
+ positions: {
516
+ sm: {
517
+ colSpan: 12,
518
+ },
519
+ md: {
520
+ colSpan: 4,
521
+ },
522
+ },
523
+ },
524
+ },
525
+ {
526
+ name: 'population',
527
+ layout: {
528
+ positions: {
529
+ sm: {
530
+ colSpan: 12,
531
+ },
532
+ md: {
533
+ colSpan: 4,
534
+ },
535
+ },
536
+ },
537
+ },
538
+ {
539
+ name: 'area',
540
+ layout: {
541
+ positions: {
542
+ sm: {
543
+ colSpan: 12,
544
+ },
545
+ md: {
546
+ colSpan: 4,
547
+ },
548
+ },
549
+ },
550
+ },
551
+ {
552
+ name: 'currencyId',
553
+ layout: {
554
+ positions: {
555
+ sm: {
556
+ colSpan: 12,
557
+ },
558
+ md: {
559
+ colSpan: 4,
560
+ },
561
+ },
562
+ },
563
+ },
564
+ ],
565
+ },
566
+ single: {
567
+ title: '{{title}}',
568
+ sections: [
569
+ {
570
+ id: 'basic-info',
571
+ layout: {
572
+ positions: {
573
+ lg: {
574
+ colSpan: 12,
575
+ },
576
+ },
577
+ },
578
+ },
579
+ {
580
+ id: 'geographic-data',
581
+ layout: {
582
+ positions: {
583
+ lg: {
584
+ colSpan: 12,
585
+ },
586
+ },
587
+ },
588
+ },
589
+ {
590
+ id: 'additional-info',
591
+ layout: {
592
+ positions: {
593
+ lg: {
594
+ colSpan: 12,
595
+ },
596
+ },
597
+ },
598
+ },
599
+ {
600
+ id: 'settings',
601
+ layout: {
602
+ positions: {
603
+ lg: {
604
+ colSpan: 12,
605
+ },
606
+ },
607
+ },
608
+ },
609
+ ],
610
+ properties: [
611
+ {
612
+ name: 'title',
613
+ layout: {
614
+ positions: {
615
+ lg: {
616
+ colSpan: 6,
617
+ order: 1,
618
+ },
619
+ },
620
+ },
621
+ },
622
+ {
623
+ name: 'code',
624
+ layout: {
625
+ positions: {
626
+ lg: {
627
+ colSpan: 6,
628
+ order: 2,
629
+ },
630
+ },
631
+ },
632
+ },
633
+ {
634
+ name: 'type',
635
+ layout: {
636
+ positions: {
637
+ lg: {
638
+ colSpan: 6,
639
+ order: 3,
640
+ },
641
+ },
642
+ },
643
+ },
644
+ {
645
+ name: 'parentId',
646
+ layout: {
647
+ positions: {
648
+ lg: {
649
+ colSpan: 6,
650
+ order: 4,
651
+ },
652
+ },
653
+ },
654
+ },
655
+ {
656
+ name: 'coordinates',
657
+ layout: {
658
+ positions: {
659
+ lg: {
660
+ colSpan: 12,
661
+ order: 5,
662
+ },
663
+ },
664
+ },
665
+ },
666
+ {
667
+ name: 'timezone',
668
+ layout: {
669
+ positions: {
670
+ lg: {
671
+ colSpan: 4,
672
+ order: 6,
673
+ },
674
+ },
675
+ },
676
+ },
677
+ {
678
+ name: 'population',
679
+ layout: {
680
+ positions: {
681
+ lg: {
682
+ colSpan: 4,
683
+ order: 7,
684
+ },
685
+ },
686
+ },
687
+ },
688
+ {
689
+ name: 'area',
690
+ layout: {
691
+ positions: {
692
+ lg: {
693
+ colSpan: 4,
694
+ order: 8,
695
+ },
696
+ },
697
+ },
698
+ },
699
+ {
700
+ name: 'currencyId',
701
+ layout: {
702
+ positions: {
703
+ lg: {
704
+ colSpan: 4,
705
+ order: 9,
706
+ },
707
+ },
708
+ },
709
+ },
710
+ ],
711
+ actions: [...entityMasterRecordActions()],
712
+ },
713
+ list: {
714
+ actions: [...entityMasterCrudActions()],
715
+ views: [
716
+ createAllQueryView({
717
+ sorts: [{ name: 'title', dir: 'asc' }],
718
+ }),
719
+ ],
720
+ },
721
+ },
722
+ },
723
+ };
724
+ return entityDef;
725
+ }