@acorex-platform/module-maintenance-management-client 0.0.33 → 0.0.37

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 (84) hide show
  1. package/fesm2022/{acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BiQlJxPX.mjs → acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BI7RNP_h.mjs} +13 -13
  2. package/fesm2022/{acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BiQlJxPX.mjs.map → acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BI7RNP_h.mjs.map} +1 -1
  3. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-asset-type.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-resource.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-cause.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-detection.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-effect.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mechanism.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-asset-type.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-mechanism.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-solution.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-cause.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-effect.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-mechanism.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-severity.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-type.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-activity-type.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-failure-mode.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-resource.mjs.map +1 -1
  24. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs.map +1 -1
  26. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-order.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-package.mjs.map +1 -1
  28. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-report.mjs.map +1 -1
  29. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-DJkKh0Qa.mjs.map +1 -1
  30. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity--Kz4Kqqe.mjs.map +1 -1
  31. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-C2OP2EN0.mjs.map +1 -1
  32. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-D9UUDRIS.mjs.map +1 -1
  33. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-glUcXwS9.mjs.map +1 -1
  34. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-CTp1voFW.mjs.map +1 -1
  35. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-ClD09en8.mjs.map +1 -1
  36. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-BcU0-nFS.mjs.map +1 -1
  37. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-N37srLVb.mjs.map +1 -1
  38. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-BkkvXk03.mjs.map +1 -1
  39. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-HlVVBMTA.mjs.map +1 -1
  40. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-BGJP73yC.mjs.map +1 -1
  41. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CLM9YuYF.mjs.map +1 -1
  42. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-DpLYMLsi.mjs.map +1 -1
  43. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-DqU2wP0I.mjs.map +1 -1
  44. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-BPZwEGE9.mjs.map +1 -1
  45. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-DaMUJOID.mjs.map +1 -1
  46. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-DkhVvBOh.mjs.map +1 -1
  47. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-WCiP2h8H.mjs.map +1 -1
  48. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-FWn7bmMX.mjs.map +1 -1
  49. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-DC5GTHYM.mjs.map +1 -1
  50. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-O6y3Q3U6.mjs.map +1 -1
  51. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-DFDajM9U.mjs.map +1 -1
  52. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-CGSHreth.mjs.map +1 -1
  53. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-GaQSPAmn.mjs.map +1 -1
  54. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-CJE8Txjo.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-BrActlGh.mjs.map +1 -1
  56. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs.map +1 -1
  57. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-xxvOfIxf.mjs → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-By_yjJjy.mjs} +2 -2
  58. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-xxvOfIxf.mjs.map → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-By_yjJjy.mjs.map} +1 -1
  59. package/fesm2022/acorex-platform-module-maintenance-management-client-failure-register-status.provider-CLBaQy_e.mjs.map +1 -1
  60. package/fesm2022/acorex-platform-module-maintenance-management-client-fill-work-report-completion.command-Capowl1e.mjs.map +1 -1
  61. package/fesm2022/acorex-platform-module-maintenance-management-client-local-entities.mjs.map +1 -1
  62. package/fesm2022/acorex-platform-module-maintenance-management-client-open-work-report-from-work-order.command-B0O4fWPt.mjs.map +1 -1
  63. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CxRfaf0G.mjs → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CcH5qKzv.mjs} +2 -2
  64. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CxRfaf0G.mjs.map → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CcH5qKzv.mjs.map} +1 -1
  65. package/fesm2022/acorex-platform-module-maintenance-management-client-resolve-person-user-id.activity-nwXAJHkd.mjs.map +1 -1
  66. package/fesm2022/acorex-platform-module-maintenance-management-client-resolve-work-order.activity-q5WM7Sv5.mjs.map +1 -1
  67. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B06a962Y.mjs → acorex-platform-module-maintenance-management-client-start-work-order-flow.command-CVlDdtxW.mjs} +2 -2
  68. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B06a962Y.mjs.map → acorex-platform-module-maintenance-management-client-start-work-order-flow.command-CVlDdtxW.mjs.map} +1 -1
  69. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-Di4R6LQl.mjs.map +1 -1
  70. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CzkCCl1L.mjs → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CZwXs7XY.mjs} +2 -2
  71. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CzkCCl1L.mjs.map → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CZwXs7XY.mjs.map} +1 -1
  72. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-_B0SUFtQ.mjs.map +1 -1
  73. package/fesm2022/acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-RA2zaQHH.mjs.map +1 -1
  74. package/fesm2022/acorex-platform-module-maintenance-management-client-work-order-list-command-Bh_6PS5w.mjs.map +1 -1
  75. package/fesm2022/acorex-platform-module-maintenance-management-client-work-order-status.provider-DvBk5kAW.mjs.map +1 -1
  76. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-Bf1WZWIS.mjs → acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs} +2 -2
  77. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-Bf1WZWIS.mjs.map → acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs.map} +1 -1
  78. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-Dth3Z9fW.mjs → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-yzj-D7MB.mjs} +3 -3
  79. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-Dth3Z9fW.mjs.map → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-yzj-D7MB.mjs.map} +1 -1
  80. package/fesm2022/acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs.map +1 -1
  81. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BSFW0Yt-.mjs → acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs} +2 -2
  82. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BSFW0Yt-.mjs.map → acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs.map} +1 -1
  83. package/fesm2022/acorex-platform-module-maintenance-management-client.mjs +1 -1
  84. package/package.json +1 -1
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
4
4
  import { inject, Injectable } from '@angular/core';
5
5
  import { isString } from 'lodash';
6
6
  import { RootConfig, AXMWorkOrderStatus } from '@acorex-platform/module-maintenance-management-client/contracts';
7
- import { A as AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BiQlJxPX.mjs';
7
+ import { A as AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BI7RNP_h.mjs';
8
8
 
9
9
  //#region ---- Imports ----
10
10
  //#endregion
@@ -93,4 +93,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
93
93
  }] });
94
94
 
95
95
  export { UpdateWorkOrderInProgressActivity };
