@acorex-platform/module-software-management-client 2.0.0-next.6 → 2.0.0-next.61

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 (18) hide show
  1. package/fesm2022/{acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs → acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs} +2 -2
  2. package/fesm2022/{acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs.map → acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs.map} +1 -1
  3. package/fesm2022/{acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs → acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs} +3 -3
  4. package/fesm2022/{acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs.map → acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs.map} +1 -1
  5. package/fesm2022/{acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs → acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs} +2 -2
  6. package/fesm2022/{acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs.map → acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs.map} +1 -1
  7. package/fesm2022/{acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs → acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs} +2 -2
  8. package/fesm2022/{acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs.map → acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs.map} +1 -1
  9. package/fesm2022/{acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs → acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs} +1 -1
  10. package/fesm2022/{acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs.map → acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs → acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs.map → acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs → acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs} +1 -1
  14. package/fesm2022/{acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs.map → acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs → acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs.map → acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs.map} +1 -1
  17. package/fesm2022/acorex-platform-module-software-management-client.mjs +32 -32
  18. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
5
5
  import { RootConfig } from '@acorex-platform/module-software-management-client/contracts';
6
6
  import * as i0 from '@angular/core';
7
7
  import { inject, Injectable } from '@angular/core';
8
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
8
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
9
9
 
10
10
  //#region ---- Imports ----
11
11
  //#endregion
@@ -80,4 +80,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
80
80
  }] });
81
81
 
82
82
  export { AcceptSoftwareSuggestionCommand };
83
- //# sourceMappingURL=acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs.map
83
+ //# sourceMappingURL=acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/accept-software-suggestion.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { RootConfig } from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class AcceptSoftwareSuggestionCommand implements AXPCommand<unknown, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<void> {\n const resolved = resolveEntityActionRef(input);\n const refType = resolveSoftwareText(resolved?.refType);\n const refId = resolveSoftwareText(resolved?.refId);\n if (!refType || !refId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.ref-required',\n ),\n },\n };\n }\n\n const [moduleName, entityName] = refType.split('.');\n if (moduleName !== RootConfig.module.name || !entityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.unsupported',\n ),\n },\n };\n }\n\n const record = (await this.entityService\n .withEntity(moduleName, entityName)\n .data()\n .byKey(refId)) as { origin?: string } | null;\n\n if (!record) {\n return { success: false, message: { text: 'Record not found' } };\n }\n\n if (record.origin !== 'suggestion') {\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.not-suggestion',\n ),\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false };\n }\n\n await this.entityService.withEntity(moduleName, entityName).data().update(refId, {\n origin: 'approved-fact',\n acceptedAt: new Date().toISOString(),\n needsReview: false,\n reviewReason: '',\n } as never);\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.accepted',\n ),\n closeButton: true,\n timeOut: 4000,\n });\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAWA;MAGa,+BAA+B,CAAA;AAD5C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA4EnE,IAAA;;;IAtEC,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;QAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;QACtD,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;AAClD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE;YACtB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,8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eAAe;AACvB,YAAA,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACpC,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,YAAY,EAAE,EAAE;AACR,SAAA,CAAC;AAEX,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,yCAAyC,CAAC;YAC9F,OAAO,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CACnD,0DAA0D,CAC3D;AACD,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA,CAAC;AAEF,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GA9EW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cADlB,MAAM,EAAA,CAAA,CAAA;;2FACnB,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/accept-software-suggestion.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { RootConfig } from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class AcceptSoftwareSuggestionCommand implements AXPCommand<unknown, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<void> {\n const resolved = resolveEntityActionRef(input);\n const refType = resolveSoftwareText(resolved?.refType);\n const refId = resolveSoftwareText(resolved?.refId);\n if (!refType || !refId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.ref-required',\n ),\n },\n };\n }\n\n const [moduleName, entityName] = refType.split('.');\n if (moduleName !== RootConfig.module.name || !entityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.unsupported',\n ),\n },\n };\n }\n\n const record = (await this.entityService\n .withEntity(moduleName, entityName)\n .data()\n .byKey(refId)) as { origin?: string } | null;\n\n if (!record) {\n return { success: false, message: { text: 'Record not found' } };\n }\n\n if (record.origin !== 'suggestion') {\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.not-suggestion',\n ),\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false };\n }\n\n await this.entityService.withEntity(moduleName, entityName).data().update(refId, {\n origin: 'approved-fact',\n acceptedAt: new Date().toISOString(),\n needsReview: false,\n reviewReason: '',\n } as never);\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.accept-suggestion.accepted',\n ),\n closeButton: true,\n timeOut: 4000,\n });\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAWA;MAGa,+BAA+B,CAAA;AAD5C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA4EnE,IAAA;;;IAtEC,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;QAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;QACtD,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;AAClD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE;YACtB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,8DAA8D,CAC/D;AACF,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;QACnD,IAAI,UAAU,KAAK,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE;YACxD,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,6DAA6D,CAC9D;AACF,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,MAAM,IAAI,MAAM,IAAI,CAAC;AACxB,aAAA,UAAU,CAAC,UAAU,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AAC;AAEF,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GA9EW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA/B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,cADlB,MAAM,EAAA,CAAA,CAAA;;2FACnB,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -4,8 +4,8 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
4
4
  import { RootConfig, canCompletePhase, nextSoftwarePhase, kickoffText, kickoffPlainTextFromVersion, discoveryReportFingerprint } from '@acorex-platform/module-software-management-client/contracts';
5
5
  import * as i0 from '@angular/core';
6
6
  import { inject, Injectable } from '@angular/core';
7
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
8
- import { l as loadIntroductionKickoffCheck, t as translateIntroductionExit } from './acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs';
7
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
8
+ import { l as loadIntroductionKickoffCheck, t as translateIntroductionExit } from './acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs';
9
9
 
10
10
  //#region ---- Imports ----
11
11
  //#endregion
@@ -179,4 +179,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
179
179
  }] });
180
180
 
181
181
  export { CompleteSoftwarePhaseActivity };
