@acorex-platform/module-maintenance-management-client 0.0.69 → 1.0.1

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 (142) hide show
  1. package/fesm2022/{acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-6cXxZPN1.mjs → acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CGjcOjjv.mjs} +305 -34
  2. package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CGjcOjjv.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-asset-type.mjs +9 -0
  4. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-asset-type.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-resource.mjs +9 -0
  6. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type-resource.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type.mjs +9 -0
  8. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-activity-type.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-cause.mjs +9 -0
  10. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-cause.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-detection.mjs +9 -0
  12. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-detection.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-effect.mjs +9 -0
  14. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-effect.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mechanism.mjs +9 -0
  16. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mechanism.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-asset-type.mjs +9 -0
  18. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-asset-type.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-mechanism.mjs +9 -0
  20. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-mechanism.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-solution.mjs +9 -0
  22. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode-solution.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode.mjs +9 -0
  24. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-mode.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-cause.mjs +9 -0
  26. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-cause.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-effect.mjs +9 -0
  28. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-effect.mjs.map +1 -1
  29. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-mechanism.mjs +9 -0
  30. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register-mechanism.mjs.map +1 -1
  31. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register.mjs +9 -0
  32. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register.mjs.map +1 -1
  33. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-severity.mjs +9 -0
  34. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-severity.mjs.map +1 -1
  35. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-type.mjs +9 -0
  36. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-type.mjs.map +1 -1
  37. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs +87 -13
  38. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs.map +1 -1
  39. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-activity-type.mjs +9 -0
  40. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-activity-type.mjs.map +1 -1
  41. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-failure-mode.mjs +9 -0
  42. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-failure-mode.mjs.map +1 -1
  43. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-resource.mjs +9 -0
  44. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template-resource.mjs.map +1 -1
  45. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs +13 -13
  46. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs.map +1 -1
  47. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs +9 -0
  48. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs.map +1 -1
  49. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-order.mjs +19 -0
  50. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-order.mjs.map +1 -1
  51. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-package.mjs +9 -0
  52. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-package.mjs.map +1 -1
  53. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-report.mjs +9 -0
  54. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-report.mjs.map +1 -1
  55. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-CDwXJTyO.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-Dgu63wyv.mjs} +36 -27
  56. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-Dgu63wyv.mjs.map +1 -0
  57. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-BgNCJg1o.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CePSpBHM.mjs} +2 -2
  58. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-BgNCJg1o.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CePSpBHM.mjs.map} +1 -1
  59. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-LY3WhspA.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-Bfvk4GcQ.mjs} +2 -2
  60. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-LY3WhspA.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-Bfvk4GcQ.mjs.map} +1 -1
  61. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DyXcIKqY.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-Jy3BDuNN.mjs} +2 -2
  62. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DyXcIKqY.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-Jy3BDuNN.mjs.map} +1 -1
  63. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-B93wAqPv.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-CCgWn686.mjs} +2 -2
  64. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-B93wAqPv.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-CCgWn686.mjs.map} +1 -1
  65. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-Clc6RXxF.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-r_GaKV4C.mjs} +2 -2
  66. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-Clc6RXxF.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-r_GaKV4C.mjs.map} +1 -1
  67. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-qSSTwoD0.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BC8cmP-E.mjs} +2 -2
  68. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-qSSTwoD0.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BC8cmP-E.mjs.map} +1 -1
  69. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DsMYTxrE.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DkyVyX8d.mjs} +2 -2
  70. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DsMYTxrE.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DkyVyX8d.mjs.map} +1 -1
  71. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-DlqzE2Za.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-WxiHq42o.mjs} +2 -2
  72. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-DlqzE2Za.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-WxiHq42o.mjs.map} +1 -1
  73. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-0xGHmQqy.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-B1yGBbFQ.mjs} +2 -2
  74. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-0xGHmQqy.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-B1yGBbFQ.mjs.map} +1 -1
  75. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-B5bLQ4g6.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-Bquvs5zg.mjs} +2 -2
  76. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-B5bLQ4g6.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-Bquvs5zg.mjs.map} +1 -1
  77. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-BCCVzThS.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-DU4i03Hi.mjs} +2 -2
  78. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-BCCVzThS.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-DU4i03Hi.mjs.map} +1 -1
  79. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CZKNsPR2.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-DvO7KoEq.mjs} +2 -2
  80. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CZKNsPR2.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-DvO7KoEq.mjs.map} +1 -1
  81. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-CWhXlK6i.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-DK702y8j.mjs} +2 -2
  82. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-CWhXlK6i.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-DK702y8j.mjs.map} +1 -1
  83. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-DzSmFBD_.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-Dua1ufeE.mjs} +2 -2
  84. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-DzSmFBD_.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-Dua1ufeE.mjs.map} +1 -1
  85. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-5mfrErkC.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-Cs-SLfHm.mjs} +2 -2
  86. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-5mfrErkC.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-Cs-SLfHm.mjs.map} +1 -1
  87. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-DKL3K1P_.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-C-vkhC0g.mjs} +2 -2
  88. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-DKL3K1P_.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-C-vkhC0g.mjs.map} +1 -1
  89. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-BwPWU2hj.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-DEcLe9MD.mjs} +2 -2
  90. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-BwPWU2hj.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-DEcLe9MD.mjs.map} +1 -1
  91. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-DZp6tUTX.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-R0UVSWKi.mjs} +80 -15
  92. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-R0UVSWKi.mjs.map +1 -0
  93. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-CEgtM97Q.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-C3KERG4U.mjs} +2 -2
  94. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-CEgtM97Q.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-C3KERG4U.mjs.map} +1 -1
  95. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-DRt6Cfbc.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-EXXJjDYH.mjs} +2 -2
  96. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-DRt6Cfbc.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-EXXJjDYH.mjs.map} +1 -1
  97. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-zQAeVklB.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-CrMPuOD8.mjs} +2 -2
  98. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-zQAeVklB.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-CrMPuOD8.mjs.map} +1 -1
  99. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-DgtyyggM.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-Bn2DAaNN.mjs} +6 -15
  100. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-Bn2DAaNN.mjs.map +1 -0
  101. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-D3ipDMzR.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-DS8_oRB7.mjs} +2 -2
  102. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-D3ipDMzR.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-DS8_oRB7.mjs.map} +1 -1
  103. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-hgfgOV6Q.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DS1RPQ-I.mjs} +12 -2
  104. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DS1RPQ-I.mjs.map +1 -0
  105. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-ubzIZ90s.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-BUMsgLTC.mjs} +2 -2
  106. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-ubzIZ90s.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-BUMsgLTC.mjs.map} +1 -1
  107. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-Blu2UR8v.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-V0CqICBq.mjs} +2 -2
  108. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-Blu2UR8v.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-V0CqICBq.mjs.map} +1 -1
  109. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog.mjs +1 -1
  110. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs +76 -9
  111. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs.map +1 -1
  112. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-DDvUWUU5.mjs → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BXKKfu4I.mjs} +2 -2
  113. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-DDvUWUU5.mjs.map → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BXKKfu4I.mjs.map} +1 -1
  114. package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CUcsLsuh.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-Be1Nup4H.mjs} +2 -2
  115. package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CUcsLsuh.mjs.map → acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-Be1Nup4H.mjs.map} +1 -1
  116. package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-CM0Wokah.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs} +12 -8
  117. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs.map +1 -0
  118. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BiD6NYBT.mjs → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BJUgm59a.mjs} +2 -2
  119. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BiD6NYBT.mjs.map → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BJUgm59a.mjs.map} +1 -1
  120. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B5Ko0JyG.mjs → acorex-platform-module-maintenance-management-client-start-work-order-flow.command-Bg1do_Uu.mjs} +135 -10
  121. package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-Bg1do_Uu.mjs.map +1 -0
  122. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-Di4R6LQl.mjs → acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-CSKzwPjv.mjs} +37 -2
  123. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-CSKzwPjv.mjs.map +1 -0
  124. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-D75YRfD2.mjs → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-B8vjsOI_.mjs} +2 -2
  125. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-D75YRfD2.mjs.map → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-B8vjsOI_.mjs.map} +1 -1
  126. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-B90OJ-Ol.mjs → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-DG80hqRj.mjs} +2 -2
  127. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-B90OJ-Ol.mjs.map → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-DG80hqRj.mjs.map} +1 -1
  128. package/fesm2022/acorex-platform-module-maintenance-management-client.mjs +1 -1
  129. package/i18n/en-AU/maintenance-management.json +31 -4
  130. package/i18n/en-US/maintenance-management.json +31 -4
  131. package/i18n/fa-IR/maintenance-management.json +31 -4
  132. package/package.json +2 -1
  133. package/types/acorex-platform-module-maintenance-management-client-contracts.d.ts +54 -8
  134. package/types/acorex-platform-module-maintenance-management-client.d.ts +10 -3
  135. package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-6cXxZPN1.mjs.map +0 -1
  136. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-CDwXJTyO.mjs.map +0 -1
  137. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-DZp6tUTX.mjs.map +0 -1
  138. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-DgtyyggM.mjs.map +0 -1
  139. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-hgfgOV6Q.mjs.map +0 -1
  140. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-CM0Wokah.mjs.map +0 -1
  141. package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B5Ko0JyG.mjs.map +0 -1
  142. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-Di4R6LQl.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-DDvUWUU5.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/create-or-get-work-report-draft.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 { defaultTo, get, 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 { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface CreateOrGetWorkReportDraftInput {\n workOrderId: string;\n performedById?: string | null;\n}\n\nexport interface CreateOrGetWorkReportDraftOutput {\n workReportId: string;\n created: boolean;\n reused: boolean;\n}\n\n//#endregion\n\n/**\n * Creates a draft work report for a work order or reuses an existing one to prevent duplicates.\n */\n@Injectable({ providedIn: 'root' })\nexport class CreateOrGetWorkReportDraftActivity\n implements AXPCommand<CreateOrGetWorkReportDraftInput, CreateOrGetWorkReportDraftOutput>\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: CreateOrGetWorkReportDraftInput,\n ): AXPCommandExecuteResultPromise<CreateOrGetWorkReportDraftOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const existing = await this.findWorkReportByWorkOrderId(workOrderId);\n if (existing?.id) {\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Reused existing work report draft',\n { workOrderId, workReportId: existing.id },\n );\n return { success: true, kind: 'object',\n data: {\n workReportId: existing.id,\n created: false,\n reused: true,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n const performedById = await this.resolvePerformedById(workOrderId, input.performedById);\n if (!performedById) {\n this.debug.error(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'performedById could not be resolved',\n { workOrderId },\n );\n return {\n success: false,\n message: { text: 'performedById is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const now = new Date().toISOString();\n const createdId = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .create({\n workOrderId,\n reportedAt: now,\n performedById,\n startedAt: now,\n finalizedAt: null,\n assessments: [],\n } as never);\n\n const workReportId = this.resolveText(createdId);\n if (!workReportId) {\n this.debug.error(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Work report draft creation returned no id',\n { workOrderId },\n );\n return {\n success: false,\n message: { text: 'Work report draft could not be created' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Created work report draft',\n { workOrderId, workReportId, performedById },\n );\n\n return { success: true, kind: 'object',\n data: {\n workReportId,\n created: true,\n reused: false,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolvePerformedById(workOrderId: string, explicit: unknown): Promise<string> {\n const fromInput = this.resolveText(explicit);\n if (fromInput) {\n return fromInput;\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 const assignedToId = this.resolveText(workOrder?.assignedToId);\n if (!assignedToId) {\n return '';\n }\n\n const page = await this.entityService\n .withEntity('HumanCapitalManagement', 'Employee')\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [{ field: 'personId', operator: { type: 'equal' }, value: assignedToId }],\n },\n } as never);\n\n const employee = defaultTo(get(page, 'items[0]'), null) as { id?: string } | null;\n return this.resolveText(employee?.id);\n }\n\n private async findWorkReportByWorkOrderId(workOrderId: string): Promise<{ id?: string } | null> {\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: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n return defaultTo(get(page, 'items[0]'), null) as { id?: string } | null;\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":";;;;;;;;AAAA;AA4BA;AAEA;;AAEG;MAEU,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC;AA6JjD,IAAA;;;IAvJC,MAAM,OAAO,CACX,KAAsC,EAAA;QAEtC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;QAExD,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,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,WAAW,CAAC;AACpE,QAAA,IAAI,QAAQ,EAAE,EAAE,EAAE;YAChB,IAAI,CAAC,KAAK,CAAC,KAAK,CACd,uCAAuC,EACvC,mBAAmB,EACnB,mCAAmC,EACnC,EAAE,WAAW,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AE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE;IACrB;8GAhKW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BXKKfu4I.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/create-or-get-work-report-draft.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 { defaultTo, get, 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 { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface CreateOrGetWorkReportDraftInput {\n workOrderId: string;\n performedById?: string | null;\n}\n\nexport interface CreateOrGetWorkReportDraftOutput {\n workReportId: string;\n created: boolean;\n reused: boolean;\n}\n\n//#endregion\n\n/**\n * Creates a draft work report for a work order or reuses an existing one to prevent duplicates.\n */\n@Injectable({ providedIn: 'root' })\nexport class CreateOrGetWorkReportDraftActivity\n implements AXPCommand<CreateOrGetWorkReportDraftInput, CreateOrGetWorkReportDraftOutput>\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: CreateOrGetWorkReportDraftInput,\n ): AXPCommandExecuteResultPromise<CreateOrGetWorkReportDraftOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const existing = await this.findWorkReportByWorkOrderId(workOrderId);\n if (existing?.id) {\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Reused existing work report draft',\n { workOrderId, workReportId: existing.id },\n );\n return { success: true, kind: 'object',\n data: {\n workReportId: existing.id,\n created: false,\n reused: true,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n const performedById = await this.resolvePerformedById(workOrderId, input.performedById);\n if (!performedById) {\n this.debug.error(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'performedById could not be resolved',\n { workOrderId },\n );\n return {\n success: false,\n message: { text: 'performedById is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const now = new Date().toISOString();\n const createdId = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .create({\n workOrderId,\n reportedAt: now,\n performedById,\n startedAt: now,\n finalizedAt: null,\n assessments: [],\n } as never);\n\n const workReportId = this.resolveText(createdId);\n if (!workReportId) {\n this.debug.error(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Work report draft creation returned no id',\n { workOrderId },\n );\n return {\n success: false,\n message: { text: 'Work report draft could not be created' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-draft',\n 'Created work report draft',\n { workOrderId, workReportId, performedById },\n );\n\n return { success: true, kind: 'object',\n data: {\n workReportId,\n created: true,\n reused: false,\n },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolvePerformedById(workOrderId: string, explicit: unknown): Promise<string> {\n const fromInput = this.resolveText(explicit);\n if (fromInput) {\n return fromInput;\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 const assignedToId = this.resolveText(workOrder?.assignedToId);\n if (!assignedToId) {\n return '';\n }\n\n const page = await this.entityService\n .withEntity('HumanCapitalManagement', 'Employee')\n .data()\n .query({\n skip: 0,\n take: 1,\n filter: {\n logic: 'and',\n filters: [{ field: 'personId', operator: { type: 'equal' }, value: assignedToId }],\n },\n } as never);\n\n const employee = defaultTo(get(page, 'items[0]'), null) as { id?: string } | null;\n return this.resolveText(employee?.id);\n }\n\n private async findWorkReportByWorkOrderId(workOrderId: string): Promise<{ id?: string } | null> {\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: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n return defaultTo(get(page, 'items[0]'), null) as { id?: string } | null;\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":";;;;;;;;AAAA;AA4BA;AAEA;;AAEG;MAEU,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG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AAG,MAAM,IAAI,CAAC;AACrB,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI;AACtE,aAAA,IAAI;AACJ,aAAA,KAAK,CAAC;AACL,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,MAAM,EAAE;AACN,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACrF,aAAA;AACO,SAAA,CAAC;QAEb,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,CAA2B;IACzE;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;8GAhKW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1,7 +1,7 @@
1
1
  import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
2
2
  import * as i0 from '@angular/core';
3
3
  import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
4
- import { a as AXMMaintenanceIntervalComponent } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-6cXxZPN1.mjs';
4
+ import { a as AXMMaintenanceIntervalComponent } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CGjcOjjv.mjs';
5
5
  import { r as readMaintenanceIntervalKinds } from './acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-D8Hnq0ct.mjs';
6
6
 
7
7
  //#region ----- Imports -----
@@ -51,4 +51,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
51
51
  }] });