96
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CzkCCl1L.mjs.map
96
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CZwXs7XY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CzkCCl1L.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/update-work-order-in-progress.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPDebugService } from '@acorex-platform/framework-client/core';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { isString } from 'lodash';\n\nimport { AXMWorkOrderStatus, RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\nimport type { AXMMaintenanceManagementWorkOrderEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface UpdateWorkOrderInProgressInput {\n workOrderId: string;\n}\n\nexport interface UpdateWorkOrderInProgressOutput {\n workOrderId: string;\n statusId: string;\n startedAt: string | null;\n skipped: boolean;\n}\n\n//#endregion\n\n/**\n * Sets the work order to in-progress when it is not already in that state.\n */\n@Injectable({ providedIn: 'root' })\nexport class UpdateWorkOrderInProgressActivity\n implements AXPCommand<UpdateWorkOrderInProgressInput, UpdateWorkOrderInProgressOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly debug = inject(AXPDebugService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: UpdateWorkOrderInProgressInput,\n ): AXPCommandExecuteResultPromise<UpdateWorkOrderInProgressOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as AXMMaintenanceManagementWorkOrderEntityModel | null;\n\n if (!workOrder?.id) {\n return {\n success: false,\n message: { text: 'Work order not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (workOrder.statusId === AXMWorkOrderStatus.InProgress) {\n return { success: true, kind: 'object',\n data: {\n workOrderId,\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt: workOrder.startedAt ?? null,\n skipped: true,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n if (workOrder.statusId === AXMWorkOrderStatus.Completed || workOrder.statusId === AXMWorkOrderStatus.SignedOff) {\n return {\n success: false,\n message: { text: 'Work order is already completed.' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const startedAt = this.resolveText(workOrder.startedAt) || new Date().toISOString();\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .update(workOrderId, {\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt,\n } as never);\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-order-status',\n 'Work order set to in-progress',\n { workOrderId, startedAt, previousStatusId: workOrder.statusId },\n );\n\n return { success: true, kind: 'object',\n data: {\n workOrderId,\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt,\n skipped: false,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AA4BA;AAEA;;AAEG;MAEU,iCAAiC,CAAA;AAD9C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC;AA0FjD,IAAA;;;IApFC,MAAM,OAAO,CACX,KAAqC,EAAA;QAErC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;AAC5C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;AAEA,QAAA,MAAM,SAAS,IAAI,MAAM,IAAI,CAAC;AAC3B,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI;AACrE,aAAA,IAAI;AACJ,aAAA,KAAK,CAAC,WAAW,CAAC,CAAwD;AAE7E,QAAA,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE;YAClB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;AACzC,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,UAA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OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;AACpC,YAAA,IAAI,EAAE;gBACJ,WAAW;gBACX,QAAQ,EAAE,kBAAkB,CAAC,UAAU;gBACvC,SAAS;AACT,gBAAA,OAAO,EAAE,KAAK;AACf,aAAA;AACD,YAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;SAC9B;IACH;;;AAMQ,IAAA,WAAW,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GA7FW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CZwXs7XY.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/update-work-order-in-progress.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPDebugService } from '@acorex-platform/framework-client/core';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { isString } from 'lodash';\n\nimport { AXMWorkOrderStatus, RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\nimport type { AXMMaintenanceManagementWorkOrderEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface UpdateWorkOrderInProgressInput {\n workOrderId: string;\n}\n\nexport interface UpdateWorkOrderInProgressOutput {\n workOrderId: string;\n statusId: string;\n startedAt: string | null;\n skipped: boolean;\n}\n\n//#endregion\n\n/**\n * Sets the work order to in-progress when it is not already in that state.\n */\n@Injectable({ providedIn: 'root' })\nexport class UpdateWorkOrderInProgressActivity\n implements AXPCommand<UpdateWorkOrderInProgressInput, UpdateWorkOrderInProgressOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly debug = inject(AXPDebugService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: UpdateWorkOrderInProgressInput,\n ): AXPCommandExecuteResultPromise<UpdateWorkOrderInProgressOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as AXMMaintenanceManagementWorkOrderEntityModel | null;\n\n if (!workOrder?.id) {\n return {\n success: false,\n message: { text: 'Work order not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (workOrder.statusId === AXMWorkOrderStatus.InProgress) {\n return { success: true, kind: 'object',\n data: {\n workOrderId,\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt: workOrder.startedAt ?? null,\n skipped: true,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n if (workOrder.statusId === AXMWorkOrderStatus.Completed || workOrder.statusId === AXMWorkOrderStatus.SignedOff) {\n return {\n success: false,\n message: { text: 'Work order is already completed.' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const startedAt = this.resolveText(workOrder.startedAt) || new Date().toISOString();\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .update(workOrderId, {\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt,\n } as never);\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-order-status',\n 'Work order set to in-progress',\n { workOrderId, startedAt, previousStatusId: workOrder.statusId },\n );\n\n return { success: true, kind: 'object',\n data: {\n workOrderId,\n statusId: AXMWorkOrderStatus.InProgress,\n startedAt,\n skipped: false,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AA4BA;AAEA;;AAEG;MAEU,iCAAiC,CAAA;AAD9C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC;AA0FjD,IAAA;;;IApFC,MAAM,OAAO,CACX,KAAqC,EAAA;QAErC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;AAC5C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;AAEA,QAAA,MAAM,SAAS,IAAI,MAAM,IAAI,CAAC;AAC3B,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,C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J,MAAM,CAAC,WAAW,EAAE;YACnB,QAAQ,EAAE,kBAAkB,CAAC,UAAU;YACvC,SAAS;AACD,SAAA,CAAC;QAEb,IAAI,CAAC,KAAK,CAAC,KAAK,CACd,uCAAuC,EACvC,mBAAmB,EACnB,+BAA+B,EAC/B,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,CAAC,QAAQ,EAAE,CACjE;AAED,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;AACpC,YAAA,IAAI,EAAE;gBACJ,WAAW;gBACX,QAAQ,EAAE,kBAAkB,CAAC,UAAU;gBACvC,SAAS;AACT,gBAAA,OAAO,EAAE,KAAK;AACf,aAAA;AACD,YAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;SAC9B;IACH;;;AAMQ,IAAA,WAAW,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GA7FW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-_B0SUFtQ.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/update-work-report-on-completion.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { get, isNumber, isString } from 'lodash';\n\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkOrderEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { isWorkReportEditable, isWorkReportFinalized } from '../../../work-report/work-report-assessment.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface UpdateWorkReportOnCompletionInput {\n workOrderId: string;\n workReportId: string;\n /** Flat field or nested form payload from fill-work-report-completion (workflow `outputs.result`). */\n result?: string | Record<string, unknown>;\n summary?: string;\n actionTaken?: string;\n recommendation?: string;\n laborHours?: number;\n downtimeMinutes?: number;\n endedAt?: string;\n needFollowUp?: boolean;\n}\n\nexport interface UpdateWorkReportOnCompletionOutput {\n workReportId: string;\n workOrderId: string;\n}\n\n//#endregion\n\n/**\n * Updates completion fields on an existing work report after the technician submits the completion form.\n * Checklist references are persisted by {@link RecordWorkReportAssessmentActivity} on checklist submit.\n */\n@Injectable({ providedIn: 'root' })\nexport class UpdateWorkReportOnCompletionActivity\n implements AXPCommand<UpdateWorkReportOnCompletionInput, UpdateWorkReportOnCompletionOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: UpdateWorkReportOnCompletionInput,\n ): AXPCommandExecuteResultPromise<UpdateWorkReportOnCompletionOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n const workReportId = this.resolveText(input?.workReportId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (!workReportId) {\n return {\n success: false,\n message: { text: 'workReportId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workReport = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(workReportId)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n\n if (!workReport?.id) {\n return {\n success: false,\n message: { text: 'Work report not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (this.resolveText(workReport.workOrderId) !== workOrderId) {\n return {\n success: false,\n message: { text: 'Work report does not belong to the work order' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as AXMMaintenanceManagementWorkOrderEntityModel | null;\n\n if (isWorkReportFinalized(workReport) || !isWorkReportEditable(workReport, workOrder)) {\n return {\n success: false,\n message: { text: 'Work report is not editable' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const formSource = this.resolveFormSource(input);\n const update: Partial<AXMMaintenanceManagementWorkReportEntityModel> = {\n result: this.resolveOptionalText(get(formSource, 'result')),\n summary: this.resolveOptionalText(get(formSource, 'summary')),\n actionTaken: this.resolveOptionalText(get(formSource, 'actionTaken')),\n recommendation: this.resolveOptionalText(get(formSource, 'recommendation')),\n laborHours: this.resolveLaborHours(get(formSource, 'laborHours'), workOrder?.actualHours),\n downtimeMinutes: this.resolveDowntimeMinutes(get(formSource, 'downtimeMinutes'), workOrder?.downtimeMinutes),\n endedAt: this.resolveEndedAt(get(formSource, 'endedAt')),\n needFollowUp: get(formSource, 'needFollowUp') === true,\n };\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .update(workReportId, update as never);\n\n return { success: true, kind: 'object',\n data: { workReportId, workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveFormSource(input: UpdateWorkReportOnCompletionInput): Record<string, unknown> {\n const nested = input.result;\n if (nested && typeof nested === 'object' && !Array.isArray(nested)) {\n return nested;\n }\n return input as unknown as Record<string, unknown>;\n }\n\n private resolveLaborHours(explicit: unknown, fromWorkOrder: unknown): number | undefined {\n if (isNumber(explicit) && explicit >= 0) {\n return explicit;\n }\n if (isNumber(fromWorkOrder) && fromWorkOrder >= 0) {\n return fromWorkOrder;\n }\n return undefined;\n }\n\n private resolveDowntimeMinutes(explicit: unknown, fromWorkOrder: unknown): number | undefined {\n if (isNumber(explicit) && explicit >= 0) {\n return explicit;\n }\n if (isNumber(fromWorkOrder) && fromWorkOrder >= 0) {\n return fromWorkOrder;\n }\n return undefined;\n }\n\n private resolveEndedAt(value: unknown): Date {\n const text = this.resolveOptionalText(value);\n if (text) {\n const parsed = new Date(text);\n if (!Number.isNaN(parsed.getTime())) {\n return parsed;\n }\n }\n return new Date();\n }\n\n private resolveOptionalText(value: unknown): string | undefined {\n const text = this.resolveText(value);\n return text || undefined;\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;AAoCA;AAEA;;;AAGG;MAEU,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AA6I1D,IAAA;;;IAvIC,MAAM,OAAO,CACX,KAAwC,EAAA;QAExC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC;QAE1D,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;AAC5C,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O,EAAE,CAAC,EAAE;AACnC,gBAAA,OAAO,MAAM;YACf;QACF;QACA,OAAO,IAAI,IAAI,EAAE;IACnB;AAEQ,IAAA,mBAAmB,CAAC,KAAc,EAAA;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QACpC,OAAO,IAAI,IAAI,SAAS;IAC1B;AAEQ,IAAA,WAAW,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GA/IW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApC,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,oCAAoC,cADvB,MAAM,EAAA,CAAA,CAAA;;2FACnB,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-_B0SUFtQ.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/update-work-report-on-completion.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { get, isNumber, isString } from 'lodash';\n\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkOrderEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { isWorkReportEditable, isWorkReportFinalized } from '../../../work-report/work-report-assessment.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface UpdateWorkReportOnCompletionInput {\n workOrderId: string;\n workReportId: string;\n /** Flat field or nested form payload from fill-work-report-completion (workflow `outputs.result`). */\n result?: string | Record<string, unknown>;\n summary?: string;\n actionTaken?: string;\n recommendation?: string;\n laborHours?: number;\n downtimeMinutes?: number;\n endedAt?: string;\n needFollowUp?: boolean;\n}\n\nexport interface UpdateWorkReportOnCompletionOutput {\n workReportId: string;\n workOrderId: string;\n}\n\n//#endregion\n\n/**\n * Updates completion fields on an existing work report after the technician submits the completion form.\n * Checklist references are persisted by {@link RecordWorkReportAssessmentActivity} on checklist submit.\n */\n@Injectable({ providedIn: 'root' })\nexport class UpdateWorkReportOnCompletionActivity\n implements AXPCommand<UpdateWorkReportOnCompletionInput, UpdateWorkReportOnCompletionOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: UpdateWorkReportOnCompletionInput,\n ): AXPCommandExecuteResultPromise<UpdateWorkReportOnCompletionOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n const workReportId = this.resolveText(input?.workReportId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (!workReportId) {\n return {\n success: false,\n message: { text: 'workReportId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workReport = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(workReportId)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n\n if (!workReport?.id) {\n return {\n success: false,\n message: { text: 'Work report not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (this.resolveText(workReport.workOrderId) !== workOrderId) {\n return {\n success: false,\n message: { text: 'Work report does not belong to the work order' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as AXMMaintenanceManagementWorkOrderEntityModel | null;\n\n if (isWorkReportFinalized(workReport) || !isWorkReportEditable(workReport, workOrder)) {\n return {\n success: false,\n message: { text: 'Work report is not editable' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const formSource = this.resolveFormSource(input);\n const update: Partial<AXMMaintenanceManagementWorkReportEntityModel> = {\n result: this.resolveOptionalText(get(formSource, 'result')),\n summary: this.resolveOptionalText(get(formSource, 'summary')),\n actionTaken: this.resolveOptionalText(get(formSource, 'actionTaken')),\n recommendation: this.resolveOptionalText(get(formSource, 'recommendation')),\n laborHours: this.resolveLaborHours(get(formSource, 'laborHours'), workOrder?.actualHours),\n downtimeMinutes: this.resolveDowntimeMinutes(get(formSource, 'downtimeMinutes'), workOrder?.downtimeMinutes),\n endedAt: this.resolveEndedAt(get(formSource, 'endedAt')),\n needFollowUp: get(formSource, 'needFollowUp') === true,\n };\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .update(workReportId, update as never);\n\n return { success: true, kind: 'object',\n data: { workReportId, workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveFormSource(input: UpdateWorkReportOnCompletionInput): Record<string, unknown> {\n const nested = input.result;\n if (nested && typeof nested === 'object' && !Array.isArray(nested)) {\n return nested;\n }\n return input as unknown as Record<string, unknown>;\n }\n\n private resolveLaborHours(explicit: unknown, fromWorkOrder: unknown): number | undefined {\n if (isNumber(explicit) && explicit >= 0) {\n return explicit;\n }\n if (isNumber(fromWorkOrder) && fromWorkOrder >= 0) {\n return fromWorkOrder;\n }\n return undefined;\n }\n\n private resolveDowntimeMinutes(explicit: unknown, fromWorkOrder: unknown): number | undefined {\n if (isNumber(explicit) && explicit >= 0) {\n return explicit;\n }\n if (isNumber(fromWorkOrder) && fromWorkOrder >= 0) {\n return fromWorkOrder;\n }\n return undefined;\n }\n\n private resolveEndedAt(value: unknown): Date {\n const text = this.resolveOptionalText(value);\n if (text) {\n const parsed = new Date(text);\n if (!Number.isNaN(parsed.getTime())) {\n return parsed;\n }\n }\n return new Date();\n }\n\n private resolveOptionalText(value: unknown): string | undefined {\n const text = this.resolveText(value);\n return text || undefined;\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;AAoCA;AAEA;;;AAGG;MAEU,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AA6I1D,IAAA;;;IAvIC,MAAM,OAAO,CACX,KAAwC,EAAA;QAExC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QACxD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC;QAE1D,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;AAC5C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;QAEA,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;AAC7C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;AAEA,QAAA,MAAM,UAAU,IAAI,MAAM,IAAI,CAAC;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AAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GA/IW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApC,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,oCAAoC,cADvB,MAAM,EAAA,CAAA,CAAA;;2FACnB,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-RA2zaQHH.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/validate-work-order-completion.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport { AXMWorkOrderStatus, RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface ValidateWorkOrderCompletionInput {\n workOrderId: string;\n}\n\nexport interface ValidateWorkOrderCompletionOutput {\n valid: boolean;\n workReportId?: string | null;\n}\n\n//#endregion\n\n/**\n * Validates that a work order can be completed.\n * TODO: enforce required questionnaire/checklist responses when multi-stage questionnaires are wired for execution.\n */\n@Injectable({ providedIn: 'root' })\nexport class ValidateWorkOrderCompletionActivity\n implements AXPCommand<ValidateWorkOrderCompletionInput, ValidateWorkOrderCompletionOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: ValidateWorkOrderCompletionInput,\n ): AXPCommandExecuteResultPromise<ValidateWorkOrderCompletionOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as { statusId?: string } | null;\n\n if (!workOrder) {\n return {\n success: false,\n message: { text: 'Work order not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (workOrder.statusId !== AXMWorkOrderStatus.InProgress) {\n return {\n success: false,\n message: { text: 'Work order must be in progress before it can be completed.' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workReportPage = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n const workReport = defaultTo(get(workReportPage, 'items[0]'), null) as { id?: string } | null;\n const workReportId = workReport?.id?.trim() || null;\n\n // TODO: when WorkReport becomes mandatory for completion, fail when workReportId is missing.\n // TODO: validate assessments on WorkReport when completion checklists are enabled.\n\n return { success: true, kind: 'object',\n data: { valid: true, workReportId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAuBA;AAEA;;;AAGG;MAEU,mCAAmC,CAAA;AADhD,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC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","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/validate-work-order-completion.activity.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport { AXMWorkOrderStatus, RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface ValidateWorkOrderCompletionInput {\n workOrderId: string;\n}\n\nexport interface ValidateWorkOrderCompletionOutput {\n valid: boolean;\n workReportId?: string | null;\n}\n\n//#endregion\n\n/**\n * Validates that a work order can be completed.\n * TODO: enforce required questionnaire/checklist responses when multi-stage questionnaires are wired for execution.\n */\n@Injectable({ providedIn: 'root' })\nexport class ValidateWorkOrderCompletionActivity\n implements AXPCommand<ValidateWorkOrderCompletionInput, ValidateWorkOrderCompletionOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(\n input: ValidateWorkOrderCompletionInput,\n ): AXPCommandExecuteResultPromise<ValidateWorkOrderCompletionOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workOrder = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workOrder.name)\n .data()\n .byKey(workOrderId)) as { statusId?: string } | null;\n\n if (!workOrder) {\n return {\n success: false,\n message: { text: 'Work order not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n if (workOrder.statusId !== AXMWorkOrderStatus.InProgress) {\n return {\n success: false,\n message: { text: 'Work order must be in progress before it can be completed.' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const workReportPage = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n const workReport = defaultTo(get(workReportPage, 'items[0]'), null) as { id?: string } | null;\n const workReportId = workReport?.id?.trim() || null;\n\n // TODO: when WorkReport becomes mandatory for completion, fail when workReportId is missing.\n // TODO: validate assessments on WorkReport when completion checklists are enabled.\n\n return { success: true, kind: 'object',\n data: { valid: true, workReportId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAuBA;AAEA;;;AAGG;MAEU,mCAAmC,CAAA;AADhD,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AA2E1D,IAAA;;;IArEC,MAAM,OAAO,CACX,KAAuC,EAAA;QAEvC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QACxD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;AAC5C,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;AAEA,QAAA,MAAM,SAAS,IAAI,MAAM,IAAI,CAAC;AAC3B,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI;AACrE,aAAA,IAAI;AACJ,aAAA,KAAK,CAAC,WAAW,CAAC,CAAiC;QAEtD,IAAI,CAAC,SAAS,EAA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EAAE;SAC9B;IACH;;;AAMQ,IAAA,WAAW,CAAC,KAAc,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GA7EW,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,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,mCAAmC,cADtB,MAAM,EAAA,CAAA,CAAA;;2FACnB,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-list-command-Bh_6PS5w.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/commands/work-order-list-command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { Injectable, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n/** Asset detail route segments (must match AssetManagement entity registration). */\nconst ASSET_DETAIL_MODULE = 'AssetManagement';\nconst ASSET_DETAIL_ENTITY = 'Asset';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface WorkOrderListCommandInput {\n entity: string;\n conditions?: Array<{ name?: string; operator?: unknown; value?: unknown }>;\n}\n\ntype WorkOrderListCommandInvocation = Partial<WorkOrderListCommandInput> & {\n data?: Record<string, unknown>;\n options?: Partial<WorkOrderListCommandInput> & { entity?: string; conditions?: WorkOrderListCommandInput['conditions'] };\n};\n\ninterface ListFilterQuery {\n field: string;\n operator: { type: string };\n value: unknown;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable()\nexport class WorkOrderListCommand implements AXPCommand<WorkOrderListCommandInput, void> {\n private readonly router = inject(Router);\n private readonly sessionService = inject(AXPSessionService);\n\n private resolvePayload(input: WorkOrderListCommandInvocation): WorkOrderListCommandInput | null {\n const entity =\n (typeof input.entity === 'string' && input.entity.trim() ? input.entity : undefined) ??\n (typeof input.options?.entity === 'string' && input.options?.entity?.trim()\n ? input.options.entity\n : undefined);\n\n if (!entity) {\n return null;\n }\n\n const conditions = input.conditions ?? input.options?.conditions;\n return { entity, ...(Array.isArray(conditions) ? { conditions } : {}) };\n }\n\n private buildFilterQueries(conditions: WorkOrderListCommandInput['conditions']): ListFilterQuery[] {\n if (!Array.isArray(conditions)) {\n return [];\n }\n\n const filters: ListFilterQuery[] = [];\n\n for (const condition of conditions) {\n const field =\n (typeof condition.name === 'string' && condition.name) ||\n (typeof (condition as { field?: string }).field === 'string'\n ? (condition as { field: string }).field\n : undefined);\n\n if (!field || condition.value === undefined || condition.value === null || condition.value === '') {\n continue;\n }\n\n const operator =\n condition.operator && typeof condition.operator === 'object' && 'type' in condition.operator\n ? (condition.operator as { type: string })\n : { type: 'equal' };\n\n filters.push({ field, operator, value: condition.value });\n }\n\n return filters;\n }\n\n private resolveAssetIdFromContext(input: WorkOrderListCommandInvocation): string | null {\n const data = input.data;\n if (!data || typeof data !== 'object') {\n return null;\n }\n\n const record = data as Record<string, unknown>;\n const assetId = record['assetId'];\n if (typeof assetId === 'string' && assetId.trim()) {\n return assetId;\n }\n\n const asset = record['asset'];\n if (asset && typeof asset === 'object' && typeof (asset as { id?: unknown }).id === 'string') {\n return (asset as { id: string }).id;\n }\n\n return null;\n }\n\n private findAssetDetailsRoute(): ActivatedRoute | null {\n const stack: ActivatedRoute[] = [this.router.routerState.root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current) {\n continue;\n }\n\n const module = current.snapshot.paramMap.get('module');\n const entity = current.snapshot.paramMap.get('entity');\n const id = current.snapshot.paramMap.get('id');\n const onViewRoute = current.snapshot.url.some((segment) => segment.path === 'view');\n\n if (onViewRoute && module === ASSET_DETAIL_MODULE && entity === ASSET_DETAIL_ENTITY && id) {\n return current;\n }\n\n stack.push(...current.children);\n }\n\n return null;\n }\n\n private buildWorkOrderPageQueryParams(\n conditions: WorkOrderListCommandInput['conditions'],\n ): Record<string, string> {\n const queryParams: Record<string, string> = {\n page: RootConfig.entities.workOrder.name,\n };\n\n const filterQueries = this.buildFilterQueries(conditions);\n if (filterQueries.length > 0) {\n queryParams['filters'] = JSON.stringify(filterQueries);\n }\n\n return queryParams;\n }\n\n private async navigateWithinCurrentAssetDetails(\n assetDetailsRoute: ActivatedRoute,\n conditions: WorkOrderListCommandInput['conditions'],\n ): Promise<void> {\n await this.router.navigate([], {\n relativeTo: assetDetailsRoute,\n queryParams: this.buildWorkOrderPageQueryParams(conditions),\n queryParamsHandling: 'merge',\n });\n }\n\n private async navigateToAssetWorkOrdersPage(\n assetId: string,\n conditions: WorkOrderListCommandInput['conditions'],\n ): Promise<void> {\n const appName = this.sessionService.application?.name;\n if (!appName) {\n throw new Error('Application name is required to open work orders in asset layout.');\n }\n\n const queryParams = this.buildWorkOrderPageQueryParams(conditions);\n const queryString = new URLSearchParams(queryParams).toString();\n const path = `/${appName}/m/${ASSET_DETAIL_MODULE}/e/${ASSET_DETAIL_ENTITY}/${assetId}/view`;\n const url = queryString ? `${path}?${queryString}` : path;\n\n await this.router.navigateByUrl(url);\n }\n\n async execute(input: WorkOrderListCommandInvocation): AXPCommandExecuteResultPromise<void> {\n try {\n const payload = this.resolvePayload(input);\n if (!payload) {\n return {\n success: false,\n message: { text: 'Entity is required for Entity:List command.' },\n };\n }\n\n const assetDetailsRoute = this.findAssetDetailsRoute();\n if (assetDetailsRoute) {\n await this.navigateWithinCurrentAssetDetails(assetDetailsRoute, payload.conditions);\n return { success: true, kind: 'object', data: undefined };\n }\n\n const assetId = this.resolveAssetIdFromContext(input);\n if (!assetId) {\n return {\n success: false,\n message: {\n text: 'Cannot open work orders in asset layout: asset id is missing on the maintenance plan.',\n },\n };\n }\n\n await this.navigateToAssetWorkOrdersPage(assetId, payload.conditions);\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n return {\n success: false,\n message: {\n text: `Failed to open work orders in asset layout: ${error instanceof Error ? error.message : String(error)}`,\n },\n };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAUA;AACA,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,mBAAmB,GAAG,OAAO;AAsBnC;AAEA;MAGa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AA0K5D,IAAA;AAxKS,IAAA,cAAc,CAAC,KAAqC,EAAA;QAC1D,MAAM,MAAM,GACV,CAAC,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS;AACnF,aAAC,OAAO,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI;AACvE,kBAAE,KAAK,CAAC,OAAO,CAAC;kBACd,SAAS,CAAC;QAEhB,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,IAAI;QACb;QAEA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU;QAChE,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,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AC9G,iBAAA;aACF;QACH;IACF;8GA3KW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-list-command-Bh_6PS5w.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/commands/work-order-list-command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { Injectable, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n/** Asset detail route segments (must match AssetManagement entity registration). */\nconst ASSET_DETAIL_MODULE = 'AssetManagement';\nconst ASSET_DETAIL_ENTITY = 'Asset';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface WorkOrderListCommandInput {\n entity: string;\n conditions?: Array<{ name?: string; operator?: unknown; value?: unknown }>;\n}\n\ntype WorkOrderListCommandInvocation = Partial<WorkOrderListCommandInput> & {\n data?: Record<string, unknown>;\n options?: Partial<WorkOrderListCommandInput> & { entity?: string; conditions?: WorkOrderListCommandInput['conditions'] };\n};\n\ninterface ListFilterQuery {\n field: string;\n operator: { type: string };\n value: unknown;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable()\nexport class WorkOrderListCommand implements AXPCommand<WorkOrderListCommandInput, void> {\n private readonly router = inject(Router);\n private readonly sessionService = inject(AXPSessionService);\n\n private resolvePayload(input: WorkOrderListCommandInvocation): WorkOrderListCommandInput | null {\n const entity =\n (typeof input.entity === 'string' && input.entity.trim() ? input.entity : undefined) ??\n (typeof input.options?.entity === 'string' && input.options?.entity?.trim()\n ? input.options.entity\n : undefined);\n\n if (!entity) {\n return null;\n }\n\n const conditions = input.conditions ?? input.options?.conditions;\n return { entity, ...(Array.isArray(conditions) ? { conditions } : {}) };\n }\n\n private buildFilterQueries(conditions: WorkOrderListCommandInput['conditions']): ListFilterQuery[] {\n if (!Array.isArray(conditions)) {\n return [];\n }\n\n const filters: ListFilterQuery[] = [];\n\n for (const condition of conditions) {\n const field =\n (typeof condition.name === 'string' && condition.name) ||\n (typeof (condition as { field?: string }).field === 'string'\n ? (condition as { field: string }).field\n : undefined);\n\n if (!field || condition.value === undefined || condition.value === null || condition.value === '') {\n continue;\n }\n\n const operator =\n condition.operator && typeof condition.operator === 'object' && 'type' in condition.operator\n ? (condition.operator as { type: string })\n : { type: 'equal' };\n\n filters.push({ field, operator, value: condition.value });\n }\n\n return filters;\n }\n\n private resolveAssetIdFromContext(input: WorkOrderListCommandInvocation): string | null {\n const data = input.data;\n if (!data || typeof data !== 'object') {\n return null;\n }\n\n const record = data as Record<string, unknown>;\n const assetId = record['assetId'];\n if (typeof assetId === 'string' && assetId.trim()) {\n return assetId;\n }\n\n const asset = record['asset'];\n if (asset && typeof asset === 'object' && typeof (asset as { id?: unknown }).id === 'string') {\n return (asset as { id: string }).id;\n }\n\n return null;\n }\n\n private findAssetDetailsRoute(): ActivatedRoute | null {\n const stack: ActivatedRoute[] = [this.router.routerState.root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current) {\n continue;\n }\n\n const module = current.snapshot.paramMap.get('module');\n const entity = current.snapshot.paramMap.get('entity');\n const id = current.snapshot.paramMap.get('id');\n const onViewRoute = current.snapshot.url.some((segment) => segment.path === 'view');\n\n if (onViewRoute && module === ASSET_DETAIL_MODULE && entity === ASSET_DETAIL_ENTITY && id) {\n return current;\n }\n\n stack.push(...current.children);\n }\n\n return null;\n }\n\n private buildWorkOrderPageQueryParams(\n conditions: WorkOrderListCommandInput['conditions'],\n ): Record<string, string> {\n const queryParams: Record<string, string> = {\n page: RootConfig.entities.workOrder.name,\n };\n\n const filterQueries = this.buildFilterQueries(conditions);\n if (filterQueries.length > 0) {\n queryParams['filters'] = JSON.stringify(filterQueries);\n }\n\n return queryParams;\n }\n\n private async navigateWithinCurrentAssetDetails(\n assetDetailsRoute: ActivatedRoute,\n conditions: WorkOrderListCommandInput['conditions'],\n ): Promise<void> {\n await this.router.navigate([], {\n relativeTo: assetDetailsRoute,\n queryParams: this.buildWorkOrderPageQueryParams(conditions),\n queryParamsHandling: 'merge',\n });\n }\n\n private async navigateToAssetWorkOrdersPage(\n assetId: string,\n conditions: WorkOrderListCommandInput['conditions'],\n ): Promise<void> {\n const appName = this.sessionService.application?.name;\n if (!appName) {\n throw new Error('Application name is required to open work orders in asset layout.');\n }\n\n const queryParams = this.buildWorkOrderPageQueryParams(conditions);\n const queryString = new URLSearchParams(queryParams).toString();\n const path = `/${appName}/m/${ASSET_DETAIL_MODULE}/e/${ASSET_DETAIL_ENTITY}/${assetId}/view`;\n const url = queryString ? `${path}?${queryString}` : path;\n\n await this.router.navigateByUrl(url);\n }\n\n async execute(input: WorkOrderListCommandInvocation): AXPCommandExecuteResultPromise<void> {\n try {\n const payload = this.resolvePayload(input);\n if (!payload) {\n return {\n success: false,\n message: { text: 'Entity is required for Entity:List command.' },\n };\n }\n\n const assetDetailsRoute = this.findAssetDetailsRoute();\n if (assetDetailsRoute) {\n await this.navigateWithinCurrentAssetDetails(assetDetailsRoute, payload.conditions);\n return { success: true, kind: 'object', data: undefined };\n }\n\n const assetId = this.resolveAssetIdFromContext(input);\n if (!assetId) {\n return {\n success: false,\n message: {\n text: 'Cannot open work orders in asset layout: asset id is missing on the maintenance plan.',\n },\n };\n }\n\n await this.navigateToAssetWorkOrdersPage(assetId, payload.conditions);\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n return {\n success: false,\n message: {\n text: `Failed to open work orders in asset layout: ${error instanceof Error ? error.message : String(error)}`,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AI,CAAC,qBAAqB,EAAE;YACtD,IAAI,iBAAiB,EAAE;gBACrB,MAAM,IAAI,CAAC,iCAAiC,CAAC,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC;AACnF,gBAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D;YAEA,MAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC;YACrD,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACP,wBAAA,IAAI,EAAE,uFAAuF;AAC9F,qBAAA;iBACF;YACH;YAEA,MAAM,IAAI,CAAC,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;AACrE,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3D;QAAE,OAAO,KAAc,EAAE;YACvB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,CAAA,4CAAA,EAA+C,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,CAAE;AAC9G,iBAAA;aACF;QACH;IACF;8GA3KW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-status.provider-DvBk5kAW.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order-status.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXPStatusProvider, AXPStatusTransition } from '@acorex-platform/framework-shared/core';\n\nimport { AXMWorkOrderStatus } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Status provider ----\n\nexport class AXMMaintenanceManagementWorkOrderStatusProvider extends AXPStatusProvider {\n readonly key = 'maintenance-management.status.work-order';\n\n readonly statuses = [\n {\n name: AXMWorkOrderStatus.Planned,\n title: '@maintenance-management:work-orders.states.planned',\n icon: 'fa-light fa-clipboard-list',\n color: 'secondary' as AXStyleColorType,\n order: 1,\n isInitial: true,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.states.scheduled',\n icon: 'fa-light fa-calendar-clock',\n color: 'info' as AXStyleColorType,\n order: 2,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.states.assigned',\n icon: 'fa-light fa-user-check',\n color: 'info' as AXStyleColorType,\n order: 3,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.states.in-progress',\n icon: 'fa-light fa-screwdriver-wrench',\n color: 'warning' as AXStyleColorType,\n order: 4,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.OnHold,\n title: '@maintenance-management:work-orders.states.on-hold',\n icon: 'fa-light fa-pause',\n color: 'warning' as AXStyleColorType,\n order: 5,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Completed,\n title: '@maintenance-management:work-orders.states.completed',\n icon: 'fa-light fa-circle-check',\n color: 'success' as AXStyleColorType,\n order: 6,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.SignedOff,\n title: '@maintenance-management:work-orders.states.signed-off',\n icon: 'fa-light fa-file-signature',\n color: 'success' as AXStyleColorType,\n order: 7,\n isInitial: false,\n isFinal: true,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.states.cancelled',\n icon: 'fa-light fa-ban',\n color: 'neutral' as AXStyleColorType,\n order: 8,\n isInitial: false,\n isFinal: true,\n generateView: true,\n },\n ];\n\n readonly transitions: AXPStatusTransition[] = [\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.status.transitions.schedule',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.status.transitions.assign',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.status.transitions.assign',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.status.transitions.reschedule',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.OnHold,\n title: '@maintenance-management:work-orders.status.transitions.put-on-hold',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.Completed,\n title: '@maintenance-management:work-orders.status.transitions.complete',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.OnHold,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.resume',\n },\n {\n from: AXMWorkOrderStatus.OnHold,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Completed,\n to: AXMWorkOrderStatus.SignedOff,\n title: '@maintenance-management:work-orders.status.transitions.sign-off',\n },\n {\n from: AXMWorkOrderStatus.Completed,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.reopen',\n },\n ];\n\n readonly defaultStatus = AXMWorkOrderStatus.Planned;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;AAAA;AAOA;AAEA;AAEM,MAAO,+CAAgD,SAAQ,iBAAiB,CAAA;AAAtF,IAAA,WAAA,GAAA;;QACW,IAAA,CAAA,GAAG,GAAG,0CAA0C;AAEhD,QAAA,IAAA,CAAA,QAAQ,GAAG;AAClB,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,OAAO;AAChC,gBAAA,KAAK,EAAE,oDAAoD;AAC3D,gBAAA,IAAI,EAAE,4BAA4B;AAClC,gBAAA,KAAK,EAAE,WAA+B;AACtC,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,YAAY,EAAE,IAAI;AACnB,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,SAAS;AAClC,gBAAA,KAAK,EAAE,sDAAsD;AA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AAK,EAAE,+DAA+D;AACvE,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,MAAM;gBAC/B,EAAE,EAAE,kBAAkB,CAAC,UAAU;AACjC,gBAAA,KAAK,EAAE,+DAA+D;AACvE,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,MAAM;gBAC/B,EAAE,EAAE,kBAAkB,CAAC,SAAS;AAChC,gBAAA,KAAK,EAAE,+DAA+D;AACvE,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,SAAS;gBAClC,EAAE,EAAE,kBAAkB,CAAC,SAAS;AAChC,gBAAA,KAAK,EAAE,iEAAiE;AACzE,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,SAAS;gBAClC,EAAE,EAAE,kBAAkB,CAAC,UAAU;AACjC,gBAAA,KAAK,EAAE,+DAA+D;AACvE,aAAA;SACF;AAEQ,QAAA,IAAA,CAAA,aAAa,GAAG,kBAAkB,CAAC,OAAO;IACrD;AAAC;AAED;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-status.provider-DvBk5kAW.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order-status.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXPStatusProvider, AXPStatusTransition } from '@acorex-platform/framework-shared/core';\n\nimport { AXMWorkOrderStatus } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Status provider ----\n\nexport class AXMMaintenanceManagementWorkOrderStatusProvider extends AXPStatusProvider {\n readonly key = 'maintenance-management.status.work-order';\n\n readonly statuses = [\n {\n name: AXMWorkOrderStatus.Planned,\n title: '@maintenance-management:work-orders.states.planned',\n icon: 'fa-light fa-clipboard-list',\n color: 'secondary' as AXStyleColorType,\n order: 1,\n isInitial: true,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.states.scheduled',\n icon: 'fa-light fa-calendar-clock',\n color: 'info' as AXStyleColorType,\n order: 2,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.states.assigned',\n icon: 'fa-light fa-user-check',\n color: 'info' as AXStyleColorType,\n order: 3,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.states.in-progress',\n icon: 'fa-light fa-screwdriver-wrench',\n color: 'warning' as AXStyleColorType,\n order: 4,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.OnHold,\n title: '@maintenance-management:work-orders.states.on-hold',\n icon: 'fa-light fa-pause',\n color: 'warning' as AXStyleColorType,\n order: 5,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Completed,\n title: '@maintenance-management:work-orders.states.completed',\n icon: 'fa-light fa-circle-check',\n color: 'success' as AXStyleColorType,\n order: 6,\n isInitial: false,\n isFinal: false,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.SignedOff,\n title: '@maintenance-management:work-orders.states.signed-off',\n icon: 'fa-light fa-file-signature',\n color: 'success' as AXStyleColorType,\n order: 7,\n isInitial: false,\n isFinal: true,\n generateView: true,\n },\n {\n name: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.states.cancelled',\n icon: 'fa-light fa-ban',\n color: 'neutral' as AXStyleColorType,\n order: 8,\n isInitial: false,\n isFinal: true,\n generateView: true,\n },\n ];\n\n readonly transitions: AXPStatusTransition[] = [\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.status.transitions.schedule',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.status.transitions.assign',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Planned,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.Assigned,\n title: '@maintenance-management:work-orders.status.transitions.assign',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Scheduled,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.start-work',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.Scheduled,\n title: '@maintenance-management:work-orders.status.transitions.reschedule',\n },\n {\n from: AXMWorkOrderStatus.Assigned,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.OnHold,\n title: '@maintenance-management:work-orders.status.transitions.put-on-hold',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.Completed,\n title: '@maintenance-management:work-orders.status.transitions.complete',\n },\n {\n from: AXMWorkOrderStatus.InProgress,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.OnHold,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.resume',\n },\n {\n from: AXMWorkOrderStatus.OnHold,\n to: AXMWorkOrderStatus.Cancelled,\n title: '@maintenance-management:work-orders.status.transitions.cancel',\n },\n {\n from: AXMWorkOrderStatus.Completed,\n to: AXMWorkOrderStatus.SignedOff,\n title: '@maintenance-management:work-orders.status.transitions.sign-off',\n },\n {\n from: AXMWorkOrderStatus.Completed,\n to: AXMWorkOrderStatus.InProgress,\n title: '@maintenance-management:work-orders.status.transitions.reopen',\n },\n ];\n\n readonly defaultStatus = AXMWorkOrderStatus.Planned;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;AAAA;AAOA;AAEA;AAEM,MAAO,+CAAgD,SAAQ,iBAAiB,CAAA;AAAtF,IAAA,WAAA,GAAA;;QACW,IAAA,CAAA,GAAG,GAAG,0CAA0C;AAEhD,QAAA,IAAA,CAAA,QAAQ,GAAG;AAClB,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,OAAO;AAChC,gBAAA,KAAK,EAAE,oDAAoD;AAC3D,gBAAA,IAAI,EAAE,4BAA4B;AAClC,gBAAA,KAAK,EAAE,WAA+B;AACtC,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,YAAY,EAAE,IAAI;AACnB,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,SAAS;AAClC,gBAAA,KAAK,EAAE,sDAAsD;AAC7D,gBAAA,IAAI,EAAE,4BAA4B;AAClC,gBAAA,KAAK,EAAE,MAA0B;AACjC,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,SAAS,EAAE,KAAK;AAChB,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,YAAY,EAAE,IAAI;AACnB,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,QAAQ;AACjC,gBAAA,KAAK,EAAE,qDAAqD;AAC5D,gBAAA,IAAI,EAAE,wBAAwB;AAC9B,gBAAA,KAAK,EAAE,MAA0B;AACjC,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,SAAS,EAAE,KAAK;AAChB,gBAAA,O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zE,aAAA;AACD,YAAA;gBACE,IAAI,EAAE,kBAAkB,CAAC,SAAS;gBAClC,EAAE,EAAE,kBAAkB,CAAC,UAAU;AACjC,gBAAA,KAAK,EAAE,+DAA+D;AACvE,aAAA;SACF;AAEQ,QAAA,IAAA,CAAA,aAAa,GAAG,kBAAkB,CAAC,OAAO;IACrD;AAAC;AAED;;"}
@@ -126,7 +126,7 @@ class AXMWorkOrderWorkReportColumnComponent extends AXPColumnWidgetComponent {
126
126
  </ax-prefix>
127
127
  </ax-button>
128
128
  }
129
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
129
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
130
130
  }
131
131
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkOrderWorkReportColumnComponent, decorators: [{
132
132
  type: Component,
@@ -160,4 +160,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
160
160
  }], ctorParameters: () => [] });
