@acorex-platform/module-maintenance-management-client 1.0.2 → 2.0.0-beta.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 (140) hide show
  1. package/fesm2022/{acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-C3cGlFKd.mjs → acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BN1T6EGq.mjs} +397 -226
  2. package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-BN1T6EGq.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register.mjs +3 -3
  4. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-failure-register.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs +127 -8
  6. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs +40 -34
  8. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs +3 -30
  10. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-order.mjs +39 -0
  12. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-work-order.mjs.map +1 -1
  13. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-B3VyUXZS.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-CvJLY_ER.mjs} +27 -27
  14. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-B3VyUXZS.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-CvJLY_ER.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CsYZTxT_.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CHISj-3_.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CsYZTxT_.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-CHISj-3_.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-Bh5dBgpo.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BB_neovt.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-Bh5dBgpo.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BB_neovt.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DvO6Fzyy.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-CA35iAeO.mjs} +2 -2
  20. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DvO6Fzyy.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-CA35iAeO.mjs.map} +1 -1
  21. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-PdvjV4lk.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-Dveksw4J.mjs} +2 -2
  22. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-PdvjV4lk.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-Dveksw4J.mjs.map} +1 -1
  23. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BV-O5oRI.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BrxNfi3J.mjs} +2 -2
  24. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BV-O5oRI.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BrxNfi3J.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-GqFBuuiR.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BwN3RK3T.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-GqFBuuiR.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BwN3RK3T.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-CiqHDstL.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-LLBPWwD6.mjs} +2 -2
  28. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-CiqHDstL.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-LLBPWwD6.mjs.map} +1 -1
  29. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-TcC_1stz.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-C530P5Cc.mjs} +2 -2
  30. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-TcC_1stz.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-C530P5Cc.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-q2O4YHPk.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-CjVopQfu.mjs} +2 -2
  32. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-q2O4YHPk.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-CjVopQfu.mjs.map} +1 -1
  33. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-CeyOYGAL.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-Bt-LPy1o.mjs} +2 -2
  34. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-CeyOYGAL.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-Bt-LPy1o.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-CDWqPcEx.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-DM3NkYIb.mjs} +2 -2
  36. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-CDWqPcEx.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-DM3NkYIb.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-6GS66uos.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CAUGtYZZ.mjs} +2 -2
  38. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-6GS66uos.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CAUGtYZZ.mjs.map} +1 -1
  39. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-BDsiwqyj.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-b2CoWHHc.mjs} +2 -2
  40. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-BDsiwqyj.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-b2CoWHHc.mjs.map} +1 -1
  41. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-DYX8gBDO.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-Ds2HnidM.mjs} +2 -2
  42. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-DYX8gBDO.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-Ds2HnidM.mjs.map} +1 -1
  43. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-DWKPDUB7.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-BWld5Sze.mjs} +5 -5
  44. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-BWld5Sze.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-wHk-6VCb.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-BO43T2pF.mjs} +2 -2
  46. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-wHk-6VCb.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-BO43T2pF.mjs.map} +1 -1
  47. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-tTg4D_-N.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-B0Zsa8d2.mjs} +2 -2
  48. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-tTg4D_-N.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-B0Zsa8d2.mjs.map} +1 -1
  49. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-BwsjdQur.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-B0p3E0th.mjs} +129 -10
  50. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-B0p3E0th.mjs.map +1 -0
  51. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-CCx9h8Gq.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-DOylBdod.mjs} +2 -2
  52. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-CCx9h8Gq.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-DOylBdod.mjs.map} +1 -1
  53. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-BlfNXvBw.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-Dg5UI7iT.mjs} +2 -2
  54. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-BlfNXvBw.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-Dg5UI7iT.mjs.map} +1 -1
  55. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-2lGT7_Xi.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-6juUHuAq.mjs} +2 -2
  56. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-2lGT7_Xi.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-6juUHuAq.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-bJKzxAis.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-Ci8LwI6j.mjs} +42 -36
  58. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-Ci8LwI6j.mjs.map +1 -0
  59. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-j2eyDg9O.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-DG6iTlAh.mjs} +5 -32
  60. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-DG6iTlAh.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DFJdx9Km.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-De8VGu0Y.mjs} +41 -2
  62. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-De8VGu0Y.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-DM60G8nP.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-7rwrxOLD.mjs} +2 -2
  64. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-DM60G8nP.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-7rwrxOLD.mjs.map} +1 -1
  65. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-DOvNijen.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-0MT-WwMU.mjs} +2 -2
  66. package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-DOvNijen.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-0MT-WwMU.mjs.map} +1 -1
  67. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog.mjs +1 -1
  68. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs +1096 -701
  69. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs.map +1 -1
  70. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-C-K8mD4N.mjs → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-DN48yuJ9.mjs} +2 -2
  71. package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-C-K8mD4N.mjs.map → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-DN48yuJ9.mjs.map} +1 -1
  72. package/fesm2022/{acorex-platform-module-maintenance-management-client-failure-register-status.provider-CLBaQy_e.mjs → acorex-platform-module-maintenance-management-client-failure-register-status.provider-C7p6xbx3.mjs} +1 -1
  73. package/fesm2022/{acorex-platform-module-maintenance-management-client-failure-register-status.provider-CLBaQy_e.mjs.map → acorex-platform-module-maintenance-management-client-failure-register-status.provider-C7p6xbx3.mjs.map} +1 -1
  74. package/fesm2022/{acorex-platform-module-maintenance-management-client-fill-work-report-completion.command-Capowl1e.mjs → acorex-platform-module-maintenance-management-client-fill-work-report-completion.command-BWOmZ9LK.mjs} +2 -2
  75. package/fesm2022/{acorex-platform-module-maintenance-management-client-fill-work-report-completion.command-Capowl1e.mjs.map → acorex-platform-module-maintenance-management-client-fill-work-report-completion.command-BWOmZ9LK.mjs.map} +1 -1
  76. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-DmfVFWOZ.mjs +98 -0
  77. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-DmfVFWOZ.mjs.map +1 -0
  78. package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-rqJ6-Akn.mjs} +6 -3
  79. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-rqJ6-Akn.mjs.map +1 -0
  80. package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-D8Hnq0ct.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-BnDgqwww.mjs} +17 -2
  81. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-BnDgqwww.mjs.map +1 -0
  82. package/fesm2022/{acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-C6rDOolF.mjs → acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-D9SdaLHS.mjs} +152 -4
  83. package/fesm2022/acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-D9SdaLHS.mjs.map +1 -0
  84. package/fesm2022/{acorex-platform-module-maintenance-management-client-open-work-report-from-work-order.command-B0O4fWPt.mjs → acorex-platform-module-maintenance-management-client-open-work-report-from-work-order.command-Cz_3VSE6.mjs} +3 -3
  85. package/fesm2022/{acorex-platform-module-maintenance-management-client-open-work-report-from-work-order.command-B0O4fWPt.mjs.map → acorex-platform-module-maintenance-management-client-open-work-report-from-work-order.command-Cz_3VSE6.mjs.map} +1 -1
  86. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-StzIetk8.mjs → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-Cs07SVKM.mjs} +3 -3
  87. package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-StzIetk8.mjs.map → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-Cs07SVKM.mjs.map} +1 -1
  88. package/fesm2022/{acorex-platform-module-maintenance-management-client-resolve-person-user-id.activity-nwXAJHkd.mjs → acorex-platform-module-maintenance-management-client-resolve-person-user-id.activity-Bmw1fXhW.mjs} +1 -1
  89. package/fesm2022/{acorex-platform-module-maintenance-management-client-resolve-person-user-id.activity-nwXAJHkd.mjs.map → acorex-platform-module-maintenance-management-client-resolve-person-user-id.activity-Bmw1fXhW.mjs.map} +1 -1
  90. package/fesm2022/{acorex-platform-module-maintenance-management-client-resolve-work-order.activity-q5WM7Sv5.mjs → acorex-platform-module-maintenance-management-client-resolve-work-order.activity-BgkerN1E.mjs} +1 -1
  91. package/fesm2022/{acorex-platform-module-maintenance-management-client-resolve-work-order.activity-q5WM7Sv5.mjs.map → acorex-platform-module-maintenance-management-client-resolve-work-order.activity-BgkerN1E.mjs.map} +1 -1
  92. package/fesm2022/{acorex-platform-module-maintenance-management-client-sign-off-work-order.command-Ca8WbM3R.mjs → acorex-platform-module-maintenance-management-client-sign-off-work-order.command-CqRr1Y2e.mjs} +132 -7
  93. package/fesm2022/acorex-platform-module-maintenance-management-client-sign-off-work-order.command-CqRr1Y2e.mjs.map +1 -0
  94. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow-id.util-CuUi8LBT.mjs → acorex-platform-module-maintenance-management-client-start-work-order-flow-id.util-BfP3AJxa.mjs} +1 -1
  95. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow-id.util-CuUi8LBT.mjs.map → acorex-platform-module-maintenance-management-client-start-work-order-flow-id.util-BfP3AJxa.mjs.map} +1 -1
  96. package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow.command-CNau6u4p.mjs → acorex-platform-module-maintenance-management-client-start-work-order-flow.command-Bq6BHkUZ.mjs} +28 -8
  97. package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-Bq6BHkUZ.mjs.map +1 -0
  98. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-CSKzwPjv.mjs → acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-DH8k3mM6.mjs} +28 -7
  99. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-DH8k3mM6.mjs.map +1 -0
  100. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-DDJHrYkP.mjs → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-D4_X8iuF.mjs} +2 -2
  101. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-DDJHrYkP.mjs.map → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-D4_X8iuF.mjs.map} +1 -1
  102. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-_B0SUFtQ.mjs → acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-BvVB4Bcr.mjs} +2 -2
  103. package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-_B0SUFtQ.mjs.map → acorex-platform-module-maintenance-management-client-update-work-report-on-completion.activity-BvVB4Bcr.mjs.map} +1 -1
  104. package/fesm2022/{acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-RA2zaQHH.mjs → acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-CSC01Cxt.mjs} +1 -1
  105. package/fesm2022/{acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-RA2zaQHH.mjs.map → acorex-platform-module-maintenance-management-client-validate-work-order-completion.activity-CSC01Cxt.mjs.map} +1 -1
  106. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-list-command-Bh_6PS5w.mjs → acorex-platform-module-maintenance-management-client-work-order-list-command-CVS61IDw.mjs} +1 -1
  107. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-list-command-Bh_6PS5w.mjs.map → acorex-platform-module-maintenance-management-client-work-order-list-command-CVS61IDw.mjs.map} +1 -1
  108. package/fesm2022/acorex-platform-module-maintenance-management-client-work-order-status-patch.util-BZWR2x2y.mjs +53 -0
  109. package/fesm2022/acorex-platform-module-maintenance-management-client-work-order-status-patch.util-BZWR2x2y.mjs.map +1 -0
  110. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-status.provider-DvBk5kAW.mjs → acorex-platform-module-maintenance-management-client-work-order-status.provider-tBxn2-nw.mjs} +1 -1
  111. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-status.provider-DvBk5kAW.mjs.map → acorex-platform-module-maintenance-management-client-work-order-status.provider-tBxn2-nw.mjs.map} +1 -1
  112. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs → acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-DvI4Gst1.mjs} +1 -1
  113. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-BikBvmHi.mjs.map → acorex-platform-module-maintenance-management-client-work-order-work-report-column.component-DvI4Gst1.mjs.map} +1 -1
  114. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-DcBxsEci.mjs → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-CDAa-HPv.mjs} +2 -2
  115. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-DcBxsEci.mjs.map → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-CDAa-HPv.mjs.map} +1 -1
  116. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs → acorex-platform-module-maintenance-management-client-work-report-assessment.util-H9Qr3JR1.mjs} +1 -1
  117. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-assessment.util-Da1HVAit.mjs.map → acorex-platform-module-maintenance-management-client-work-report-assessment.util-H9Qr3JR1.mjs.map} +1 -1
  118. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs → acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-CRJgdMsV.mjs} +2 -2
  119. package/fesm2022/{acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-BgIQr5Hr.mjs.map → acorex-platform-module-maintenance-management-client-work-report-checklist-results-view.component-CRJgdMsV.mjs.map} +1 -1
  120. package/fesm2022/acorex-platform-module-maintenance-management-client.mjs +1 -1
  121. package/i18n/en-AU/maintenance-management.json +59 -12
  122. package/i18n/en-US/maintenance-management.json +59 -12
  123. package/i18n/fa-IR/maintenance-management.json +58 -11
  124. package/package.json +3 -3
  125. package/types/acorex-platform-module-maintenance-management-client-contracts.d.ts +270 -107
  126. package/types/acorex-platform-module-maintenance-management-client.d.ts +13 -2
  127. package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-C3cGlFKd.mjs.map +0 -1
  128. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-DWKPDUB7.mjs.map +0 -1
  129. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-BwsjdQur.mjs.map +0 -1
  130. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-bJKzxAis.mjs.map +0 -1
  131. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-j2eyDg9O.mjs.map +0 -1
  132. package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DFJdx9Km.mjs.map +0 -1
  133. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-b8sTwXxe.mjs +0 -54
  134. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-b8sTwXxe.mjs.map +0 -1
  135. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-B0vjGln5.mjs.map +0 -1
  136. package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-D8Hnq0ct.mjs.map +0 -1
  137. package/fesm2022/acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-C6rDOolF.mjs.map +0 -1
  138. package/fesm2022/acorex-platform-module-maintenance-management-client-sign-off-work-order.command-Ca8WbM3R.mjs.map +0 -1
  139. package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-CNau6u4p.mjs.map +0 -1
  140. package/fesm2022/acorex-platform-module-maintenance-management-client-update-work-order-completed.activity-CSKzwPjv.mjs.map +0 -1