182
- //# sourceMappingURL=acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs.map
182
+ //# sourceMappingURL=acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/complete-software-phase.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n canCompletePhase,\n discoveryReportFingerprint,\n kickoffPlainTextFromVersion,\n kickoffText,\n nextSoftwarePhase,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n type DiscoveryFindingRecord,\n type SoftwarePhase,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from '../../commands/software-command.util';\nimport { loadIntroductionKickoffCheck } from './load-introduction-kickoff-check';\nimport { translateIntroductionExit } from './introduction-exit-message.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface CompleteSoftwarePhaseInput {\n softwareId?: string;\n phase?: SoftwarePhase;\n}\n\nexport interface CompleteSoftwarePhaseOutput {\n valid: boolean;\n currentPhase?: string;\n}\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class CompleteSoftwarePhaseActivity implements AXPCommand<CompleteSoftwarePhaseInput, CompleteSoftwarePhaseOutput> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: CompleteSoftwarePhaseInput): AXPCommandExecuteResultPromise<CompleteSoftwarePhaseOutput> {\n const softwareId = await this.resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: 'softwareId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const software = (await this.entityService.withEntity(RootConfig.module.name, RootConfig.entities.software.name).data().byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n\n if (!software) {\n return {\n success: false,\n message: { text: 'Software not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n const phase = (resolveSoftwareText(input?.phase) || resolveSoftwareText(software.currentPhase) || 'introduction') as SoftwarePhase;\n\n const kickoff = await loadIntroductionKickoffCheck(this.entityService, software);\n const discovery = phase === 'discovery' ? await this.loadDiscoveryCheck(software) : undefined;\n const gate = canCompletePhase(phase, software, kickoff, discovery);\n if (!gate.ok) {\n const text =\n phase === 'introduction'\n ? await translateIntroductionExit(this.i18n, gate)\n : gate.message.startsWith('@')\n ? await this.i18n.translateAsync(gate.message)\n : gate.message;\n return {\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed', currentPhase: software.currentPhase },\n };\n }\n\n const alreadyAdvanced = phase === 'introduction' ? Boolean(software.introductionCompletedAt) && software.currentPhase !== 'introduction' : software.currentPhase !== phase;\n\n if (alreadyAdvanced) {\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: software.currentPhase },\n metadata: { outcome: 'Done' },\n };\n }\n\n if (phase === 'discovery' && gate.advance === false) {\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: software.currentPhase },\n message: { text: gate.message },\n metadata: { outcome: 'Done' },\n };\n }\n\n const nextPhase = nextSoftwarePhase(phase);\n const now = new Date().toISOString();\n const patch: Record<string, unknown> = {\n currentPhase: nextPhase ?? phase,\n };\n\n if (phase === 'introduction') {\n patch['introductionCompletedAt'] = now;\n }\n\n if (!nextPhase) {\n patch['definitionCompletedAt'] = now;\n }\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, patch as never);\n } catch (error) {\n const raw = error instanceof Error ? error.message : gate.message;\n const text = raw.startsWith('@') ? await this.i18n.translateAsync(raw) : raw;\n return {\n success: false,\n message: { text: text || gate.message, type: 'warning' },\n metadata: { outcome: 'Failed', currentPhase: software.currentPhase },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: String(patch['currentPhase']) },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolveSoftwareId(input: CompleteSoftwarePhaseInput): Promise<string> {\n const fromInput = resolveSoftwareText(input?.softwareId);\n if (fromInput) {\n return fromInput;\n }\n\n const resolved = resolveEntityActionRef(input);\n return resolveSoftwareText(resolved?.refId);\n }\n\n private async loadDiscoveryCheck(software: AXMSoftwareManagementSoftwareEntityModel) {\n const kickoffVersionId = kickoffText(software.kickoffApprovedVersionId);\n let kickoffPlainText = '';\n if (kickoffVersionId) {\n try {\n const version = (await this.entityService.withEntity('DocumentManagement', 'DocumentVersion').data().byKey(kickoffVersionId)) as { metaDataForm?: unknown } | null;\n kickoffPlainText = kickoffPlainTextFromVersion(version);\n } catch {\n kickoffPlainText = '';\n }\n }\n\n let findings: DiscoveryFindingRecord[] = [];\n try {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.discoveryItem.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n filter: { field: 'softwareId', operator: { type: 'equal' }, value: software.id },\n });\n findings = (page.items ?? []) as DiscoveryFindingRecord[];\n } catch {\n findings = [];\n }\n\n const documentId = kickoffText(software.discoveryReportDocumentId);\n let statusId = '';\n let hostVersionId = '';\n if (documentId) {\n try {\n const document = (await this.entityService.withEntity('DocumentManagement', 'Document').data().byKey(documentId)) as { statusId?: unknown; versionId?: unknown } | null;\n statusId = kickoffText(document?.statusId);\n hostVersionId = kickoffText(document?.versionId);\n } catch {\n statusId = '';\n }\n }\n\n return {\n currentPhase: software.currentPhase,\n decision: software.discoveryDecision,\n rationale: software.discoveryRationale,\n kickoffApprovedVersionId: kickoffVersionId,\n findings,\n statusId,\n hostVersionId,\n approvedVersionId: software.discoveryApprovedVersionId,\n approvedFingerprint: software.discoveryApprovedFingerprint,\n reportFingerprint: discoveryReportFingerprint({\n kickoffVersionId,\n kickoffPlainText,\n decision: kickoffText(software.discoveryDecision),\n rationale: kickoffText(software.discoveryRationale),\n findings,\n }),\n };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAoCA;MAGa,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAkLrD,IAAA;;;IA5KC,MAAM,OAAO,CAAC,KAAiC,EAAA;QAC7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;AAC3C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;AAEA,QAAA,MAAM,QAAQ,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAoD;QAE7L,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;aAClC;QACH;AAEA,QAAA,MAAM,KAAK,IAAI,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,mBAAmB,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C,YAAA,wBAAwB,EAAE,gBAAgB;YAC1C,QAAQ;YACR,QAAQ;YACR,aAAa;YACb,iBAAiB,EAAE,QAAQ,CAAC,0BAA0B;YACtD,mBAAmB,EAAE,QAAQ,CAAC,4BAA4B;YAC1D,iBAAiB,EAAE,0BAA0B,CAAC;gBAC5C,gBAAgB;gBAChB,gBAAgB;AAChB,gBAAA,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AACjD,gBAAA,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC;gBACnD,QAAQ;aACT,CAAC;SACH;IACH;8GAnLW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cADhB,MAAM,EAAA,CAAA,CAAA;;2FACnB,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/complete-software-phase.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n canCompletePhase,\n discoveryReportFingerprint,\n kickoffPlainTextFromVersion,\n kickoffText,\n nextSoftwarePhase,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n type DiscoveryFindingRecord,\n type SoftwarePhase,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from '../../commands/software-command.util';\nimport { loadIntroductionKickoffCheck } from './load-introduction-kickoff-check';\nimport { translateIntroductionExit } from './introduction-exit-message.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface CompleteSoftwarePhaseInput {\n softwareId?: string;\n phase?: SoftwarePhase;\n}\n\nexport interface CompleteSoftwarePhaseOutput {\n valid: boolean;\n currentPhase?: string;\n}\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class CompleteSoftwarePhaseActivity implements AXPCommand<CompleteSoftwarePhaseInput, CompleteSoftwarePhaseOutput> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: CompleteSoftwarePhaseInput): AXPCommandExecuteResultPromise<CompleteSoftwarePhaseOutput> {\n const softwareId = await this.resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: 'softwareId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const software = (await this.entityService.withEntity(RootConfig.module.name, RootConfig.entities.software.name).data().byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n\n if (!software) {\n return {\n success: false,\n message: { text: 'Software not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n const phase = (resolveSoftwareText(input?.phase) || resolveSoftwareText(software.currentPhase) || 'introduction') as SoftwarePhase;\n\n const kickoff = await loadIntroductionKickoffCheck(this.entityService, software);\n const discovery = phase === 'discovery' ? await this.loadDiscoveryCheck(software) : undefined;\n const gate = canCompletePhase(phase, software, kickoff, discovery);\n if (!gate.ok) {\n const text =\n phase === 'introduction'\n ? await translateIntroductionExit(this.i18n, gate)\n : gate.message.startsWith('@')\n ? await this.i18n.translateAsync(gate.message)\n : gate.message;\n return {\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed', currentPhase: software.currentPhase },\n };\n }\n\n const alreadyAdvanced = phase === 'introduction' ? Boolean(software.introductionCompletedAt) && software.currentPhase !== 'introduction' : software.currentPhase !== phase;\n\n if (alreadyAdvanced) {\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: software.currentPhase },\n metadata: { outcome: 'Done' },\n };\n }\n\n if (phase === 'discovery' && gate.advance === false) {\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: software.currentPhase },\n message: { text: gate.message },\n metadata: { outcome: 'Done' },\n };\n }\n\n const nextPhase = nextSoftwarePhase(phase);\n const now = new Date().toISOString();\n const patch: Record<string, unknown> = {\n currentPhase: nextPhase ?? phase,\n };\n\n if (phase === 'introduction') {\n patch['introductionCompletedAt'] = now;\n }\n\n if (!nextPhase) {\n patch['definitionCompletedAt'] = now;\n }\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, patch as never);\n } catch (error) {\n const raw = error instanceof Error ? error.message : gate.message;\n const text = raw.startsWith('@') ? await this.i18n.translateAsync(raw) : raw;\n return {\n success: false,\n message: { text: text || gate.message, type: 'warning' },\n metadata: { outcome: 'Failed', currentPhase: software.currentPhase },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: { valid: true, currentPhase: String(patch['currentPhase']) },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolveSoftwareId(input: CompleteSoftwarePhaseInput): Promise<string> {\n const fromInput = resolveSoftwareText(input?.softwareId);\n if (fromInput) {\n return fromInput;\n }\n\n const resolved = resolveEntityActionRef(input);\n return resolveSoftwareText(resolved?.refId);\n }\n\n private async loadDiscoveryCheck(software: AXMSoftwareManagementSoftwareEntityModel) {\n const kickoffVersionId = kickoffText(software.kickoffApprovedVersionId);\n let kickoffPlainText = '';\n if (kickoffVersionId) {\n try {\n const version = (await this.entityService.withEntity('DocumentManagement', 'DocumentVersion').data().byKey(kickoffVersionId)) as { metaDataForm?: unknown } | null;\n kickoffPlainText = kickoffPlainTextFromVersion(version);\n } catch {\n kickoffPlainText = '';\n }\n }\n\n let findings: DiscoveryFindingRecord[] = [];\n try {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.discoveryItem.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n filter: { field: 'softwareId', operator: { type: 'equal' }, value: software.id },\n });\n findings = (page.items ?? []) as DiscoveryFindingRecord[];\n } catch {\n findings = [];\n }\n\n const documentId = kickoffText(software.discoveryReportDocumentId);\n let statusId = '';\n let hostVersionId = '';\n if (documentId) {\n try {\n const document = (await this.entityService.withEntity('DocumentManagement', 'Document').data().byKey(documentId)) as { statusId?: unknown; versionId?: unknown } | null;\n statusId = kickoffText(document?.statusId);\n hostVersionId = kickoffText(document?.versionId);\n } catch {\n statusId = '';\n }\n }\n\n return {\n currentPhase: software.currentPhase,\n decision: software.discoveryDecision,\n rationale: software.discoveryRationale,\n kickoffApprovedVersionId: kickoffVersionId,\n findings,\n statusId,\n hostVersionId,\n approvedVersionId: software.discoveryApprovedVersionId,\n approvedFingerprint: software.discoveryApprovedFingerprint,\n reportFingerprint: discoveryReportFingerprint({\n kickoffVersionId,\n kickoffPlainText,\n decision: kickoffText(software.discoveryDecision),\n rationale: kickoffText(software.discoveryRationale),\n findings,\n }),\n };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAoCA;MAGa,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAkLrD,IAAA;;;IA5KC,MAAM,OAAO,CAAC,KAAiC,EAAA;QAC7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,UAAU,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AAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cADhB,MAAM,EAAA,CAAA,CAAA;;2FACnB,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -7,7 +7,7 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
7
7
  import { AXPSoftwareManagementCommandKeys, kickoffText, RootConfig } from '@acorex-platform/module-software-management-client/contracts';