52
52
 
53
53
  export { AXMMaintenanceIntervalWidgetEditComponent };
54
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CUcsLsuh.mjs.map
54
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-Be1Nup4H.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CUcsLsuh.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/maintenance-interval/maintenance-interval-widget-edit.component.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport type { AXMMaintenanceIntervalConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { ChangeDetectionStrategy, Component, computed } from '@angular/core';\n\nimport { AXMMaintenanceIntervalComponent } from './maintenance-interval.component';\nimport { readMaintenanceIntervalKinds } from './maintenance-interval-widget.kinds';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-maintenance-interval-widget-edit',\n template: `\n <axm-maintenance-interval\n [supportedIntervalKinds]=\"supportedKinds()\"\n [value]=\"currentValue()\"\n [disabled]=\"isDisabled()\"\n (valueChange)=\"onIntervalConfigChange($event)\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXMMaintenanceIntervalComponent],\n})\nexport class AXMMaintenanceIntervalWidgetEditComponent extends AXPValueWidgetComponent<\n AXMMaintenanceIntervalConfig | null\n> {\n //#region ----- Computed Properties -----\n\n protected readonly supportedKinds = computed(() =>\n readMaintenanceIntervalKinds(this.options(), (path) => this.contextService.getValue(path)),\n );\n\n protected readonly currentValue = computed(() => this.getValue());\n\n protected readonly isDisabled = computed(() => Boolean(this.options()['disabled']));\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onIntervalConfigChange(config: AXMMaintenanceIntervalConfig): void {\n this.setValue(config);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAAA;AASA;AAEA;AAeM,MAAO,yCAA0C,SAAQ,uBAE9D,CAAA;AAfD,IAAA,WAAA,GAAA;;;QAkBqB,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,4BAA4B,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;2FAC3F;QAEkB,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;yFAAC;AAE9C,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;uFAAC;AAWpF,IAAA;;;AALW,IAAA,sBAAsB,CAAC,MAAoC,EAAA;AACnE,QAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IACvB;8GAnBW,yCAAyC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yCAAyC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAX1C;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAES,+BAA+B,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,EAAA,OAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAE9B,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAbrD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sCAAsC;AAChD,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,+BAA+B,CAAC;AAC3C,iBAAA;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-Be1Nup4H.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/maintenance-interval/maintenance-interval-widget-edit.component.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport type { AXMMaintenanceIntervalConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { ChangeDetectionStrategy, Component, computed } from '@angular/core';\n\nimport { AXMMaintenanceIntervalComponent } from './maintenance-interval.component';\nimport { readMaintenanceIntervalKinds } from './maintenance-interval-widget.kinds';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-maintenance-interval-widget-edit',\n template: `\n <axm-maintenance-interval\n [supportedIntervalKinds]=\"supportedKinds()\"\n [value]=\"currentValue()\"\n [disabled]=\"isDisabled()\"\n (valueChange)=\"onIntervalConfigChange($event)\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXMMaintenanceIntervalComponent],\n})\nexport class AXMMaintenanceIntervalWidgetEditComponent extends AXPValueWidgetComponent<\n AXMMaintenanceIntervalConfig | null\n> {\n //#region ----- Computed Properties -----\n\n protected readonly supportedKinds = computed(() =>\n readMaintenanceIntervalKinds(this.options(), (path) => this.contextService.getValue(path)),\n );\n\n protected readonly currentValue = computed(() => this.getValue());\n\n protected readonly isDisabled = computed(() => Boolean(this.options()['disabled']));\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onIntervalConfigChange(config: AXMMaintenanceIntervalConfig): void {\n this.setValue(config);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAAA;AASA;AAEA;AAeM,MAAO,yCAA0C,SAAQ,uBAE9D,CAAA;AAfD,IAAA,WAAA,GAAA;;;QAkBqB,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,4BAA4B,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;2FAC3F;QAEkB,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;yFAAC;AAE9C,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;uFAAC;AAWpF,IAAA;;;AALW,IAAA,sBAAsB,CAAC,MAAoC,EAAA;AACnE,QAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IACvB;8GAnBW,yCAAyC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yCAAyC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAX1C;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAES,+BAA+B,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,EAAA,OAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAE9B,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAbrD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sCAAsC;AAChD,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,+BAA+B,CAAC;AAC3C,iBAAA;;;"}
@@ -1,6 +1,6 @@
1
1
  import { AXLabelComponent } from '@acorex/components/label';
2
2
  import { AXSchedulerPickerService } from '@acorex/components/scheduler-picker';
3
- import * as i6 from '@acorex/core/translation';
3
+ import * as i7 from '@acorex/core/translation';
4
4
  import { AXTranslationModule } from '@acorex/core/translation';
5
5
  import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
6
6
  import { AXMMaintenanceIntervalUnit, draftFromAXMMaintenanceIntervalConfig, buildAXMMaintenanceIntervalConfig, AXMMaintenanceIntervalTriggerLogic } from '@acorex-platform/module-maintenance-management-client/contracts';
@@ -20,6 +20,7 @@ const UNIT_LABEL_KEYS = {
20
20
  [AXMMaintenanceIntervalUnit.Operation]: `${I18N}.units.operation`,
21
21
  };
22
22
  const KIND_LABEL_KEYS = {
23
+ schedule: `${I18N}.kinds.schedule`,
23
24
  date: `${I18N}.kinds.date`,
24
25
  distance: `${I18N}.kinds.distance`,
25
26
  'operating-hours': `${I18N}.kinds.operating-hours`,
@@ -63,8 +64,8 @@ class AXMMaintenanceIntervalWidgetViewComponent extends AXPValueWidgetComponent
63
64
  //#endregion
64
65
  //#region ----- Lifecycle -----
65
66
  this.#scheduleSummaryEffect = effect(() => {
66
- const dateTrigger = this.triggers().find((trigger) => trigger.kind === 'date');
67
- const schedule = dateTrigger && 'schedule' in dateTrigger ? dateTrigger.schedule : null;
67
+ const scheduleTrigger = this.triggers().find((trigger) => trigger.kind === 'schedule' || (trigger.kind === 'date' && 'schedule' in trigger && trigger.schedule));
68
+ const schedule = scheduleTrigger && 'schedule' in scheduleTrigger ? scheduleTrigger.schedule : null;
68
69
  void this.loadScheduleSummary(schedule);
69
70
  }, /* @ts-ignore */
70
71
  ...(ngDevMode ? [{ debugName: "#scheduleSummaryEffect" }] : /* istanbul ignore next */ []));
@@ -78,17 +79,20 @@ class AXMMaintenanceIntervalWidgetViewComponent extends AXPValueWidgetComponent
78
79
  return KIND_LABEL_KEYS[trigger.kind] ?? '';
79
80
  }
80
81
  meterText(trigger) {
81
- if (trigger.kind === 'date') {
82
+ if (trigger.kind === 'date' || trigger.kind === 'schedule') {
82
83
  return '';
83
84
  }
84
85
  return String(trigger.interval);
85
86
  }
86
87
  unitLabel(trigger) {
87
- if (trigger.kind === 'date' || trigger.unit == null) {
88
+ if (trigger.kind === 'date' || trigger.kind === 'schedule' || trigger.unit == null) {
88
89
  return '';
89
90
  }
90
91
  return UNIT_LABEL_KEYS[trigger.unit];
91
92
  }
93
+ dateLabel(trigger) {
94
+ return trigger.kind === 'date' && trigger.date ? trigger.date : '';
95
+ }
92
96
  scheduleLabel() {
93
97
  return this.scheduleSummary();
94
98
  }
@@ -110,12 +114,12 @@ class AXMMaintenanceIntervalWidgetViewComponent extends AXPValueWidgetComponent
110
114
  return !!value && typeof value === 'object' && 'mode' in value;
111
115
  }
112
116
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMaintenanceIntervalWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
113
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMMaintenanceIntervalWidgetViewComponent, isStandalone: true, selector: "axm-maintenance-interval-widget-view", usesInheritance: true, ngImport: i0, template: "<!-- ----- Nothing to configure, or no interval is enabled ----- -->\n@if (triggers().length === 0) {\n <!-- ----- Asset type supports intervals, but none are enabled ----- -->\n @if (hasSupportedKinds()) {\n <span class=\"ax-text-muted\">{{ noneKey | translate | async }}</span>\n }\n <!-- ----- Asset type has no supported interval kinds ----- -->\n @else {\n <span class=\"ax-text-muted\">{{ emptyKey | translate | async }}</span>\n }\n}\n\n@for (trigger of triggers(); track trigger.kind) {\n <div class=\"mt-2\">\n <ax-label>{{ kindLabel(trigger) | translate | async }}</ax-label>\n <!-- ----- Date shows the existing scheduler summary ----- -->\n @if (trigger.kind === 'date') {\n <span class=\"ms-2\">{{ scheduleLabel() }}</span>\n }\n <!-- ----- Meter interval shows the amount and unit ----- -->\n @else {\n <span class=\"ms-2\">{{ everyKey | translate | async }} {{ meterText(trigger) }} {{ unitLabel(trigger) | translate | async }}</span>\n }\n </div>\n}\n\n<!-- ----- Trigger condition when more than one interval is configured ----- -->\n@if (showTriggerLogic()) {\n <div class=\"mt-3\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <span class=\"ms-2\">{{ triggerLogicKey() | translate | async }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
117
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMMaintenanceIntervalWidgetViewComponent, isStandalone: true, selector: "axm-maintenance-interval-widget-view", usesInheritance: true, ngImport: i0, template: "<!-- ----- Nothing to configure, or no interval is enabled ----- -->\n@if (triggers().length === 0) {\n <!-- ----- Asset type supports intervals, but none are enabled ----- -->\n @if (hasSupportedKinds()) {\n <span class=\"ax-text-muted\">{{ noneKey | translate | async }}</span>\n }\n <!-- ----- Asset type has no supported interval kinds ----- -->\n @else {\n <span class=\"ax-text-muted\">{{ emptyKey | translate | async }}</span>\n }\n}\n\n@for (trigger of triggers(); track trigger.kind) {\n <div class=\"mt-2\">\n <ax-label>{{ kindLabel(trigger) | translate | async }}</ax-label>\n <!-- ----- Schedule shows the scheduler summary ----- -->\n @if (trigger.kind === 'schedule') {\n <span class=\"ms-2\">{{ scheduleLabel() }}</span>\n }\n <!-- ----- Date shows a schedule summary when present, otherwise the single date ----- -->\n @else if (trigger.kind === 'date') {\n <!-- ----- Legacy date triggers that still store a scheduler value ----- -->\n @if (scheduleLabel(); as summary) {\n <span class=\"ms-2\">{{ summary }}</span>\n }\n <!-- ----- Plain date-only trigger ----- -->\n @else {\n <span class=\"ms-2\">{{ dateLabel(trigger) }}</span>\n }\n }\n <!-- ----- Meter interval shows the amount and unit ----- -->\n @else {\n <span class=\"ms-2\">{{ everyKey | translate | async }} {{ meterText(trigger) }} {{ unitLabel(trigger) | translate | async }}</span>\n }\n </div>\n}\n\n<!-- ----- Trigger condition when more than one interval is configured ----- -->\n@if (showTriggerLogic()) {\n <div class=\"mt-3\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <span class=\"ms-2\">{{ triggerLogicKey() | translate | async }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
114
118
  }
115
119
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMaintenanceIntervalWidgetViewComponent, decorators: [{
116
120
  type: Component,
117
- args: [{ selector: 'axm-maintenance-interval-widget-view', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, AXTranslationModule, AXLabelComponent], template: "<!-- ----- Nothing to configure, or no interval is enabled ----- -->\n@if (triggers().length === 0) {\n <!-- ----- Asset type supports intervals, but none are enabled ----- -->\n @if (hasSupportedKinds()) {\n <span class=\"ax-text-muted\">{{ noneKey | translate | async }}</span>\n }\n <!-- ----- Asset type has no supported interval kinds ----- -->\n @else {\n <span class=\"ax-text-muted\">{{ emptyKey | translate | async }}</span>\n }\n}\n\n@for (trigger of triggers(); track trigger.kind) {\n <div class=\"mt-2\">\n <ax-label>{{ kindLabel(trigger) | translate | async }}</ax-label>\n <!-- ----- Date shows the existing scheduler summary ----- -->\n @if (trigger.kind === 'date') {\n <span class=\"ms-2\">{{ scheduleLabel() }}</span>\n }\n <!-- ----- Meter interval shows the amount and unit ----- -->\n @else {\n <span class=\"ms-2\">{{ everyKey | translate | async }} {{ meterText(trigger) }} {{ unitLabel(trigger) | translate | async }}</span>\n }\n </div>\n}\n\n<!-- ----- Trigger condition when more than one interval is configured ----- -->\n@if (showTriggerLogic()) {\n <div class=\"mt-3\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <span class=\"ms-2\">{{ triggerLogicKey() | translate | async }}</span>\n </div>\n}\n" }]
121
+ args: [{ selector: 'axm-maintenance-interval-widget-view', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, AXTranslationModule, AXLabelComponent], template: "<!-- ----- Nothing to configure, or no interval is enabled ----- -->\n@if (triggers().length === 0) {\n <!-- ----- Asset type supports intervals, but none are enabled ----- -->\n @if (hasSupportedKinds()) {\n <span class=\"ax-text-muted\">{{ noneKey | translate | async }}</span>\n }\n <!-- ----- Asset type has no supported interval kinds ----- -->\n @else {\n <span class=\"ax-text-muted\">{{ emptyKey | translate | async }}</span>\n }\n}\n\n@for (trigger of triggers(); track trigger.kind) {\n <div class=\"mt-2\">\n <ax-label>{{ kindLabel(trigger) | translate | async }}</ax-label>\n <!-- ----- Schedule shows the scheduler summary ----- -->\n @if (trigger.kind === 'schedule') {\n <span class=\"ms-2\">{{ scheduleLabel() }}</span>\n }\n <!-- ----- Date shows a schedule summary when present, otherwise the single date ----- -->\n @else if (trigger.kind === 'date') {\n <!-- ----- Legacy date triggers that still store a scheduler value ----- -->\n @if (scheduleLabel(); as summary) {\n <span class=\"ms-2\">{{ summary }}</span>\n }\n <!-- ----- Plain date-only trigger ----- -->\n @else {\n <span class=\"ms-2\">{{ dateLabel(trigger) }}</span>\n }\n }\n <!-- ----- Meter interval shows the amount and unit ----- -->\n @else {\n <span class=\"ms-2\">{{ everyKey | translate | async }} {{ meterText(trigger) }} {{ unitLabel(trigger) | translate | async }}</span>\n }\n </div>\n}\n\n<!-- ----- Trigger condition when more than one interval is configured ----- -->\n@if (showTriggerLogic()) {\n <div class=\"mt-3\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <span class=\"ms-2\">{{ triggerLogicKey() | translate | async }}</span>\n </div>\n}\n" }]
118
122
  }] });
119
123
 
120
124
  export { AXMMaintenanceIntervalWidgetViewComponent };
121
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-CM0Wokah.mjs.map
125
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/maintenance-interval/maintenance-interval-widget-view.component.ts","../../../../libs/modules/maintenance-management/client/src/lib/features/maintenance-interval/maintenance-interval-widget-view.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXLabelComponent } from '@acorex/components/label';\nimport { AXSchedulerPickerService, AXSchedulerPickerValue } from '@acorex/components/scheduler-picker';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport {\n AXMMaintenanceIntervalConfig,\n AXMMaintenanceIntervalTrigger,\n AXMMaintenanceIntervalTriggerLogic,\n AXMMaintenanceIntervalUnit,\n buildAXMMaintenanceIntervalConfig,\n draftFromAXMMaintenanceIntervalConfig,\n} from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\n\nimport { readMaintenanceIntervalKinds } from './maintenance-interval-widget.kinds';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst I18N = '@maintenance-management:maintenance-interval';\n\nconst UNIT_LABEL_KEYS: Record<AXMMaintenanceIntervalUnit, string> = {\n [AXMMaintenanceIntervalUnit.Kilometer]: `${I18N}.units.kilometer`,\n [AXMMaintenanceIntervalUnit.Mile]: `${I18N}.units.mile`,\n [AXMMaintenanceIntervalUnit.Hour]: `${I18N}.units.hour`,\n [AXMMaintenanceIntervalUnit.Operation]: `${I18N}.units.operation`,\n};\n\nconst KIND_LABEL_KEYS: Record<string, string> = {\n schedule: `${I18N}.kinds.schedule`,\n date: `${I18N}.kinds.date`,\n distance: `${I18N}.kinds.distance`,\n 'operating-hours': `${I18N}.kinds.operating-hours`,\n 'operation-count': `${I18N}.kinds.operation-count`,\n};\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-maintenance-interval-widget-view',\n templateUrl: './maintenance-interval-widget-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AsyncPipe, AXTranslationModule, AXLabelComponent],\n})\nexport class AXMMaintenanceIntervalWidgetViewComponent extends AXPValueWidgetComponent<\n AXMMaintenanceIntervalConfig | null\n> {\n //#region ----- Services & Dependencies -----\n\n private readonly schedulerPickerService = inject(AXSchedulerPickerService);\n\n //#endregion\n\n //#region ----- Constants -----\n\n protected readonly emptyKey = `${I18N}.empty`;\n protected readonly noneKey = `${I18N}.none`;\n protected readonly everyKey = `${I18N}.every`;\n protected readonly triggerLogicTitleKey = `${I18N}.trigger-logic.title`;\n protected readonly anyKey = `${I18N}.trigger-logic.any`;\n protected readonly allKey = `${I18N}.trigger-logic.all`;\n\n //#endregion\n\n //#region ----- State Signals -----\n\n private readonly scheduleSummary = signal('');\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly intervalConfig = computed(() => {\n const supported = readMaintenanceIntervalKinds(this.options(), (path) => this.contextService.getValue(path));\n const draft = draftFromAXMMaintenanceIntervalConfig(this.getValue(), supported);\n return buildAXMMaintenanceIntervalConfig(supported, draft).config;\n });\n\n protected readonly hasSupportedKinds = computed(\n () => readMaintenanceIntervalKinds(this.options(), (path) => this.contextService.getValue(path)).length > 0,\n );\n\n protected readonly triggers = computed(() => this.intervalConfig().triggers);\n\n protected readonly showTriggerLogic = computed(() => this.triggers().length > 1);\n\n protected readonly triggerLogicKey = computed(() =>\n this.intervalConfig().triggerLogic === AXMMaintenanceIntervalTriggerLogic.All ? this.allKey : this.anyKey,\n );\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n #scheduleSummaryEffect = effect(() => {\n const scheduleTrigger = this.triggers().find(\n (trigger) => trigger.kind === 'schedule' || (trigger.kind === 'date' && 'schedule' in trigger && trigger.schedule),\n );\n const schedule = scheduleTrigger && 'schedule' in scheduleTrigger ? scheduleTrigger.schedule : null;\n void this.loadScheduleSummary(schedule);\n });\n\n //#endregion\n\n //#region ----- Template helpers -----\n\n protected kindLabel(trigger: AXMMaintenanceIntervalTrigger): string {\n return KIND_LABEL_KEYS[trigger.kind] ?? '';\n }\n\n protected meterText(trigger: AXMMaintenanceIntervalTrigger): string {\n if (trigger.kind === 'date' || trigger.kind === 'schedule') {\n return '';\n }\n return String(trigger.interval);\n }\n\n protected unitLabel(trigger: AXMMaintenanceIntervalTrigger): string {\n if (trigger.kind === 'date' || trigger.kind === 'schedule' || trigger.unit == null) {\n return '';\n }\n return UNIT_LABEL_KEYS[trigger.unit];\n }\n\n protected dateLabel(trigger: AXMMaintenanceIntervalTrigger): string {\n return trigger.kind === 'date' && trigger.date ? trigger.date : '';\n }\n\n protected scheduleLabel(): string {\n return this.scheduleSummary();\n }\n\n //#endregion\n\n //#region ----- Schedule summary -----\n\n private async loadScheduleSummary(schedule: unknown): Promise<void> {\n if (!this.isSchedulerValue(schedule)) {\n this.scheduleSummary.set('');\n return;\n }\n try {\n this.scheduleSummary.set(await this.schedulerPickerService.toNaturalLanguage(schedule));\n } catch {\n this.scheduleSummary.set('');\n }\n }\n\n private isSchedulerValue(value: unknown): value is AXSchedulerPickerValue {\n return !!value && typeof value === 'object' && 'mode' in value;\n }\n\n //#endregion\n}\n\n//#endregion\n","<!-- ----- Nothing to configure, or no interval is enabled ----- -->\n@if (triggers().length === 0) {\n <!-- ----- Asset type supports intervals, but none are enabled ----- -->\n @if (hasSupportedKinds()) {\n <span class=\"ax-text-muted\">{{ noneKey | translate | async }}</span>\n }\n <!-- ----- Asset type has no supported interval kinds ----- -->\n @else {\n <span class=\"ax-text-muted\">{{ emptyKey | translate | async }}</span>\n }\n}\n\n@for (trigger of triggers(); track trigger.kind) {\n <div class=\"mt-2\">\n <ax-label>{{ kindLabel(trigger) | translate | async }}</ax-label>\n <!-- ----- Schedule shows the scheduler summary ----- -->\n @if (trigger.kind === 'schedule') {\n <span class=\"ms-2\">{{ scheduleLabel() }}</span>\n }\n <!-- ----- Date shows a schedule summary when present, otherwise the single date ----- -->\n @else if (trigger.kind === 'date') {\n <!-- ----- Legacy date triggers that still store a scheduler value ----- -->\n @if (scheduleLabel(); as summary) {\n <span class=\"ms-2\">{{ summary }}</span>\n }\n <!-- ----- Plain date-only trigger ----- -->\n @else {\n <span class=\"ms-2\">{{ dateLabel(trigger) }}</span>\n }\n }\n <!-- ----- Meter interval shows the amount and unit ----- -->\n @else {\n <span class=\"ms-2\">{{ everyKey | translate | async }} {{ meterText(trigger) }} {{ unitLabel(trigger) | translate | async }}</span>\n }\n </div>\n}\n\n<!-- ----- Trigger condition when more than one interval is configured ----- -->\n@if (showTriggerLogic()) {\n <div class=\"mt-3\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <span class=\"ms-2\">{{ triggerLogicKey() | translate | async }}</span>\n </div>\n}\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAAA;AAmBA;AAEA;AAEA,MAAM,IAAI,GAAG,8CAA8C;AAE3D,MAAM,eAAe,GAA+C;AAClE,IAAA,CAAC,0BAA0B,CAAC,SAAS,GAAG,CAAA,EAAG,IAAI,CAAA,gBAAA,CAAkB;AACjE,IAAA,CAAC,0BAA0B,CAAC,IAAI,GAAG,CAAA,EAAG,IAAI,CAAA,WAAA,CAAa;AACvD,IAAA,CAAC,0BAA0B,CAAC,IAAI,GAAG,CAAA,EAAG,IAAI,CAAA,WAAA,CAAa;AACvD,IAAA,CAAC,0BAA0B,CAAC,SAAS,GAAG,CAAA,EAAG,IAAI,CAAA,gBAAA,CAAkB;CAClE;AAED,MAAM,eAAe,GAA2B;IAC9C,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,eAAA,CAAiB;IAClC,IAAI,EAAE,CAAA,EAAG,IAAI,CAAA,WAAA,CAAa;IAC1B,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,eAAA,CAAiB;IAClC,iBAAiB,EAAE,CAAA,EAAG,IAAI,CAAA,sBAAA,C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A,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yCAAyC,uHClDtD,svDA4CA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIuB,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,0GAAhD,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAER,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBANrD,SAAS;+BACE,sCAAsC,EAAA,eAAA,EAE/B,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,svDAAA,EAAA;;;"}
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
4
4
  import { inject, Injectable } from '@angular/core';
5
5
  import { defaultTo, get, isString } from 'lodash';
6
6
  import { RootConfig } 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-6cXxZPN1.mjs';
7
+ import { A as AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CGjcOjjv.mjs';
8
8
  import { i as isWorkReportFinalized, s as sortWorkReportAssessments, u as upsertWorkReportAssessment } from './acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs';
9
9
 
10
10
  //#region ---- Imports ----
@@ -149,4 +149,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
149
149
  }] });
150
150
 
151
151
  export { RecordWorkReportAssessmentActivity };
152
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BiD6NYBT.mjs.map
152
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BJUgm59a.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BiD6NYBT.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/record-work-report-assessment.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 { defaultTo, get, isString } from 'lodash';\n\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport {\n isWorkReportFinalized,\n sortWorkReportAssessments,\n upsertWorkReportAssessment,\n} from '../../../work-report/work-report-assessment.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface RecordWorkReportAssessmentInput {\n workOrderId: string;\n workReportId?: string | null;\n performedById?: string | null;\n assessmentCaseId: string;\n completedById?: string | null;\n}\n\nexport interface RecordWorkReportAssessmentOutput {\n workReportId: string;\n workOrderId: string;\n}\n\n//#endregion\n\n/**\n * Persists a lightweight checklist assessment reference on WorkReport after a checklist is submitted.\n * Questionnaire answers remain in AssessmentCase / AssessmentSession storage.\n */\n@Injectable({ providedIn: 'root' })\nexport class RecordWorkReportAssessmentActivity\n implements AXPCommand<RecordWorkReportAssessmentInput, RecordWorkReportAssessmentOutput>\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: RecordWorkReportAssessmentInput,\n ): AXPCommandExecuteResultPromise<RecordWorkReportAssessmentOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n const assessmentCaseId = this.resolveText(input?.assessmentCaseId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (!assessmentCaseId) {\n return { success: true, kind: 'object',\n data: { workReportId: this.resolveText(input.workReportId), workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n const workReport = await this.resolveWorkReport(workOrderId, input);\n if (!workReport?.id) {\n return {\n success: false,\n message: { text: 'Work report could not be resolved for the work order' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (isWorkReportFinalized(workReport)) {\n return {\n success: false,\n message: { text: 'Work report is finalized and cannot be updated' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const assessmentCase = await this.loadAssessmentCase(assessmentCaseId);\n const completedById = this.resolveText(input.completedById);\n const assessments = sortWorkReportAssessments(\n upsertWorkReportAssessment(workReport.assessments, {\n assessmentCaseId,\n assessmentCaseTitle: assessmentCase?.title as never,\n completedAt: new Date().toISOString(),\n completedById: completedById || null,\n }),\n );\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .update(workReport.id, { assessments } as never);\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-assessment',\n 'Recorded checklist reference on work report',\n { workOrderId, workReportId: workReport.id, assessmentCaseId, assessmentCount: assessments.length },\n );\n\n return { success: true, kind: 'object',\n data: { workReportId: workReport.id, workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolveWorkReport(\n workOrderId: string,\n input: RecordWorkReportAssessmentInput,\n ): Promise<AXMMaintenanceManagementWorkReportEntityModel | null> {\n const workReportId = this.resolveText(input.workReportId);\n if (workReportId) {\n const byId = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(workReportId)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n\n if (byId?.id && this.resolveText(byId.workOrderId) === workOrderId) {\n return byId;\n }\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: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n const existing = defaultTo(get(page, 'items[0]'), null) as AXMMaintenanceManagementWorkReportEntityModel | null;\n if (existing?.id) {\n return existing;\n }\n\n const performedById = this.resolveText(input.performedById);\n if (!performedById) {\n return null;\n }\n\n const now = new Date().toISOString();\n const createdId = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .create({\n workOrderId,\n reportedAt: now,\n performedById,\n startedAt: now,\n finalizedAt: null,\n assessments: [],\n } as never);\n\n const id = this.resolveText(createdId);\n if (!id) {\n return null;\n }\n\n return (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(id)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n }\n\n private async loadAssessmentCase(assessmentCaseId: string): Promise<{ title?: unknown } | null> {\n try {\n return (await this.entityService\n .withEntity('AssessmentManagement', 'AssessmentCase')\n .data()\n .byKey(assessmentCaseId)) as { title?: unknown } | null;\n } catch {\n return null;\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"],"names":[],"mappings":";;;;;;;;;AAAA;AAmCA;AAEA;;;AAGG;MAEU,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;;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,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-BJUgm59a.mjs","sources":["../../../../libs/modules/maintenance-management/client/src/lib/features/work-order/workflows/activities/record-work-report-assessment.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 { defaultTo, get, isString } from 'lodash';\n\nimport { RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE } from '../work-order-workflow.debug';\nimport type { AXMMaintenanceManagementWorkReportEntityModel } from '@acorex-platform/module-maintenance-management-client/contracts';\nimport {\n isWorkReportFinalized,\n sortWorkReportAssessments,\n upsertWorkReportAssessment,\n} from '../../../work-report/work-report-assessment.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface RecordWorkReportAssessmentInput {\n workOrderId: string;\n workReportId?: string | null;\n performedById?: string | null;\n assessmentCaseId: string;\n completedById?: string | null;\n}\n\nexport interface RecordWorkReportAssessmentOutput {\n workReportId: string;\n workOrderId: string;\n}\n\n//#endregion\n\n/**\n * Persists a lightweight checklist assessment reference on WorkReport after a checklist is submitted.\n * Questionnaire answers remain in AssessmentCase / AssessmentSession storage.\n */\n@Injectable({ providedIn: 'root' })\nexport class RecordWorkReportAssessmentActivity\n implements AXPCommand<RecordWorkReportAssessmentInput, RecordWorkReportAssessmentOutput>\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: RecordWorkReportAssessmentInput,\n ): AXPCommandExecuteResultPromise<RecordWorkReportAssessmentOutput> {\n const workOrderId = this.resolveText(input?.workOrderId);\n const assessmentCaseId = this.resolveText(input?.assessmentCaseId);\n\n if (!workOrderId) {\n return {\n success: false,\n message: { text: 'workOrderId is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (!assessmentCaseId) {\n return { success: true, kind: 'object',\n data: { workReportId: this.resolveText(input.workReportId), workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n const workReport = await this.resolveWorkReport(workOrderId, input);\n if (!workReport?.id) {\n return {\n success: false,\n message: { text: 'Work report could not be resolved for the work order' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n if (isWorkReportFinalized(workReport)) {\n return {\n success: false,\n message: { text: 'Work report is finalized and cannot be updated' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const assessmentCase = await this.loadAssessmentCase(assessmentCaseId);\n const completedById = this.resolveText(input.completedById);\n const assessments = sortWorkReportAssessments(\n upsertWorkReportAssessment(workReport.assessments, {\n assessmentCaseId,\n assessmentCaseTitle: assessmentCase?.title as never,\n completedAt: new Date().toISOString(),\n completedById: completedById || null,\n }),\n );\n\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .update(workReport.id, { assessments } as never);\n\n this.debug.trace(\n AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE,\n 'work-report-assessment',\n 'Recorded checklist reference on work report',\n { workOrderId, workReportId: workReport.id, assessmentCaseId, assessmentCount: assessments.length },\n );\n\n return { success: true, kind: 'object',\n data: { workReportId: workReport.id, workOrderId },\n metadata: { outcome: 'Done' },\n };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async resolveWorkReport(\n workOrderId: string,\n input: RecordWorkReportAssessmentInput,\n ): Promise<AXMMaintenanceManagementWorkReportEntityModel | null> {\n const workReportId = this.resolveText(input.workReportId);\n if (workReportId) {\n const byId = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(workReportId)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n\n if (byId?.id && this.resolveText(byId.workOrderId) === workOrderId) {\n return byId;\n }\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: [{ field: 'workOrderId', operator: { type: 'equal' }, value: workOrderId }],\n },\n } as never);\n\n const existing = defaultTo(get(page, 'items[0]'), null) as AXMMaintenanceManagementWorkReportEntityModel | null;\n if (existing?.id) {\n return existing;\n }\n\n const performedById = this.resolveText(input.performedById);\n if (!performedById) {\n return null;\n }\n\n const now = new Date().toISOString();\n const createdId = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .create({\n workOrderId,\n reportedAt: now,\n performedById,\n startedAt: now,\n finalizedAt: null,\n assessments: [],\n } as never);\n\n const id = this.resolveText(createdId);\n if (!id) {\n return null;\n }\n\n return (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workReport.name)\n .data()\n .byKey(id)) as AXMMaintenanceManagementWorkReportEntityModel | null;\n }\n\n private async loadAssessmentCase(assessmentCaseId: string): Promise<{ title?: unknown } | null> {\n try {\n return (await this.entityService\n .withEntity('AssessmentManagement', 'AssessmentCase')\n .data()\n .byKey(assessmentCaseId)) as { title?: unknown } | null;\n } catch {\n return null;\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"],"names":[],"mappings":";;;;;;;;;AAAA;AAmCA;AAEA;;;A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AA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -4,11 +4,79 @@ import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/t
4
4
  import { AXPEntityService, getRecordWorkflowInstanceId, buildAXPRecordWorkflowInfo } from '@acorex-platform/framework-client/layout/entity';
5
5
  import { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';
6
6
  import { AXP_WORKFLOW_ENGINE } from '@acorex-platform/framework-client/workflow';
7
+ import { AXPWorkflowInstanceHumanTaskService } from '@acorex-platform/module-workflow-management-client';
7
8
  import * as i0 from '@angular/core';
8
9
  import { inject, Injectable } from '@angular/core';
9
10
  import { defaultTo, get, isString } from 'lodash';
10
11
  import { AXMWorkOrderStatus, RootConfig } from '@acorex-platform/module-maintenance-management-client/contracts';
11
- import { q as queryWorkflowTemplatesForAsset, r as resolveDisplayLabel } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-6cXxZPN1.mjs';
12
+ import { q as queryWorkflowTemplatesForAsset, r as resolveDisplayLabel } from './acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CGjcOjjv.mjs';
13
+
14
+ //#region ----- Types -----
15
+ function resolveText(value) {
16
+ return typeof value === 'string' ? value.trim() : '';
17
+ }
18
+ function isRecord(value) {
19
+ return value != null && typeof value === 'object' && !Array.isArray(value);
20
+ }
21
+ //#endregion
22
+ //#region ----- Resolve -----
23
+ /**
24
+ * Distinguishes WorkOrder id from workflow-instance / bookmark ids on StartFlow input.
25
+ * Prefer explicit business `data.id` / `workOrderId`; never treat bookmarkId or instanceId as the work order.
26
+ */
27
+ function resolveStartWorkOrderFlowIds(input) {
28
+ const root = isRecord(input) ? input : {};
29
+ const data = isRecord(root['data']) ? root['data'] : {};
30
+ const options = isRecord(root['options']) ? root['options'] : {};
31
+ const optionsData = isRecord(options['data']) ? options['data'] : {};
32
+ const sourceInstanceId = resolveText(root['instanceId']) ||
33
+ resolveText(data['instanceId']) ||
34
+ resolveText(options['instanceId']) ||
35
+ resolveText(optionsData['instanceId']);
36
+ const sourceBookmarkId = resolveText(root['bookmarkId']) ||
37
+ resolveText(data['bookmarkId']) ||
38
+ resolveText(options['bookmarkId']) ||
39
+ resolveText(optionsData['bookmarkId']);
40
+ const sourceActivityId = resolveText(root['activityId']) ||
41
+ resolveText(data['activityId']) ||
42
+ resolveText(options['activityId']) ||
43
+ resolveText(optionsData['activityId']);
44
+ const sourceTaskToken = resolveText(root['taskToken']) ||
45
+ resolveText(data['taskToken']) ||
46
+ resolveText(options['taskToken']) ||
47
+ resolveText(optionsData['taskToken']);
48
+ const candidates = [
49
+ resolveText(data['workOrderId']),
50
+ resolveText(root['workOrderId']),
51
+ resolveText(options['workOrderId']),
52
+ resolveText(data['id']),
53
+ resolveText(optionsData['id']),
54
+ resolveText(optionsData['workOrderId']),
55
+ ];
56
+ let workOrderId = '';
57
+ for (const candidate of candidates) {
58
+ if (!candidate) {
59
+ continue;
60
+ }
61
+ // Never confuse task-board / workflow ids with the work order.
62
+ if (candidate === sourceInstanceId ||
63
+ candidate === sourceBookmarkId ||
64
+ candidate === sourceActivityId ||
65
+ candidate === sourceTaskToken) {
66
+ continue;
67
+ }
68
+ workOrderId = candidate;
69
+ break;
70
+ }
71
+ return {
72
+ workOrderId,
73
+ sourceInstanceId,
74
+ sourceBookmarkId,
75
+ sourceActivityId,
76
+ sourceTaskToken,
77
+ };
78
+ }
79
+ //#endregion
12
80
 
13
81
  //#region ---- Imports ----
14
82
  const STARTABLE_STATUSES = new Set([
@@ -25,6 +93,7 @@ class StartWorkOrderFlowCommand {
25
93
  //#region ---- Services & Dependencies ----
26
94
  this.entityService = inject(AXPEntityService);
27
95
  this.workflowEngine = inject(AXP_WORKFLOW_ENGINE);
96
+ this.humanTaskService = inject(AXPWorkflowInstanceHumanTaskService);
28
97
  this.toastService = inject(AXToastService);
29
98
  this.translationService = inject(AXTranslationService);
30
99
  this.dialogService = inject(AXDialogService);
@@ -33,18 +102,23 @@ class StartWorkOrderFlowCommand {
33
102
  //#endregion
34
103
  //#region ---- Command Implementation ----
35
104
  async execute(input) {
36
- const row = defaultTo(get(input, 'data'), {});
37
- const workOrderId = this.resolveText(get(row, 'id'));
105
+ const ids = resolveStartWorkOrderFlowIds(input);
106
+ const workOrderId = ids.workOrderId;
38
107
  if (!workOrderId) {
39
108
  return { success: false, message: { text: 'Work order id is required.' } };
40
109
  }
41
- if (getRecordWorkflowInstanceId(row)) {
42
- return { success: false };
43
- }
110
+ const row = defaultTo(get(input, 'data'), {});
44
111
  let workOrder = await this.loadWorkOrder(workOrderId, row);
45
112
  if (!workOrder) {
46
113
  return { success: false, message: { text: 'Work order not found.' } };
47
114
  }
115
+ const existingExecutionInstanceId = getRecordWorkflowInstanceId(workOrder);
116
+ // Idempotent retry: execution already attached — close the interval card if still open.
117
+ if (existingExecutionInstanceId) {
118
+ await this.consumeSourceIntervalCard(ids);
119
+ this.eventService.publish('task-board.refresh', {});
120
+ return { success: true, kind: 'object', data: undefined };
121
+ }
48
122
  const explicitTemplateId = this.resolveText(get(input, 'maintenanceTemplateId'));
49
123
  const selectedTemplateId = await this.resolveMaintenanceTemplateId(workOrder, explicitTemplateId || undefined);
50
124
  if (!selectedTemplateId) {
@@ -60,7 +134,8 @@ class StartWorkOrderFlowCommand {
60
134
  workOrder = (await this.loadWorkOrder(workOrderId)) ?? workOrder;
61
135
  }
62
136
  const assetIdentifiers = await this.resolveAssetIdentifiers(this.resolveText(workOrder.assetId));
63
- const workflowInputs = this.buildWorkflowInputs(workOrder, workflowConfig, assignedEmployeeId, assetIdentifiers);
137
+ const checklistOverride = this.resolveText(get(input, 'checklist')) || this.resolveText(get(input, 'options.checklist'));
138
+ const workflowInputs = this.buildWorkflowInputs(workOrder, workflowConfig, assignedEmployeeId, assetIdentifiers, checklistOverride || undefined);
64
139
  const correlationId = `${RootConfig.entities.workOrder.source}:${workOrderId}:${workflowName}`;
65
140
  try {
66
141
  // Start via engine only — do not use AXPWorkflowManager.start() here; it auto-runs inline
@@ -69,6 +144,7 @@ class StartWorkOrderFlowCommand {
69
144
  workflowId: workflowName,
70
145
  input: {
71
146
  ...workflowInputs,
147
+ workOrderId,
72
148
  refId: workOrderId,
73
149
  refType: RootConfig.entities.workOrder.source,
74
150
  correlationId,
@@ -96,6 +172,8 @@ class StartWorkOrderFlowCommand {
96
172
  correlationId,
97
173
  }),
98
174
  });
175
+ // Close the original interval card only after execution workflow + workflowInfo succeed.
176
+ await this.consumeSourceIntervalCard(ids);
99
177
  this.eventService.publish('task-board.refresh', { provider: workflowName });
100
178
  const taskBoardHint = await this.translationService.translateAsync('@maintenance-management:work-orders.messages.workflow-started-use-task-board');
101
179
  this.toastService.show({
@@ -119,11 +197,41 @@ class StartWorkOrderFlowCommand {
119
197
  closeButton: true,
120
198
  timeOut: 5000,
121
199
  });
200
+ // Leave the interval card open for retry.
122
201
  return { success: false, message: { text: message } };
123
202
  }
124
203
  }
125
204
  //#endregion
126
205
  //#region ---- Helpers ----
206
+ /**
207
+ * Consumes the interval-due human-task bookmark after execution workflow is attached.
208
+ * Failures here do not roll back StartFlow — the card may remain until the next idempotent retry.
209
+ */
210
+ async consumeSourceIntervalCard(ids) {
211
+ if (!ids.sourceInstanceId || !ids.sourceBookmarkId || !ids.sourceActivityId || !ids.sourceTaskToken) {
212
+ return;
213
+ }
214
+ // Never resume using the work-order / execution instance id as the source card.
215
+ if (ids.sourceInstanceId === ids.workOrderId ||
216
+ ids.sourceBookmarkId === ids.workOrderId ||
217
+ ids.sourceActivityId === ids.workOrderId) {
218
+ return;
219
+ }
220
+ try {
221
+ await this.humanTaskService.resumeSuspendedHumanTask({
222
+ instanceId: ids.sourceInstanceId,
223
+ bookmarkId: ids.sourceBookmarkId,
224
+ activityId: ids.sourceActivityId,
225
+ taskToken: ids.sourceTaskToken,
226
+ outcome: 'Done',
227
+ userInput: { workOrderId: ids.workOrderId },
228
+ suppressContinuation: true,
229
+ });
230
+ }
231
+ catch (error) {
232
+ console.error('[StartWorkOrderFlowCommand] failed to consume interval card', error);
233
+ }
234
+ }
127
235
  async loadWorkOrder(workOrderId, row) {
128
236
  if (get(row, 'id') === workOrderId) {
129
237
  return row;
@@ -195,7 +303,7 @@ class StartWorkOrderFlowCommand {
195
303
  await this.showWarning(content);
196
304
  return null;
197
305
  }
198
- const workflowName = workflowConfig.workflowName.trim();
306
+ const workflowName = this.resolveExecutionWorkflowName(workflowConfig);
199
307
  const assignedToId = this.resolveText(workOrder.assignedToId);
200
308
  if (!assignedToId) {
201
309
  const content = await this.translationService.translateAsync('@maintenance-management:work-orders.messages.assigned-user-required');
@@ -210,6 +318,17 @@ class StartWorkOrderFlowCommand {
210
318
  }
211
319
  return { workflowConfig: workflowConfig, workflowName, assignedEmployeeId };
212
320
  }
321
+ /**
322
+ * Interval templates bind `maintenance-interval-work-order` for due-check creation.
323
+ * Manual StartFlow continues with `defaultInput.executionWorkflowName` when present.
324
+ */
325
+ resolveExecutionWorkflowName(workflowConfig) {
326
+ const executionName = this.resolveText(get(workflowConfig, 'defaultInput.executionWorkflowName'));
327
+ if (executionName) {
328
+ return executionName;
329
+ }
330
+ return workflowConfig.workflowName.trim();
331
+ }
213
332
  async resolveWorkflowConfigForTemplate(templateId) {
214
333
  const template = await this.entityService
215
334
  .withEntity(RootConfig.module.name, RootConfig.entities.maintenanceTemplate.name)
@@ -232,7 +351,7 @@ class StartWorkOrderFlowCommand {
232
351
  assetSerialNumber: assetSerialNumber || null,
233
352
  };
234
353
  }
235
- buildWorkflowInputs(workOrder, workflowConfig, assignedEmployeeId, assetIdentifiers) {
354
+ buildWorkflowInputs(workOrder, workflowConfig, assignedEmployeeId, assetIdentifiers, checklistOverride) {
236
355
  const assetTitle = workOrder.asset?.title;
237
356
  const assetDisplayName = typeof assetTitle === 'string'
238
357
  ? assetTitle
@@ -243,6 +362,11 @@ class StartWorkOrderFlowCommand {
243
362
  ? maintenanceTypeTitle
244
363
  : resolveMultiLanguageString(maintenanceTypeTitle, this.translationService.getActiveLang());
245
364
  const assignedToTitle = workOrder.assignedTo?.fullName;
365
+ // Interval workflow input `checklist` maps to approval flow `preChecklistQuestionnaireId`.
366
+ const checklistId = this.resolveText(checklistOverride) ||
367
+ this.resolveText(templateDefaults['checklist']) ||
368
+ this.resolveText(templateDefaults['preChecklistQuestionnaireId']);
369
+ // Template defaults first; runtime plan / work-order refs must win (never overridable by defaults).
246
370
  return {
247
371
  ...templateDefaults,
248
372
  workOrderId: workOrder.id,
@@ -263,6 +387,7 @@ class StartWorkOrderFlowCommand {
263
387
  assignedEmployeeId: assignedEmployeeId || null,
264
388
  sourceType: workOrder.sourceType ?? null,
265
389
  dueDate: workOrder.scheduledEnd ?? workOrder.scheduledStart ?? null,
390
+ ...(checklistId ? { preChecklistQuestionnaireId: checklistId, checklist: checklistId } : {}),
266
391
  };
267
392
  }
268
393
  resolveText(value) {
@@ -402,4 +527,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
402
527
  }] });
403
528
 
404
529
  export { StartWorkOrderFlowCommand };
405
- //# sourceMappingURL=acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B5Ko0JyG.mjs.map
530
+ //# sourceMappingURL=acorex-platform-module-maintenance-management-client-start-work-order-flow.command-Bg1do_Uu.mjs.map