161
161
 
162
162
  export { AXMWorkOrderWorkReportColumnComponent };
163
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-Bf1WZWIS.mjs.map
163
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-Bf1WZWIS.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/widgets/work-order-work-report-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXFormatService } from '@acorex/core/format';\nimport {\n AXTranslationModule,\n AXTranslationService,\n} from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport {\n AXMMaintenanceManagementCommandKeys,\n RootConfig,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-order-work-report-column',\n template: `\n @if (isLoading()) {\n <ax-loading></ax-loading>\n } @else {\n <ax-button\n class=\"ax-sm\"\n look=\"link\"\n [text]=\"buttonLabel()\"\n (onClick)=\"openWorkReport()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-file-lines\"></i>\n </ax-prefix>\n </ax-button>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n ],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkOrderWorkReportColumnComponent extends AXPColumnWidgetComponent<unknown> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n private readonly formatService = inject(AXFormatService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected isLoading = signal(false);\n protected workReport =\n signal<AXMMaintenanceManagementWorkReportEntityModel | null>(null);\n protected buttonLabel = signal('');\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n super();\n effect(() => {\n const row = this.rowData as Record<string, unknown> | undefined;\n untracked(() => {\n void this.syncRowState(row);\n });\n });\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected async openWorkReport(): Promise<void> {\n const row = this.rowData as Record<string, unknown> | undefined;\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n return;\n }\n\n await this.commandService.execute(\n AXMMaintenanceManagementCommandKeys.WorkReport.OpenFromWorkOrder,\n {\n workOrderId,\n },\n );\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async syncRowState(\n row: Record<string, unknown> | undefined,\n ): Promise<void> {\n this.isLoading.set(true);\n try {\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n this.workReport.set(null);\n this.buttonLabel.set('');\n return;\n }\n\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'workOrderId',\n operator: { type: 'equal' },\n value: workOrderId,\n },\n ],\n },\n } as never);\n\n const report = defaultTo(\n get(page, 'items[0]'),\n null,\n ) as AXMMaintenanceManagementWorkReportEntityModel | null;\n this.workReport.set(report?.id ? report : null);\n this.buttonLabel.set(await this.resolveButtonLabel(report));\n } finally {\n this.isLoading.set(false);\n }\n }\n\n private async resolveButtonLabel(\n report: AXMMaintenanceManagementWorkReportEntityModel | null,\n ): Promise<string> {\n if (!report) {\n return this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.work-report-column.title',\n );\n }\n\n const result = this.resolveText(report.result);\n if (result) {\n return result;\n }\n\n const reportedAt = this.resolveText(report.reportedAt);\n if (reportedAt) {\n return this.formatService.format(reportedAt, 'datetime');\n }\n\n return this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.work-report-column.view-report',\n );\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AAsBA;AAEA;AA6BM,MAAO,qCAAsC,SAAQ,wBAAiC,CAAA;;;AAqB1F,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAnBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;;;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iB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,2BAAA,EAAA,QAAA,EAAA,8IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACjB,eAAe,8KACf,mBAAmB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIV,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBA3BjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mCAAmC;AAC7C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;AAeT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,iBAAiB;wBACjB,eAAe;wBACf,mBAAmB;AACpB,qBAAA;AACD,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/widgets/work-order-work-report-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXFormatService } from '@acorex/core/format';\nimport {\n AXTranslationModule,\n AXTranslationService,\n} from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport {\n AXMMaintenanceManagementCommandKeys,\n RootConfig,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-order-work-report-column',\n template: `\n @if (isLoading()) {\n <ax-loading></ax-loading>\n } @else {\n <ax-button\n class=\"ax-sm\"\n look=\"link\"\n [text]=\"buttonLabel()\"\n (onClick)=\"openWorkReport()\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-file-lines\"></i>\n </ax-prefix>\n </ax-button>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n ],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkOrderWorkReportColumnComponent extends AXPColumnWidgetComponent<unknown> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n private readonly formatService = inject(AXFormatService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected isLoading = signal(false);\n protected workReport =\n signal<AXMMaintenanceManagementWorkReportEntityModel | null>(null);\n protected buttonLabel = signal('');\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n super();\n effect(() => {\n const row = this.rowData as Record<string, unknown> | undefined;\n untracked(() => {\n void this.syncRowState(row);\n });\n });\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected async openWorkReport(): Promise<void> {\n const row = this.rowData as Record<string, unknown> | undefined;\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n return;\n }\n\n await this.commandService.execute(\n AXMMaintenanceManagementCommandKeys.WorkReport.OpenFromWorkOrder,\n {\n workOrderId,\n },\n );\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async syncRowState(\n row: Record<string, unknown> | undefined,\n ): Promise<void> {\n this.isLoading.set(true);\n try {\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n this.workReport.set(null);\n this.buttonLabel.set('');\n return;\n }\n\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'workOrderId',\n operator: { type: 'equal' },\n value: workOrderId,\n },\n ],\n },\n } as never);\n\n const report = defaultTo(\n get(page, 'items[0]'),\n null,\n ) as AXMMaintenanceManagementWorkReportEntityModel | null;\n this.workReport.set(report?.id ? report : null);\n this.buttonLabel.set(await this.resolveButtonLabel(report));\n } finally {\n this.isLoading.set(false);\n }\n }\n\n private async resolveButtonLabel(\n report: AXMMaintenanceManagementWorkReportEntityModel | null,\n ): Promise<string> {\n if (!report) {\n return this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.work-report-column.title',\n );\n }\n\n const result = this.resolveText(report.result);\n if (result) {\n return result;\n }\n\n const reportedAt = this.resolveText(report.reportedAt);\n if (reportedAt) {\n return this.formatService.format(reportedAt, 'datetime');\n }\n\n return this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.work-report-column.view-report',\n );\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AAsBA;AAEA;AA6BM,MAAO,qCAAsC,SAAQ,wBAAiC,CAAA;;;AAqB1F,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAnBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;;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AAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,2BAAA,EAAA,QAAA,EAAA,8IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACjB,eAAe,8KACf,mBAAmB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIV,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBA3BjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mCAAmC;AAC7C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;AAeT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,iBAAiB;wBACjB,eAAe;wBACf,mBAAmB;AACpB,qBAAA;AACD,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;"}
@@ -14,7 +14,7 @@ import * as i0 from '@angular/core';
14
14
  import { inject, signal, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
15
15
  import { get, defaultTo, isString } from 'lodash';
16
16
  import { AXMWorkOrderStatus, RootConfig, AXMMaintenanceManagementCommandKeys } from '@acorex-platform/module-maintenance-management-client/contracts';
17
- import { q as queryWorkflowTemplatesForAsset, r as resolveDisplayLabel } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BiQlJxPX.mjs';
17
+ import { q as queryWorkflowTemplatesForAsset, r as resolveDisplayLabel } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BI7RNP_h.mjs';
18
18
 
19
19
  //#region ---- Imports ----
20
20
  const STARTABLE_STATUSES = new Set([
@@ -240,7 +240,7 @@ class AXMWorkOrderWorkflowColumnComponent extends AXPColumnWidgetComponent {
240
240
  <span class="text-muted text-xs">---</span>
241
241
  }
242
242
  </div>
243
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i3.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
243
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items", "closeParentOnClick", "lockOnLoading"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i3.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
244
244
  }
245
245
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkOrderWorkflowColumnComponent, decorators: [{
246
246
  type: Component,
@@ -317,4 +317,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
317
317
  }], ctorParameters: () => [] });
318
318
 
319
319
  export { AXMWorkOrderWorkflowColumnComponent };
320
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-Dth3Z9fW.mjs.map
320
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-yzj-D7MB.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-Dth3Z9fW.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/widgets/work-order-workflow-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXDropdownModule } from '@acorex/components/dropdown';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport {\n AXTranslationModule,\n AXTranslationService,\n} from '@acorex/core/translation';\nimport {\n AXPEntityService,\n getRecordWorkflowInstanceId,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport {\n AXMMaintenanceManagementCommandKeys,\n AXMWorkOrderStatus,\n RootConfig,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementMaintenanceTemplateWorkflowConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport {\n type EntityStorageBackend,\n queryWorkflowTemplatesForAsset,\n resolveDisplayLabel,\n} from '../../../middlewares/maintenance-generation.utils';\n\n//#endregion\n\n//#region ---- Types ----\n\ninterface WorkflowTemplateOption {\n id: string;\n title: string;\n}\n\nconst STARTABLE_STATUSES = new Set<string>([\n AXMWorkOrderStatus.Planned,\n AXMWorkOrderStatus.Scheduled,\n AXMWorkOrderStatus.Assigned,\n]);\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-order-workflow-column',\n host: {\n class: 'w-full block',\n '(click)': 'onColumnClick($event)',\n '(mousedown)': 'onColumnClick($event)',\n '(dblclick)': 'onColumnClick($event)',\n },\n template: `\n <div class=\"w-full\">\n @if (isBusy() || isLoading()) {\n <ax-loading></ax-loading>\n } @else if (activeWorkflowLabel()) {\n <span\n class=\"inline-flex items-center gap-1 text-xs font-medium\"\n [title]=\"activeWorkflowLabel()\"\n >\n <i class=\"fa-light fa-diagram-project fa-fw\"></i>\n <span>{{ activeWorkflowLabel() }}</span>\n </span>\n } @else if (canSelect()) {\n @if (templates().length === 0) {\n <span class=\"text-muted text-xs\">---</span>\n } @else if (templates().length === 1) {\n <ax-button\n class=\"ax-sm\"\n look=\"link\"\n [text]=\"templates()[0].title\"\n (onClick)=\"selectTemplate(templates()[0])\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-play\"></i>\n </ax-prefix>\n </ax-button>\n } @else {\n <ax-button class=\"ax-sm\" look=\"outline\" [text]=\"selectLabel()\">\n <ax-prefix>\n <i class=\"fa-light fa-diagram-project\"></i>\n </ax-prefix>\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (template of templates(); track template.id) {\n <ax-button-item\n [text]=\"template.title\"\n (onClick)=\"selectTemplate(template)\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-play\"></i>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n } @else {\n <span class=\"text-muted text-xs\">---</span>\n }\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n AXButtonModule,\n AXDecoratorModule,\n AXDropdownModule,\n AXLoadingModule,\n AXTranslationModule,\n ],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkOrderWorkflowColumnComponent extends AXPColumnWidgetComponent<unknown> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected isLoading = signal(false);\n protected isBusy = signal(false);\n protected templates = signal<WorkflowTemplateOption[]>([]);\n protected activeWorkflowLabel = signal('');\n protected canSelect = signal(false);\n protected selectLabel = signal('');\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n super();\n effect(() => {\n const row = this.rowData as Record<string, unknown> | undefined;\n untracked(() => {\n void this.syncRowState(row);\n });\n });\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n /** Prevents grid row default / double-click actions when interacting with this column. */\n protected onColumnClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n protected async selectTemplate(\n template: WorkflowTemplateOption,\n ): Promise<void> {\n if (this.isBusy() || !template.id) {\n return;\n }\n\n const row = this.rowData as Record<string, unknown> | undefined;\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n return;\n }\n\n this.isBusy.set(true);\n try {\n const entitySource = `${RootConfig.module.name}.${RootConfig.entities.workOrder.name}`;\n const result = await this.commandService.execute(\n AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow,\n {\n entity: entitySource,\n data: {\n ...defaultTo(row, {}),\n id: workOrderId,\n maintenanceTemplateId: template.id,\n },\n \n },\n );\n\n if (result?.success) {\n const updated = (await this.entityService\n .withEntity(\n RootConfig.module.name,\n RootConfig.entities.workOrder.name,\n )\n .data()\n .byKey(workOrderId)) as Record<string, unknown> | null;\n if (row && updated) {\n Object.assign(row, updated);\n await this.syncRowState(row);\n }\n } else if (row) {\n const updated = (await this.entityService\n .withEntity(\n RootConfig.module.name,\n RootConfig.entities.workOrder.name,\n )\n .data()\n .byKey(workOrderId)\n .catch(() => null)) as Record<string, unknown> | null;\n if (updated) {\n Object.assign(row, updated);\n await this.syncRowState(row);\n }\n }\n } finally {\n this.isBusy.set(false);\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async syncRowState(\n row: Record<string, unknown> | undefined,\n ): Promise<void> {\n this.isLoading.set(true);\n try {\n this.selectLabel.set(\n await this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.workflow-column.select-workflow',\n ),\n );\n\n if (!row) {\n this.templates.set([]);\n this.activeWorkflowLabel.set('');\n this.canSelect.set(false);\n return;\n }\n\n if (getRecordWorkflowInstanceId(row)) {\n this.templates.set([]);\n this.canSelect.set(false);\n this.activeWorkflowLabel.set(this.resolveActiveWorkflowLabel(row));\n return;\n }\n\n const statusId = this.resolveText(get(row, 'statusId'));\n const assetId = this.resolveText(get(row, 'assetId'));\n const canStart = STARTABLE_STATUSES.has(statusId) && !!assetId;\n this.canSelect.set(canStart);\n this.activeWorkflowLabel.set('');\n\n if (!canStart || !assetId) {\n this.templates.set([]);\n return;\n }\n\n const backend = this.createStorageBackend();\n const templateEntityName = `${RootConfig.module.name}.${RootConfig.entities.maintenanceTemplate.name}`;\n const rawTemplates = await queryWorkflowTemplatesForAsset(\n backend,\n templateEntityName,\n assetId,\n );\n const locale = this.translation.getActiveLang() as 'en-US' | 'fa-IR';\n\n this.templates.set(\n [...rawTemplates]\n .sort((a, b) => {\n const ta = resolveDisplayLabel(a.title, a.code ?? a.id, locale);\n const tb = resolveDisplayLabel(b.title, b.code ?? b.id, locale);\n return ta.localeCompare(tb, locale, { sensitivity: 'base' });\n })\n .map((template) => ({\n id: template.id,\n title: resolveDisplayLabel(\n template.title,\n template.code ?? template.id,\n locale,\n ),\n })),\n );\n } finally {\n this.isLoading.set(false);\n }\n }\n\n private resolveActiveWorkflowLabel(row: Record<string, unknown>): string {\n const locale = this.translation.getActiveLang() as 'en-US' | 'fa-IR';\n const workflowConfig = get(row, 'maintenanceTemplate.workflowConfig') as\n | AXMMaintenanceManagementMaintenanceTemplateWorkflowConfig\n | null\n | undefined;\n const workflowName = workflowConfig?.workflowName?.trim();\n if (workflowName) {\n return workflowName;\n }\n\n const templateTitle = get(row, 'maintenanceTemplate.title');\n if (templateTitle) {\n return resolveDisplayLabel(\n templateTitle as Parameters<typeof resolveDisplayLabel>[0],\n this.resolveText(get(row, 'maintenanceTemplateId')),\n locale,\n );\n }\n\n return '';\n }\n\n private createStorageBackend(): EntityStorageBackend {\n return {\n getOne: async (entityName, id) => {\n const [module, entity] = entityName.split('.');\n return this.entityService.withEntity(module, entity).data().byKey(id);\n },\n insertOne: async () => null,\n query: async (entityName, request) => {\n const [module, entity] = entityName.split('.');\n return this.entityService\n .withEntity(module, entity)\n .data()\n .query(request as never);\n },\n };\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#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AmB;AACpB,qBAAA;AACD,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-yzj-D7MB.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/widgets/work-order-workflow-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXDropdownModule } from '@acorex/components/dropdown';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport {\n AXTranslationModule,\n AXTranslationService,\n} from '@acorex/core/translation';\nimport {\n AXPEntityService,\n getRecordWorkflowInstanceId,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { defaultTo, get, isString } from 'lodash';\n\nimport {\n AXMMaintenanceManagementCommandKeys,\n AXMWorkOrderStatus,\n RootConfig,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport type { AXMMaintenanceManagementMaintenanceTemplateWorkflowConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport {\n type EntityStorageBackend,\n queryWorkflowTemplatesForAsset,\n resolveDisplayLabel,\n} from '../../../middlewares/maintenance-generation.utils';\n\n//#endregion\n\n//#region ---- Types ----\n\ninterface WorkflowTemplateOption {\n id: string;\n title: string;\n}\n\nconst STARTABLE_STATUSES = new Set<string>([\n AXMWorkOrderStatus.Planned,\n AXMWorkOrderStatus.Scheduled,\n AXMWorkOrderStatus.Assigned,\n]);\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-order-workflow-column',\n host: {\n class: 'w-full block',\n '(click)': 'onColumnClick($event)',\n '(mousedown)': 'onColumnClick($event)',\n '(dblclick)': 'onColumnClick($event)',\n },\n template: `\n <div class=\"w-full\">\n @if (isBusy() || isLoading()) {\n <ax-loading></ax-loading>\n } @else if (activeWorkflowLabel()) {\n <span\n class=\"inline-flex items-center gap-1 text-xs font-medium\"\n [title]=\"activeWorkflowLabel()\"\n >\n <i class=\"fa-light fa-diagram-project fa-fw\"></i>\n <span>{{ activeWorkflowLabel() }}</span>\n </span>\n } @else if (canSelect()) {\n @if (templates().length === 0) {\n <span class=\"text-muted text-xs\">---</span>\n } @else if (templates().length === 1) {\n <ax-button\n class=\"ax-sm\"\n look=\"link\"\n [text]=\"templates()[0].title\"\n (onClick)=\"selectTemplate(templates()[0])\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-play\"></i>\n </ax-prefix>\n </ax-button>\n } @else {\n <ax-button class=\"ax-sm\" look=\"outline\" [text]=\"selectLabel()\">\n <ax-prefix>\n <i class=\"fa-light fa-diagram-project\"></i>\n </ax-prefix>\n <ax-dropdown-panel #panel>\n <ax-button-item-list>\n @for (template of templates(); track template.id) {\n <ax-button-item\n [text]=\"template.title\"\n (onClick)=\"selectTemplate(template)\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-play\"></i>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n }\n } @else {\n <span class=\"text-muted text-xs\">---</span>\n }\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n AXButtonModule,\n AXDecoratorModule,\n AXDropdownModule,\n AXLoadingModule,\n AXTranslationModule,\n ],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkOrderWorkflowColumnComponent extends AXPColumnWidgetComponent<unknown> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected isLoading = signal(false);\n protected isBusy = signal(false);\n protected templates = signal<WorkflowTemplateOption[]>([]);\n protected activeWorkflowLabel = signal('');\n protected canSelect = signal(false);\n protected selectLabel = signal('');\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n super();\n effect(() => {\n const row = this.rowData as Record<string, unknown> | undefined;\n untracked(() => {\n void this.syncRowState(row);\n });\n });\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n /** Prevents grid row default / double-click actions when interacting with this column. */\n protected onColumnClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n protected async selectTemplate(\n template: WorkflowTemplateOption,\n ): Promise<void> {\n if (this.isBusy() || !template.id) {\n return;\n }\n\n const row = this.rowData as Record<string, unknown> | undefined;\n const workOrderId = this.resolveText(get(row, 'id'));\n if (!workOrderId) {\n return;\n }\n\n this.isBusy.set(true);\n try {\n const entitySource = `${RootConfig.module.name}.${RootConfig.entities.workOrder.name}`;\n const result = await this.commandService.execute(\n AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow,\n {\n entity: entitySource,\n data: {\n ...defaultTo(row, {}),\n id: workOrderId,\n maintenanceTemplateId: template.id,\n },\n \n },\n );\n\n if (result?.success) {\n const updated = (await this.entityService\n .withEntity(\n RootConfig.module.name,\n RootConfig.entities.workOrder.name,\n )\n .data()\n .byKey(workOrderId)) as Record<string, unknown> | null;\n if (row && updated) {\n Object.assign(row, updated);\n await this.syncRowState(row);\n }\n } else if (row) {\n const updated = (await this.entityService\n .withEntity(\n RootConfig.module.name,\n RootConfig.entities.workOrder.name,\n )\n .data()\n .byKey(workOrderId)\n .catch(() => null)) as Record<string, unknown> | null;\n if (updated) {\n Object.assign(row, updated);\n await this.syncRowState(row);\n }\n }\n } finally {\n this.isBusy.set(false);\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async syncRowState(\n row: Record<string, unknown> | undefined,\n ): Promise<void> {\n this.isLoading.set(true);\n try {\n this.selectLabel.set(\n await this.translation.translateAsync(\n '@maintenance-management:work-orders.entities.work-order.fields.workflow-column.select-workflow',\n ),\n );\n\n if (!row) {\n this.templates.set([]);\n this.activeWorkflowLabel.set('');\n this.canSelect.set(false);\n return;\n }\n\n if (getRecordWorkflowInstanceId(row)) {\n this.templates.set([]);\n this.canSelect.set(false);\n this.activeWorkflowLabel.set(this.resolveActiveWorkflowLabel(row));\n return;\n }\n\n const statusId = this.resolveText(get(row, 'statusId'));\n const assetId = this.resolveText(get(row, 'assetId'));\n const canStart = STARTABLE_STATUSES.has(statusId) && !!assetId;\n this.canSelect.set(canStart);\n this.activeWorkflowLabel.set('');\n\n if (!canStart || !assetId) {\n this.templates.set([]);\n return;\n }\n\n const backend = this.createStorageBackend();\n const templateEntityName = `${RootConfig.module.name}.${RootConfig.entities.maintenanceTemplate.name}`;\n const rawTemplates = await queryWorkflowTemplatesForAsset(\n backend,\n templateEntityName,\n assetId,\n );\n const locale = this.translation.getActiveLang() as 'en-US' | 'fa-IR';\n\n this.templates.set(\n [...rawTemplates]\n .sort((a, b) => {\n const ta = resolveDisplayLabel(a.title, a.code ?? a.id, locale);\n const tb = resolveDisplayLabel(b.title, b.code ?? b.id, locale);\n return ta.localeCompare(tb, locale, { sensitivity: 'base' });\n })\n .map((template) => ({\n id: template.id,\n title: resolveDisplayLabel(\n template.title,\n template.code ?? template.id,\n locale,\n ),\n })),\n );\n } finally {\n this.isLoading.set(false);\n }\n }\n\n private resolveActiveWorkflowLabel(row: Record<string, unknown>): string {\n const locale = this.translation.getActiveLang() as 'en-US' | 'fa-IR';\n const workflowConfig = get(row, 'maintenanceTemplate.workflowConfig') as\n | AXMMaintenanceManagementMaintenanceTemplateWorkflowConfig\n | null\n | undefined;\n const workflowName = workflowConfig?.workflowName?.trim();\n if (workflowName) {\n return workflowName;\n }\n\n const templateTitle = get(row, 'maintenanceTemplate.title');\n if (templateTitle) {\n return resolveDisplayLabel(\n templateTitle as Parameters<typeof resolveDisplayLabel>[0],\n this.resolveText(get(row, 'maintenanceTemplateId')),\n locale,\n );\n }\n\n return '';\n }\n\n private createStorageBackend(): EntityStorageBackend {\n return {\n getOne: async (entityName, id) => {\n const [module, entity] = entityName.split('.');\n return this.entityService.withEntity(module, entity).data().byKey(id);\n },\n insertOne: async () => null,\n query: async (entityName, request) => {\n const [module, entity] = entityName.split('.');\n return this.entityService\n .withEntity(module, entity)\n .data()\n .query(request as never);\n },\n };\n }\n\n private resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAwCA,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS;AACzC,IAAA,kBAAkB,CAAC,OAAO;AAC1B,IAAA,kBAAkB,CAAC,SAAS;AAC5B,IAAA,kBAAkB,CAAC,QAAQ;AAC5B,CAAA,CAAC;AAEF;AAEA;AAwEM,MAAO,mCAAoC,SAAQ,wBAAiC,CAAA;;;AAsBxF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AApBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;;;QAMjD,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK;sFAAC;QACzB,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK;mFAAC;QACtB,IAAA,CAAA,SAAS,GAAG,MAAM,CAA2B,EAAE;sFAAC;QAChD,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,EAAE;gGAAC;QAChC,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK;sFAAC;QACzB,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,EAAE;wFAAC;QAQhC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,OAA8C;YAC/D,SAAS,CAA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wBAAA,YAAY,EAAE,uBAAuB;AACtC,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,iBAAiB;wBACjB,gBAAgB;wBAChB,eAAe;wBACf,mBAAmB;AACpB,qBAAA;AACD,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-report/work-report-assessment.util.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { defaultTo, isString } from 'lodash';\n\nimport type {\n AXMMaintenanceManagementWorkReportEntityModel,\n AXMWorkReportAssessmentReference,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXMWorkOrderStatus } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Upsert ----\n\nexport interface UpsertWorkReportAssessmentInput {\n assessmentCaseId: string;\n assessmentCaseTitle?: AXPMultiLanguageString;\n completedAt: string;\n completedById?: string | null;\n}\n\n/**\n * Returns a new assessments array with one case reference appended or updated (no duplicate case ids).\n */\nexport function upsertWorkReportAssessment(\n existing: AXMWorkReportAssessmentReference[] | undefined,\n input: UpsertWorkReportAssessmentInput,\n): AXMWorkReportAssessmentReference[] {\n const assessmentCaseId = resolveText(input.assessmentCaseId);\n if (!assessmentCaseId) {\n return defaultTo(existing, []);\n }\n\n const nextItem: AXMWorkReportAssessmentReference = {\n assessmentCaseId,\n assessmentCase: {\n id: assessmentCaseId,\n ...(input.assessmentCaseTitle !== undefined ? { title: input.assessmentCaseTitle } : {}),\n },\n completedAt: input.completedAt,\n completedById: resolveOptionalText(input.completedById) ?? null,\n };\n\n const list = [...defaultTo(existing, [])];\n const index = list.findIndex((item) => item.assessmentCaseId === assessmentCaseId);\n if (index >= 0) {\n list[index] = { ...list[index], ...nextItem };\n return list;\n }\n\n return [...list, nextItem];\n}\n\nexport function sortWorkReportAssessments(\n assessments: AXMWorkReportAssessmentReference[] | undefined,\n): AXMWorkReportAssessmentReference[] {\n return [...defaultTo(assessments, [])].sort((a, b) => {\n const aTime = resolveText(a.completedAt);\n const bTime = resolveText(b.completedAt);\n if (aTime && bTime) {\n return aTime.localeCompare(bTime);\n }\n return aTime ? -1 : bTime ? 1 : 0;\n });\n}\n\nexport function isWorkReportFinalized(\n workReport: Pick<AXMMaintenanceManagementWorkReportEntityModel, 'finalizedAt'>,\n): boolean {\n return !!resolveText(workReport.finalizedAt);\n}\n\n\n\nexport function isWorkReportEditable(\n workReport: Pick<AXMMaintenanceManagementWorkReportEntityModel, 'finalizedAt'>,\n workOrder?: { statusId?: string; approvalStatus?: string } | null,\n): boolean {\n if (isWorkReportFinalized(workReport)) {\n return false;\n }\n\n const statusId = resolveText(workOrder?.statusId);\n if (statusId === AXMWorkOrderStatus.SignedOff) {\n return false;\n }\n\n if (resolveText(workOrder?.approvalStatus) === 'pending') {\n return false;\n }\n\n if (statusId === AXMWorkOrderStatus.Completed) {\n return false;\n }\n\n return true;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveOptionalText(value: unknown): string | undefined {\n const text = resolveText(value);\n return text || undefined;\n}\n\nfunction resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n}\n\n//#endregion\n"],"names":[],"mappings":";;;AAAA;AAsBA;;AAEG;AACG,SAAU,0BAA0B,CACxC,QAAwD,EACxD,KAAsC,EAAA;IAEtC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC5D,IAAI,CAAC,gBAAgB,EAAE;AACrB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AG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC;AACnC,IAAA,CAAC,CAAC;AACJ;AAEM,SAAU,qBAAqB,CACnC,UAA8E,EAAA;IAE9E,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC;AAC9C;AAIM,SAAU,oBAAoB,CAClC,UAA8E,EAC9E,SAAiE,EAAA;AAEjE,IAAA,IAAI,qBAAqB,CAAC,UAAU,CAAC,EAAE;AACrC,QAAA,OAAO,KAAK;IACd;IAEA,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC;AACjD,IAAA,IAAI,QAAQ,KAAK,kBAAkB,CAAC,SAAS,EAAE;AAC7C,QAAA,OAAO,KAAK;IACd;IAEA,IAAI,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,KAAK,SAAS,EAAE;AACxD,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,IAAI,QAAQ,KAAK,kBAAkB,CAAC,SAAS,EAAE;AAC7C,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,IAAI;AACb;AAEA;AAEA;AAEA,SAAS,mBAAmB,CAAC,KAAc,EAAA;AACzC,IAAA,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC;IAC/B,OAAO,IAAI,IAAI,SAAS;AAC1B;AAEA,SAAS,WAAW,CAAC,KAAc,EAAA;AACjC,IAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,QAAA,OAAO,EAAE;IACX;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,EAAE;AACrB;AAEA;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-report/work-report-assessment.util.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { defaultTo, isString } from 'lodash';\n\nimport type {\n AXMMaintenanceManagementWorkReportEntityModel,\n AXMWorkReportAssessmentReference,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXMWorkOrderStatus } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Upsert ----\n\nexport interface UpsertWorkReportAssessmentInput {\n assessmentCaseId: string;\n assessmentCaseTitle?: AXPMultiLanguageString;\n completedAt: string;\n completedById?: string | null;\n}\n\n/**\n * Returns a new assessments array with one case reference appended or updated (no duplicate case ids).\n */\nexport function upsertWorkReportAssessment(\n existing: AXMWorkReportAssessmentReference[] | undefined,\n input: UpsertWorkReportAssessmentInput,\n): AXMWorkReportAssessmentReference[] {\n const assessmentCaseId = resolveText(input.assessmentCaseId);\n if (!assessmentCaseId) {\n return defaultTo(existing, []);\n }\n\n const nextItem: AXMWorkReportAssessmentReference = {\n assessmentCaseId,\n assessmentCase: {\n id: assessmentCaseId,\n ...(input.assessmentCaseTitle !== undefined ? { title: input.assessmentCaseTitle } : {}),\n },\n completedAt: input.completedAt,\n completedById: resolveOptionalText(input.completedById) ?? null,\n };\n\n const list = [...defaultTo(existing, [])];\n const index = list.findIndex((item) => item.assessmentCaseId === assessmentCaseId);\n if (index >= 0) {\n list[index] = { ...list[index], ...nextItem };\n return list;\n }\n\n return [...list, nextItem];\n}\n\nexport function sortWorkReportAssessments(\n assessments: AXMWorkReportAssessmentReference[] | undefined,\n): AXMWorkReportAssessmentReference[] {\n return [...defaultTo(assessments, [])].sort((a, b) => {\n const aTime = resolveText(a.completedAt);\n const bTime = resolveText(b.completedAt);\n if (aTime && bTime) {\n return aTime.localeCompare(bTime);\n }\n return aTime ? -1 : bTime ? 1 : 0;\n });\n}\n\nexport function isWorkReportFinalized(\n workReport: Pick<AXMMaintenanceManagementWorkReportEntityModel, 'finalizedAt'>,\n): boolean {\n return !!resolveText(workReport.finalizedAt);\n}\n\n\n\nexport function isWorkReportEditable(\n workReport: Pick<AXMMaintenanceManagementWorkReportEntityModel, 'finalizedAt'>,\n workOrder?: { statusId?: string; approvalStatus?: string } | null,\n): boolean {\n if (isWorkReportFinalized(workReport)) {\n return false;\n }\n\n const statusId = resolveText(workOrder?.statusId);\n if (statusId === AXMWorkOrderStatus.SignedOff) {\n return false;\n }\n\n if (resolveText(workOrder?.approvalStatus) === 'pending') {\n return false;\n }\n\n if (statusId === AXMWorkOrderStatus.Completed) {\n return false;\n }\n\n return true;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveOptionalText(value: unknown): string | undefined {\n const text = resolveText(value);\n return text || undefined;\n}\n\nfunction resolveText(value: unknown): string {\n if (!isString(value)) {\n return '';\n }\n return value.trim();\n}\n\n//#endregion\n"],"names":[],"mappings":";;;AAAA;AAsBA;;AAEG;AACG,SAAU,0BAA0B,CACxC,QAAwD,EACxD,KAAsC,EAAA;IAEtC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC5D,IAAI,CAAC,gBAAgB,EAAE;AACrB,QAAA,OAAO,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;IAChC;AAEA,IAAA,MAAM,QAAQ,GAAqC;QACjD,gBAAgB;AAChB,QAAA,cAAc,EAAE;AACd,YAAA,EAAE,EAAE,gBAAgB;YACpB,IAAI,KAAK,CAAC,mBAAmB,KAAK,SAAS,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC;AACzF,SAAA;QACD,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,aAAa,EAAE,mBAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,IAAI;KAChE;IAED,MAAM,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACzC,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,CAAC;AAClF,IAAA,IAA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kBAAkB,CAAC,SAAS,EAAE;AAC7C,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,IAAI;AACb;AAEA;AAEA;AAEA,SAAS,mBAAmB,CAAC,KAAc,EAAA;AACzC,IAAA,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC;IAC/B,OAAO,IAAI,IAAI,SAAS;AAC1B;AAEA,SAAS,WAAW,CAAC,KAAc,EAAA;AACjC,IAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpB,QAAA,OAAO,EAAE;IACX;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,EAAE;AACrB;AAEA;;"}
@@ -100,7 +100,7 @@ class AXMWorkReportChecklistResultsViewComponent extends AXPValueWidgetComponent
100
100
  }