8
8
  import * as i0 from '@angular/core';
9
9
  import { inject, Injectable } from '@angular/core';
10
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
10
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
11
11
 
12
12
  //#region ----- Imports -----
13
13
  //#endregion
@@ -159,4 +159,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
159
159
  }] });
160
160
 
161
161
  export { ExportDiscoveryKickoffPdfCommand, GenerateDiscoveryKickoffCommand, OpenDiscoveryKickoffCommand, SubmitDiscoveryKickoffCommand };
162
- //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs.map
162
+ //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-kickoff.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote kickoff commands -----\n\nabstract class DiscoveryKickoffRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: '@software-management:messages.kickoff.id-required', type: 'warning' },\n };\n }\n\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n });\n if (!result?.success) {\n const text = messageText(result) || '@software-management:messages.kickoff.failed';\n return { success: false, message: { text, type: 'warning' } };\n }\n\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n return result;\n }\n\n protected async afterSuccess(_data: Record<string, unknown> | undefined): Promise<void> {\n return undefined;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryKickoffPdfCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-kickoff.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n//#endregion\n\n//#region ----- Open the stored sheet -----\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryKickoffCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n const documentId = kickoffText(software?.kickoffDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.missing-sheet');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAsBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,EAAE;IACX;IACA,MAAM,GAAG,GAAG,KAAgC;AAC5C,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjF;AAEA,SAAS,WAAW,CAAC,MAA2D,EAAA;AAC9E,IAAA,OAAO,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC1E;AAEA;AAEA;AAEA,MAAe,6BAA6B,CAAA;AAA5C,IAAA,WAAA,GAAA;AACqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;IA4B1D;IAxBE,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,mDAAmD,EAAE,IAAI,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,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-kickoff.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote kickoff commands -----\n\nabstract class DiscoveryKickoffRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: '@software-management:messages.kickoff.id-required', type: 'warning' },\n };\n }\n\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n });\n if (!result?.success) {\n const text = messageText(result) || '@software-management:messages.kickoff.failed';\n return { success: false, message: { text, type: 'warning' } };\n }\n\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n return result;\n }\n\n protected async afterSuccess(_data: Record<string, unknown> | undefined): Promise<void> {\n return undefined;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryKickoffPdfCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-kickoff.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n//#endregion\n\n//#region ----- Open the stored sheet -----\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryKickoffCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n const documentId = kickoffText(software?.kickoffDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.missing-sheet');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAsBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE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CAAC,QAAQ,EAAE,iBAAiB,CAAC;QAC3D,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,qDAAqD,CAAC;AAClG,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACd,gBAAA,KAAK,EAAE,SAAS;AAChB,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,OAAO,EAAE,IAAI;AACd,aAAA,CAAC;YACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE;QAC9C;AAEA,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,UAAU,EAAE,CAAC;AAC/E,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE;IAChE;8GAvCW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -8,7 +8,7 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
8
8
  import { AXPSoftwareManagementCommandKeys, kickoffText, RootConfig, kickoffPlainTextFromVersion } from '@acorex-platform/module-software-management-client/contracts';
9
9
  import * as i0 from '@angular/core';
10
10
  import { inject, Injectable } from '@angular/core';
11
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
11
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
12
12
 
13
13
  //#region ----- Imports -----
14
14
  //#endregion
@@ -275,4 +275,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
275
275
  }] });
276
276
 
277
277
  export { ExportDiscoveryReportPdfCommand, GenerateDiscoveryReportCommand, LinkDiscoveryQuestionnaireCommand, OpenDiscoveryReportCommand, SubmitDiscoveryReportCommand, ViewPinnedKickoffCommand };
