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

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 (60) hide show
  1. package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs +163 -0
  2. package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs +351 -0
  4. package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs +200 -0
  6. package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-location-management-client.mjs +1701 -0
  8. package/fesm2022/acorex-platform-module-location-management-client.mjs.map +1 -0
  9. package/package.json +21 -5
  10. package/types/acorex-platform-module-location-management-client-contracts.d.ts +277 -0
  11. package/types/acorex-platform-module-location-management-client.d.ts +42 -0
  12. package/contracts/datasource.keys.d.ts +0 -6
  13. package/contracts/datasource.keys.js +0 -8
  14. package/contracts/entities/geographic-region/geographic-region.entity.d.ts +0 -2
  15. package/contracts/entities/geographic-region/geographic-region.entity.js +0 -725
  16. package/contracts/entities/geographic-region/geographic-region.types.d.ts +0 -27
  17. package/contracts/entities/geographic-region/geographic-region.types.js +0 -1
  18. package/contracts/entities/geographic-region/index.d.ts +0 -2
  19. package/contracts/entities/geographic-region/index.js +0 -2
  20. package/contracts/entities/index.d.ts +0 -5
  21. package/contracts/entities/index.js +0 -5
  22. package/contracts/entities/location/index.d.ts +0 -2
  23. package/contracts/entities/location/index.js +0 -2
  24. package/contracts/entities/location/location.entity.d.ts +0 -2
  25. package/contracts/entities/location/location.entity.js +0 -1075
  26. package/contracts/entities/location/location.types.d.ts +0 -30
  27. package/contracts/entities/location/location.types.js +0 -1
  28. package/contracts/entities/location-assignment/index.d.ts +0 -2
  29. package/contracts/entities/location-assignment/index.js +0 -2
  30. package/contracts/entities/location-assignment/location-assignment.entity.d.ts +0 -2
  31. package/contracts/entities/location-assignment/location-assignment.entity.js +0 -194
  32. package/contracts/entities/location-assignment/location-assignment.types.d.ts +0 -35
  33. package/contracts/entities/location-assignment/location-assignment.types.js +0 -2
  34. package/contracts/entities/location-role/index.d.ts +0 -2
  35. package/contracts/entities/location-role/index.js +0 -2
  36. package/contracts/entities/location-role/location-role.entity.d.ts +0 -2
  37. package/contracts/entities/location-role/location-role.entity.js +0 -143
  38. package/contracts/entities/location-role/location-role.types.d.ts +0 -6
  39. package/contracts/entities/location-role/location-role.types.js +0 -1
  40. package/contracts/entities/location-type/index.d.ts +0 -2
  41. package/contracts/entities/location-type/index.js +0 -2
  42. package/contracts/entities/location-type/location-type.entity.d.ts +0 -2
  43. package/contracts/entities/location-type/location-type.entity.js +0 -237
  44. package/contracts/entities/location-type/location-type.types.d.ts +0 -8
  45. package/contracts/entities/location-type/location-type.types.js +0 -1
  46. package/contracts/features.keys.d.ts +0 -1
  47. package/contracts/features.keys.js +0 -2
  48. package/contracts/index.d.ts +0 -8
  49. package/contracts/index.js +0 -10
  50. package/contracts/location-assignment.actions.d.ts +0 -8
  51. package/contracts/location-assignment.actions.js +0 -73
  52. package/contracts/location-assignment.utils.d.ts +0 -53
  53. package/contracts/location-assignment.utils.js +0 -145
  54. package/contracts/menu.keys.d.ts +0 -8
  55. package/contracts/menu.keys.js +0 -8
  56. package/contracts/package.json +0 -5
  57. package/contracts/permission.keys.d.ts +0 -33
  58. package/contracts/permission.keys.js +0 -42
  59. package/contracts/root-config.d.ts +0 -42
  60. package/contracts/root-config.js +0 -43