@@ -1,3 +1,10 @@
1
+ import { axpRegisterEntityPublicReadFields } from '@acorex-platform/framework-shared/entity';
2
+
3
+ // Existing catalog tree outputs. These flags/counts contain no related records.
4
+ for (const entity of ['FailureType', 'FailureDetection', 'FailureCause', 'FailureMechanism', 'FailureEffect']) {
5
+ axpRegisterEntityPublicReadFields(`MaintenanceManagement.${entity}`, 'hasChild', 'childrenCount');
6
+ }
7
+
1
8
  /** Maintenance catalog scope for questionnaires, question bank items, and workflow definitions. */
2
9
  const MM_CATALOG_SCOPE_MN = 'maintenance-management.mn';
3
10
 
@@ -33,392 +40,864 @@ const AXM_MAINTENANCE_INTERVAL_CHECK_COMMAND_KEY = AXMMaintenanceManagementComma
33
40
  //#endregion
34
41
 
35
42
  //#region ----- Constants -----
36
- /** Bookmark action that starts an interval work order. */
37
- const AXM_INTERVAL_START_FLOW_ACTION_NAME = 'start-flow';
38
- /** Bookmark action that opens the in-progress checklist form. */
39
- const AXM_INTERVAL_OPEN_FORM_ACTION_NAME = 'open-form';
40
- /** Bookmark action that collects a signature and completes the interval work order. */
41
- const AXM_INTERVAL_SIGN_OFF_ACTION_NAME = 'sign-off';
42
- /** Seeded interval workflow name. The task-board card belongs to this instance. */
43
- const AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME = 'maintenance-interval-work-order';
44
- const AXM_INTERVAL_DUE_ACTIVITY_ID = 'intervalDueHumanTask';
45
- /** Workflow variable / instance property for the checklist case of this work order. */
46
- const AXM_INTERVAL_CHECKLIST_CASE_ID = 'assessmentCaseId';
47
- /** Workflow variable / instance property for the checklist session of this work order. */
48
- const AXM_INTERVAL_CHECKLIST_SESSION_ID = 'assessmentSessionId';
49
- /** Workflow variable storing the template questionnaire this occurrence was opened against. */
50
- const AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID = 'checklistQuestionnaireId';
51
- /** Short-lived claim so concurrent Open Form clicks create one case and session. */
52
- const AXM_INTERVAL_CHECKLIST_CLAIM = 'checklistOccurrenceClaim';
53
- const AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION = '@maintenance-management:work-orders.tasks.interval-due.in-progress-description';
54
- const AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION = '@maintenance-management:work-orders.tasks.interval-due.completed-description';
55
- //#endregion
56
- //#region ----- Checklist id -----
57
- function isRecord(value) {
58
- return value != null && typeof value === 'object' && !Array.isArray(value);
59
- }
60
- function resolveChecklistId(value) {
61
- if (typeof value === 'string') {
62
- return value.trim();
63
- }
64
- if (isRecord(value)) {
65
- return resolveChecklistId(value['id']);
66
- }
67
- return '';
68
- }
43
+ /** Widget name for the maintenance interval editor. Kind strings match `AXMAssetIntervalKind`. */
44
+ const AXM_MAINTENANCE_INTERVAL_WIDGET = 'maintenance-interval-editor';
69
45
  /**
70
- * Questionnaire for this interval occurrence.
71
- * `workflowState.input.checklist` wins over a task-action or command fallback.
46
+ * Same stored values as `AXMAssetIntervalKind`.
47
+ * Combinations are multiple entries, not extra kinds.
72
48
  */