278
- //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs.map
278
+ //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-report.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffPlainTextFromVersion,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote report commands -----\n\nabstract class DiscoveryReportRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n protected readonly toast = inject(AXToastService);\n protected readonly i18n = inject(AXTranslationService);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n\n const extra = await this.extraInput();\n if (!extra) {\n return { success: false };\n }\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n ...extra,\n });\n const text = await this.translateMessage(messageText(result));\n if (!result?.success) {\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 6000 });\n return { success: false, message: { text } };\n }\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n this.toast.show({ color: 'success', title: text, content: text, closeButton: true, timeOut: 6000 });\n return result;\n }\n\n protected async extraInput(): Promise<Record<string, unknown> | null> {\n return {};\n }\n\n protected async afterSuccess(data?: Record<string, unknown>): Promise<void> {\n void data;\n }\n\n private async translateMessage(text: string): Promise<string> {\n if (!text) {\n return this.i18n.translateAsync('@software-management:messages.discovery.failed');\n }\n if (text.startsWith('@')) {\n return this.i18n.translateAsync(text);\n }\n return text;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryReportPdfCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportDiscoveryReportPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-report.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class LinkDiscoveryQuestionnaireCommand extends DiscoveryReportRemoteCommand {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.LinkDiscoveryQuestionnaire;\n\n protected override async extraInput(): Promise<Record<string, unknown> | null> {\n const picked = await this.layoutBuilder\n .create()\n .dialog<{ questionnaireId?: unknown } | null>((dialog) => {\n dialog\n .setTitle('@software-management:actions.link-discovery-questionnaire.title')\n .setSize('md')\n .setCloseButton(true)\n .setContext({ questionnaireId: null })\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .formField('@software-management:actions.link-discovery-questionnaire.title', (field) => {\n field.path('questionnaireId');\n field.lookupBox({\n entity: 'AssessmentManagement.Questionnaire',\n multiple: false,\n look: 'select',\n });\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.save.title');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n const context = dialogRef.context() as { questionnaireId?: unknown };\n const questionnaireId = kickoffText(\n context.questionnaireId && typeof context.questionnaireId === 'object'\n ? (context.questionnaireId as { id?: unknown }).id\n : context.questionnaireId,\n );\n if (!questionnaireId) {\n throw new Error('@software-management:messages.discovery.questionnaire-required');\n }\n return { questionnaireId };\n });\n })\n .show();\n if (!picked?.questionnaireId) {\n return null;\n }\n return { questionnaireId: picked.questionnaireId };\n }\n}\n\n//#endregion\n\n//#region ----- Read the pinned kickoff and open the report -----\n\n@Injectable({ providedIn: 'root' })\nexport class ViewPinnedKickoffCommand implements AXPCommand<unknown, { versionId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ versionId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const versionId = kickoffText(software?.kickoffApprovedVersionId);\n if (!versionId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.pinned-kickoff-missing');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n const version = (await this.entityService\n .withEntity('DocumentManagement', 'DocumentVersion')\n .data()\n .byKey(versionId)) as { metaDataForm?: unknown } | null;\n const text = kickoffPlainTextFromVersion(version);\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle('@software-management:actions.view-pinned-kickoff.title')\n .setSize('lg')\n .setCloseButton(true)\n .setContext({ text })\n .content((flex) => {\n flex.customWidget('text-block-layout', { content: text || versionId });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n });\n })\n .show();\n return { success: true, kind: 'object', data: { versionId } };\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryReportCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const documentId = kickoffText(software?.discoveryReportDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.missing-report');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAwBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,EAAE;IACX;IACA,MAAM,GAAG,GAAG,KAAgC;AAC5C,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,G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software-management-client-discovery-report.commands-CypfcZhS.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-report.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffPlainTextFromVersion,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote report commands -----\n\nabstract class DiscoveryReportRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n protected readonly toast = inject(AXToastService);\n protected readonly i18n = inject(AXTranslationService);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n\n const extra = await this.extraInput();\n if (!extra) {\n return { success: false };\n }\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n ...extra,\n });\n const text = await this.translateMessage(messageText(result));\n if (!result?.success) {\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 6000 });\n return { success: false, message: { text } };\n }\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n this.toast.show({ color: 'success', title: text, content: text, closeButton: true, timeOut: 6000 });\n return result;\n }\n\n protected async extraInput(): Promise<Record<string, unknown> | null> {\n return {};\n }\n\n protected async afterSuccess(data?: Record<string, unknown>): Promise<void> {\n void data;\n }\n\n private async translateMessage(text: string): Promise<string> {\n if (!text) {\n return this.i18n.translateAsync('@software-management:messages.discovery.failed');\n }\n if (text.startsWith('@')) {\n return this.i18n.translateAsync(text);\n }\n return text;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryReportPdfCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportDiscoveryReportPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-report.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class LinkDiscoveryQuestionnaireCommand extends DiscoveryReportRemoteCommand {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.LinkDiscoveryQuestionnaire;\n\n protected override async extraInput(): Promise<Record<string, unknown> | null> {\n const picked = await this.layoutBuilder\n .create()\n .dialog<{ questionnaireId?: unknown } | null>((dialog) => {\n dialog\n .setTitle('@software-management:actions.link-discovery-questionnaire.title')\n .setSize('md')\n .setCloseButton(true)\n .setContext({ questionnaireId: null })\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .formField('@software-management:actions.link-discovery-questionnaire.title', (field) => {\n field.path('questionnaireId');\n field.lookupBox({\n entity: 'AssessmentManagement.Questionnaire',\n multiple: false,\n look: 'select',\n });\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.save.title');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n const context = dialogRef.context() as { questionnaireId?: unknown };\n const questionnaireId = kickoffText(\n context.questionnaireId && typeof context.questionnaireId === 'object'\n ? (context.questionnaireId as { id?: unknown }).id\n : context.questionnaireId,\n );\n if (!questionnaireId) {\n throw new Error('@software-management:messages.discovery.questionnaire-required');\n }\n return { questionnaireId };\n });\n })\n .show();\n if (!picked?.questionnaireId) {\n return null;\n }\n return { questionnaireId: picked.questionnaireId };\n }\n}\n\n//#endregion\n\n//#region ----- Read the pinned kickoff and open the report -----\n\n@Injectable({ providedIn: 'root' })\nexport class ViewPinnedKickoffCommand implements AXPCommand<unknown, { versionId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ versionId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const versionId = kickoffText(software?.kickoffApprovedVersionId);\n if (!versionId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.pinned-kickoff-missing');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n const version = (await this.entityService\n .withEntity('DocumentManagement', 'DocumentVersion')\n .data()\n .byKey(versionId)) as { metaDataForm?: unknown } | null;\n const text = kickoffPlainTextFromVersion(version);\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle('@software-management:actions.view-pinned-kickoff.title')\n .setSize('lg')\n .setCloseButton(true)\n .setContext({ text })\n .content((flex) => {\n flex.customWidget('text-block-layout', { content: text || versionId });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n });\n })\n .show();\n return { success: true, kind: 'object', data: { versionId } };\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryReportCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const documentId = kickoffText(software?.discoveryReportDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.missing-report');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAwBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,EAAE;IACX;IACA,MAAM,GAAG,GAAG,KAAgC;AAC5C,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjF;AAEA,SAAS,WAAW,CAAC,MAA2D,EAAA;AAC9E,IAAA,OAAO,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC1E;AAEA;AAEA;AAEA,MAAe,4BAA4B,CAAA;AAA3C,IAAA,WAAA,GAAA;AACqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACrC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC;IA+CxD;IA3CE,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAA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C;AACA,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,UAAU,EAAE,CAAC;AAC/E,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE;IAChE;8GAtBW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -68,4 +68,4 @@ async function translateIntroductionExit(i18n, decision) {
68
68
  //#endregion
69
69
 
70
70
  export { loadIntroductionKickoffCheck as l, translateIntroductionExit as t };