@@ -0,0 +1,163 @@
1
+ import { AXToastService } from '@acorex/components/toast';
2
+ import { AXTranslationService } from '@acorex/core/translation';
3
+ import { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+ import { get } from 'lodash';
7
+ import { AXPEntityDataSelectorService, AXPEntityFormBuilderService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
8
+ import { RootConfig, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle } from '@acorex-platform/module-location-management-client/contracts';
9
+ import { resolveEntityActionCommandInput, mergeEntityActionProcessData } from '@acorex-platform/framework-shared/runtime';
10
+
11
+ //#region ---- Imports ----
12
+ //#endregion
13
+ //#region ---- Command ----
14
+ class AXMLocationAssignmentAssignExistingLocationCommand {
15
+ constructor() {
16
+ this.entityDataSelector = inject(AXPEntityDataSelectorService);
17
+ this.entityForm = inject(AXPEntityFormBuilderService);
18
+ this.entityService = inject(AXPEntityDefinitionRegistryService);
19
+ this.toastService = inject(AXToastService);
20
+ this.translationService = inject(AXTranslationService);
21
+ }
22
+ async execute(input) {
23
+ const resolved = resolveEntityActionCommandInput(input);
24
+ const processData = mergeEntityActionProcessData(input);
25
+ const entity = resolved.entity;
26
+ const ownerRef = this.resolveOwnerRef(processData);
27
+ if (!ownerRef.id) {
28
+ return {
29
+ success: false,
30
+ message: {
31
+ text: await this.translationService.translateAsync('@location-management:location-assignments.messages.missing-party-context'),
32
+ },
33
+ };
34
+ }
35
+ const [moduleName, entityName] = (entity || '').split('.');
36
+ if (!moduleName || !entityName) {
37
+ return {
38
+ success: false,
39
+ message: {
40
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),
41
+ },
42
+ };
43
+ }
44
+ const locationEntity = await this.entityService.resolve(RootConfig.module.name, RootConfig.entities.location.name);
45
+ if (!locationEntity) {
46
+ return {
47
+ success: false,
48
+ message: {
49
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),
50
+ },
51
+ };
52
+ }
53
+ const selectorTitle = await this.translationService.translateAsync('@location-management:location-assignments.actions.assign-existing-location.selector-title');
54
+ const selectorResult = await this.entityDataSelector.open({
55
+ entity: locationEntity,
56
+ title: selectorTitle,
57
+ allowMultiple: false,
58
+ columns: ['title', 'code', 'street1', 'cityId', 'countryId'],
59
+ });
60
+ if (!selectorResult?.items?.length) {
61
+ return { success: false };
62
+ }
63
+ const selectedLocation = selectorResult.items[0];
64
+ const locationId = selectedLocation.id ?? selectedLocation._id;
65
+ const locationSnapshot = buildLocationAssignmentLocationSnapshot(selectedLocation, locationId);
66
+ const formTitle = await this.translationService.translateAsync('@location-management:location-assignments.actions.assign-existing-location.form-title', { params: { partyTitle: ownerRef.title } });
67
+ const result = await this.entityForm
68
+ .entity(`${moduleName}.${entityName}`)
69
+ .create({
70
+ locationId,
71
+ location: locationSnapshot,
72
+ ownerRef,
73
+ })
74
+ .include('roleId', 'personId', 'notes')
75
+ .title(formTitle)
76
+ .actions((actions) => {
77
+ actions.cancel('@general:actions.cancel.title');
78
+ actions.submit('@general:actions.create.title');
79
+ })
80
+ .onAction(async (dialogRef) => {
81
+ if (dialogRef.action() === 'cancel') {
82
+ return { success: false };
83
+ }
84
+ const locationAssignmentEntity = await this.entityService.resolve(moduleName, entityName);
85
+ const createFn = locationAssignmentEntity?.commands?.create?.execute;
86
+ if (!createFn) {
87
+ const msg = await this.translationService.translateAsync('@general:messages.entity.create-command-unavailable');
88
+ this.toastService.show({
89
+ color: 'danger',
90
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
91
+ content: msg,
92
+ });
93
+ throw new Error(msg);
94
+ }
95
+ dialogRef.setLoading(true);
96
+ try {
97
+ const context = dialogRef.context();
98
+ const personId = (context['personId'] ?? get(context, 'person.id'));
99
+ const personInContext = get(context, 'person');
100
+ const personSnapshot = personId && personInContext
101
+ ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)
102
+ : undefined;
103
+ const payload = {
104
+ ...context,
105
+ locationId,
106
+ ownerRef,
107
+ location: locationSnapshot,
108
+ ...(personId ? { personId, person: personSnapshot } : {}),
109
+ };
110
+ const createResult = await createFn(payload);
111
+ const __single_createResult = runtimeCommandPayloadData(createResult);
112
+ if (__single_createResult) {
113
+ return { success: true, kind: 'object',
114
+ data: runtimeCommandPayloadData(createResult),
115
+ message: {
116
+ text: await this.translationService.translateAsync('@general:messages.generic.success.description'),
117
+ },
118
+ };
119
+ }
120
+ return {
121
+ success: false,
122
+ message: {
123
+ text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),
124
+ },
125
+ };
126
+ }
127
+ catch (error) {
128
+ const errorMsg = error instanceof Error
129
+ ? error.message
130
+ : await this.translationService.translateAsync('@general:messages.entity.create-failed');
131
+ this.toastService.show({
132
+ color: 'danger',
133
+ title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
134
+ content: errorMsg,
135
+ });
136
+ throw error;
137
+ }
138
+ finally {
139
+ dialogRef.setLoading(false);
140
+ }
141
+ })
142
+ .show();
143
+ return result;
144
+ }
145
+ resolveOwnerRef(processData) {
146
+ const nestedOwner = get(processData, 'ownerRef');
147
+ const locale = this.translationService.getActiveLang?.() ?? 'en-US';
148
+ return {
149
+ type: processData['ownerRef.type'] ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,
150
+ id: processData['ownerRef.id'] ?? nestedOwner?.id ?? '',
151
+ title: resolveLocationAssignmentDisplayTitle(locale, processData['ownerRef.title'], nestedOwner?.title, get(processData, 'party.title'), get(processData, 'title')),
152
+ };
153
+ }
154
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentAssignExistingLocationCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
155
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentAssignExistingLocationCommand, providedIn: 'root' }); }
156
+ }
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMLocationAssignmentAssignExistingLocationCommand, decorators: [{
158
+ type: Injectable,
159
+ args: [{ providedIn: 'root' }]
160
+ }] });
161
+
162
+ export { AXMLocationAssignmentAssignExistingLocationCommand };
163
+ //# sourceMappingURL=acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/assign-existing-location-to-party.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\nimport { get } from 'lodash';\nimport {\n AXPEntityDataSelectorService,\n AXPEntityDefinitionRegistryService,\n AXPEntityFormBuilderService,\n} from '@acorex-platform/framework-client/layout/entity';\n\nimport { RootConfig, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot } from '@acorex-platform/module-location-management-client/contracts';\nimport {\n AXPCommand,\n mergeEntityActionProcessData,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMLocationAssignmentAssignExistingLocationCommand implements AXPCommand<any, any> {\n private readonly entityDataSelector = inject(AXPEntityDataSelectorService);\n private readonly entityForm = inject(AXPEntityFormBuilderService);\n private readonly entityService = inject(AXPEntityDefinitionRegistryService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: any): AXPCommandExecuteResultPromise<any> {\n const resolved = resolveEntityActionCommandInput(input);\n const processData = mergeEntityActionProcessData(input);\n const entity = resolved.entity;\n const ownerRef = this.resolveOwnerRef(processData);\n if (!ownerRef.id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@location-management:location-assignments.messages.missing-party-context',\n ),\n },\n };\n }\n\n const [moduleName, entityName] = (entity || '').split('.');\n if (!moduleName || !entityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n if (!locationEntity) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const selectorTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.assign-existing-location.selector-title',\n );\n const selectorResult = await this.entityDataSelector.open({\n entity: locationEntity,\n title: selectorTitle,\n allowMultiple: false,\n columns: ['title', 'code', 'street1', 'cityId', 'countryId'],\n });\n\n if (!selectorResult?.items?.length) {\n return { success: false };\n }\n\n const selectedLocation = selectorResult.items[0];\n const locationId = selectedLocation.id ?? selectedLocation._id;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(\n selectedLocation as Record<string, unknown>,\n locationId as string,\n );\n\n const formTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.assign-existing-location.form-title',\n { params: { partyTitle: ownerRef.title } },\n );\n\n const result = await this.entityForm\n .entity(`${moduleName}.${entityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(formTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationAssignmentEntity = await this.entityService.resolve(moduleName, entityName);\n const createFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const personId = (context['personId'] ?? get(context, 'person.id')) as string | undefined;\n const personInContext = get(context, 'person') as Record<string, unknown> | undefined;\n const personSnapshot =\n personId && personInContext\n ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)\n : undefined;\n\n const payload = {\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n };\n const createResult = await createFn(payload);\n const __single_createResult = runtimeCommandPayloadData(createResult);\n if (__single_createResult) {\n return { success: true, kind: 'object',\n data: runtimeCommandPayloadData(createResult),\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n }\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show();\n\n return result as unknown as AXPRuntimeCommandResult<any>;\n }\n\n private resolveOwnerRef(processData: Record<string, unknown>) {\n const nestedOwner = get(processData, 'ownerRef') as { type?: string; id?: string; title?: unknown } | undefined;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n return {\n type: (processData['ownerRef.type'] as string) ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,\n id: (processData['ownerRef.id'] as string) ?? nestedOwner?.id ?? '',\n title: resolveLocationAssignmentDisplayTitle(\n locale,\n processData['ownerRef.title'],\n nestedOwner?.title,\n get(processData, 'party.title'),\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EAAA,kDAAkD,cADrC,MAAM,EAAA,CAAA,CAAA;;2FACnB,kDAAkD,EAAA,UAAA,EAAA,CAAA;kBAD9D,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,351 @@
1
+ import { AXPSystemActionType, resolveMultiLanguageString, formatAddressData, AXPWidgetsList } from '@acorex-platform/framework-shared/core';
2
+ import { entityMasterCreateAction, entityMasterBulkDeleteAction, entityMasterDeleteAction, entityMasterViewAction, AXPEntityCommandScope, entityDetailsEditAction, entityOverrideDetailsViewAction } from '@acorex-platform/framework-shared/entity';
3
+
4
+ // Management feature removed - module name is used directly as feature key
5
+ const AXMLocationManagementFeatureKeys = {};
6
+
7
+ const config = {
8
+ i18n: 'location-management',
9
+ };
10
+ const RootConfig = {
11
+ config,
12
+ module: {
13
+ name: 'LocationManagement',
14
+ title: '@location-management:module.title',
15
+ icon: 'fa-light fa-map-marker-alt',
16
+ },
17
+ entities: {
18
+ location: {
19
+ name: 'Location',
20
+ title: '@location-management:locations.entities.location.title',
21
+ titlePlural: '@location-management:locations.entities.location.plural',
22
+ icon: 'fa-light fa-map-marker-alt',
23
+ },
24
+ locationType: {
25
+ name: 'LocationType',
26
+ title: '@location-management:location-types.entities.location-type.title',
27
+ titlePlural: '@location-management:location-types.entities.location-type.plural',
28
+ icon: 'fa-light fa-tags',
29
+ },
30
+ locationRole: {
31
+ name: 'LocationRole',
32
+ title: '@location-management:location-roles.entities.location-role.title',
33
+ titlePlural: '@location-management:location-roles.entities.location-role.plural',
34
+ icon: 'fa-light fa-map-pin',
35
+ },
36
+ geographicRegion: {
37
+ name: 'GeographicRegion',
38
+ title: '@location-management:geographic-regions.entities.geographic-region.title',
39
+ titlePlural: '@location-management:geographic-regions.entities.geographic-region.plural',
40
+ icon: 'fa-light fa-globe',
41
+ },
42
+ locationAssignment: {
43
+ name: 'LocationAssignment',
44
+ title: `@${config.i18n}:location-assignments.entities.location-assignment.title`,
45
+ titlePlural: `@${config.i18n}:location-assignments.entities.location-assignment.plural`,
46
+ icon: 'fa-light fa-building-user',
47
+ },
48
+ },
49
+ };
50
+
51
+ //#region ---- Command keys ----
52
+ const ASSIGN_EXISTING_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:AssignExistingLocation`;
53
+ const CREATE_WITH_NEW_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`;
54
+ //#endregion
55
+ //#region ---- Location assignment related-entity actions ----
56
+ const assigneeProcessOptions = () => ({
57
+ process: {
58
+ redirect: false,
59
+ canCreateNewOne: true,
60
+ data: {
61
+ 'ownerRef.type': '{{ host.entity() }}',
62
+ 'ownerRef.id': '{{ host.eval("id") }}',
63
+ 'ownerRef.title': '{{ host.eval("party.title") }}',
64
+ },
65
+ },
66
+ });
67
+ /** Read-only assignments list on Location detail (no create/update/delete). */
68
+ function locationAssignmentReadOnlyRelatedActions() {
69
+ return [
70
+ { ...entityMasterCreateAction(), hidden: true },
71
+ { ...entityMasterBulkDeleteAction(), hidden: true },
72
+ { ...entityMasterDeleteAction(), hidden: true },
73
+ { ...entityMasterViewAction(), hidden: true },
74
+ ];
75
+ }
76
+ function locationAssignmentPartyCreateAction() {
77
+ const assigneeOptions = assigneeProcessOptions();
78
+ return {
79
+ name: 'Create',
80
+ title: '@general:actions.create.title',
81
+ command: { name: 'Entity:Create' },
82
+ icon: 'fa-light fa-plus',
83
+ priority: 'primary',
84
+ type: AXPSystemActionType.Create,
85
+ scope: AXPEntityCommandScope.TypeLevel,
86
+ items: [
87
+ {
88
+ name: 'AssignExistingLocation',
89
+ title: '@location-management:location-assignments.actions.assign-existing-location.title',
90
+ command: { name: ASSIGN_EXISTING_LOCATION, options: assigneeOptions },
91
+ icon: 'fa-light fa-map-marker-alt',
92
+ priority: 'primary',
93
+ type: AXPSystemActionType.Create,
94
+ scope: AXPEntityCommandScope.TypeLevel,
95
+ },
96
+ {
97
+ name: 'CreateWithNewLocation',
98
+ title: '@location-management:location-assignments.actions.create-with-new-location.title',
99
+ command: { name: CREATE_WITH_NEW_LOCATION, options: assigneeOptions },
100
+ icon: 'fa-light fa-location-plus',
101
+ priority: 'primary',
102
+ type: AXPSystemActionType.Create,
103
+ scope: AXPEntityCommandScope.TypeLevel,
104
+ },
105
+ ],
106
+ };
107
+ }
108
+ /**
109
+ * Actions for LocationAssignment when shown from Party/Customer/Supplier.
110
+ * Create menu: assign existing location or create new location with assignee prefilled.
111
+ */
112
+ function locationAssignmentDetailsCrudActionsForPartyContext(_partyIdContextPath = 'id') {
113
+ return [
114
+ { ...entityMasterCreateAction(), hidden: true },
115
+ locationAssignmentPartyCreateAction(),
116
+ entityDetailsEditAction(),
117
+ entityOverrideDetailsViewAction(),
118
+ ];
119
+ }
120
+ //#endregion
121
+
122
+ //#region ---- Imports ----
123
+ //#endregion
124
+ //#region ---- Constants ----
125
+ /** Canonical assignee type for party-scoped location assignment links. */
126
+ const LOCATION_ASSIGNMENT_PARTY_TYPE = 'BusinessCore.Party';
127
+ //#endregion
128
+ //#region ---- Display helpers ----
129
+ /** Resolves assignee display title from host/process data (plain string or multi-language object). */
130
+ function resolveLocationAssignmentDisplayTitle(locale, ...candidates) {
131
+ for (const candidate of candidates) {
132
+ if (candidate == null || candidate === '') {
133
+ continue;
134
+ }
135
+ const resolved = resolveMultiLanguageString(candidate, locale).trim();
136
+ if (resolved) {
137
+ return resolved;
138
+ }
139
+ }
140
+ return '';
141
+ }
142
+ /** Builds a location snapshot for nested LocationAssignment display fields. */
143
+ function buildLocationAssignmentLocationSnapshot(locationRow, locationId) {
144
+ const fullAddress = locationRow['fullAddress']?.trim() || formatAddressData(locationRow)?.trim() || undefined;
145
+ const toRegionRef = (value) => {
146
+ if (value == null) {
147
+ return undefined;
148
+ }
149
+ if (typeof value === 'object') {
150
+ const record = value;
151
+ const title = record['title'];
152
+ if (title == null) {
153
+ return undefined;
154
+ }
155
+ if (typeof title === 'string') {
156
+ return { title };
157
+ }
158
+ if (typeof title === 'object') {
159
+ return {
160
+ title: resolveMultiLanguageString(title, 'en-US'),
161
+ };
162
+ }
163
+ return undefined;
164
+ }
165
+ return { title: String(value) };
166
+ };
167
+ return {
168
+ id: locationId,
169
+ title: locationRow['title'],
170
+ fullAddress,
171
+ street1: locationRow['street1'],
172
+ street2: locationRow['street2'],
173
+ postalCode: locationRow['postalCode'],
174
+ city: toRegionRef(locationRow['city']),
175
+ state: toRegionRef(locationRow['state']),
176
+ country: toRegionRef(locationRow['country']),
177
+ };
178
+ }
179
+ /** Builds a person snapshot for nested LocationAssignment site-contact fields. */
180
+ function buildLocationAssignmentPersonSnapshot(personRow, personId) {
181
+ const fullName = personRow['fullName'] ??
182
+ [personRow['firstName'], personRow['lastName']].filter(Boolean).join(' ').trim();
183
+ return {
184
+ id: personId,
185
+ fullName: fullName || undefined,
186
+ phones: personRow['phones'],
187
+ emails: personRow['emails'],
188
+ };
189
+ }
190
+ //#endregion
191
+ //#region ---- Filter helpers ----
192
+ /** Filters LocationAssignment rows for a location detail context. */
193
+ function locationAssignmentLocationConditions(locationIdContextPath = 'id') {
194
+ return [
195
+ {
196
+ name: 'locationId',
197
+ operator: { type: 'equal' },
198
+ value: `{{context.eval("${locationIdContextPath}")}}`,
199
+ },
200
+ ];
201
+ }
202
+ /** Filters LocationAssignment rows for the current details-view host entity. */
203
+ function locationAssignmentPartyConditions(hostIdContextPath = 'id') {
204
+ return [
205
+ {
206
+ name: 'ownerRef.type',
207
+ operator: { type: 'equal' },
208
+ value: '{{ host.entity() }}',
209
+ },
210
+ {
211
+ name: 'ownerRef.id',
212
+ operator: { type: 'equal' },
213
+ value: `{{ host.eval("${hostIdContextPath}") }}`,
214
+ },
215
+ ];
216
+ }
217
+ //#endregion
218
+ //#region ---- Form layout helpers ----
219
+ /** Assignee lookup omitted when injected from party/customer/supplier context. */
220
+ const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES = ['ownerRef.id', 'ownerRef.type'];
221
+ /** Location lookup omitted when injected from location detail context. */
222
+ const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES = ['locationId'];
223
+ function omitLocationAssignmentRefFromEditLayouts(layouts) {
224
+ return layouts.filter((layout) => !LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES.includes(layout.name));
225
+ }
226
+ function omitLocationAssignmentLocationFromEditLayouts(layouts) {
227
+ return layouts.filter((layout) => !LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES.includes(layout.name));
228
+ }
229
+ //#endregion
230
+ //#region ---- Property factories ----
231
+ /** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */
232
+ function createLocationAssignmentOwnerRefLookupProperty(groupId, options = {}) {
233
+ const readonly = options.readonly ?? false;
234
+ return {
235
+ name: 'ownerRef.id',
236
+ title: '@location-management:location-assignments.entities.location-assignment.fields.assignee.title',
237
+ groupId,
238
+ options: readonly
239
+ ? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }
240
+ : { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
241
+ schema: {
242
+ dataType: 'string',
243
+ readonly,
244
+ interface: {
245
+ type: AXPWidgetsList.Editors.LookupBox,
246
+ options: {
247
+ readonly,
248
+ entity: "{{ context.eval('ownerRef.type') }}",
249
+ textField: 'title',
250
+ valueField: 'id',
251
+ expose: [
252
+ { source: 'id', target: 'ownerRef.id' },
253
+ { source: 'title', target: 'ownerRef.title' },
254
+ ],
255
+ triggers: [{ event: "{{ events.context('ownerRef.type') }}", action: '{{ widget.refresh() }}' }],
256
+ },
257
+ },
258
+ },
259
+ validations: [{ rule: 'required' }],
260
+ };
261
+ }
262
+ /** Hidden assignee type field; defaults to BusinessCore.Party. */
263
+ function createLocationAssignmentOwnerRefTypeProperty(groupId) {
264
+ return {
265
+ name: 'ownerRef.type',
266
+ title: '@location-management:location-assignments.entities.location-assignment.fields.assignee-type.title',
267
+ groupId,
268
+ schema: {
269
+ dataType: 'string',
270
+ visible: false,
271
+ defaultValue: LOCATION_ASSIGNMENT_PARTY_TYPE,
272
+ interface: { type: AXPWidgetsList.Editors.TextBox },
273
+ },
274
+ };
275
+ }
276
+ //#endregion
277
+
278
+ const AXPLocationManagementMenuKeys = {
279
+ Root: 'location-management:menu',
280
+ Locations: 'location-management:menu:locations',
281
+ Divider1: 'location-management:menu:divider-1',
282
+ LocationTypes: 'location-management:menu:location-types',
283
+ LocationRoles: 'location-management:menu:location-roles',
284
+ GeographicRegions: 'location-management:menu:geographic-regions',
285
+ };
286
+
287
+ /**
288
+ * People & Organization capabilities used by this module.
289
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
290
+ */
291
+ const AXPPeopleOrganizationPermissionKeys = {
292
+ Access: 'PeopleOrganization:Permission:Access',
293
+ ViewOrganization: 'PeopleOrganization:Permission:ViewOrganization',
294
+ MaintainOrganization: 'PeopleOrganization:Permission:MaintainOrganization',
295
+ MaintainTeams: 'PeopleOrganization:Permission:MaintainTeams',
296
+ MaintainEmployees: 'PeopleOrganization:Permission:MaintainEmployees',
297
+ ManageEmployeeActions: 'PeopleOrganization:Permission:ManageEmployeeActions',
298
+ MaintainPersons: 'PeopleOrganization:Permission:MaintainPersons',
299
+ MaintainAttendance: 'PeopleOrganization:Permission:MaintainAttendance',
300
+ ManageAttendanceActions: 'PeopleOrganization:Permission:ManageAttendanceActions',
301
+ DesignJobs: 'PeopleOrganization:Permission:DesignJobs',
302
+ Setup: 'PeopleOrganization:Permission:Setup',
303
+ };
304
+ /**
305
+ * @deprecated Prefer {@link AXPPeopleOrganizationPermissionKeys}.
306
+ * Legacy nested shape kept so existing imports compile during migration.
307
+ */
308
+ const AXMLocationManagementPermissionsKeys = {
309
+ LocationManagement: {
310
+ Management: AXPPeopleOrganizationPermissionKeys.Setup,
311
+ Locations: {
312
+ Management: AXPPeopleOrganizationPermissionKeys.Setup,
313
+ View: AXPPeopleOrganizationPermissionKeys.Setup,
314
+ Edit: AXPPeopleOrganizationPermissionKeys.Setup,
315
+ Delete: AXPPeopleOrganizationPermissionKeys.Setup,
316
+ Create: AXPPeopleOrganizationPermissionKeys.Setup,
317
+ },
318
+ LocationTypes: {
319
+ Management: AXPPeopleOrganizationPermissionKeys.Setup,
320
+ View: AXPPeopleOrganizationPermissionKeys.Setup,
321
+ Edit: AXPPeopleOrganizationPermissionKeys.Setup,
322
+ Delete: AXPPeopleOrganizationPermissionKeys.Setup,
323
+ Create: AXPPeopleOrganizationPermissionKeys.Setup,
324
+ },
325
+ LocationRoles: {
326
+ Management: AXPPeopleOrganizationPermissionKeys.Setup,
327
+ View: AXPPeopleOrganizationPermissionKeys.Setup,
328
+ Edit: AXPPeopleOrganizationPermissionKeys.Setup,
329
+ Delete: AXPPeopleOrganizationPermissionKeys.Setup,
330
+ Create: AXPPeopleOrganizationPermissionKeys.Setup,
331
+ },
332
+ GeographicRegions: {
333
+ Management: AXPPeopleOrganizationPermissionKeys.Setup,
334
+ View: AXPPeopleOrganizationPermissionKeys.Setup,
335
+ Edit: AXPPeopleOrganizationPermissionKeys.Setup,
336
+ Delete: AXPPeopleOrganizationPermissionKeys.Setup,
337
+ Create: AXPPeopleOrganizationPermissionKeys.Setup,
338
+ },
339
+ },
340
+ };
341
+
342
+ //#endregion
343
+
344
+ //#region ---- Contracts barrel ----
345
+
346
+ /**
347
+ * Generated bundle index. Do not edit.
348
+ */
349
+
350
+ export { AXMLocationManagementFeatureKeys, AXMLocationManagementPermissionsKeys, AXPLocationManagementMenuKeys, AXPPeopleOrganizationPermissionKeys, LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES, LOCATION_ASSIGNMENT_PARTY_TYPE, LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES, RootConfig, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot, createLocationAssignmentOwnerRefLookupProperty, createLocationAssignmentOwnerRefTypeProperty, locationAssignmentDetailsCrudActionsForPartyContext, locationAssignmentLocationConditions, locationAssignmentPartyConditions, locationAssignmentReadOnlyRelatedActions, omitLocationAssignmentLocationFromEditLayouts, omitLocationAssignmentRefFromEditLayouts, resolveLocationAssignmentDisplayTitle };
351
+ //# sourceMappingURL=acorex-platform-module-location-management-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-contracts.mjs","sources":["../../../../libs/modules/location-management/contracts/src/features.keys.ts","../../../../libs/modules/location-management/contracts/src/root-config.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.actions.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.utils.ts","../../../../libs/modules/location-management/contracts/src/menu.keys.ts","../../../../libs/modules/location-management/contracts/src/permission.keys.ts","../../../../libs/modules/location-management/contracts/src/entities/location-assignment/location-assignment.types.ts","../../../../libs/modules/location-management/contracts/src/index.ts","../../../../libs/modules/location-management/contracts/src/acorex-platform-module-location-management-client-contracts.ts"],"sourcesContent":["// Management feature removed - module name is used directly as feature key\nexport const AXMLocationManagementFeatureKeys = {} as const;\n\n","const config = {\n i18n: 'location-management',\n};\n\nexport const RootConfig = {\n config,\n module: {\n name: 'LocationManagement',\n title: '@location-management:module.title',\n icon: 'fa-light fa-map-marker-alt',\n },\n entities: {\n location: {\n name: 'Location',\n title: '@location-management:locations.entities.location.title',\n titlePlural: '@location-management:locations.entities.location.plural',\n icon: 'fa-light fa-map-marker-alt',\n },\n\n locationType: {\n name: 'LocationType',\n title: '@location-management:location-types.entities.location-type.title',\n titlePlural: '@location-management:location-types.entities.location-type.plural',\n icon: 'fa-light fa-tags',\n },\n locationRole: {\n name: 'LocationRole',\n title: '@location-management:location-roles.entities.location-role.title',\n titlePlural: '@location-management:location-roles.entities.location-role.plural',\n icon: 'fa-light fa-map-pin',\n },\n geographicRegion: {\n name: 'GeographicRegion',\n title: '@location-management:geographic-regions.entities.geographic-region.title',\n titlePlural: '@location-management:geographic-regions.entities.geographic-region.plural',\n icon: 'fa-light fa-globe',\n },\n locationAssignment: {\n name: 'LocationAssignment',\n title: `@${config.i18n}:location-assignments.entities.location-assignment.title`,\n titlePlural: `@${config.i18n}:location-assignments.entities.location-assignment.plural`,\n icon: 'fa-light fa-building-user',\n },\n },\n} as const;\n","import { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntityAction,\n AXPEntityCommandScope,\n entityDetailsEditAction,\n entityMasterBulkDeleteAction,\n entityMasterCreateAction,\n entityMasterDeleteAction,\n entityMasterViewAction,\n entityOverrideDetailsViewAction,\n} from '@acorex-platform/framework-shared/entity';\n\nimport { RootConfig } from './root-config';\n\n//#region ---- Command keys ----\n\nconst ASSIGN_EXISTING_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:AssignExistingLocation`;\nconst CREATE_WITH_NEW_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`;\n\n//#endregion\n\n//#region ---- Location assignment related-entity actions ----\n\nconst assigneeProcessOptions = () => ({\n process: {\n redirect: false,\n canCreateNewOne: true,\n data: {\n 'ownerRef.type': '{{ host.entity() }}',\n 'ownerRef.id': '{{ host.eval(\"id\") }}',\n 'ownerRef.title': '{{ host.eval(\"party.title\") }}',\n },\n },\n});\n\n/** Read-only assignments list on Location detail (no create/update/delete). */\nexport function locationAssignmentReadOnlyRelatedActions(): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n { ...entityMasterBulkDeleteAction(), hidden: true },\n { ...entityMasterDeleteAction(), hidden: true },\n { ...entityMasterViewAction(), hidden: true },\n ];\n}\n\nfunction locationAssignmentPartyCreateAction(): AXPEntityAction {\n const assigneeOptions = assigneeProcessOptions();\n\n return {\n name: 'Create',\n title: '@general:actions.create.title',\n command: { name: 'Entity:Create' },\n icon: 'fa-light fa-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n items: [\n {\n name: 'AssignExistingLocation',\n title: '@location-management:location-assignments.actions.assign-existing-location.title',\n command: { name: ASSIGN_EXISTING_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-map-marker-alt',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n name: 'CreateWithNewLocation',\n title: '@location-management:location-assignments.actions.create-with-new-location.title',\n command: { name: CREATE_WITH_NEW_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-location-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n ],\n };\n}\n\n/**\n * Actions for LocationAssignment when shown from Party/Customer/Supplier.\n * Create menu: assign existing location or create new location with assignee prefilled.\n */\nexport function locationAssignmentDetailsCrudActionsForPartyContext(\n _partyIdContextPath = 'id',\n): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n locationAssignmentPartyCreateAction(),\n entityDetailsEditAction(),\n entityOverrideDetailsViewAction(),\n ];\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPWidgetsList,\n formatAddressData,\n resolveMultiLanguageString,\n type AXPMultiLanguageString,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityProperty, AXPQueryFilter } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Types ----\n\ntype LocationAssignmentLocationSnapshot = {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n};\n\ntype LocationAssignmentPersonSnapshot = {\n id: string;\n fullName?: string;\n phones?: unknown[];\n emails?: unknown[];\n};\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Canonical assignee type for party-scoped location assignment links. */\nexport const LOCATION_ASSIGNMENT_PARTY_TYPE = 'BusinessCore.Party';\n\n//#endregion\n\n//#region ---- Display helpers ----\n\n/** Resolves assignee display title from host/process data (plain string or multi-language object). */\nexport function resolveLocationAssignmentDisplayTitle(locale: string, ...candidates: unknown[]): string {\n for (const candidate of candidates) {\n if (candidate == null || candidate === '') {\n continue;\n }\n\n const resolved = resolveMultiLanguageString(\n candidate as string | AXPMultiLanguageString | null | undefined,\n locale,\n ).trim();\n if (resolved) {\n return resolved;\n }\n }\n\n return '';\n}\n\n/** Builds a location snapshot for nested LocationAssignment display fields. */\nexport function buildLocationAssignmentLocationSnapshot(\n locationRow: Record<string, unknown>,\n locationId: string,\n): LocationAssignmentLocationSnapshot {\n const fullAddress =\n (locationRow['fullAddress'] as string | undefined)?.trim() || formatAddressData(locationRow)?.trim() || undefined;\n\n const toRegionRef = (value: unknown) => {\n if (value == null) {\n return undefined;\n }\n if (typeof value === 'object') {\n const record = value as Record<string, unknown>;\n const title = record['title'];\n if (title == null) {\n return undefined;\n }\n if (typeof title === 'string') {\n return { title };\n }\n if (typeof title === 'object') {\n return {\n title: resolveMultiLanguageString(title as AXPMultiLanguageString, 'en-US'),\n };\n }\n return undefined;\n }\n return { title: String(value) };\n };\n\n return {\n id: locationId,\n title: locationRow['title'] as string,\n fullAddress,\n street1: locationRow['street1'] as string | undefined,\n street2: locationRow['street2'] as string | undefined,\n postalCode: locationRow['postalCode'] as string | undefined,\n city: toRegionRef(locationRow['city']),\n state: toRegionRef(locationRow['state']),\n country: toRegionRef(locationRow['country']),\n };\n}\n\n/** Builds a person snapshot for nested LocationAssignment site-contact fields. */\nexport function buildLocationAssignmentPersonSnapshot(\n personRow: Record<string, unknown>,\n personId: string,\n): LocationAssignmentPersonSnapshot {\n const fullName =\n (personRow['fullName'] as string | undefined) ??\n [personRow['firstName'], personRow['lastName']].filter(Boolean).join(' ').trim();\n\n return {\n id: personId,\n fullName: fullName || undefined,\n phones: personRow['phones'] as unknown[] | undefined,\n emails: personRow['emails'] as unknown[] | undefined,\n };\n}\n\n//#endregion\n\n//#region ---- Filter helpers ----\n\n/** Filters LocationAssignment rows for a location detail context. */\nexport function locationAssignmentLocationConditions(locationIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'locationId',\n operator: { type: 'equal' },\n value: `{{context.eval(\"${locationIdContextPath}\")}}`,\n },\n ];\n}\n\n/** Filters LocationAssignment rows for the current details-view host entity. */\nexport function locationAssignmentPartyConditions(hostIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'ownerRef.type',\n operator: { type: 'equal' },\n value: '{{ host.entity() }}',\n },\n {\n name: 'ownerRef.id',\n operator: { type: 'equal' },\n value: `{{ host.eval(\"${hostIdContextPath}\") }}`,\n },\n ];\n}\n\n//#endregion\n\n//#region ---- Form layout helpers ----\n\n/** Assignee lookup omitted when injected from party/customer/supplier context. */\nexport const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES = ['ownerRef.id', 'ownerRef.type'] as const;\n\n/** Location lookup omitted when injected from location detail context. */\nexport const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES = ['locationId'] as const;\n\ntype PropertyLayoutRef = { name: string; layout?: Record<string, unknown> };\n\nexport function omitLocationAssignmentRefFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES)[number],\n ),\n );\n}\n\nexport function omitLocationAssignmentLocationFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES)[number],\n ),\n );\n}\n\n//#endregion\n\n//#region ---- Property factories ----\n\n/** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */\nexport function createLocationAssignmentOwnerRefLookupProperty(\n groupId: string,\n options: { readonly?: boolean } = {},\n): AXPEntityProperty {\n const readonly = options.readonly ?? false;\n\n return {\n name: 'ownerRef.id',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee.title',\n groupId,\n options: readonly\n ? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }\n : { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },\n schema: {\n dataType: 'string',\n readonly,\n interface: {\n type: AXPWidgetsList.Editors.LookupBox,\n options: {\n readonly,\n entity: \"{{ context.eval('ownerRef.type') }}\",\n textField: 'title',\n valueField: 'id',\n expose: [\n { source: 'id', target: 'ownerRef.id' },\n { source: 'title', target: 'ownerRef.title' },\n ],\n triggers: [{ event: \"{{ events.context('ownerRef.type') }}\", action: '{{ widget.refresh() }}' }],\n },\n },\n },\n validations: [{ rule: 'required' }],\n };\n}\n\n/** Hidden assignee type field; defaults to BusinessCore.Party. */\nexport function createLocationAssignmentOwnerRefTypeProperty(groupId: string): AXPEntityProperty {\n return {\n name: 'ownerRef.type',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee-type.title',\n groupId,\n schema: {\n dataType: 'string',\n visible: false,\n defaultValue: LOCATION_ASSIGNMENT_PARTY_TYPE,\n interface: { type: AXPWidgetsList.Editors.TextBox },\n },\n };\n}\n\n//#endregion\n","export const AXPLocationManagementMenuKeys = {\n Root: 'location-management:menu',\n Locations: 'location-management:menu:locations',\n Divider1: 'location-management:menu:divider-1',\n LocationTypes: 'location-management:menu:location-types',\n LocationRoles: 'location-management:menu:location-roles',\n GeographicRegions: 'location-management:menu:geographic-regions',\n} as const;\n\n","/**\n * People & Organization capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPPeopleOrganizationPermissionKeys = {\n Access: 'PeopleOrganization:Permission:Access',\n ViewOrganization: 'PeopleOrganization:Permission:ViewOrganization',\n MaintainOrganization: 'PeopleOrganization:Permission:MaintainOrganization',\n MaintainTeams: 'PeopleOrganization:Permission:MaintainTeams',\n MaintainEmployees: 'PeopleOrganization:Permission:MaintainEmployees',\n ManageEmployeeActions: 'PeopleOrganization:Permission:ManageEmployeeActions',\n MaintainPersons: 'PeopleOrganization:Permission:MaintainPersons',\n MaintainAttendance: 'PeopleOrganization:Permission:MaintainAttendance',\n ManageAttendanceActions: 'PeopleOrganization:Permission:ManageAttendanceActions',\n DesignJobs: 'PeopleOrganization:Permission:DesignJobs',\n Setup: 'PeopleOrganization:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPPeopleOrganizationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMLocationManagementPermissionsKeys = {\n LocationManagement: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n Locations: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationTypes: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationRoles: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n GeographicRegions: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n },\n} as const;\n","import type { AXPEntityReference } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#region ---- Types ----\n\nexport interface AXMLocationManagementLocationAssignmentEntityModel extends AXPEntityModel<string> {\n locationId: string;\n ownerRef: AXPEntityReference;\n roleId: string;\n personId?: string;\n location?: {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n };\n role?: { id: string; title: string };\n person?: { id: string; fullName?: string; phones?: unknown[]; emails?: unknown[] };\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './features.keys';\nexport * from './location-assignment.actions';\nexport * from './location-assignment.utils';\nexport * from './menu.keys';\nexport * from './permission.keys';\n\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,gCAAgC,GAAG;;ACDhD,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,qBAAqB;CAC5B;AAEM,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,KAAK,EAAE,mCAAmC;AAC1C,QAAA,IAAI,EAAE,4BAA4B;AACnC,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,UAAU;AAChB,YAAA,KAAK,EAAE,wDAAwD;AAC/D,YAAA,WAAW,EAAE,yDAAyD;AACtE,YAAA,IAAI,EAAE,4BAA4B;AACnC,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,kEAAkE;AACzE,YAAA,WAAW,EAAE,mEAAmE;AAChF,YAAA,IAAI,EAAE,kBAAkB;AACzB,SAAA;AACD,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,kEAAkE;AACzE,YAAA,WAAW,EAAE,mEAAmE;AAChF,YAAA,IAAI,EAAE,qBAAqB;AAC5B,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