101
101
  </div>
102
102
  }
103
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
103
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
104
104
  }
105
105
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkReportChecklistResultsViewComponent, decorators: [{
106
106
  type: Component,
@@ -146,4 +146,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
146
146
  }] });
147
147
 
148
148
  export { AXMWorkReportChecklistResultsViewComponent };
149
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BSFW0Yt-.mjs.map
149
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BSFW0Yt-.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-report/widgets/work-report-checklist-results-view.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport {\n AXTranslationModule,\n AXTranslationService,\n resolveMultiLanguageString,\n} from '@acorex/core/translation';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { defaultTo, isString } from 'lodash';\n\nimport { sortWorkReportAssessments } from '../work-report-assessment.util';\nimport type { AXMWorkReportAssessmentReference } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-report-checklist-results-view',\n template: `\n @if (rows().length === 0) {\n <span class=\"text-muted text-sm\">—</span>\n } @else {\n <div class=\"flex flex-col gap-3\">\n @for (row of rows(); track row.assessmentCaseId) {\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\n <div class=\"flex flex-col gap-0.5\">\n <span class=\"font-medium text-sm\">{{ row.checklistLabel }}</span>\n @if (row.caseTitle) {\n <span class=\"text-muted text-xs\">{{ row.caseTitle }}</span>\n }\n @if (row.completedAtLabel) {\n <span class=\"text-muted text-xs\" [dir]=\"'ltr'\">{{\n row.completedAtLabel\n }}</span>\n }\n </div>\n <ax-button\n class=\"ax-sm\"\n look=\"outline\"\n [text]=\"viewResponseLabel()\"\n [disabled]=\"false\"\n (onClick)=\"viewResponse(row.assessmentCaseId)\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-eye\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXButtonModule, AXDecoratorModule, AXTranslationModule],\n})\nexport class AXMWorkReportChecklistResultsViewComponent extends AXPValueWidgetComponent<\n AXMWorkReportAssessmentReference[]\n> {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n private readonly formatService = inject(AXFormatService);\n\n //#endregion\n\n //#region ---- Computed ----\n\n protected rows = computed(() => {\n const assessments = sortWorkReportAssessments(\n defaultTo(this.getValue(), []),\n );\n const locale = this.translation.getActiveLang();\n\n return assessments\n .filter(\n (item): item is AXMWorkReportAssessmentReference =>\n !!item?.assessmentCaseId,\n )\n .map((item, index) => ({\n assessmentCaseId: item.assessmentCaseId,\n checklistLabel: this.resolveChecklistLabel(index),\n completedAtLabel: this.resolveCompletedAtLabel(item.completedAt),\n caseTitle: resolveMultiLanguageString(\n (item.assessmentCase?.title ?? '') as never,\n locale,\n ),\n }));\n });\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected viewResponseLabel(): string {\n return this.translation.translateSync(\n '@maintenance-management:work-reports.entities.work-report.fields.assessments.actions.view-response',\n );\n }\n\n protected async viewResponse(assessmentCaseId: string): Promise<void> {\n if (!assessmentCaseId?.trim()) {\n return;\n }\n\n await this.commandService.execute(\n 'AssessmentManagement.AssessmentSession:ViewAnswers',\n {\n caseId: assessmentCaseId,\n },\n );\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveChecklistLabel(index: number): string {\n return this.translation.translateSync(\n '@maintenance-management:work-reports.entities.work-report.fields.assessments.checklist-label',\n { params: { index: index + 1 } },\n );\n }\n\n private resolveCompletedAtLabel(value: string | null | undefined): string {\n if (!isString(value) || !value.trim()) {\n return '';\n }\n try {\n return this.formatService.format(value, 'datetime');\n } catch {\n return '';\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AAkBA;AAEA;AAyCM,MAAO,0CAA2C,SAAQ,uBAE/D,CAAA;AAzCD,IAAA,WAAA,GAAA;;;AA4CmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;;;AAM9C,QAAA,IAAA,CAAA,IAAI,GAAG,QAAQ,CAAC,MAAK;AAC7B,YAAA,MAAM,WAAW,GAAG,yBAAyB,CAC3C,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC/B;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;AAE/C,YAAA,OAAO;iBACJ,MAAM,CACL,CAAC,IAAI,KACH,CAAC,CAAC,IAAI,EAAE,gBAAgB;iBAE3B,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MAAM;gBACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;AACvC,gBAAA,cAA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;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;AAClE,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-report/widgets/work-report-checklist-results-view.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport {\n AXTranslationModule,\n AXTranslationService,\n resolveMultiLanguageString,\n} from '@acorex/core/translation';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { defaultTo, isString } from 'lodash';\n\nimport { sortWorkReportAssessments } from '../work-report-assessment.util';\nimport type { AXMWorkReportAssessmentReference } from '@acorex-platform/module-maintenance-management-client/contracts';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-work-report-checklist-results-view',\n template: `\n @if (rows().length === 0) {\n <span class=\"text-muted text-sm\">—</span>\n } @else {\n <div class=\"flex flex-col gap-3\">\n @for (row of rows(); track row.assessmentCaseId) {\n <div class=\"flex flex-wrap items-center justify-between gap-2\">\n <div class=\"flex flex-col gap-0.5\">\n <span class=\"font-medium text-sm\">{{ row.checklistLabel }}</span>\n @if (row.caseTitle) {\n <span class=\"text-muted text-xs\">{{ row.caseTitle }}</span>\n }\n @if (row.completedAtLabel) {\n <span class=\"text-muted text-xs\" [dir]=\"'ltr'\">{{\n row.completedAtLabel\n }}</span>\n }\n </div>\n <ax-button\n class=\"ax-sm\"\n look=\"outline\"\n [text]=\"viewResponseLabel()\"\n [disabled]=\"false\"\n (onClick)=\"viewResponse(row.assessmentCaseId)\"\n >\n <ax-prefix>\n <i class=\"fa-light fa-eye\"></i>\n </ax-prefix>\n </ax-button>\n </div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXButtonModule, AXDecoratorModule, AXTranslationModule],\n})\nexport class AXMWorkReportChecklistResultsViewComponent extends AXPValueWidgetComponent<\n AXMWorkReportAssessmentReference[]\n> {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n private readonly formatService = inject(AXFormatService);\n\n //#endregion\n\n //#region ---- Computed ----\n\n protected rows = computed(() => {\n const assessments = sortWorkReportAssessments(\n defaultTo(this.getValue(), []),\n );\n const locale = this.translation.getActiveLang();\n\n return assessments\n .filter(\n (item): item is AXMWorkReportAssessmentReference =>\n !!item?.assessmentCaseId,\n )\n .map((item, index) => ({\n assessmentCaseId: item.assessmentCaseId,\n checklistLabel: this.resolveChecklistLabel(index),\n completedAtLabel: this.resolveCompletedAtLabel(item.completedAt),\n caseTitle: resolveMultiLanguageString(\n (item.assessmentCase?.title ?? '') as never,\n locale,\n ),\n }));\n });\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected viewResponseLabel(): string {\n return this.translation.translateSync(\n '@maintenance-management:work-reports.entities.work-report.fields.assessments.actions.view-response',\n );\n }\n\n protected async viewResponse(assessmentCaseId: string): Promise<void> {\n if (!assessmentCaseId?.trim()) {\n return;\n }\n\n await this.commandService.execute(\n 'AssessmentManagement.AssessmentSession:ViewAnswers',\n {\n caseId: assessmentCaseId,\n },\n );\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveChecklistLabel(index: number): string {\n return this.translation.translateSync(\n '@maintenance-management:work-reports.entities.work-report.fields.assessments.checklist-label',\n { params: { index: index + 1 } },\n );\n }\n\n private resolveCompletedAtLabel(value: string | null | undefined): string {\n if (!isString(value) || !value.trim()) {\n return '';\n }\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,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,YAAA,EAAA,UAAA,EAAA,UAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,mBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,iBAAiB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,2BAAA,EAAA,QAAA,EAAA,8IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAErD,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBAvCtD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wCAAwC;AAClD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;AAClE,iBAAA;;;"}
@@ -1,2 +1,2 @@
1
- export { a as AXMMaintenanceManagementMenuProvider, b as AXMMaintenanceManagementModule, c as AXMMaintenanceManagementPermissionDefinitionProvider, d as AXMMaintenanceManagementSearchCommandProvider, A as AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE, e as createWorkOrderExecutionWorkflowDefinition, w as workOrderExecutionWorkflowDefinition, f as workOrderExecutionWorkflowName } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BiQlJxPX.mjs';
1
+ export { a as AXMMaintenanceManagementMenuProvider, b as AXMMaintenanceManagementModule, c as AXMMaintenanceManagementPermissionDefinitionProvider, d as AXMMaintenanceManagementSearchCommandProvider, A as AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE, e as createWorkOrderExecutionWorkflowDefinition, w as workOrderExecutionWorkflowDefinition, f as workOrderExecutionWorkflowName } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BI7RNP_h.mjs';
2
2
  //# sourceMappingURL=acorex-platform-module-maintenance-management-client.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex-platform/module-maintenance-management-client",
3
- "version": "0.0.33",
3
+ "version": "0.0.37",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0 || ^22.0.0",