71
- //# sourceMappingURL=acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs.map
71
+ //# sourceMappingURL=acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/load-introduction-kickoff-check.ts","../../../../libs/modules/software-management/client/src/lib/workflows/activities/introduction-exit-message.util.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n buildIntroductionKickoffCheck,\n kickoffFingerprintFromRows,\n kickoffText,\n type AXMSoftwareManagementSoftwareEntityModel,\n type IntroductionKickoffCheck,\n} from '@acorex-platform/module-software-management-client/contracts';\n\n//#endregion\n\n//#region ----- Load -----\n\n/**\n * Reads the kickoff document the introduction gate needs.\n * An approved host version is included even when the software row has not stored it yet.\n */\nexport async function loadIntroductionKickoffCheck(\n entityService: AXPEntityService,\n software: AXMSoftwareManagementSoftwareEntityModel,\n): Promise<IntroductionKickoffCheck | null> {\n const documentId = kickoffText(software.kickoffDocumentId);\n const pinnedVersionId = kickoffText(software.kickoffApprovedVersionId);\n if (!documentId && !pinnedVersionId) {\n return null;\n }\n\n const document = documentId ? await readRow(entityService, 'Document', documentId) : null;\n const hostVersionId = kickoffText(document?.['versionId']);\n const versionId = hostVersionId || pinnedVersionId;\n const version = versionId ? await readRow(entityService, 'DocumentVersion', versionId) : null;\n\n return buildIntroductionKickoffCheck({\n statusId: document?.['statusId'],\n status: document?.['status'],\n hostVersionId,\n approvedVersionId: software.kickoffApprovedVersionId,\n approvedFingerprint: software.kickoffApprovedFingerprint,\n versionFingerprint: kickoffFingerprintFromRows(version, document),\n });\n}\n\nasync function readRow(\n entityService: AXPEntityService,\n entity: 'Document' | 'DocumentVersion',\n id: string,\n): Promise<Record<string, unknown> | null> {\n try {\n const row = await entityService.withEntity('DocumentManagement', entity).data().byKey(id);\n return row && typeof row === 'object' ? (row as unknown as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n INTRODUCTION_EXIT_MESSAGE,\n type IntroductionExitDecision,\n type IntroductionRequiredField,\n} from '@acorex-platform/module-software-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst INTRODUCTION_FIELD_LABEL: Record<IntroductionRequiredField, string> = {\n title: '@software-management:entities.software.fields.title.title',\n idea: '@software-management:entities.software.fields.idea.title',\n initialProblem: '@software-management:entities.software.fields.initial-problem.title',\n goal: '@software-management:entities.software.fields.goal.title',\n ownerId: '@software-management:entities.software.fields.owner.title',\n};\n\n//#endregion\n\n//#region ----- Message -----\n\nexport async function translateIntroductionExit(\n i18n: AXTranslationService,\n decision: Pick<IntroductionExitDecision, 'message' | 'missingFields'>,\n): Promise<string> {\n const missing = decision.missingFields ?? [];\n if (missing.length) {\n const labels: string[] = [];\n for (const field of missing) {\n labels.push(await i18n.translateAsync(INTRODUCTION_FIELD_LABEL[field]));\n }\n const lang = i18n.getActiveLang?.() ?? 'en-US';\n const fields = labels.filter((label) => label.trim().length > 0).join(lang.startsWith('fa') ? '، ' : ', ');\n return i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.missingFields, { params: { fields } });\n }\n if (decision.message.startsWith('@')) {\n return i18n.translateAsync(decision.message);\n }\n return decision.message;\n}\n\n//#endregion\n"],"names":[],"mappings":";;AAAA;AAWA;AAEA;AAEA;;;AAGG;AACI,eAAe,4BAA4B,CAChD,aAA+B,EAC/B,QAAkD,EAAA;IAElD,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAC1D,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,wBAAwB,CAAC;AACtE,IAAA,IAAI,CAAC,UAAU,IAAI,CAAC,eAAe,EAAE;AACnC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,OAAO,CAAC,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,IAAI;IACzF,MAAM,aAAa,GAAG,WAAW,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;AAC1D,IAAA,MAAM,SAAS,GAAG,aAAa,IAAI,eAAe;AAClD,IAAA,MAAM,OAAO,GAAG,SAAS,GAAG,MAAM,OAAO,CAAC,aAAa,EAAE,iBAAiB,EAAE,SAAS,CAAC,GAAG,IAAI;AAE7F,IAAA,OAAO,6BAA6B,CAAC;AACnC,QAAA,QAAQ,EAAE,QAAQ,GAAG,UAAU,CAAC;AAChC,QAAA,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC5B,aAAa;QAC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AK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1G,QAAA,OAAO,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IAC7F;IACA,IAAI,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC9C;IACA,OAAO,QAAQ,CAAC,OAAO;AACzB;AAEA;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/load-introduction-kickoff-check.ts","../../../../libs/modules/software-management/client/src/lib/workflows/activities/introduction-exit-message.util.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n buildIntroductionKickoffCheck,\n kickoffFingerprintFromRows,\n kickoffText,\n type AXMSoftwareManagementSoftwareEntityModel,\n type IntroductionKickoffCheck,\n} from '@acorex-platform/module-software-management-client/contracts';\n\n//#endregion\n\n//#region ----- Load -----\n\n/**\n * Reads the kickoff document the introduction gate needs.\n * An approved host version is included even when the software row has not stored it yet.\n */\nexport async function loadIntroductionKickoffCheck(\n entityService: AXPEntityService,\n software: AXMSoftwareManagementSoftwareEntityModel,\n): Promise<IntroductionKickoffCheck | null> {\n const documentId = kickoffText(software.kickoffDocumentId);\n const pinnedVersionId = kickoffText(software.kickoffApprovedVersionId);\n if (!documentId && !pinnedVersionId) {\n return null;\n }\n\n const document = documentId ? await readRow(entityService, 'Document', documentId) : null;\n const hostVersionId = kickoffText(document?.['versionId']);\n const versionId = hostVersionId || pinnedVersionId;\n const version = versionId ? await readRow(entityService, 'DocumentVersion', versionId) : null;\n\n return buildIntroductionKickoffCheck({\n statusId: document?.['statusId'],\n status: document?.['status'],\n hostVersionId,\n approvedVersionId: software.kickoffApprovedVersionId,\n approvedFingerprint: software.kickoffApprovedFingerprint,\n versionFingerprint: kickoffFingerprintFromRows(version, document),\n });\n}\n\nasync function readRow(\n entityService: AXPEntityService,\n entity: 'Document' | 'DocumentVersion',\n id: string,\n): Promise<Record<string, unknown> | null> {\n try {\n const row = await entityService.withEntity('DocumentManagement', entity).data().byKey(id);\n return row && typeof row === 'object' ? (row as unknown as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n INTRODUCTION_EXIT_MESSAGE,\n type IntroductionExitDecision,\n type IntroductionRequiredField,\n} from '@acorex-platform/module-software-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst INTRODUCTION_FIELD_LABEL: Record<IntroductionRequiredField, string> = {\n title: '@software-management:entities.software.fields.title.title',\n idea: '@software-management:entities.software.fields.idea.title',\n initialProblem: '@software-management:entities.software.fields.initial-problem.title',\n goal: '@software-management:entities.software.fields.goal.title',\n ownerId: '@software-management:entities.software.fields.owner.title',\n};\n\n//#endregion\n\n//#region ----- Message -----\n\nexport async function translateIntroductionExit(\n i18n: AXTranslationService,\n decision: Pick<IntroductionExitDecision, 'message' | 'missingFields'>,\n): Promise<string> {\n const missing = decision.missingFields ?? [];\n if (missing.length) {\n const labels: string[] = [];\n for (const field of missing) {\n labels.push(await i18n.translateAsync(INTRODUCTION_FIELD_LABEL[field]));\n }\n const lang = i18n.getActiveLang?.() ?? 'en-US';\n const fields = labels.filter((label) => label.trim().length > 0).join(lang.startsWith('fa') ? '، ' : ', ');\n return i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.missingFields, { params: { fields } });\n }\n if (decision.message.startsWith('@')) {\n return i18n.translateAsync(decision.message);\n }\n return decision.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,OAAO,QAAQ,CAAC,OAAO;AACzB;AAEA;;"}
@@ -4,7 +4,7 @@ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entit
4
4
  import { introductionValueText, RootConfig, evaluateIntroductionExit, INTRODUCTION_EXIT_MESSAGE, AXPSoftwareManagementPermissionKeys } from '@acorex-platform/module-software-management-client/contracts';
5
5
  import * as i0 from '@angular/core';
6
6
  import { inject, Injectable } from '@angular/core';
7
- import { l as loadIntroductionKickoffCheck, t as translateIntroductionExit } from './acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs';
7
+ import { l as loadIntroductionKickoffCheck, t as translateIntroductionExit } from './acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs';
8
8
 
9
9
  //#region ----- Imports -----
10
10
  //#endregion
@@ -155,4 +155,4 @@ function readInput(input, key) {
155
155
  }
156
156
 
157
157
  export { LoadSoftwareIntroductionActivity, SaveSoftwareIntroductionActivity };