73
- function readIntervalChecklistId(source, fallback) {
74
- const workflowInstance = isRecord(source?.['workflowInstance'])
75
- ? source['workflowInstance']
76
- : source;
77
- const workflowState = isRecord(workflowInstance?.['workflowState'])
78
- ? workflowInstance['workflowState']
79
- : null;
80
- const input = isRecord(workflowState?.['input']) ? workflowState['input'] : null;
81
- const properties = isRecord(workflowState?.['properties'])
82
- ? workflowState['properties']
83
- : null;
84
- return (resolveChecklistId(input?.['checklist']) ||
85
- resolveChecklistId(input?.['preChecklistQuestionnaireId']) ||
86
- resolveChecklistId(properties?.[AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID]) ||
87
- resolveChecklistId(properties?.['checklist']) ||
88
- resolveChecklistId(fallback));
49
+ const AXM_MAINTENANCE_INTERVAL_KINDS = ['schedule', 'date', 'distance', 'operating-hours', 'operation-count'];
50
+ const METER_KINDS = ['distance', 'operating-hours', 'operation-count'];
51
+ /** How multiple enabled intervals combine. Stored in lowercase, like other persisted enums. */
52
+ var AXMMaintenanceIntervalTriggerLogic;
53
+ (function (AXMMaintenanceIntervalTriggerLogic) {
54
+ AXMMaintenanceIntervalTriggerLogic["Any"] = "any";
55
+ AXMMaintenanceIntervalTriggerLogic["All"] = "all";
56
+ })(AXMMaintenanceIntervalTriggerLogic || (AXMMaintenanceIntervalTriggerLogic = {}));
57
+ /** Unit stored on a meter trigger. Distance is the only kind with a choice. */
58
+ var AXMMaintenanceIntervalUnit;
59
+ (function (AXMMaintenanceIntervalUnit) {
60
+ AXMMaintenanceIntervalUnit["Kilometer"] = "kilometer";
61
+ AXMMaintenanceIntervalUnit["Mile"] = "mile";
62
+ AXMMaintenanceIntervalUnit["Hour"] = "hour";
63
+ AXMMaintenanceIntervalUnit["Operation"] = "operation";
64
+ })(AXMMaintenanceIntervalUnit || (AXMMaintenanceIntervalUnit = {}));
65
+ //#endregion
66
+ //#region ----- Kind helpers -----
67
+ const KIND_SET = new Set(AXM_MAINTENANCE_INTERVAL_KINDS);
68
+ function isAXMMaintenanceIntervalKind(value) {
69
+ return KIND_SET.has(value);
89
70
  }
90
- function readChecklistIdFromTaskActions(actions) {
91
- if (!isRecord(actions)) {
92
- return '';
71
+ function isAXMMaintenanceMeterKind(value) {
72
+ return value === 'distance' || value === 'operating-hours' || value === 'operation-count';
73
+ }
74
+ function defaultAXMMaintenanceIntervalUnit(kind) {
75
+ switch (kind) {
76
+ case 'distance':
77
+ return AXMMaintenanceIntervalUnit.Kilometer;
78
+ case 'operating-hours':
79
+ return AXMMaintenanceIntervalUnit.Hour;
80
+ case 'operation-count':
81
+ return AXMMaintenanceIntervalUnit.Operation;
93
82
  }
94
- const lists = [actions['prefix'], actions['suffix']];
95
- for (const list of lists) {
96
- if (!Array.isArray(list)) {
97
- continue;
98
- }
99
- for (const item of list) {
100
- if (!isRecord(item) || !isRecord(item['command'])) {
101
- continue;
102
- }
103
- const options = isRecord(item['command']['options']) ? item['command']['options'] : null;
104
- const checklist = resolveChecklistId(options?.['checklist']);
105
- if (checklist) {
106
- return checklist;
107
- }
108
- }
83
+ }
84
+ function isAXMMaintenanceIntervalUnitForKind(kind, unit) {
85
+ switch (kind) {
86
+ case 'distance':
87
+ return unit === AXMMaintenanceIntervalUnit.Kilometer || unit === AXMMaintenanceIntervalUnit.Mile;
88
+ case 'operating-hours':
89
+ return unit === AXMMaintenanceIntervalUnit.Hour;
90
+ case 'operation-count':
91
+ return unit === AXMMaintenanceIntervalUnit.Operation;
109
92
  }
110
- return '';
111
93
  }
112
- //#endregion
113
- //#region ----- Task action -----
114
- function buildIntervalWorkOrderOpenFormAction(input) {
115
- return {
116
- name: AXM_INTERVAL_OPEN_FORM_ACTION_NAME,
117
- title: '@maintenance-management:work-orders.tasks.actions.open-form',
118
- icon: 'fa-light fa-file-lines',
119
- color: 'primary',
120
- priority: 'primary',
121
- command: {
122
- name: AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm,
123
- options: {
124
- data: { id: input.workOrderId },
125
- checklist: input.checklist,
126
- },
127
- },
128
- };
94
+ function emptyAXMMaintenanceIntervalConfig() {
95
+ return { triggerLogic: AXMMaintenanceIntervalTriggerLogic.Any, triggers: [] };
129
96
  }
130
- function buildIntervalWorkOrderSignOffAction(input) {
97
+ function emptyAXMMaintenanceIntervalDraft() {
131
98
  return {
132
- name: AXM_INTERVAL_SIGN_OFF_ACTION_NAME,
133
- title: '@maintenance-management:work-orders.tasks.actions.sign-off',
134
- icon: 'fa-light fa-file-signature',
135
- color: 'primary',
136
- priority: 'primary',
137
- command: {
138
- name: AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff,
139
- options: {
140
- data: { id: input.workOrderId },
141
- checklist: input.checklist,
142
- },
99
+ triggerLogic: AXMMaintenanceIntervalTriggerLogic.Any,
100
+ scheduleEnabled: false,
101
+ schedule: null,
102
+ dateEnabled: false,
103
+ date: null,
104
+ meters: {
105
+ distance: { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Kilometer },
106
+ 'operating-hours': { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Hour },
107
+ 'operation-count': { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Operation },
143
108
  },
144
109
  };
145
110
  }
146
- function isIntervalStartFlowAction(action) {
147
- if (!isRecord(action)) {
148
- return false;
111
+ //#endregion
112
+ //#region ----- Normalize -----
113
+ function scheduleMode(value) {
114
+ if (!value || typeof value !== 'object') {
115
+ return '';
149
116
  }
150
- const command = isRecord(action['command']) ? action['command'] : null;
151
- const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
152
- const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
153
- return name === AXM_INTERVAL_START_FLOW_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow;
117
+ const mode = value.mode;
118
+ return typeof mode === 'string' ? mode.trim() : '';
154
119
  }
155
- function isIntervalSignOffAction(action) {
156
- if (!isRecord(action)) {
157
- return false;
120
+ function scheduleStartDate(value) {
121
+ if (!value || typeof value !== 'object') {
122
+ return null;
158
123
  }
159
- const command = isRecord(action['command']) ? action['command'] : null;
160
- const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
161
- const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
162
- return name === AXM_INTERVAL_SIGN_OFF_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff;
124
+ const start = value.startCondition;
125
+ return start?.startDate ?? null;
163
126
  }
164
- function isIntervalOpenFormAction(action) {
165
- if (!isRecord(action)) {
127
+ function isSchedule(value) {
128
+ if (!value || typeof value !== 'object') {
166
129
  return false;
167
130
  }
168
- const command = isRecord(action['command']) ? action['command'] : null;
169
- const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
170
- const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
171
- return name === AXM_INTERVAL_OPEN_FORM_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm;
131
+ const record = value;
132
+ return typeof record.mode === 'string' || record.startCondition != null || typeof record.recurrence === 'string';
172
133
  }
173
- /**
174
- * Replaces Start Flow with a single Open Form action.
175
- * A second call refreshes that action and does not add another button.
176
- */
177
- function replaceIntervalStartFlowActions(actions, openFormAction) {
178
- const prefixSource = Array.isArray(actions?.prefix) ? actions.prefix : [];
179
- const suffixSource = Array.isArray(actions?.suffix) ? actions.suffix : [];
180
- let changed = false;
181
- let placed = false;
182
- const rewrite = (list) => {
183
- const next = [];
184
- for (const item of list) {
185
- if (isIntervalStartFlowAction(item) || isIntervalOpenFormAction(item)) {
186
- changed = true;
187
- if (!placed) {
188
- next.push(openFormAction);
189
- placed = true;
190
- }
191
- continue;
192
- }
193
- next.push(item);
194
- }
195
- return next;
196
- };
197
- const prefix = rewrite(prefixSource);
198
- const suffix = rewrite(suffixSource);
199
- if (!placed) {
200
- suffix.push(openFormAction);
201
- changed = true;
134
+ /** Calendar day stored on a date interval, as `YYYY-MM-DD`. */
135
+ function readIntervalDate(value) {
136
+ const date = value instanceof Date
137
+ ? value
138
+ : typeof value === 'string' && value.trim()
139
+ ? new Date(value)
140
+ : null;
141
+ if (!date || Number.isNaN(date.getTime())) {
142
+ return null;
202
143
  }
203
- return { prefix, suffix, changed };
144
+ const month = String(date.getMonth() + 1).padStart(2, '0');
145
+ const day = String(date.getDate()).padStart(2, '0');
146
+ return `${date.getFullYear()}-${month}-${day}`;
204
147
  }
205
- /**
206
- * Completed checklists reopen read-only. In Progress stays editable.
207
- * Accepts the stored status string or a status object (`name` / `id`).
208
- * Any other status cannot open this card's form.
209
- */
210
- function resolveIntervalChecklistViewerMode(statusId) {
211
- const status = readStatusName(statusId);
212
- if (status === 'completed') {
213
- return 'readonly';
214
- }
215
- if (status === 'in-progress') {
216
- return 'editable';
217
- }
218
- return 'unavailable';
148
+ function isUnit(value) {
149
+ return (value === AXMMaintenanceIntervalUnit.Kilometer ||
150
+ value === AXMMaintenanceIntervalUnit.Mile ||
151
+ value === AXMMaintenanceIntervalUnit.Hour ||
152
+ value === AXMMaintenanceIntervalUnit.Operation);
219
153
  }
220
- /** Status plugin values are a name string or an object with `name` / `id`. */
221
- function readStatusName(value, seen) {
222
- if (typeof value === 'string') {
223
- return value.trim();
154
+ function readTriggerLogic(value) {
155
+ return value === AXMMaintenanceIntervalTriggerLogic.All
156
+ ? AXMMaintenanceIntervalTriggerLogic.All
157
+ : AXMMaintenanceIntervalTriggerLogic.Any;
158
+ }
159
+ function supportedKindSet(kinds) {
160
+ const set = new Set();
161
+ for (const kind of kinds) {
162
+ if (isAXMMaintenanceIntervalKind(kind)) {
163
+ set.add(kind);
164
+ }
224
165
  }
225
- if (value == null || typeof value !== 'object' || Array.isArray(value)) {
226
- return '';
166
+ return set;
167
+ }
168
+ function meterIssue(kind, interval) {
169
+ if (typeof interval !== 'number' || !Number.isFinite(interval) || interval <= 0) {
170
+ return 'interval';
227
171
  }
228
- if (seen?.has(value)) {
229
- return '';
172
+ if (kind === 'operation-count' && !Number.isInteger(interval)) {
173
+ return 'integer';
230
174
  }
231
- const next = seen ?? new Set();
232
- next.add(value);
233
- const record = value;
234
- return (readStatusName(record['name'], next) ||
235
- readStatusName(record['id'], next) ||
236
- readStatusName(record['statusId'], next) ||
237
- readStatusName(record['status'], next));
175
+ return null;
238
176
  }
239
177
  /**
240
- * In Progress cards show Open Form, then Sign Off.
241
- * Completed cards keep Open Form and drop Sign Off. Other actions, including History, stay where they are.
178
+ * Builds the value object emitted by the interval editor.
179
+ * Unsupported, disabled, and invalid triggers are left out.
180
+ * Zero or one valid trigger always reports `any`.
242
181
  */
243
- function applyIntervalWorkOrderCardActions(actions, mode, input) {
244
- const openForm = buildIntervalWorkOrderOpenFormAction(input);
245
- const desired = mode === 'completed'
246
- ? [openForm]
247
- : [openForm, buildIntervalWorkOrderSignOffAction(input)];
248
- const prefixSource = Array.isArray(actions?.prefix) ? actions.prefix : [];
249
- const suffixSource = Array.isArray(actions?.suffix) ? actions.suffix : [];
250
- let changed = false;
251
- let placed = false;
252
- const isManaged = (item) => isIntervalStartFlowAction(item) || isIntervalOpenFormAction(item) || isIntervalSignOffAction(item);
253
- const rewrite = (list) => {
254
- const next = [];
255
- for (const item of list) {
256
- if (isManaged(item)) {
257
- changed = true;
258
- if (!placed) {
259
- next.push(...desired);
260
- placed = true;
261
- }
262
- continue;
182
+ function buildAXMMaintenanceIntervalConfig(supportedIntervalKinds, draft) {
183
+ const supported = supportedKindSet(supportedIntervalKinds);
184
+ const triggers = [];
185
+ const errors = [];
186
+ if (supported.has('schedule') && draft.scheduleEnabled) {
187
+ const schedule = draft.schedule;
188
+ if (schedule && scheduleMode(schedule) === 'specific-date') {
189
+ if (readIntervalDate(scheduleStartDate(schedule))) {
190
+ triggers.push({ kind: 'schedule', schedule });
191
+ }
192
+ else {
193
+ errors.push({ kind: 'schedule', code: 'date' });
263
194
  }
264
- next.push(item);
265
195
  }
266
- return next;
267
- };
268
- const prefix = rewrite(prefixSource);
269
- const suffix = rewrite(suffixSource);
270
- if (!placed) {
271
- suffix.push(...desired);
272
- changed = true;
273
- }
274
- return { prefix, suffix, changed: changed || !sameJson(actions, { prefix, suffix }) };
275
- }
276
- /**
277
- * Cancellation from workflow-activity:sign-off is success:true with metadata.outcome Cancelled.
278
- * Only an explicit Signed outcome with a signature continues.
279
- */
280
- function readSignOffActivityOutcome(result) {
281
- const outcome = text(result?.metadata?.outcome);
282
- if (result?.success === false) {
283
- return outcome === 'Cancelled' ? 'Cancelled' : 'Failed';
284
- }
285
- if (!result || outcome === 'Cancelled' || outcome !== 'Signed') {
286
- return 'Cancelled';
287
- }
288
- const data = isRecord(result.data) ? result.data : null;
289
- return text(data?.['signature']) ? 'Signed' : 'Cancelled';
290
- }
291
- function rewriteIntervalCardBookmarks(input) {
292
- const workflowInstance = isRecord(input.instance['workflowInstance'])
293
- ? input.instance['workflowInstance']
294
- : input.instance;
295
- const bookmarks = readBookmarkList(workflowInstance['bookmarks']);
296
- const definitionId = text(input.instance['definitionId']) || text(workflowInstance['definitionId']);
297
- const checklist = readIntervalChecklistId(input.instance, readChecklistFromBookmarks(bookmarks));
298
- const selected = new Set(selectIntervalBookmarks(bookmarks, input.workOrderId, text(input.sourceBookmarkId), definitionId).map((bookmark) => text(bookmark['id'])));
299
- if (selected.size === 0) {
300
- return { bookmarks, changed: false };
196
+ else if (isSchedule(schedule)) {
197
+ triggers.push({ kind: 'schedule', schedule });
198
+ }
199
+ else {
200
+ errors.push({ kind: 'schedule', code: 'schedule' });
201
+ }
301
202
  }
302
- const description = input.mode === 'completed' ? AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION : AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION;
303
- const statusId = input.mode === 'completed' ? 'completed' : 'in-progress';
304
- let changed = false;
305
- const next = bookmarks.map((bookmark) => {
306
- if (!selected.has(text(bookmark['id']))) {
307
- return bookmark;
203
+ if (supported.has('date') && draft.dateEnabled) {
204
+ const date = readIntervalDate(draft.date);
205
+ if (date) {
206
+ triggers.push({ kind: 'date', date });
308
207
  }
309
- const payload = readPayload(bookmark);
310
- if (!payload) {
311
- return bookmark;
208
+ else if (!supported.has('schedule') && isSchedule(draft.schedule)) {
209
+ triggers.push({ kind: 'date', schedule: draft.schedule });
312
210
  }
313
- const before = JSON.stringify(payload);
314
- if (input.mode === 'in-progress' && text(input.assigneeUserId)) {
315
- payload['assignedUserIds'] = [text(input.assigneeUserId)];
211
+ else {
212
+ errors.push({ kind: 'date', code: 'date' });
316
213
  }
317
- const context = isRecord(payload['context']) ? { ...payload['context'] } : {};
318
- const actions = isRecord(payload['actions']) ? payload['actions'] : {};
319
- const replaced = applyIntervalWorkOrderCardActions({
320
- prefix: Array.isArray(actions['prefix']) ? actions['prefix'] : [],
321
- suffix: Array.isArray(actions['suffix']) ? actions['suffix'] : [],
322
- }, input.mode, { workOrderId: input.workOrderId, checklist });
323
- payload['actions'] = { prefix: replaced.prefix, suffix: replaced.suffix };
324
- payload['description'] = description;
325
- payload['context'] = {
326
- ...context,
327
- workOrderId: input.workOrderId,
328
- statusId,
329
- ...(checklist ? { checklist } : {}),
330
- };
331
- if (JSON.stringify(payload) !== before) {
332
- changed = true;
214
+ }
215
+ for (const kind of METER_KINDS) {
216
+ const meter = draft.meters[kind];
217
+ if (!supported.has(kind) || !meter.enabled) {
218
+ continue;
333
219
  }
334
- return {
335
- ...bookmark,
336
- payload,
337
- payloadJson: JSON.stringify(payload),
338
- };
339
- });
340
- return { bookmarks: next, changed };
341
- }
342
- function readBookmarkList(value) {
343
- if (!Array.isArray(value)) {
344
- return [];
220
+ const issue = meterIssue(kind, meter.interval);
221
+ if (issue) {
222
+ errors.push({ kind, code: issue });
223
+ continue;
224
+ }
225
+ const unit = isAXMMaintenanceIntervalUnitForKind(kind, meter.unit)
226
+ ? meter.unit
227
+ : defaultAXMMaintenanceIntervalUnit(kind);
228
+ triggers.push({ kind, interval: meter.interval, unit });
345
229
  }
346
- return value.map((item) => (isRecord(item) ? { ...item } : null)).filter((item) => !!item);
230
+ const triggerLogic = triggers.length > 1 && draft.triggerLogic === AXMMaintenanceIntervalTriggerLogic.All
231
+ ? AXMMaintenanceIntervalTriggerLogic.All
232
+ : AXMMaintenanceIntervalTriggerLogic.Any;
233
+ return { config: { triggerLogic, triggers }, errors };
347
234
  }
348
- function readPayload(bookmark) {
349
- if (isRecord(bookmark['payload'])) {
350
- return { ...bookmark['payload'] };
351
- }
352
- const payloadJson = bookmark['payloadJson'];
353
- if (typeof payloadJson !== 'string' || !payloadJson.trim()) {
354
- return null;
235
+ /**
236
+ * Date trigger schedule, or a legacy scheduler-picker object stored before interval configs.
237
+ * Meter-only configs have no calendar schedule.
238
+ */
239
+ function readMaintenancePlanCalendarSchedule(value) {
240
+ if (!value || typeof value !== 'object') {
241
+ return undefined;
355
242
  }
356
- try {
357
- const parsed = JSON.parse(payloadJson);
358
- return isRecord(parsed) ? { ...parsed } : null;
243
+ const record = value;
244
+ if (Array.isArray(record.triggers)) {
245
+ for (const item of record.triggers) {
246
+ if (!item || typeof item !== 'object') {
247
+ continue;
248
+ }
249
+ const kind = item.kind;
250
+ if (kind !== 'date' && kind !== 'schedule') {
251
+ continue;
252
+ }
253
+ const schedule = item.schedule;
254
+ if (isSchedule(schedule)) {
255
+ return schedule;
256
+ }
257
+ }
258
+ return undefined;
359
259
  }
360
- catch {
361
- return null;
260
+ if (record.mode != null || record.startCondition != null || record.recurrence != null) {
261
+ return value;
362
262
  }
263
+ return undefined;
363
264
  }
364
- function readChecklistFromBookmarks(bookmarks) {
365
- for (const bookmark of bookmarks) {
366
- const payload = readPayload(bookmark);
367
- const fromActions = readChecklistIdFromTaskActions(payload?.['actions']);
368
- if (fromActions) {
369
- return fromActions;
370
- }
371
- const context = isRecord(payload?.['context']) ? payload?.['context'] : null;
372
- const fromContext = text(context?.['checklist']);
373
- if (fromContext) {
374
- return fromContext;
375
- }
376
- }
377
- return '';
265
+ /**
266
+ * Plan calendar: prefer the Scheduling Widget field, then the interval-config calendar trigger.
267
+ */
268
+ function readMaintenancePlanSchedule(plan) {
269
+ return (readMaintenancePlanCalendarSchedule(plan.schedule) ??
270
+ readMaintenancePlanCalendarSchedule(plan.intervalConfig));
378
271
  }
379
- function selectIntervalBookmarks(bookmarks, workOrderId, sourceBookmarkId, definitionId) {
380
- const active = bookmarks.filter((bookmark) => bookmark['isConsumed'] !== true && bookmark['consumed'] !== true);
381
- if (sourceBookmarkId) {
382
- const byId = active.filter((bookmark) => text(bookmark['id']) === sourceBookmarkId);
383
- if (byId.length > 0) {
384
- return byId;
385
- }
386
- }
387
- if (definitionId !== AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME) {
388
- return [];
272
+ /**
273
+ * Hydrates the Scheduling Widget from older plans that only stored a recurring calendar
274
+ * on `intervalConfig`. Specific Date on intervalConfig stays on that widget and is not copied.
275
+ * The Scheduling Widget and Maintenance Interval Config remain independent.
276
+ */
277
+ function syncMaintenancePlanScheduleFields(record) {
278
+ const existing = readMaintenancePlanCalendarSchedule(record['schedule']);
279
+ if (existing) {
280
+ return;
389
281
  }
390
- const byWorkOrder = active.filter((bookmark) => bookmarkReferencesWorkOrder(bookmark, workOrderId));
391
- if (byWorkOrder.length > 0) {
392
- return byWorkOrder;
282
+ const fromConfig = readMaintenancePlanCalendarSchedule(record['intervalConfig']);
283
+ if (!fromConfig || scheduleMode(fromConfig) === 'specific-date') {
284
+ return;
393
285
  }
394
- const humanTasks = active.filter((bookmark) => {
395
- if (text(bookmark['activityId']) === AXM_INTERVAL_DUE_ACTIVITY_ID) {
396
- return true;
397
- }
398
- const payload = readPayload(bookmark);
399
- return text(payload?.['activityType']) === 'workflow-activity:human-task';
400
- });
401
- return humanTasks.length === 1 ? humanTasks : [];
402
- }
403
- function bookmarkReferencesWorkOrder(bookmark, workOrderId) {
404
- const payload = readPayload(bookmark);
405
- const context = isRecord(payload?.['context']) ? payload?.['context'] : null;
406
- return text(context?.['workOrderId']) === workOrderId;
286
+ record['schedule'] = fromConfig;
407
287
  }
408
- function sameJson(left, right) {
409
- return JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
288
+ /** True when `schedule` is a calendar scheduler value (not meter-only interval config). */
289
+ function hasMaintenanceTemplateSchedule(schedule) {
290
+ return readMaintenancePlanCalendarSchedule(schedule) != null;
410
291
  }
411
- //#endregion
412
- //#region ----- Occurrence identity -----
413
- function text(value) {
414
- return typeof value === 'string' ? value.trim() : '';
292
+ /**
293
+ * Deep-clones a template/plan Scheduling Widget value for plan creation.
294
+ * Does not invent a daily/Never fallback — callers must load the saved template first.
295
+ */
296
+ function cloneMaintenanceTemplateSchedule(schedule) {
297
+ const source = readMaintenancePlanCalendarSchedule(schedule);
298
+ if (!source) {
299
+ throw new Error('Maintenance template schedule is required to create a plan.');
300
+ }
301
+ return structuredClone(source);
415
302
  }
416
- function createdStamp(row) {
417
- const auditAt = row.auditInfo?.created?.at;
418
- if (typeof auditAt === 'string' && auditAt.trim()) {
419
- return auditAt.trim();
303
+ /**
304
+ * Whether a list/partial template row still needs `getOne` before plan generation.
305
+ * Reload when maintenance type or (when required) calendar schedule is missing.
306
+ */
307
+ function shouldReloadMaintenanceTemplateForPlan(partial, options) {
308
+ if (!partial?.maintenanceTypeId) {
309
+ return true;
420
310
  }
421
- if (auditAt instanceof Date && !Number.isNaN(auditAt.getTime())) {
311
+ if (options?.requireSchedule && !hasMaintenanceTemplateSchedule(partial.schedule)) {
312
+ return true;
313
+ }
314
+ return false;
315
+ }
316
+ /** Reads a stored config into editor state. Kinds outside `supportedIntervalKinds` are dropped. */
317
+ function draftFromAXMMaintenanceIntervalConfig(value, supportedIntervalKinds) {
318
+ const draft = emptyAXMMaintenanceIntervalDraft();
319
+ const supported = supportedKindSet(supportedIntervalKinds);
320
+ if (!value || typeof value !== 'object') {
321
+ return draft;
322
+ }
323
+ const record = value;
324
+ draft.triggerLogic = readTriggerLogic(record.triggerLogic);
325
+ if (!Array.isArray(record.triggers)) {
326
+ return draft;
327
+ }
328
+ for (const item of record.triggers) {
329
+ if (!item || typeof item !== 'object' || !('kind' in item) || typeof item.kind !== 'string') {
330
+ continue;
331
+ }
332
+ const kind = item.kind;
333
+ if (kind === 'date') {
334
+ const schedule = item.schedule;
335
+ const date = readIntervalDate(item.date);
336
+ if (isSchedule(schedule) && supported.has('schedule') && !draft.scheduleEnabled) {
337
+ draft.scheduleEnabled = true;
338
+ draft.schedule = schedule;
339
+ }
340
+ if (!supported.has('date')) {
341
+ continue;
342
+ }
343
+ if (date) {
344
+ draft.dateEnabled = true;
345
+ draft.date = date;
346
+ }
347
+ else if (isSchedule(schedule) && !supported.has('schedule')) {
348
+ draft.dateEnabled = true;
349
+ draft.schedule = schedule;
350
+ }
351
+ continue;
352
+ }
353
+ if (!isAXMMaintenanceIntervalKind(kind) || !supported.has(kind)) {
354
+ continue;
355
+ }
356
+ if (kind === 'schedule') {
357
+ const schedule = item.schedule;
358
+ if (!isSchedule(schedule) || draft.scheduleEnabled) {
359
+ continue;
360
+ }
361
+ draft.scheduleEnabled = true;
362
+ draft.schedule = schedule;
363
+ continue;
364
+ }
365
+ if (!isAXMMaintenanceMeterKind(kind)) {
366
+ continue;
367
+ }
368
+ const meter = draft.meters[kind];
369
+ if (meter.enabled) {
370
+ continue;
371
+ }
372
+ const interval = item.interval;
373
+ const unit = item.unit;
374
+ if (meterIssue(kind, typeof interval === 'number' ? interval : null)) {
375
+ continue;
376
+ }
377
+ meter.enabled = true;
378
+ meter.interval = interval;
379
+ meter.unit = isUnit(unit) && isAXMMaintenanceIntervalUnitForKind(kind, unit) ? unit : defaultAXMMaintenanceIntervalUnit(kind);
380
+ }
381
+ return draft;
382
+ }
383
+ //#endregion
384
+
385
+ //#region ----- Constants -----
386
+ /** Seeded inspection workflow. It collects meters and does not replace interval-plan triggers. */
387
+ const AXM_INSPECTION_WORK_ORDER_WORKFLOW_NAME = 'maintenance-inspection-work-order';
388
+ const AXM_INSPECTION_USAGE_KINDS_INPUT = 'usageKinds';
389
+ const DEFAULT_USAGE_KIND = 'distance';
390
+ function readKindToken(value) {
391
+ if (typeof value === 'string') {
392
+ return value.trim();
393
+ }
394
+ if (value && typeof value === 'object' && 'id' in value && typeof value.id === 'string') {
395
+ return value.id.trim();
396
+ }
397
+ return '';
398
+ }
399
+ /** Meter kinds an asset type can collect. Schedule and date stay on the plan, not on this input. */
400
+ function collectableUsageKinds(supported) {
401
+ const kinds = [];
402
+ for (const kind of supported) {
403
+ if (isAXMMaintenanceMeterKind(kind) && !kinds.includes(kind)) {
404
+ kinds.push(kind);
405
+ }
406
+ }
407
+ return kinds;
408
+ }
409
+ function normalizeUsageKindList(value) {
410
+ if (value == null || value === '') {
411
+ return [];
412
+ }
413
+ if (Array.isArray(value)) {
414
+ return value;
415
+ }
416
+ if (typeof value === 'string') {
417
+ return value
418
+ .split(',')
419
+ .map((item) => item.trim())
420
+ .filter((item) => item.length > 0);
421
+ }
422
+ return null;
423
+ }
424
+ /**
425
+ * Readings to collect for one inspection template or instance.
426
+ * An empty selection defaults to distance when that meter is supported.
427
+ * An asset type with no meters can keep an empty selection, including the workflow's distance default.
428
+ * Distance cannot stay selected when the asset type supports other meters but not distance.
429
+ */
430
+ function resolveInspectionUsageKinds(value, supported) {
431
+ const allowed = collectableUsageKinds(supported);
432
+ const items = normalizeUsageKindList(value);
433
+ if (items == null) {
434
+ return { kinds: [], issue: 'unsupported' };
435
+ }
436
+ const selected = [];
437
+ for (const item of items) {
438
+ const token = readKindToken(item);
439
+ if (!token) {
440
+ continue;
441
+ }
442
+ if (!isAXMMaintenanceMeterKind(token) || !allowed.includes(token)) {
443
+ const onlyDefaultDistance = allowed.length === 0 && items.every((entry) => {
444
+ const kind = readKindToken(entry);
445
+ return kind === '' || kind === DEFAULT_USAGE_KIND;
446
+ });
447
+ if (onlyDefaultDistance) {
448
+ return { kinds: [], issue: null };
449
+ }
450
+ return { kinds: [], issue: token === DEFAULT_USAGE_KIND ? 'distance-unsupported' : 'unsupported' };
451
+ }
452
+ if (!selected.includes(token)) {
453
+ selected.push(token);
454
+ }
455
+ }
456
+ if (selected.length === 0) {
457
+ if (allowed.length === 0) {
458
+ return { kinds: [], issue: null };
459
+ }
460
+ if (!allowed.includes(DEFAULT_USAGE_KIND)) {
461
+ return { kinds: [], issue: 'distance-unsupported' };
462
+ }
463
+ return { kinds: [DEFAULT_USAGE_KIND], issue: null };
464
+ }
465
+ return { kinds: selected, issue: null };
466
+ }
467
+ function readInspectionUsageKinds(source) {
468
+ const workflowInstance = source?.['workflowInstance'] && typeof source['workflowInstance'] === 'object'
469
+ ? source['workflowInstance']
470
+ : source;
471
+ const workflowState = workflowInstance?.['workflowState'] && typeof workflowInstance['workflowState'] === 'object'
472
+ ? workflowInstance['workflowState']
473
+ : null;
474
+ const input = workflowState?.['input'] && typeof workflowState['input'] === 'object'
475
+ ? workflowState['input']
476
+ : null;
477
+ const raw = input?.[AXM_INSPECTION_USAGE_KINDS_INPUT] ?? source?.[AXM_INSPECTION_USAGE_KINDS_INPUT];
478
+ if (!Array.isArray(raw)) {
479
+ return [];
480
+ }
481
+ return raw.map(readKindToken).filter((kind) => isAXMMaintenanceMeterKind(kind));
482
+ }
483
+ //#endregion
484
+
485
+ //#region ----- Constants -----
486
+ /** Bookmark action that starts an interval work order. */
487
+ const AXM_INTERVAL_START_FLOW_ACTION_NAME = 'start-flow';
488
+ /** Bookmark action that opens the in-progress checklist form. */
489
+ const AXM_INTERVAL_OPEN_FORM_ACTION_NAME = 'open-form';
490
+ /** Bookmark action that collects a signature and completes the interval work order. */
491
+ const AXM_INTERVAL_SIGN_OFF_ACTION_NAME = 'sign-off';
492
+ /** Seeded interval workflow name. The task-board card belongs to this instance. */
493
+ const AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME = 'maintenance-interval-work-order';
494
+ const AXM_INTERVAL_DUE_ACTIVITY_ID = 'intervalDueHumanTask';
495
+ /** Workflow variable / instance property for the checklist case of this work order. */
496
+ const AXM_INTERVAL_CHECKLIST_CASE_ID = 'assessmentCaseId';
497
+ /** Workflow variable / instance property for the checklist session of this work order. */
498
+ const AXM_INTERVAL_CHECKLIST_SESSION_ID = 'assessmentSessionId';
499
+ /** Workflow variable storing the template questionnaire this occurrence was opened against. */
500
+ const AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID = 'checklistQuestionnaireId';
501
+ /** Short-lived claim so concurrent Open Form clicks create one case and session. */
502
+ const AXM_INTERVAL_CHECKLIST_CLAIM = 'checklistOccurrenceClaim';
503
+ const AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION = '@maintenance-management:work-orders.tasks.interval-due.in-progress-description';
504
+ const AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION = '@maintenance-management:work-orders.tasks.interval-due.completed-description';
505
+ const AXM_INTERVAL_CANCELLED_TASK_DESCRIPTION = '@maintenance-management:work-orders.tasks.interval-due.cancelled-description';
506
+ //#endregion
507
+ //#region ----- Checklist id -----
508
+ function isRecord(value) {
509
+ return value != null && typeof value === 'object' && !Array.isArray(value);
510
+ }
511
+ function resolveChecklistId(value) {
512
+ if (typeof value === 'string') {
513
+ const trimmed = value.trim();
514
+ // An unevaluated workflow expression is not a questionnaire.
515
+ if (!trimmed || trimmed.includes('{{')) {
516
+ return '';
517
+ }
518
+ return trimmed;
519
+ }
520
+ if (isRecord(value)) {
521
+ return resolveChecklistId(value['id']);
522
+ }
523
+ return '';
524
+ }
525
+ /**
526
+ * Questionnaire for this interval occurrence.
527
+ * `workflowState.input.checklist` wins over a task-action or command fallback.
528
+ */
529
+ function readIntervalChecklistId(source, fallback) {
530
+ const workflowInstance = isRecord(source?.['workflowInstance'])
531
+ ? source['workflowInstance']
532
+ : source;
533
+ const workflowState = isRecord(workflowInstance?.['workflowState'])
534
+ ? workflowInstance['workflowState']
535
+ : null;
536
+ const input = isRecord(workflowState?.['input']) ? workflowState['input'] : null;
537
+ const properties = isRecord(workflowState?.['properties'])
538
+ ? workflowState['properties']
539
+ : null;
540
+ return (resolveChecklistId(input?.['checklist']) ||
541
+ resolveChecklistId(input?.['preChecklistQuestionnaireId']) ||
542
+ resolveChecklistId(properties?.[AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID]) ||
543
+ resolveChecklistId(properties?.['checklist']) ||
544
+ resolveChecklistId(fallback));
545
+ }
546
+ function readChecklistIdFromTaskActions(actions) {
547
+ if (!isRecord(actions)) {
548
+ return '';
549
+ }
550
+ const lists = [actions['prefix'], actions['suffix']];
551
+ for (const list of lists) {
552
+ if (!Array.isArray(list)) {
553
+ continue;
554
+ }
555
+ for (const item of list) {
556
+ if (!isRecord(item) || !isRecord(item['command'])) {
557
+ continue;
558
+ }
559
+ const options = isRecord(item['command']['options']) ? item['command']['options'] : null;
560
+ const checklist = resolveChecklistId(options?.['checklist']);
561
+ if (checklist) {
562
+ return checklist;
563
+ }
564
+ }
565
+ }
566
+ return '';
567
+ }
568
+ //#endregion
569
+ //#region ----- Task action -----
570
+ function buildIntervalWorkOrderOpenFormAction(input) {
571
+ return {
572
+ name: AXM_INTERVAL_OPEN_FORM_ACTION_NAME,
573
+ title: '@maintenance-management:work-orders.tasks.actions.open-form',
574
+ icon: 'fa-light fa-file-lines',
575
+ color: 'primary',
576
+ priority: 'primary',
577
+ command: {
578
+ name: AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm,
579
+ options: {
580
+ data: { id: input.workOrderId },
581
+ checklist: input.checklist,
582
+ ...(input.usageKinds ? { usageKinds: input.usageKinds } : {}),
583
+ },
584
+ },
585
+ };
586
+ }
587
+ function buildIntervalWorkOrderSignOffAction(input) {
588
+ return {
589
+ name: AXM_INTERVAL_SIGN_OFF_ACTION_NAME,
590
+ title: '@maintenance-management:work-orders.tasks.actions.sign-off',
591
+ icon: 'fa-light fa-file-signature',
592
+ color: 'primary',
593
+ priority: 'primary',
594
+ command: {
595
+ name: AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff,
596
+ options: {
597
+ data: { id: input.workOrderId },
598
+ checklist: input.checklist,
599
+ ...(input.usageKinds ? { usageKinds: input.usageKinds } : {}),
600
+ },
601
+ },
602
+ };
603
+ }
604
+ function isIntervalStartFlowAction(action) {
605
+ if (!isRecord(action)) {
606
+ return false;
607
+ }
608
+ const command = isRecord(action['command']) ? action['command'] : null;
609
+ const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
610
+ const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
611
+ return name === AXM_INTERVAL_START_FLOW_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow;
612
+ }
613
+ function isIntervalSignOffAction(action) {
614
+ if (!isRecord(action)) {
615
+ return false;
616
+ }
617
+ const command = isRecord(action['command']) ? action['command'] : null;
618
+ const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
619
+ const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
620
+ return name === AXM_INTERVAL_SIGN_OFF_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff;
621
+ }
622
+ function isIntervalOpenFormAction(action) {
623
+ if (!isRecord(action)) {
624
+ return false;
625
+ }
626
+ const command = isRecord(action['command']) ? action['command'] : null;
627
+ const commandName = typeof command?.['name'] === 'string' ? command['name'].trim() : '';
628
+ const name = typeof action['name'] === 'string' ? action['name'].trim() : '';
629
+ return name === AXM_INTERVAL_OPEN_FORM_ACTION_NAME || commandName === AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm;
630
+ }
631
+ /**
632
+ * Replaces Start Flow with a single Open Form action.
633
+ * A second call refreshes that action and does not add another button.
634
+ */
635
+ function replaceIntervalStartFlowActions(actions, openFormAction) {
636
+ const prefixSource = Array.isArray(actions?.prefix) ? actions.prefix : [];
637
+ const suffixSource = Array.isArray(actions?.suffix) ? actions.suffix : [];
638
+ let changed = false;
639
+ let placed = false;
640
+ const rewrite = (list) => {
641
+ const next = [];
642
+ for (const item of list) {
643
+ if (isIntervalStartFlowAction(item) || isIntervalOpenFormAction(item)) {
644
+ changed = true;
645
+ if (!placed) {
646
+ next.push(openFormAction);
647
+ placed = true;
648
+ }
649
+ continue;
650
+ }
651
+ next.push(item);
652
+ }
653
+ return next;
654
+ };
655
+ const prefix = rewrite(prefixSource);
656
+ const suffix = rewrite(suffixSource);
657
+ if (!placed) {
658
+ suffix.push(openFormAction);
659
+ changed = true;
660
+ }
661
+ return { prefix, suffix, changed };
662
+ }
663
+ /**
664
+ * Completed and cancelled checklists reopen read-only. In Progress stays editable. Planned stays unavailable.
665
+ * Accepts the stored status string or a status object (`name` / `id`).
666
+ * Any other status cannot open this card's form.
667
+ */
668
+ function resolveIntervalChecklistViewerMode(statusId) {
669
+ const status = readStatusName(statusId);
670
+ if (status === 'completed' || status === 'cancelled') {
671
+ return 'readonly';
672
+ }
673
+ if (status === 'in-progress') {
674
+ return 'editable';
675
+ }
676
+ return 'unavailable';
677
+ }
678
+ /** Status plugin values are a name string or an object with `name` / `id`. */
679
+ function readStatusName(value, seen) {
680
+ if (typeof value === 'string') {
681
+ return value.trim();
682
+ }
683
+ if (value == null || typeof value !== 'object' || Array.isArray(value)) {
684
+ return '';
685
+ }
686
+ if (seen?.has(value)) {
687
+ return '';
688
+ }
689
+ const next = seen ?? new Set();
690
+ next.add(value);
691
+ const record = value;
692
+ return (readStatusName(record['name'], next) ||
693
+ readStatusName(record['id'], next) ||
694
+ readStatusName(record['statusId'], next) ||
695
+ readStatusName(record['status'], next));
696
+ }
697
+ /**
698
+ * In Progress cards show Open Form, then Sign Off.
699
+ * Completed cards keep Open Form and drop Sign Off. Other actions, including History, stay where they are.
700
+ */
701
+ function applyIntervalWorkOrderCardActions(actions, mode, input) {
702
+ const openForm = buildIntervalWorkOrderOpenFormAction(input);
703
+ const desired = mode === 'in-progress'
704
+ ? [openForm, buildIntervalWorkOrderSignOffAction(input)]
705
+ : [openForm];
706
+ const prefixSource = Array.isArray(actions?.prefix) ? actions.prefix : [];
707
+ const suffixSource = Array.isArray(actions?.suffix) ? actions.suffix : [];
708
+ let changed = false;
709
+ let placed = false;
710
+ const isManaged = (item) => isIntervalStartFlowAction(item) || isIntervalOpenFormAction(item) || isIntervalSignOffAction(item);
711
+ const rewrite = (list) => {
712
+ const next = [];
713
+ for (const item of list) {
714
+ if (isManaged(item)) {
715
+ changed = true;
716
+ if (!placed) {
717
+ next.push(...desired);
718
+ placed = true;
719
+ }
720
+ continue;
721
+ }
722
+ next.push(item);
723
+ }
724
+ return next;
725
+ };
726
+ const prefix = rewrite(prefixSource);
727
+ const suffix = rewrite(suffixSource);
728
+ if (!placed) {
729
+ suffix.push(...desired);
730
+ changed = true;
731
+ }
732
+ return { prefix, suffix, changed: changed || !sameJson(actions, { prefix, suffix }) };
733
+ }
734
+ /**
735
+ * Cancellation from workflow-activity:sign-off is success:true with metadata.outcome Cancelled.
736
+ * Only an explicit Signed outcome with a signature continues.
737
+ */
738
+ function readSignOffActivityOutcome(result) {
739
+ const outcome = text$1(result?.metadata?.outcome);
740
+ if (result?.success === false) {
741
+ return outcome === 'Cancelled' ? 'Cancelled' : 'Failed';
742
+ }
743
+ if (!result || outcome === 'Cancelled' || outcome !== 'Signed') {
744
+ return 'Cancelled';
745
+ }
746
+ const data = isRecord(result.data) ? result.data : null;
747
+ return text$1(data?.['signature']) ? 'Signed' : 'Cancelled';
748
+ }
749
+ function rewriteIntervalCardBookmarks(input) {
750
+ const workflowInstance = isRecord(input.instance['workflowInstance'])
751
+ ? input.instance['workflowInstance']
752
+ : input.instance;
753
+ const bookmarks = readBookmarkList(workflowInstance['bookmarks']);
754
+ const definitionId = text$1(input.instance['definitionId']) || text$1(workflowInstance['definitionId']);
755
+ const checklist = readIntervalChecklistId(input.instance, readChecklistFromBookmarks(bookmarks));
756
+ const usageKinds = readInspectionUsageKinds(input.instance).join(',');
757
+ const selected = new Set(selectIntervalBookmarks(bookmarks, input.workOrderId, text$1(input.sourceBookmarkId), definitionId).map((bookmark) => text$1(bookmark['id'])));
758
+ if (selected.size === 0) {
759
+ return { bookmarks, changed: false };
760
+ }
761
+ const inspectionCard = definitionId === AXM_INSPECTION_WORK_ORDER_WORKFLOW_NAME;
762
+ const description = input.mode === 'cancelled'
763
+ ? inspectionCard
764
+ ? '@maintenance-management:work-orders.tasks.inspection.cancelled-description'
765
+ : AXM_INTERVAL_CANCELLED_TASK_DESCRIPTION
766
+ : inspectionCard
767
+ ? input.mode === 'completed'
768
+ ? '@maintenance-management:work-orders.tasks.inspection.completed-description'
769
+ : '@maintenance-management:work-orders.tasks.inspection.in-progress-description'
770
+ : input.mode === 'completed'
771
+ ? AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION
772
+ : AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION;
773
+ const statusId = input.mode === 'completed' ? 'completed' : input.mode === 'cancelled' ? 'cancelled' : 'in-progress';
774
+ let changed = false;
775
+ const next = bookmarks.map((bookmark) => {
776
+ if (!selected.has(text$1(bookmark['id']))) {
777
+ return bookmark;
778
+ }
779
+ const payload = readPayload(bookmark);
780
+ if (!payload) {
781
+ return bookmark;
782
+ }
783
+ const before = JSON.stringify(payload);
784
+ if (input.mode === 'in-progress' && text$1(input.assigneeUserId)) {
785
+ payload['assignedUserIds'] = [text$1(input.assigneeUserId)];
786
+ }
787
+ const context = isRecord(payload['context']) ? { ...payload['context'] } : {};
788
+ const actions = isRecord(payload['actions']) ? payload['actions'] : {};
789
+ const replaced = applyIntervalWorkOrderCardActions({
790
+ prefix: Array.isArray(actions['prefix']) ? actions['prefix'] : [],
791
+ suffix: Array.isArray(actions['suffix']) ? actions['suffix'] : [],
792
+ }, input.mode, { workOrderId: input.workOrderId, checklist, ...(usageKinds ? { usageKinds } : {}) });
793
+ payload['actions'] = { prefix: replaced.prefix, suffix: replaced.suffix };
794
+ payload['description'] = description;
795
+ if (text$1(input.dueDate)) {
796
+ payload['dueDate'] = text$1(input.dueDate);
797
+ }
798
+ if (input.mode === 'cancelled') {
799
+ payload['waitingResolved'] = true;
800
+ payload['resolvedReason'] = text$1(input.resolvedReason) || 'deadline-expiry';
801
+ }
802
+ payload['context'] = {
803
+ ...context,
804
+ workOrderId: input.workOrderId,
805
+ statusId,
806
+ ...(checklist ? { checklist } : {}),
807
+ ...(usageKinds ? { usageKinds } : {}),
808
+ };
809
+ if (JSON.stringify(payload) !== before) {
810
+ changed = true;
811
+ }
812
+ return {
813
+ ...bookmark,
814
+ payload,
815
+ payloadJson: JSON.stringify(payload),
816
+ };
817
+ });
818
+ return { bookmarks: next, changed };
819
+ }
820
+ function readBookmarkList(value) {
821
+ if (!Array.isArray(value)) {
822
+ return [];
823
+ }
824
+ return value.map((item) => (isRecord(item) ? { ...item } : null)).filter((item) => !!item);
825
+ }
826
+ function readPayload(bookmark) {
827
+ if (isRecord(bookmark['payload'])) {
828
+ return { ...bookmark['payload'] };
829
+ }
830
+ const payloadJson = bookmark['payloadJson'];
831
+ if (typeof payloadJson !== 'string' || !payloadJson.trim()) {
832
+ return null;
833
+ }
834
+ try {
835
+ const parsed = JSON.parse(payloadJson);
836
+ return isRecord(parsed) ? { ...parsed } : null;
837
+ }
838
+ catch {
839
+ return null;
840
+ }
841
+ }
842
+ function readChecklistFromBookmarks(bookmarks) {
843
+ for (const bookmark of bookmarks) {
844
+ const payload = readPayload(bookmark);
845
+ const fromActions = readChecklistIdFromTaskActions(payload?.['actions']);
846
+ if (fromActions) {
847
+ return fromActions;
848
+ }
849
+ const context = isRecord(payload?.['context']) ? payload?.['context'] : null;
850
+ const fromContext = text$1(context?.['checklist']);
851
+ if (fromContext) {
852
+ return fromContext;
853
+ }
854
+ }
855
+ return '';
856
+ }
857
+ function selectIntervalBookmarks(bookmarks, workOrderId, sourceBookmarkId, definitionId) {
858
+ const active = bookmarks.filter((bookmark) => bookmark['isConsumed'] !== true && bookmark['consumed'] !== true);
859
+ if (sourceBookmarkId) {
860
+ const byId = active.filter((bookmark) => text$1(bookmark['id']) === sourceBookmarkId);
861
+ if (byId.length > 0) {
862
+ return byId;
863
+ }
864
+ }
865
+ if (definitionId !== AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME &&
866
+ definitionId !== AXM_INSPECTION_WORK_ORDER_WORKFLOW_NAME) {
867
+ return [];
868
+ }
869
+ const byWorkOrder = active.filter((bookmark) => bookmarkReferencesWorkOrder(bookmark, workOrderId));
870
+ if (byWorkOrder.length > 0) {
871
+ return byWorkOrder;
872
+ }
873
+ const humanTasks = active.filter((bookmark) => {
874
+ if (text$1(bookmark['activityId']) === AXM_INTERVAL_DUE_ACTIVITY_ID) {
875
+ return true;
876
+ }
877
+ const payload = readPayload(bookmark);
878
+ return text$1(payload?.['activityType']) === 'workflow-activity:human-task';
879
+ });
880
+ return humanTasks.length === 1 ? humanTasks : [];
881
+ }
882
+ function bookmarkReferencesWorkOrder(bookmark, workOrderId) {
883
+ const payload = readPayload(bookmark);
884
+ const context = isRecord(payload?.['context']) ? payload?.['context'] : null;
885
+ return text$1(context?.['workOrderId']) === workOrderId;
886
+ }
887
+ function sameJson(left, right) {
888
+ return JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
889
+ }
890
+ //#endregion
891
+ //#region ----- Occurrence identity -----
892
+ function text$1(value) {
893
+ return typeof value === 'string' ? value.trim() : '';
894
+ }
895
+ function createdStamp(row) {
896
+ const auditAt = row.auditInfo?.created?.at;
897
+ if (typeof auditAt === 'string' && auditAt.trim()) {
898
+ return auditAt.trim();
899
+ }
900
+ if (auditAt instanceof Date && !Number.isNaN(auditAt.getTime())) {
422
901
  return auditAt.toISOString();
423
902
  }
424
903
  if (typeof row.createdAt === 'string' && row.createdAt.trim()) {
@@ -428,7 +907,7 @@ function createdStamp(row) {
428
907
  }
429
908
  /** Earliest created row, then lowest id. Rows without an id are ignored. */
430
909
  function pickCanonicalChecklistRow(rows) {
431
- const withId = rows.filter((row) => text(row.id));
910
+ const withId = rows.filter((row) => text$1(row.id));
432
911
  if (withId.length === 0) {
433
912
  return null;
434
913
  }
@@ -444,8 +923,8 @@ function pickCanonicalChecklistRow(rows) {
444
923
  if (!leftAt && rightAt) {
445
924
  return 1;
446
925
  }
447
- const leftId = text(left.id);
448
- const rightId = text(right.id);
926
+ const leftId = text$1(left.id);
927
+ const rightId = text$1(right.id);
449
928
  if (leftId === rightId) {
450
929
  return 0;
451
930
  }
@@ -457,21 +936,21 @@ function pickCanonicalChecklistRow(rows) {
457
936
  * Questionnaire id alone is not enough.
458
937
  */
459
938
  function isWorkOrderChecklistOccurrence(input) {
460
- const workOrderId = text(input.workOrderId);
461
- const questionnaireId = text(input.questionnaireId);
462
- const subjectType = text(input.subjectType);
463
- const caseId = text(input.assessmentCase?.['id']);
464
- const sessionCaseId = text(input.session?.['caseId']);
939
+ const workOrderId = text$1(input.workOrderId);
940
+ const questionnaireId = text$1(input.questionnaireId);
941
+ const subjectType = text$1(input.subjectType);
942
+ const caseId = text$1(input.assessmentCase?.['id']);
943
+ const sessionCaseId = text$1(input.session?.['caseId']);
465
944
  if (!workOrderId || !questionnaireId || !subjectType || !caseId || !sessionCaseId || sessionCaseId !== caseId) {
466
945
  return false;
467
946
  }
468
- if (text(input.assessmentCase?.['questionnaireId']) !== questionnaireId) {
947
+ if (text$1(input.assessmentCase?.['questionnaireId']) !== questionnaireId) {
469
948
  return false;
470
949
  }
471
950
  const subject = isRecord(input.assessmentCase?.['subjectRef'])
472
951
  ? input.assessmentCase?.['subjectRef']
473
952
  : null;
474
- return text(subject?.['type']) === subjectType && text(subject?.['id']) === workOrderId;
953
+ return text$1(subject?.['type']) === subjectType && text$1(subject?.['id']) === workOrderId;
475
954
  }
476
955
  //#endregion
477
956
 
@@ -513,380 +992,296 @@ const AXMMaintenanceManagementMenuKeys = {
513
992
  */
514
993
  const AXPAssetsMaintenancePermissionKeys = {
515
994
  Access: 'AssetsMaintenance:Permission:Access',
516
- MaintainAssets: 'AssetsMaintenance:Permission:MaintainAssets',
517
- MaintainMaintenance: 'AssetsMaintenance:Permission:MaintainMaintenance',
518
- Setup: 'AssetsMaintenance:Permission:Setup',
519
- };
520
- const cap = AXPAssetsMaintenancePermissionKeys.MaintainMaintenance;
521
- function entityCrud() {
522
- return {
523
- Management: cap,
524
- View: cap,
525
- Create: cap,
526
- Update: cap,
527
- Delete: cap,
528
- };
529
- }
530
- /**
531
- * @deprecated Prefer {@link AXPAssetsMaintenancePermissionKeys}.
532
- * Legacy nested shape kept so existing imports compile during migration.
533
- */
534
- const AXMMaintenanceManagementPermissionKeys = {
535
- MaintenanceManagement: {
536
- Management: cap,
537
- ActivityCategory: entityCrud(),
538
- MaintenanceType: entityCrud(),
539
- MaintenanceTemplate: entityCrud(),
540
- MaintenancePlan: entityCrud(),
541
- WorkPackage: entityCrud(),
542
- WorkOrder: entityCrud(),
543
- WorkReport: entityCrud(),
544
- MaintenanceTemplateActivityType: entityCrud(),
545
- MaintenanceTemplateResource: entityCrud(),
546
- MaintenanceTemplateFailureMode: entityCrud(),
547
- ActivityType: entityCrud(),
548
- ActivityTypeAssetType: entityCrud(),
549
- ActivityTypeResource: entityCrud(),
550
- FailureCause: entityCrud(),
551
- FailureMechanism: entityCrud(),
552
- FailureDetection: entityCrud(),
553
- FailureEffect: entityCrud(),
554
- FailureSeverity: entityCrud(),
555
- FailureType: entityCrud(),
556
- FailureMode: entityCrud(),
557
- FailureRegister: entityCrud(),
558
- },
559
- };
560
-
561
- //#region ---- Status names ----
562
- var AXMWorkOrderStatus;
563
- (function (AXMWorkOrderStatus) {
564
- AXMWorkOrderStatus["Planned"] = "planned";
565
- AXMWorkOrderStatus["Scheduled"] = "scheduled";
566
- AXMWorkOrderStatus["Assigned"] = "assigned";
567
- AXMWorkOrderStatus["InProgress"] = "in-progress";
568
- AXMWorkOrderStatus["OnHold"] = "on-hold";
569
- AXMWorkOrderStatus["Completed"] = "completed";
570
- AXMWorkOrderStatus["SignedOff"] = "signed-off";
571
- AXMWorkOrderStatus["Cancelled"] = "cancelled";
572
- })(AXMWorkOrderStatus || (AXMWorkOrderStatus = {}));
573
- //#endregion
574
-
575
- //#region ---- Source type enum ----
576
- var AXMWorkOrderSourceType;
577
- (function (AXMWorkOrderSourceType) {
578
- AXMWorkOrderSourceType["Manual"] = "manual";
579
- AXMWorkOrderSourceType["MaintenancePlan"] = "maintenance-plan";
580
- AXMWorkOrderSourceType["CreateAsset"] = "create-asset";
581
- AXMWorkOrderSourceType["FailureRegister"] = "failure-register";
582
- })(AXMWorkOrderSourceType || (AXMWorkOrderSourceType = {}));
583
- //#endregion
584
-
585
- //#region ---- Status names ----
586
- var AXMFailureRegisterStatus;
587
- (function (AXMFailureRegisterStatus) {
588
- AXMFailureRegisterStatus["Reported"] = "reported";
589
- AXMFailureRegisterStatus["UnderReview"] = "underReview";
590
- AXMFailureRegisterStatus["WorkOrderRequired"] = "workOrderRequired";
591
- AXMFailureRegisterStatus["WorkOrderCreated"] = "workOrderCreated";
592
- AXMFailureRegisterStatus["InProgress"] = "inProgress";
593
- AXMFailureRegisterStatus["Resolved"] = "resolved";
594
- AXMFailureRegisterStatus["FollowUpRequired"] = "followUpRequired";
595
- AXMFailureRegisterStatus["Rejected"] = "rejected";
596
- AXMFailureRegisterStatus["Duplicate"] = "duplicate";
597
- AXMFailureRegisterStatus["Closed"] = "closed";
598
- })(AXMFailureRegisterStatus || (AXMFailureRegisterStatus = {}));
599
- //#endregion
600
-
601
- //#region ----- Constants -----
602
- /** Widget name for the maintenance interval editor. Kind strings match `AXMAssetIntervalKind`. */
603
- const AXM_MAINTENANCE_INTERVAL_WIDGET = 'maintenance-interval-editor';
604
- /**
605
- * Same stored values as `AXMAssetIntervalKind`.
606
- * Combinations are multiple entries, not extra kinds.
607
- */
608
- const AXM_MAINTENANCE_INTERVAL_KINDS = ['schedule', 'date', 'distance', 'operating-hours', 'operation-count'];
609
- const METER_KINDS = ['distance', 'operating-hours', 'operation-count'];
610
- /** How multiple enabled intervals combine. Stored in lowercase, like other persisted enums. */
611
- var AXMMaintenanceIntervalTriggerLogic;
612
- (function (AXMMaintenanceIntervalTriggerLogic) {
613
- AXMMaintenanceIntervalTriggerLogic["Any"] = "any";
614
- AXMMaintenanceIntervalTriggerLogic["All"] = "all";
615
- })(AXMMaintenanceIntervalTriggerLogic || (AXMMaintenanceIntervalTriggerLogic = {}));
616
- /** Unit stored on a meter trigger. Distance is the only kind with a choice. */
617
- var AXMMaintenanceIntervalUnit;
618
- (function (AXMMaintenanceIntervalUnit) {
619
- AXMMaintenanceIntervalUnit["Kilometer"] = "kilometer";
620
- AXMMaintenanceIntervalUnit["Mile"] = "mile";
621
- AXMMaintenanceIntervalUnit["Hour"] = "hour";
622
- AXMMaintenanceIntervalUnit["Operation"] = "operation";
623
- })(AXMMaintenanceIntervalUnit || (AXMMaintenanceIntervalUnit = {}));
624
- //#endregion
625
- //#region ----- Kind helpers -----
626
- const KIND_SET = new Set(AXM_MAINTENANCE_INTERVAL_KINDS);
627
- function isAXMMaintenanceIntervalKind(value) {
628
- return KIND_SET.has(value);
629
- }
630
- function isAXMMaintenanceMeterKind(value) {
631
- return value === 'distance' || value === 'operating-hours' || value === 'operation-count';
632
- }
633
- function defaultAXMMaintenanceIntervalUnit(kind) {
634
- switch (kind) {
635
- case 'distance':
636
- return AXMMaintenanceIntervalUnit.Kilometer;
637
- case 'operating-hours':
638
- return AXMMaintenanceIntervalUnit.Hour;
639
- case 'operation-count':
640
- return AXMMaintenanceIntervalUnit.Operation;
641
- }
642
- }
643
- function isAXMMaintenanceIntervalUnitForKind(kind, unit) {
644
- switch (kind) {
645
- case 'distance':
646
- return unit === AXMMaintenanceIntervalUnit.Kilometer || unit === AXMMaintenanceIntervalUnit.Mile;
647
- case 'operating-hours':
648
- return unit === AXMMaintenanceIntervalUnit.Hour;
649
- case 'operation-count':
650
- return unit === AXMMaintenanceIntervalUnit.Operation;
651
- }
652
- }
653
- function emptyAXMMaintenanceIntervalConfig() {
654
- return { triggerLogic: AXMMaintenanceIntervalTriggerLogic.Any, triggers: [] };
655
- }
656
- function emptyAXMMaintenanceIntervalDraft() {
657
- return {
658
- triggerLogic: AXMMaintenanceIntervalTriggerLogic.Any,
659
- scheduleEnabled: false,
660
- schedule: null,
661
- dateEnabled: false,
662
- date: null,
663
- meters: {
664
- distance: { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Kilometer },
665
- 'operating-hours': { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Hour },
666
- 'operation-count': { enabled: false, interval: null, unit: AXMMaintenanceIntervalUnit.Operation },
667
- },
668
- };
669
- }
670
- //#endregion
671
- //#region ----- Normalize -----
672
- function scheduleMode(value) {
673
- if (!value || typeof value !== 'object') {
674
- return '';
675
- }
676
- const mode = value.mode;
677
- return typeof mode === 'string' ? mode.trim() : '';
678
- }
679
- function scheduleStartDate(value) {
680
- if (!value || typeof value !== 'object') {
681
- return null;
682
- }
683
- const start = value.startCondition;
684
- return start?.startDate ?? null;
685
- }
686
- function isSchedule(value) {
687
- if (!value || typeof value !== 'object') {
688
- return false;
689
- }
690
- const record = value;
691
- return typeof record.mode === 'string' || record.startCondition != null || typeof record.recurrence === 'string';
692
- }
693
- /** Calendar day stored on a date interval, as `YYYY-MM-DD`. */
694
- function readIntervalDate(value) {
695
- const date = value instanceof Date
696
- ? value
697
- : typeof value === 'string' && value.trim()
698
- ? new Date(value)
699
- : null;
700
- if (!date || Number.isNaN(date.getTime())) {
701
- return null;
702
- }
703
- const month = String(date.getMonth() + 1).padStart(2, '0');
704
- const day = String(date.getDate()).padStart(2, '0');
705
- return `${date.getFullYear()}-${month}-${day}`;
706
- }
707
- function isUnit(value) {
708
- return (value === AXMMaintenanceIntervalUnit.Kilometer ||
709
- value === AXMMaintenanceIntervalUnit.Mile ||
710
- value === AXMMaintenanceIntervalUnit.Hour ||
711
- value === AXMMaintenanceIntervalUnit.Operation);
712
- }
713
- function readTriggerLogic(value) {
714
- return value === AXMMaintenanceIntervalTriggerLogic.All
715
- ? AXMMaintenanceIntervalTriggerLogic.All
716
- : AXMMaintenanceIntervalTriggerLogic.Any;
717
- }
718
- function supportedKindSet(kinds) {
719
- const set = new Set();
720
- for (const kind of kinds) {
721
- if (isAXMMaintenanceIntervalKind(kind)) {
722
- set.add(kind);
723
- }
724
- }
725
- return set;
726
- }
727
- function meterIssue(kind, interval) {
728
- if (typeof interval !== 'number' || !Number.isFinite(interval) || interval <= 0) {
729
- return 'interval';
730
- }
731
- if (kind === 'operation-count' && !Number.isInteger(interval)) {
732
- return 'integer';
733
- }
734
- return null;
995
+ MaintainAssets: 'AssetsMaintenance:Permission:MaintainAssets',
996
+ MaintainMaintenance: 'AssetsMaintenance:Permission:MaintainMaintenance',
997
+ Setup: 'AssetsMaintenance:Permission:Setup',
998
+ };
999
+ const cap = AXPAssetsMaintenancePermissionKeys.MaintainMaintenance;
1000
+ function entityCrud() {
1001
+ return {
1002
+ Management: cap,
1003
+ View: cap,
1004
+ Create: cap,
1005
+ Update: cap,
1006
+ Delete: cap,
1007
+ };
735
1008
  }
736
1009
  /**
737
- * Builds the value object emitted by the interval editor.
738
- * Unsupported, disabled, and invalid triggers are left out.
739
- * Zero or one valid trigger always reports `any`.
1010
+ * @deprecated Prefer {@link AXPAssetsMaintenancePermissionKeys}.
1011
+ * Legacy nested shape kept so existing imports compile during migration.
740
1012
  */
741
- function buildAXMMaintenanceIntervalConfig(supportedIntervalKinds, draft) {
742
- const supported = supportedKindSet(supportedIntervalKinds);
743
- const triggers = [];
744
- const errors = [];
745
- if (supported.has('schedule') && draft.scheduleEnabled) {
746
- const schedule = draft.schedule;
747
- if (schedule && scheduleMode(schedule) === 'specific-date') {
748
- if (readIntervalDate(scheduleStartDate(schedule))) {
749
- triggers.push({ kind: 'schedule', schedule });
750
- }
751
- else {
752
- errors.push({ kind: 'schedule', code: 'date' });
753
- }
754
- }
755
- else if (isSchedule(schedule)) {
756
- triggers.push({ kind: 'schedule', schedule });
757
- }
758
- else {
759
- errors.push({ kind: 'schedule', code: 'schedule' });
760
- }
1013
+ const AXMMaintenanceManagementPermissionKeys = {
1014
+ MaintenanceManagement: {
1015
+ Management: cap,
1016
+ ActivityCategory: entityCrud(),
1017
+ MaintenanceType: entityCrud(),
1018
+ MaintenanceTemplate: entityCrud(),
1019
+ MaintenancePlan: entityCrud(),
1020
+ WorkPackage: entityCrud(),
1021
+ WorkOrder: entityCrud(),
1022
+ WorkReport: entityCrud(),
1023
+ MaintenanceTemplateActivityType: entityCrud(),
1024
+ MaintenanceTemplateResource: entityCrud(),
1025
+ MaintenanceTemplateFailureMode: entityCrud(),
1026
+ ActivityType: entityCrud(),
1027
+ ActivityTypeAssetType: entityCrud(),
1028
+ ActivityTypeResource: entityCrud(),
1029
+ FailureCause: entityCrud(),
1030
+ FailureMechanism: entityCrud(),
1031
+ FailureDetection: entityCrud(),
1032
+ FailureEffect: entityCrud(),
1033
+ FailureSeverity: entityCrud(),
1034
+ FailureType: entityCrud(),
1035
+ FailureMode: entityCrud(),
1036
+ FailureRegister: entityCrud(),
1037
+ },
1038
+ };
1039
+
1040
+ //#region ---- Status names ----
1041
+ var AXMWorkOrderStatus;
1042
+ (function (AXMWorkOrderStatus) {
1043
+ AXMWorkOrderStatus["Planned"] = "planned";
1044
+ AXMWorkOrderStatus["Scheduled"] = "scheduled";
1045
+ AXMWorkOrderStatus["Assigned"] = "assigned";
1046
+ AXMWorkOrderStatus["InProgress"] = "in-progress";
1047
+ AXMWorkOrderStatus["OnHold"] = "on-hold";
1048
+ AXMWorkOrderStatus["Completed"] = "completed";
1049
+ AXMWorkOrderStatus["SignedOff"] = "signed-off";
1050
+ AXMWorkOrderStatus["Cancelled"] = "cancelled";
1051
+ })(AXMWorkOrderStatus || (AXMWorkOrderStatus = {}));
1052
+ //#endregion
1053
+
1054
+ //#region ---- Source type enum ----
1055
+ var AXMWorkOrderSourceType;
1056
+ (function (AXMWorkOrderSourceType) {
1057
+ AXMWorkOrderSourceType["Manual"] = "manual";
1058
+ AXMWorkOrderSourceType["MaintenancePlan"] = "maintenance-plan";
1059
+ AXMWorkOrderSourceType["CreateAsset"] = "create-asset";
1060
+ AXMWorkOrderSourceType["FailureRegister"] = "failure-register";
1061
+ })(AXMWorkOrderSourceType || (AXMWorkOrderSourceType = {}));
1062
+ //#endregion
1063
+
1064
+ //#region ---- Status names ----
1065
+ var AXMFailureRegisterStatus;
1066
+ (function (AXMFailureRegisterStatus) {
1067
+ AXMFailureRegisterStatus["Reported"] = "reported";
1068
+ AXMFailureRegisterStatus["UnderReview"] = "underReview";
1069
+ AXMFailureRegisterStatus["WorkOrderRequired"] = "workOrderRequired";
1070
+ AXMFailureRegisterStatus["WorkOrderCreated"] = "workOrderCreated";
1071
+ AXMFailureRegisterStatus["InProgress"] = "inProgress";
1072
+ AXMFailureRegisterStatus["Resolved"] = "resolved";
1073
+ AXMFailureRegisterStatus["FollowUpRequired"] = "followUpRequired";
1074
+ AXMFailureRegisterStatus["Rejected"] = "rejected";
1075
+ AXMFailureRegisterStatus["Duplicate"] = "duplicate";
1076
+ AXMFailureRegisterStatus["Closed"] = "closed";
1077
+ })(AXMFailureRegisterStatus || (AXMFailureRegisterStatus = {}));
1078
+ //#endregion
1079
+
1080
+ //#endregion
1081
+ //#region ----- Snapshot -----
1082
+ function readCompletion(value) {
1083
+ if (!Array.isArray(value)) {
1084
+ return [];
761
1085
  }
762
- if (supported.has('date') && draft.dateEnabled) {
763
- const date = readIntervalDate(draft.date);
764
- if (date) {
765
- triggers.push({ kind: 'date', date });
766
- }
767
- else if (!supported.has('schedule') && isSchedule(draft.schedule)) {
768
- triggers.push({ kind: 'date', schedule: draft.schedule });
1086
+ const readings = [];
1087
+ for (const item of value) {
1088
+ if (!item || typeof item !== 'object') {
1089
+ continue;
769
1090
  }
770
- else {
771
- errors.push({ kind: 'date', code: 'date' });
1091
+ const record = item;
1092
+ const kind = record['kind'];
1093
+ const unit = record['unit'];
1094
+ const currentValue = record['currentValue'];
1095
+ const capturedAt = record['capturedAt'];
1096
+ if (typeof kind !== 'string' ||
1097
+ !isAXMMaintenanceMeterKind(kind) ||
1098
+ typeof unit !== 'string' ||
1099
+ !isAXMMaintenanceIntervalUnitForKind(kind, unit) ||
1100
+ typeof currentValue !== 'number' ||
1101
+ typeof capturedAt !== 'string') {
1102
+ continue;
772
1103
  }
1104
+ readings.push({ kind, unit: unit, currentValue, capturedAt });
773
1105
  }
774
- for (const kind of METER_KINDS) {
775
- const meter = draft.meters[kind];
776
- if (!supported.has(kind) || !meter.enabled) {
1106
+ return readings;
1107
+ }
1108
+ function readDrafts(value, capturedAt) {
1109
+ if (!Array.isArray(value)) {
1110
+ return [];
1111
+ }
1112
+ const readings = [];
1113
+ for (const item of value) {
1114
+ if (!item || typeof item !== 'object') {
777
1115
  continue;
778
1116
  }
779
- const issue = meterIssue(kind, meter.interval);
780
- if (issue) {
781
- errors.push({ kind, code: issue });
1117
+ const record = item;
1118
+ const kind = record['kind'];
1119
+ const unit = record['unit'];
1120
+ const rawValue = record['value'] ?? record['currentValue'];
1121
+ if (typeof kind !== 'string' || !isAXMMaintenanceMeterKind(kind) || typeof unit !== 'string' || typeof rawValue !== 'number') {
782
1122
  continue;
783
1123
  }
784
- const unit = isAXMMaintenanceIntervalUnitForKind(kind, meter.unit)
785
- ? meter.unit
786
- : defaultAXMMaintenanceIntervalUnit(kind);
787
- triggers.push({ kind, interval: meter.interval, unit });
788
- }
789
- const triggerLogic = triggers.length > 1 && draft.triggerLogic === AXMMaintenanceIntervalTriggerLogic.All
790
- ? AXMMaintenanceIntervalTriggerLogic.All
791
- : AXMMaintenanceIntervalTriggerLogic.Any;
792
- return { config: { triggerLogic, triggers }, errors };
1124
+ if (!isAXMMaintenanceIntervalUnitForKind(kind, unit)) {
1125
+ continue;
1126
+ }
1127
+ const readingAt = typeof record['readingAt'] === 'string' && record['readingAt'].trim() ? record['readingAt'] : capturedAt;
1128
+ readings.push({
1129
+ kind: kind,
1130
+ unit: unit,
1131
+ currentValue: rawValue,
1132
+ capturedAt: readingAt,
1133
+ });
1134
+ }
1135
+ return readings;
793
1136
  }
794
1137
  /**
795
- * Date trigger schedule, or a legacy scheduler-picker object stored before interval configs.
796
- * Meter-only configs have no calendar schedule.
1138
+ * Completed work orders keep the readings captured at completion.
1139
+ * A draft submitted with the task wins over a later live asset meter.
1140
+ * Live meters are used only when the task has not submitted readings yet.
797
1141
  */
798
- function readMaintenancePlanCalendarSchedule(value) {
799
- if (!value || typeof value !== 'object') {
800
- return undefined;
1142
+ function resolveWorkOrderCompletionUsageSnapshot(input) {
1143
+ const existing = readCompletion(input.existing);
1144
+ if (existing.length > 0) {
1145
+ return { readings: existing, source: 'existing' };
801
1146
  }
802
- const record = value;
803
- if (Array.isArray(record.triggers)) {
804
- for (const item of record.triggers) {
805
- if (!item || typeof item !== 'object') {
806
- continue;
807
- }
808
- const kind = item.kind;
809
- if (kind !== 'date' && kind !== 'schedule') {
810
- continue;
811
- }
812
- const schedule = item.schedule;
813
- if (isSchedule(schedule)) {
814
- return schedule;
1147
+ const drafts = readDrafts(input.drafts, input.capturedAt);
1148
+ if (drafts.length > 0) {
1149
+ return { readings: drafts, source: 'submitted' };
1150
+ }
1151
+ return { readings: [...input.live], source: 'live' };
1152
+ }
1153
+ function missingRequiredTaskReadings(requiredKinds, drafts) {
1154
+ const present = new Set(readDrafts(drafts, new Date(0).toISOString()).map((reading) => reading.kind));
1155
+ return requiredKinds.filter((kind) => isAXMMaintenanceMeterKind(kind) && !present.has(kind));
1156
+ }
1157
+ //#endregion
1158
+
1159
+ //#region ----- Constants -----
1160
+ const AXM_SCHEDULED_OCCURRENCE_BATCH_SIZE = 25;
1161
+ const AXM_DEADLINE_EXPIRY_REASON = 'deadline-expiry';
1162
+ const AXM_SCHEDULE_CHANGED_REASON = 'schedule-changed';
1163
+ const CLAIM_LEASE_MS = 2 * 60 * 1000;
1164
+ //#endregion
1165
+ //#region ----- Identity -----
1166
+ function scheduledOccurrenceKey(planId, scheduledStart) {
1167
+ return `${planId}:${scheduledStart}`;
1168
+ }
1169
+ function meterOccurrenceKey(planId, signature) {
1170
+ return `${planId}:meter:${signature}`;
1171
+ }
1172
+ /** Stable id so two runners inserting the same occurrence collide instead of duplicating it. */
1173
+ function stableOccurrenceId(key) {
1174
+ let hash = 0x811c9dc5;
1175
+ for (let index = 0; index < key.length; index += 1) {
1176
+ hash ^= key.charCodeAt(index);
1177
+ hash = Math.imul(hash, 0x01000193);
1178
+ }
1179
+ const hex = (hash >>> 0).toString(16).padStart(8, '0').repeat(4).slice(0, 32);
1180
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-4${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;
1181
+ }
1182
+ //#endregion
1183
+ //#region ----- Reconcile -----
1184
+ function reconcileScheduleOccurrences(desired, existing) {
1185
+ const desiredByKey = new Map(desired.map((item) => [item.key, item]));
1186
+ const desiredByStart = new Map(desired.map((item) => [Date.parse(item.scheduledStart), item]));
1187
+ const consumed = new Set();
1188
+ const resume = [];
1189
+ const supersede = [];
1190
+ for (const row of existing) {
1191
+ const start = Date.parse(row.scheduledStart ?? '');
1192
+ const match = (row.occurrenceKey && desiredByKey.get(row.occurrenceKey))
1193
+ || (Number.isFinite(start) ? desiredByStart.get(start) : undefined);
1194
+ if (match) {
1195
+ consumed.add(match.key);
1196
+ if (!row.workflowInstanceId && !isHistory(row.statusId)) {
1197
+ resume.push({ id: row.id, occurrence: match });
815
1198
  }
1199
+ continue;
1200
+ }
1201
+ if (row.autoGenerated && row.occurrenceKey && !isHistory(row.statusId) && !isStarted(row.statusId)) {
1202
+ supersede.push(row);
816
1203
  }
817
- return undefined;
818
1204
  }
819
- if (record.mode != null || record.startCondition != null || record.recurrence != null) {
820
- return value;
1205
+ return {
1206
+ create: desired.filter((item) => !consumed.has(item.key)),
1207
+ resume,
1208
+ supersede,
1209
+ };
1210
+ }
1211
+ function takeOccurrenceBatch(items, cursor, size = AXM_SCHEDULED_OCCURRENCE_BATCH_SIZE) {
1212
+ return items.filter((item) => item.index >= cursor).slice(0, size);
1213
+ }
1214
+ function isHistory(statusId) {
1215
+ return statusId === AXMWorkOrderStatus.Completed
1216
+ || statusId === AXMWorkOrderStatus.SignedOff
1217
+ || statusId === AXMWorkOrderStatus.Cancelled;
1218
+ }
1219
+ function isStarted(statusId) {
1220
+ return statusId === AXMWorkOrderStatus.InProgress || statusId === AXMWorkOrderStatus.OnHold;
1221
+ }
1222
+ //#endregion
1223
+ //#region ----- Window -----
1224
+ function scheduledTaskWindow(input) {
1225
+ const start = Date.parse(text(input.scheduledStart));
1226
+ const deadline = Date.parse(text(input.signOffDeadline));
1227
+ const hasStart = Number.isFinite(start);
1228
+ const hasDeadline = Number.isFinite(deadline);
1229
+ if (!hasStart && !hasDeadline) {
1230
+ return 'unscheduled';
1231
+ }
1232
+ const now = input.now.getTime();
1233
+ if (hasStart && now < start) {
1234
+ return 'before';
1235
+ }
1236
+ if (hasDeadline && now > deadline) {
1237
+ return 'after';
1238
+ }
1239
+ return 'open';
1240
+ }
1241
+ function canMutateScheduledTask(input) {
1242
+ if (!text(input.occurrenceKey) && !text(input.signOffDeadline)) {
1243
+ return true;
821
1244
  }
822
- return undefined;
1245
+ return scheduledTaskWindow(input) === 'open';
823
1246
  }
824
- /** Reads a stored config into editor state. Kinds outside `supportedIntervalKinds` are dropped. */
825
- function draftFromAXMMaintenanceIntervalConfig(value, supportedIntervalKinds) {
826
- const draft = emptyAXMMaintenanceIntervalDraft();
827
- const supported = supportedKindSet(supportedIntervalKinds);
828
- if (!value || typeof value !== 'object') {
829
- return draft;
1247
+ function isDeadlineCancellationPatch(patch) {
1248
+ const reason = text(patch['cancellationReason']);
1249
+ return text(patch['statusId']) === AXMWorkOrderStatus.Cancelled
1250
+ && (reason === AXM_DEADLINE_EXPIRY_REASON || reason === AXM_SCHEDULE_CHANGED_REASON)
1251
+ && typeof patch['cancelledAt'] === 'string'
1252
+ && !('draftUsageReadings' in patch)
1253
+ && !('completionUsageReadings' in patch)
1254
+ && !('intervalStatesProgression' in patch);
1255
+ }
1256
+ function buildDeadlineCancellationPatch(claim, cancelledAt) {
1257
+ return {
1258
+ statusId: AXMWorkOrderStatus.Cancelled,
1259
+ cancellationReason: claim.outcome === AXM_SCHEDULE_CHANGED_REASON ? AXM_SCHEDULE_CHANGED_REASON : AXM_DEADLINE_EXPIRY_REASON,
1260
+ cancelledAt,
1261
+ outcomeClaim: claim,
1262
+ };
1263
+ }
1264
+ function decideScheduledOutcome(input) {
1265
+ const status = text(input.statusId);
1266
+ if (status === AXMWorkOrderStatus.Completed || status === AXMWorkOrderStatus.SignedOff) {
1267
+ return input.incoming === 'signed' ? 'accept' : 'reject';
830
1268
  }
831
- const record = value;
832
- draft.triggerLogic = readTriggerLogic(record.triggerLogic);
833
- if (!Array.isArray(record.triggers)) {
834
- return draft;
1269
+ if (status === AXMWorkOrderStatus.Cancelled && input.incoming === 'signed') {
1270
+ return 'reject';
835
1271
  }
836
- for (const item of record.triggers) {
837
- if (!item || typeof item !== 'object' || !('kind' in item) || typeof item.kind !== 'string') {
838
- continue;
839
- }
840
- const kind = item.kind;
841
- if (kind === 'date') {
842
- const schedule = item.schedule;
843
- const date = readIntervalDate(item.date);
844
- if (isSchedule(schedule) && supported.has('schedule') && !draft.scheduleEnabled) {
845
- draft.scheduleEnabled = true;
846
- draft.schedule = schedule;
847
- }
848
- if (!supported.has('date')) {
849
- continue;
850
- }
851
- if (date) {
852
- draft.dateEnabled = true;
853
- draft.date = date;
854
- }
855
- else if (isSchedule(schedule) && !supported.has('schedule')) {
856
- draft.dateEnabled = true;
857
- draft.schedule = schedule;
858
- }
859
- continue;
860
- }
861
- if (!isAXMMaintenanceIntervalKind(kind) || !supported.has(kind)) {
862
- continue;
863
- }
864
- if (kind === 'schedule') {
865
- const schedule = item.schedule;
866
- if (!isSchedule(schedule) || draft.scheduleEnabled) {
867
- continue;
868
- }
869
- draft.scheduleEnabled = true;
870
- draft.schedule = schedule;
871
- continue;
872
- }
873
- if (!isAXMMaintenanceMeterKind(kind)) {
874
- continue;
875
- }
876
- const meter = draft.meters[kind];
877
- if (meter.enabled) {
878
- continue;
879
- }
880
- const interval = item.interval;
881
- const unit = item.unit;
882
- if (meterIssue(kind, typeof interval === 'number' ? interval : null)) {
883
- continue;
884
- }
885
- meter.enabled = true;
886
- meter.interval = interval;
887
- meter.unit = isUnit(unit) && isAXMMaintenanceIntervalUnitForKind(kind, unit) ? unit : defaultAXMMaintenanceIntervalUnit(kind);
1272
+ const claim = input.claim;
1273
+ if (!claim || !text(claim.outcome) || !text(claim.at)) {
1274
+ return 'accept';
888
1275
  }
889
- return draft;
1276
+ const age = input.now.getTime() - Date.parse(claim.at);
1277
+ const fresh = Number.isFinite(age) && age >= 0 && age < (input.leaseMs ?? CLAIM_LEASE_MS);
1278
+ if (!fresh || claim.outcome === input.incoming) {
1279
+ return 'accept';
1280
+ }
1281
+ return 'reject';
1282
+ }
1283
+ function text(value) {
1284
+ return typeof value === 'string' ? value.trim() : '';
890
1285
  }
891
1286
  //#endregion
892
1287
 
@@ -1265,5 +1660,5 @@ function resolveMaintenanceIntervalStates(value) {
1265
1660
  * Generated bundle index. Do not edit.
1266
1661
  */
1267
1662
 
1268
- export { AXMFailureRegisterStatus, AXMMaintenanceIntervalTriggerLogic, AXMMaintenanceIntervalUnit, AXMMaintenanceManagementCommandKeys, AXMMaintenanceManagementFeatureKeys, AXMMaintenanceManagementMenuKeys, AXMMaintenanceManagementPermissionKeys, AXMWorkOrderSourceType, AXMWorkOrderStatus, AXM_INTERVAL_CHECKLIST_CASE_ID, AXM_INTERVAL_CHECKLIST_CLAIM, AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID, AXM_INTERVAL_CHECKLIST_SESSION_ID, AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION, AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION, AXM_INTERVAL_OPEN_FORM_ACTION_NAME, AXM_INTERVAL_SIGN_OFF_ACTION_NAME, AXM_INTERVAL_START_FLOW_ACTION_NAME, AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME, AXM_MAINTENANCE_INTERVAL_CHECK_COMMAND_KEY, AXM_MAINTENANCE_INTERVAL_KINDS, AXM_MAINTENANCE_INTERVAL_STATE_ERRORS, AXM_MAINTENANCE_INTERVAL_STATE_KINDS, AXM_MAINTENANCE_INTERVAL_WIDGET, AXPAssetsMaintenancePermissionKeys, MM_CATALOG_SCOPE_MN, MaintenanceManagementManifest, RootConfig, applyIntervalWorkOrderCardActions, buildAXMMaintenanceIntervalConfig, buildIntervalWorkOrderOpenFormAction, buildIntervalWorkOrderSignOffAction, defaultAXMMaintenanceIntervalUnit, draftFromAXMMaintenanceIntervalConfig, emptyAXMMaintenanceIntervalConfig, emptyAXMMaintenanceIntervalDraft, isAXMMaintenanceIntervalKind, isAXMMaintenanceIntervalUnitForKind, isAXMMaintenanceMeterKind, isIntervalOpenFormAction, isIntervalSignOffAction, isIntervalStartFlowAction, isWorkOrderChecklistOccurrence, pickCanonicalChecklistRow, readChecklistIdFromTaskActions, readIntervalChecklistId, readIntervalDate, readMaintenanceIntervalStates, readMaintenancePlanCalendarSchedule, readSignOffActivityOutcome, replaceIntervalStartFlowActions, resolveChecklistId, resolveIntervalChecklistViewerMode, resolveMaintenanceIntervalStates, rewriteIntervalCardBookmarks };
1663
+ export { AXMFailureRegisterStatus, AXMMaintenanceIntervalTriggerLogic, AXMMaintenanceIntervalUnit, AXMMaintenanceManagementCommandKeys, AXMMaintenanceManagementFeatureKeys, AXMMaintenanceManagementMenuKeys, AXMMaintenanceManagementPermissionKeys, AXMWorkOrderSourceType, AXMWorkOrderStatus, AXM_DEADLINE_EXPIRY_REASON, AXM_INSPECTION_USAGE_KINDS_INPUT, AXM_INSPECTION_WORK_ORDER_WORKFLOW_NAME, AXM_INTERVAL_CANCELLED_TASK_DESCRIPTION, AXM_INTERVAL_CHECKLIST_CASE_ID, AXM_INTERVAL_CHECKLIST_CLAIM, AXM_INTERVAL_CHECKLIST_QUESTIONNAIRE_ID, AXM_INTERVAL_CHECKLIST_SESSION_ID, AXM_INTERVAL_COMPLETED_TASK_DESCRIPTION, AXM_INTERVAL_IN_PROGRESS_TASK_DESCRIPTION, AXM_INTERVAL_OPEN_FORM_ACTION_NAME, AXM_INTERVAL_SIGN_OFF_ACTION_NAME, AXM_INTERVAL_START_FLOW_ACTION_NAME, AXM_INTERVAL_WORK_ORDER_WORKFLOW_NAME, AXM_MAINTENANCE_INTERVAL_CHECK_COMMAND_KEY, AXM_MAINTENANCE_INTERVAL_KINDS, AXM_MAINTENANCE_INTERVAL_STATE_ERRORS, AXM_MAINTENANCE_INTERVAL_STATE_KINDS, AXM_MAINTENANCE_INTERVAL_WIDGET, AXM_SCHEDULED_OCCURRENCE_BATCH_SIZE, AXM_SCHEDULE_CHANGED_REASON, AXPAssetsMaintenancePermissionKeys, MM_CATALOG_SCOPE_MN, MaintenanceManagementManifest, RootConfig, applyIntervalWorkOrderCardActions, buildAXMMaintenanceIntervalConfig, buildDeadlineCancellationPatch, buildIntervalWorkOrderOpenFormAction, buildIntervalWorkOrderSignOffAction, canMutateScheduledTask, cloneMaintenanceTemplateSchedule, collectableUsageKinds, decideScheduledOutcome, defaultAXMMaintenanceIntervalUnit, draftFromAXMMaintenanceIntervalConfig, emptyAXMMaintenanceIntervalConfig, emptyAXMMaintenanceIntervalDraft, hasMaintenanceTemplateSchedule, isAXMMaintenanceIntervalKind, isAXMMaintenanceIntervalUnitForKind, isAXMMaintenanceMeterKind, isDeadlineCancellationPatch, isIntervalOpenFormAction, isIntervalSignOffAction, isIntervalStartFlowAction, isWorkOrderChecklistOccurrence, meterOccurrenceKey, missingRequiredTaskReadings, pickCanonicalChecklistRow, readChecklistIdFromTaskActions, readInspectionUsageKinds, readIntervalChecklistId, readIntervalDate, readMaintenanceIntervalStates, readMaintenancePlanCalendarSchedule, readMaintenancePlanSchedule, readSignOffActivityOutcome, reconcileScheduleOccurrences, replaceIntervalStartFlowActions, resolveChecklistId, resolveInspectionUsageKinds, resolveIntervalChecklistViewerMode, resolveMaintenanceIntervalStates, resolveWorkOrderCompletionUsageSnapshot, rewriteIntervalCardBookmarks, scheduledOccurrenceKey, scheduledTaskWindow, shouldReloadMaintenanceTemplateForPlan, stableOccurrenceId, syncMaintenancePlanScheduleFields, takeOccurrenceBatch };
1269
1664
  //# sourceMappingURL=acorex-platform-module-maintenance-management-client-contracts.mjs.map