@acorex-platform/module-location-management-client 2.0.0-next.15 → 2.0.0-next.16
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/fesm2022/{acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs → acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs} +23 -10
- package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-location-management-client.mjs +2 -2
- package/package.json +1 -1
- package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map +0 -1
|
@@ -10,6 +10,21 @@ import { resolveEntityActionCommandInput, mergeEntityActionProcessData } from '@
|
|
|
10
10
|
|
|
11
11
|
//#region ---- Imports ----
|
|
12
12
|
//#endregion
|
|
13
|
+
//#region ---- Helpers ----
|
|
14
|
+
/** Saved row from either a runtime command result or a plain create payload. */
|
|
15
|
+
function createdRow(result) {
|
|
16
|
+
if (!result || typeof result !== 'object') {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const payload = runtimeCommandPayloadData(result);
|
|
20
|
+
const row = (payload ?? result);
|
|
21
|
+
const id = row['id'] ?? row['_id'];
|
|
22
|
+
if (id == null || id === '') {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return row;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
13
28
|
//#region ---- Command ----
|
|
14
29
|
class AXMLocationAssignmentCreateWithNewLocationCommand {
|
|
15
30
|
constructor() {
|
|
@@ -67,9 +82,8 @@ class AXMLocationAssignmentCreateWithNewLocationCommand {
|
|
|
67
82
|
dialogRef.setLoading(true);
|
|
68
83
|
try {
|
|
69
84
|
const context = dialogRef.context();
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
if (!locationRow?.id && !locationRow?._id) {
|
|
85
|
+
const locationRow = createdRow(await createLocationFn(context));
|
|
86
|
+
if (!locationRow) {
|
|
73
87
|
return {
|
|
74
88
|
success: false,
|
|
75
89
|
message: {
|
|
@@ -95,7 +109,7 @@ class AXMLocationAssignmentCreateWithNewLocationCommand {
|
|
|
95
109
|
}
|
|
96
110
|
})
|
|
97
111
|
.show());
|
|
98
|
-
const locationRow =
|
|
112
|
+
const locationRow = createdRow(locationResult);
|
|
99
113
|
if (!locationRow) {
|
|
100
114
|
return { success: false };
|
|
101
115
|
}
|
|
@@ -138,17 +152,16 @@ class AXMLocationAssignmentCreateWithNewLocationCommand {
|
|
|
138
152
|
const personSnapshot = personId && personInContext
|
|
139
153
|
? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)
|
|
140
154
|
: undefined;
|
|
141
|
-
const
|
|
155
|
+
const assignmentRow = createdRow(await createAssignmentFn({
|
|
142
156
|
...context,
|
|
143
157
|
locationId,
|
|
144
158
|
ownerRef,
|
|
145
159
|
location: locationSnapshot,
|
|
146
160
|
...(personId ? { personId, person: personSnapshot } : {}),
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
if (__single_createResult) {
|
|
161
|
+
}));
|
|
162
|
+
if (assignmentRow) {
|
|
150
163
|
return { success: true, kind: 'object',
|
|
151
|
-
data:
|
|
164
|
+
data: assignmentRow,
|
|
152
165
|
message: {
|
|
153
166
|
text: await this.translationService.translateAsync('@general:messages.generic.success.description'),
|
|
154
167
|
},
|
|
@@ -197,4 +210,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
197
210
|
}] });
|
|
198
211
|
|
|
199
212
|
export { AXMLocationAssignmentCreateWithNewLocationCommand };
|
|
200
|
-
//# sourceMappingURL=acorex-platform-module-location-management-client-create-location-with-assignment.command-
|
|
213
|
+
//# sourceMappingURL=acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/create-location-with-assignment.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 { AXPEntityDefinitionRegistryService, AXPEntityFormBuilderService } 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 ---- Helpers ----\n\n/** Saved row from either a runtime command result or a plain create payload. */\nfunction createdRow(result: unknown): Record<string, unknown> | undefined {\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n const payload = runtimeCommandPayloadData(result as AXPRuntimeCommandResult<Record<string, unknown>>);\n const row = (payload ?? result) as Record<string, unknown>;\n const id = row['id'] ?? row['_id'];\n if (id == null || id === '') {\n return undefined;\n }\n return row;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMLocationAssignmentCreateWithNewLocationCommand implements AXPCommand<any, any> {\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 [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');\n if (!assignmentModuleName || !assignmentEntityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationDialogTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.location-dialog-title',\n );\n\n const locationResult = (await this.entityForm\n .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)\n .create({})\n .title(locationDialogTitle)\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 locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n const createLocationFn = locationEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createLocationFn) {\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 locationRow = createdRow(await createLocationFn(context));\n if (!locationRow) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n }\n return { success: true, kind: 'object', data: locationRow };\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()) as unknown as AXPRuntimeCommandResult<any>;\n\n const locationRow = createdRow(locationResult);\n if (!locationRow) {\n return { success: false };\n }\n const locationId = (locationRow['id'] ?? locationRow['_id']) as string;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);\n\n const assignmentFormTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title',\n );\n\n const assignmentResult = (await this.entityForm\n .entity(`${assignmentModuleName}.${assignmentEntityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(assignmentFormTitle)\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(\n assignmentModuleName,\n assignmentEntityName,\n );\n const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createAssignmentFn) {\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 assignmentRow = createdRow(\n await createAssignmentFn({\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n }),\n );\n if (assignmentRow) {\n return { success: true, kind: 'object',\n data: assignmentRow,\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()) as unknown as AXPRuntimeCommandResult<any>;\n\n return assignmentResult;\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'),\n get(processData, 'title'),\n ),\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAiBA;AAEA;AAEA;AACA,SAAS,UAAU,CAAC,MAAe,EAAA;IACjC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACzC,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,MAAM,OAAO,GAAG,yBAAyB,CAAC,MAA0D,CAAC;AACrG,IAAA,MAAM,GAAG,IAAI,OAAO,IAAI,MAAM,CAA4B;IAC1D,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC;IAClC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,EAAE,EAAE;AAC3B,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAO,GAAG;AACZ;AAEA;AAEA;MAGa,iDAAiD,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D,cADpC,MAAM,EAAA,CAAA,CAAA;;2FACnB,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBAD7D,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1540,7 +1540,7 @@ class AXMLocationManagementModule {
|
|
|
1540
1540
|
},
|
|
1541
1541
|
{
|
|
1542
1542
|
key: `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`,
|
|
1543
|
-
command: () => import('./acorex-platform-module-location-management-client-create-location-with-assignment.command-
|
|
1543
|
+
command: () => import('./acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs').then((c) => c.AXMLocationAssignmentCreateWithNewLocationCommand),
|
|
1544
1544
|
},
|
|
1545
1545
|
]),
|
|
1546
1546
|
], imports: [CommonModule,
|
|
@@ -1599,7 +1599,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1599
1599
|
},
|
|
1600
1600
|
{
|
|
1601
1601
|
key: `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`,
|
|
1602
|
-
command: () => import('./acorex-platform-module-location-management-client-create-location-with-assignment.command-
|
|
1602
|
+
command: () => import('./acorex-platform-module-location-management-client-create-location-with-assignment.command-DA9Sa1z_.mjs').then((c) => c.AXMLocationAssignmentCreateWithNewLocationCommand),
|
|
1603
1603
|
},
|
|
1604
1604
|
]),
|
|
1605
1605
|
]
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/create-location-with-assignment.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 { AXPEntityDefinitionRegistryService, AXPEntityFormBuilderService } 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 AXMLocationAssignmentCreateWithNewLocationCommand implements AXPCommand<any, any> {\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 [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');\n if (!assignmentModuleName || !assignmentEntityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationDialogTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.location-dialog-title',\n );\n\n const locationResult = (await this.entityForm\n .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)\n .create({})\n .title(locationDialogTitle)\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 locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n const createLocationFn = locationEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createLocationFn) {\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 createResult = await createLocationFn(context);\n const locationRow = runtimeCommandPayloadData(createResult);\n if (!locationRow?.id && !locationRow?._id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n }\n return { success: true, kind: 'object', data: locationRow };\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()) as unknown as AXPRuntimeCommandResult<any>;\n\n const locationRow = runtimeCommandPayloadData(locationResult) as Record<string, unknown> | undefined;\n if (!locationRow) {\n return { success: false };\n }\n const locationId = (locationRow['id'] ?? locationRow['_id']) as string;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);\n\n const assignmentFormTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title',\n );\n\n const assignmentResult = (await this.entityForm\n .entity(`${assignmentModuleName}.${assignmentEntityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(assignmentFormTitle)\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(\n assignmentModuleName,\n assignmentEntityName,\n );\n const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createAssignmentFn) {\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 createResult = await createAssignmentFn({\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n });\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()) as unknown as AXPRuntimeCommandResult<any>;\n\n return assignmentResult;\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'),\n get(processData, 'title'),\n ),\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAiBA;AAEA;MAGa,iDAAiD,CAAA;AAD9D,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC1D,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAqNnE,IAAA;IAnNC,MAAM,OAAO,CAAC,KAAU,EAAA;AACtB,QAAA,MAAM,QAAQ,GAAG,+BAA+B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,WAAW,GAAG,4BAA4B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;AAClD,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,0EAA0E,CAC3E;AACF,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC;A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