158
- //# sourceMappingURL=acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs.map
158
+ //# sourceMappingURL=acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/introduction-task.activities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementPermissionKeys,\n evaluateIntroductionExit,\n INTRODUCTION_EXIT_MESSAGE,\n introductionValueText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { translateIntroductionExit } from './introduction-exit-message.util';\nimport { loadIntroductionKickoffCheck } from './load-introduction-kickoff-check';\n\n//#endregion\n\n//#region ----- Types -----\n\ninterface IntroductionDialogData {\n title: string;\n idea: string;\n initialProblem: string;\n goal: string;\n ownerId: string;\n potentialUsers: string;\n openQuestions: string;\n approvalText: string;\n}\n\ninterface SaveIntroductionInput {\n softwareId?: unknown;\n title?: unknown;\n idea?: unknown;\n initialProblem?: unknown;\n goal?: unknown;\n ownerId?: unknown;\n potentialUsers?: unknown;\n openQuestions?: unknown;\n}\n\n//#endregion\n\n//#region ----- Load -----\n\n@Injectable({ providedIn: 'root' })\nexport class LoadSoftwareIntroductionActivity implements AXPCommand<unknown, IntroductionDialogData> {\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly session = inject(AXPSessionService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<IntroductionDialogData> {\n const softwareId = introductionValueText(readInput(input, 'softwareId'));\n if (!softwareId) {\n return this.failure(await this.i18n.translateAsync('@software-management:messages.kickoff.id-required'));\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n if (!software) {\n return this.failure(await this.i18n.translateAsync('@software-management:messages.kickoff.not-found'));\n }\n\n const kickoff = await loadIntroductionKickoffCheck(this.entityService, software);\n const decision = evaluateIntroductionExit(software, kickoff);\n const approvalText = decision.ok\n ? await this.i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.ready)\n : await translateIntroductionExit(this.i18n, decision);\n const canEdit = this.session.authorize(AXPSoftwareManagementPermissionKeys.MaintainSoftwareDefinitions);\n\n return {\n success: true,\n kind: 'object',\n data: {\n title: introductionValueText(software.title),\n idea: introductionValueText(software.idea),\n initialProblem: introductionValueText(software.initialProblem),\n goal: introductionValueText(software.goal),\n ownerId: introductionValueText(software.ownerId) || introductionValueText(software.owner),\n potentialUsers: introductionValueText(software.potentialUsers),\n openQuestions: introductionValueText(software.openQuestions),\n approvalText,\n },\n metadata: { outcome: canEdit ? 'edit' : 'view' },\n };\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private failure(text: string): AXPCommandExecuteResultPromise<IntroductionDialogData> {\n return Promise.resolve({\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed' },\n });\n }\n\n //#endregion\n}\n\n//#endregion\n\n//#region ----- Save -----\n\n@Injectable({ providedIn: 'root' })\nexport class SaveSoftwareIntroductionActivity implements AXPCommand<SaveIntroductionInput, { saved: boolean }> {\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly session = inject(AXPSessionService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: SaveIntroductionInput): AXPCommandExecuteResultPromise<{ saved: boolean }> {\n if (!this.session.authorize(AXPSoftwareManagementPermissionKeys.MaintainSoftwareDefinitions)) {\n return {\n success: false,\n message: {\n text: await this.i18n.translateAsync('@software-management:messages.introduction.save-forbidden'),\n type: 'warning',\n },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const softwareId = introductionValueText(input?.softwareId);\n if (!softwareId || softwareId.includes('{{')) {\n return {\n success: false,\n message: {\n text: await this.i18n.translateAsync('@software-management:messages.kickoff.id-required'),\n type: 'warning',\n },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const patch = {\n title: introductionValueText(input?.title),\n idea: introductionValueText(input?.idea),\n initialProblem: introductionValueText(input?.initialProblem),\n goal: introductionValueText(input?.goal),\n ownerId: introductionValueText(input?.ownerId),\n potentialUsers: introductionValueText(input?.potentialUsers),\n openQuestions: introductionValueText(input?.openQuestions),\n };\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, patch as never);\n } catch (error: unknown) {\n const raw = error instanceof Error ? error.message : '';\n const text = raw.startsWith('@')\n ? await this.i18n.translateAsync(raw)\n : raw || (await this.i18n.translateAsync('@software-management:messages.introduction.save-failed'));\n return {\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: { saved: true },\n message: {\n text: await this.i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.saved),\n type: 'success',\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction readInput(input: unknown, key: string): unknown {\n if (!input || typeof input !== 'object') {\n return undefined;\n }\n return (input as Record<string, unknown>)[key];\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAAA;AA6CA;AAEA;MAGa,gCAAgC,CAAA;AAD7C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACnC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyDrD,IAAA;;;IAnDC,MAAM,OAAO,CAAC,KAAc,EAAA;QAC1B,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACxE,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,mDAAmD,CAAC,CAAC;QAC1G;AAEA,QAAA,MAAM,QAAQ,IAAI,MAAM,IAAI,CAAC;AAC1B,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI;AACpE,aAAA,IAAI;AACJ,aAAA,KAAK,CAAC,UAAU,CAAC,CAAoD;QACxE,IAAI,CAA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c,EAAE,GAAW,EAAA;IAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAQ,KAAiC,CAAC,GAAG,CAAC;AAChD;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/introduction-task.activities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementPermissionKeys,\n evaluateIntroductionExit,\n INTRODUCTION_EXIT_MESSAGE,\n introductionValueText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { translateIntroductionExit } from './introduction-exit-message.util';\nimport { loadIntroductionKickoffCheck } from './load-introduction-kickoff-check';\n\n//#endregion\n\n//#region ----- Types -----\n\ninterface IntroductionDialogData {\n title: string;\n idea: string;\n initialProblem: string;\n goal: string;\n ownerId: string;\n potentialUsers: string;\n openQuestions: string;\n approvalText: string;\n}\n\ninterface SaveIntroductionInput {\n softwareId?: unknown;\n title?: unknown;\n idea?: unknown;\n initialProblem?: unknown;\n goal?: unknown;\n ownerId?: unknown;\n potentialUsers?: unknown;\n openQuestions?: unknown;\n}\n\n//#endregion\n\n//#region ----- Load -----\n\n@Injectable({ providedIn: 'root' })\nexport class LoadSoftwareIntroductionActivity implements AXPCommand<unknown, IntroductionDialogData> {\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly session = inject(AXPSessionService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<IntroductionDialogData> {\n const softwareId = introductionValueText(readInput(input, 'softwareId'));\n if (!softwareId) {\n return this.failure(await this.i18n.translateAsync('@software-management:messages.kickoff.id-required'));\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n if (!software) {\n return this.failure(await this.i18n.translateAsync('@software-management:messages.kickoff.not-found'));\n }\n\n const kickoff = await loadIntroductionKickoffCheck(this.entityService, software);\n const decision = evaluateIntroductionExit(software, kickoff);\n const approvalText = decision.ok\n ? await this.i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.ready)\n : await translateIntroductionExit(this.i18n, decision);\n const canEdit = this.session.authorize(AXPSoftwareManagementPermissionKeys.MaintainSoftwareDefinitions);\n\n return {\n success: true,\n kind: 'object',\n data: {\n title: introductionValueText(software.title),\n idea: introductionValueText(software.idea),\n initialProblem: introductionValueText(software.initialProblem),\n goal: introductionValueText(software.goal),\n ownerId: introductionValueText(software.ownerId) || introductionValueText(software.owner),\n potentialUsers: introductionValueText(software.potentialUsers),\n openQuestions: introductionValueText(software.openQuestions),\n approvalText,\n },\n metadata: { outcome: canEdit ? 'edit' : 'view' },\n };\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private failure(text: string): AXPCommandExecuteResultPromise<IntroductionDialogData> {\n return Promise.resolve({\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed' },\n });\n }\n\n //#endregion\n}\n\n//#endregion\n\n//#region ----- Save -----\n\n@Injectable({ providedIn: 'root' })\nexport class SaveSoftwareIntroductionActivity implements AXPCommand<SaveIntroductionInput, { saved: boolean }> {\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly session = inject(AXPSessionService);\n private readonly i18n = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: SaveIntroductionInput): AXPCommandExecuteResultPromise<{ saved: boolean }> {\n if (!this.session.authorize(AXPSoftwareManagementPermissionKeys.MaintainSoftwareDefinitions)) {\n return {\n success: false,\n message: {\n text: await this.i18n.translateAsync('@software-management:messages.introduction.save-forbidden'),\n type: 'warning',\n },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const softwareId = introductionValueText(input?.softwareId);\n if (!softwareId || softwareId.includes('{{')) {\n return {\n success: false,\n message: {\n text: await this.i18n.translateAsync('@software-management:messages.kickoff.id-required'),\n type: 'warning',\n },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const patch = {\n title: introductionValueText(input?.title),\n idea: introductionValueText(input?.idea),\n initialProblem: introductionValueText(input?.initialProblem),\n goal: introductionValueText(input?.goal),\n ownerId: introductionValueText(input?.ownerId),\n potentialUsers: introductionValueText(input?.potentialUsers),\n openQuestions: introductionValueText(input?.openQuestions),\n };\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, patch as never);\n } catch (error: unknown) {\n const raw = error instanceof Error ? error.message : '';\n const text = raw.startsWith('@')\n ? await this.i18n.translateAsync(raw)\n : raw || (await this.i18n.translateAsync('@software-management:messages.introduction.save-failed'));\n return {\n success: false,\n message: { text, type: 'warning' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: { saved: true },\n message: {\n text: await this.i18n.translateAsync(INTRODUCTION_EXIT_MESSAGE.saved),\n type: 'success',\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction readInput(input: unknown, key: string): unknown {\n if (!input || typeof input !== 'object') {\n return undefined;\n }\n return (input as Record<string, unknown>)[key];\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAAA;AA6CA;AAEA;MAGa,gCAAgC,CAAA;AAD7C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAA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I,EAAE;AACrB,YAAA,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,KAAK,CAAC;AACrE,gBAAA,IAAI,EAAE,SAAS;AAChB,aAAA;AACD,YAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;SAC9B;IACH;8GAxEW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cADnB,MAAM,EAAA,CAAA,CAAA;;2FACnB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AA8ElC;AAEA;AAEA,SAAS,SAAS,CAAC,KAAc,EAAE,GAAW,EAAA;IAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAQ,KAAiC,CAAC,GAAG,CAAC;AAChD;;"}
@@ -6,4 +6,4 @@ function asSoftwareRecord(value) {
6
6
  }
7
7
 
8
8
  export { resolveSoftwareText as r };
9
- //# sourceMappingURL=acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs.map
9
+ //# sourceMappingURL=acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/software-command.util.ts"],"sourcesContent":["export function resolveSoftwareText(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n}\n\nexport function asSoftwareRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null;\n}\n"],"names":[],"mappings":"AAAM,SAAU,mBAAmB,CAAC,KAAc,EAAA;AAChD,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE;AACtD;AAEM,SAAU,gBAAgB,CAAC,KAAc,EAAA;AAC7C,IAAA,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAAiC,GAAG,IAAI;AACvF;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/software-command.util.ts"],"sourcesContent":["export function resolveSoftwareText(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n}\n\nexport function asSoftwareRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' ? (value as Record<string, unknown>) : null;\n}\n"],"names":[],"mappings":"AAAM,SAAU,mBAAmB,CAAC,KAAc,EAAA;AAChD,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE;AACtD;AAEM,SAAU,gBAAgB,CAAC,KAAc,EAAA;AAC7C,IAAA,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAAiC,GAAG,IAAI;AACvF;;"}
@@ -8,7 +8,7 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
8
8
  import { RootConfig, introductionValueText, SOFTWARE_DEFINITION_WORKFLOW_NAME } from '@acorex-platform/module-software-management-client/contracts';
9
9
  import * as i0 from '@angular/core';
10
10
  import { inject, Injectable } from '@angular/core';
11
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
11
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
12
12
 
13
13
  //#region ---- Imports ----
14
14
  //#endregion
@@ -121,4 +121,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
121
121
  }] });
122
122
 
123
123
  export { StartSoftwareDefinitionFlowCommand };
124
- //# sourceMappingURL=acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs.map
124
+ //# sourceMappingURL=acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/start-software-definition-flow.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport {\n AXPEntityService,\n buildAXPRecordWorkflowInfo,\n getRecordWorkflowInstanceId,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXP_WORKFLOW_ENGINE, type AXPWorkflowEngine } from '@acorex-platform/framework-client/workflow';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n introductionValueText,\n RootConfig,\n SOFTWARE_DEFINITION_WORKFLOW_NAME,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class StartSoftwareDefinitionFlowCommand implements AXPCommand<unknown, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE) as AXPWorkflowEngine;\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<void> {\n const resolved = resolveEntityActionRef(input);\n const softwareId = resolveSoftwareText(resolved?.refId);\n if (!softwareId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.id-required',\n ),\n },\n };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n\n if (!software) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.not-found',\n ),\n },\n };\n }\n\n if (getRecordWorkflowInstanceId(software as never)) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.already-started',\n ),\n },\n };\n }\n\n const ownerId =\n introductionValueText(software.ownerId) ||\n introductionValueText(software.owner) ||\n resolveSoftwareText(this.sessionService.user?.id);\n const correlationId = `${RootConfig.entities.software.source}:${softwareId}:${SOFTWARE_DEFINITION_WORKFLOW_NAME}`;\n\n try {\n const startResponse = await this.workflowEngine.start({\n workflowId: SOFTWARE_DEFINITION_WORKFLOW_NAME,\n input: {\n softwareId,\n softwareTitle: resolveSoftwareText(software.title),\n ownerId,\n refId: softwareId,\n refType: RootConfig.entities.software.source,\n correlationId,\n },\n });\n\n const instanceId = startResponse.instanceId;\n if (!instanceId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n },\n };\n }\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, {\n workflowInfo: buildAXPRecordWorkflowInfo({\n instanceId,\n definitionId: SOFTWARE_DEFINITION_WORKFLOW_NAME,\n correlationId,\n }),\n } as never);\n\n this.eventService.publish('task-board.refresh', { provider: SOFTWARE_DEFINITION_WORKFLOW_NAME });\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.started',\n ),\n closeButton: true,\n timeOut: 6000,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: message,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAuBA;MAGa,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAsB;AACjE,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC/C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAkH5D,IAAA;;;IA5GC,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;QAC9C,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;QACvD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,sDAAsD,CACvD;AACF,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,QAAQ,IAAI,MAAM,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OAAO,GAAG,eAAe;AACxE,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,gBAAA,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,OAAO,EAAE,IAAI;AACd,aAAA,CAAC;AACF,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QACvD;IACF;8GAvHW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/start-software-definition-flow.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport {\n AXPEntityService,\n buildAXPRecordWorkflowInfo,\n getRecordWorkflowInstanceId,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXP_WORKFLOW_ENGINE, type AXPWorkflowEngine } from '@acorex-platform/framework-client/workflow';\nimport { AXPCommand, resolveEntityActionRef, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n introductionValueText,\n RootConfig,\n SOFTWARE_DEFINITION_WORKFLOW_NAME,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class StartSoftwareDefinitionFlowCommand implements AXPCommand<unknown, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE) as AXPWorkflowEngine;\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<void> {\n const resolved = resolveEntityActionRef(input);\n const softwareId = resolveSoftwareText(resolved?.refId);\n if (!softwareId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.id-required',\n ),\n },\n };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n\n if (!software) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.not-found',\n ),\n },\n };\n }\n\n if (getRecordWorkflowInstanceId(software as never)) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.already-started',\n ),\n },\n };\n }\n\n const ownerId =\n introductionValueText(software.ownerId) ||\n introductionValueText(software.owner) ||\n resolveSoftwareText(this.sessionService.user?.id);\n const correlationId = `${RootConfig.entities.software.source}:${softwareId}:${SOFTWARE_DEFINITION_WORKFLOW_NAME}`;\n\n try {\n const startResponse = await this.workflowEngine.start({\n workflowId: SOFTWARE_DEFINITION_WORKFLOW_NAME,\n input: {\n softwareId,\n softwareTitle: resolveSoftwareText(software.title),\n ownerId,\n refId: softwareId,\n refType: RootConfig.entities.software.source,\n correlationId,\n },\n });\n\n const instanceId = startResponse.instanceId;\n if (!instanceId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n },\n };\n }\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .update(softwareId, {\n workflowInfo: buildAXPRecordWorkflowInfo({\n instanceId,\n definitionId: SOFTWARE_DEFINITION_WORKFLOW_NAME,\n correlationId,\n }),\n } as never);\n\n this.eventService.publish('task-board.refresh', { provider: SOFTWARE_DEFINITION_WORKFLOW_NAME });\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translationService.translateAsync(\n '@software-management:messages.start-flow.started',\n ),\n closeButton: true,\n timeOut: 6000,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: message,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAuBA;MAGa,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAsB;AACjE,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,G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AAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -102,67 +102,67 @@ class AXMSoftwareManagementModule {
102
102
  provideCommandSetups([
103
103
  {
104
104
  key: AXPSoftwareManagementCommandKeys.Software.StartFlow,
105
- command: () => import('./acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs').then((c) => c.StartSoftwareDefinitionFlowCommand),
105
+ command: () => import('./acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs').then((c) => c.StartSoftwareDefinitionFlowCommand),
106
106
  },
107
107
  {
108
108
  key: AXPSoftwareManagementCommandKeys.Software.CompletePhase,
109
- command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
109
+ command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
110
110
  },
111
111
  {
112
112
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.CompletePhase,
113
- command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
113
+ command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
114
114
  },
115
115
  {
116
116
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.LoadIntroduction,
117
- command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs').then((c) => c.LoadSoftwareIntroductionActivity),
117
+ command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs').then((c) => c.LoadSoftwareIntroductionActivity),
118
118
  },
119
119
  {
120
120
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.SaveIntroduction,
121
- command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs').then((c) => c.SaveSoftwareIntroductionActivity),
121
+ command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs').then((c) => c.SaveSoftwareIntroductionActivity),
122
122
  },
123
123
  {
124
124
  key: AXPSoftwareManagementCommandKeys.Software.AcceptSuggestion,
125
- command: () => import('./acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs').then((c) => c.AcceptSoftwareSuggestionCommand),
125
+ command: () => import('./acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs').then((c) => c.AcceptSoftwareSuggestionCommand),
126
126
  },
127
127
  {
128
128
  key: AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet,
129
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.GenerateDiscoveryKickoffCommand),
129
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.GenerateDiscoveryKickoffCommand),
130
130
  },
131
131
  {
132
132
  key: AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet,
133
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.SubmitDiscoveryKickoffCommand),
133
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.SubmitDiscoveryKickoffCommand),
134
134
  },
135
135
  {
136
136
  key: AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf,
137
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.ExportDiscoveryKickoffPdfCommand),
137
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.ExportDiscoveryKickoffPdfCommand),
138
138
  },
139
139
  {
140
140
  key: AXPSoftwareManagementCommandKeys.Software.OpenKickoffSheet,
141
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.OpenDiscoveryKickoffCommand),
141
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.OpenDiscoveryKickoffCommand),
142
142
  },
143
143
  {
144
144
  key: AXPSoftwareManagementCommandKeys.Software.ViewPinnedKickoff,
145
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.ViewPinnedKickoffCommand),
145
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.ViewPinnedKickoffCommand),
146
146
  },
147
147
  {
148
148
  key: AXPSoftwareManagementCommandKeys.Software.GenerateDiscoveryReport,
149
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.GenerateDiscoveryReportCommand),
149
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.GenerateDiscoveryReportCommand),
150
150
  },
151
151
  {
152
152
  key: AXPSoftwareManagementCommandKeys.Software.SubmitDiscoveryReport,
153
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.SubmitDiscoveryReportCommand),
153
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.SubmitDiscoveryReportCommand),
154
154
  },
155
155
  {
156
156
  key: AXPSoftwareManagementCommandKeys.Software.ExportDiscoveryReportPdf,
157
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.ExportDiscoveryReportPdfCommand),
157
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.ExportDiscoveryReportPdfCommand),
158
158
  },
159
159
  {
160
160
  key: AXPSoftwareManagementCommandKeys.Software.OpenDiscoveryReport,
161
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.OpenDiscoveryReportCommand),
161
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.OpenDiscoveryReportCommand),
162
162
  },
163
163
  {
164
164
  key: AXPSoftwareManagementCommandKeys.Software.LinkDiscoveryQuestionnaire,
165
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.LinkDiscoveryQuestionnaireCommand),
165
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.LinkDiscoveryQuestionnaireCommand),
166
166
  },
167
167
  ]),
168
168
  ] }); }
@@ -185,67 +185,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
185
185
  provideCommandSetups([
186
186
  {
187
187
  key: AXPSoftwareManagementCommandKeys.Software.StartFlow,
188
- command: () => import('./acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs').then((c) => c.StartSoftwareDefinitionFlowCommand),
188
+ command: () => import('./acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs').then((c) => c.StartSoftwareDefinitionFlowCommand),
189
189
  },
190
190
  {
191
191
  key: AXPSoftwareManagementCommandKeys.Software.CompletePhase,
192
- command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
192
+ command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
193
193
  },
194
194
  {
195
195
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.CompletePhase,
196
- command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
196
+ command: () => import('./acorex-platform-module-software-management-client-complete-software-phase.activity-Db4onrLu.mjs').then((c) => c.CompleteSoftwarePhaseActivity),
197
197
  },
198
198
  {
199
199
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.LoadIntroduction,
200
- command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs').then((c) => c.LoadSoftwareIntroductionActivity),
200
+ command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs').then((c) => c.LoadSoftwareIntroductionActivity),
201
201
  },
202
202
  {
203
203
  key: AXPSoftwareManagementCommandKeys.WorkflowActivity.SaveIntroduction,
204
- command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs').then((c) => c.SaveSoftwareIntroductionActivity),
204
+ command: () => import('./acorex-platform-module-software-management-client-introduction-task.activities-B2LZAxva.mjs').then((c) => c.SaveSoftwareIntroductionActivity),
205
205
  },
206
206
  {
207
207
  key: AXPSoftwareManagementCommandKeys.Software.AcceptSuggestion,
208
- command: () => import('./acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs').then((c) => c.AcceptSoftwareSuggestionCommand),
208
+ command: () => import('./acorex-platform-module-software-management-client-accept-software-suggestion.command-DA2fXjwV.mjs').then((c) => c.AcceptSoftwareSuggestionCommand),
209
209
  },
210
210
  {
211
211
  key: AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet,
212
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.GenerateDiscoveryKickoffCommand),
212
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.GenerateDiscoveryKickoffCommand),
213
213
  },
214
214
  {
215
215
  key: AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet,
216
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.SubmitDiscoveryKickoffCommand),
216
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.SubmitDiscoveryKickoffCommand),
217
217
  },
218
218
  {
219
219
  key: AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf,
220
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.ExportDiscoveryKickoffPdfCommand),
220
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.ExportDiscoveryKickoffPdfCommand),
221
221
  },
222
222
  {
223
223
  key: AXPSoftwareManagementCommandKeys.Software.OpenKickoffSheet,
224
- command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs').then((c) => c.OpenDiscoveryKickoffCommand),
224
+ command: () => import('./acorex-platform-module-software-management-client-discovery-kickoff.commands-Dyu8dhVp.mjs').then((c) => c.OpenDiscoveryKickoffCommand),
225
225
  },
226
226
  {
227
227
  key: AXPSoftwareManagementCommandKeys.Software.ViewPinnedKickoff,
228
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.ViewPinnedKickoffCommand),
228
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.ViewPinnedKickoffCommand),
229
229
  },
230
230
  {
231
231
  key: AXPSoftwareManagementCommandKeys.Software.GenerateDiscoveryReport,
232
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.GenerateDiscoveryReportCommand),
232
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.GenerateDiscoveryReportCommand),
233
233
  },
234
234
  {
235
235
  key: AXPSoftwareManagementCommandKeys.Software.SubmitDiscoveryReport,
236
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.SubmitDiscoveryReportCommand),
236
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.SubmitDiscoveryReportCommand),
237
237
  },
238
238
  {
239
239
  key: AXPSoftwareManagementCommandKeys.Software.ExportDiscoveryReportPdf,
240
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.ExportDiscoveryReportPdfCommand),
240
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.ExportDiscoveryReportPdfCommand),
241
241
  },
242
242
  {
243
243
  key: AXPSoftwareManagementCommandKeys.Software.OpenDiscoveryReport,
244
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.OpenDiscoveryReportCommand),
244
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.OpenDiscoveryReportCommand),
245
245
  },
246
246
  {
247
247
  key: AXPSoftwareManagementCommandKeys.Software.LinkDiscoveryQuestionnaire,
248
- command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs').then((c) => c.LinkDiscoveryQuestionnaireCommand),
248
+ command: () => import('./acorex-platform-module-software-management-client-discovery-report.commands-CypfcZhS.mjs').then((c) => c.LinkDiscoveryQuestionnaireCommand),
249
249
  },
250
250
  ]),
251
251
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex-platform/module-software-management-client",
3
- "version": "2.0.0-next.6",
3
+ "version": "2.0.0-next.61",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0 || ^22.0.0",