@acorex/modules 21.0.0-next.70 → 21.0.0-next.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-modules-ai-management.mjs +7 -11
- package/fesm2022/acorex-modules-ai-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-assessment-management-acorex-modules-assessment-management-IHgQ8RVH.mjs → acorex-modules-assessment-management-acorex-modules-assessment-management-BnfSTevp.mjs} +654 -496
- package/fesm2022/acorex-modules-assessment-management-acorex-modules-assessment-management-BnfSTevp.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-assessment-case.entity-B95yBXgi.mjs → acorex-modules-assessment-management-assessment-case.entity-BWMbcZFT.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-case.entity-B95yBXgi.mjs.map → acorex-modules-assessment-management-assessment-case.entity-BWMbcZFT.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-Jhy94fgV.mjs → acorex-modules-assessment-management-assessment-session-answers-view.util-B42XNJUV.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-Jhy94fgV.mjs.map → acorex-modules-assessment-management-assessment-session-answers-view.util-B42XNJUV.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-assessment-session.entity-DBhBxqh1.mjs → acorex-modules-assessment-management-assessment-session.entity-osEWRiw1.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-session.entity-DBhBxqh1.mjs.map → acorex-modules-assessment-management-assessment-session.entity-osEWRiw1.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-fill-assessment-session.command-nkFpnKE2.mjs → acorex-modules-assessment-management-fill-assessment-session.command-DIUV6Az-.mjs} +3 -3
- package/fesm2022/acorex-modules-assessment-management-fill-assessment-session.command-DIUV6Az-.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-preview-question.command-B29oj3WB.mjs → acorex-modules-assessment-management-preview-question.command-B0kZz-BV.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-preview-question.command-B29oj3WB.mjs.map → acorex-modules-assessment-management-preview-question.command-B0kZz-BV.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-preview-questionnaire.command-Sd4gRHo5.mjs → acorex-modules-assessment-management-preview-questionnaire.command-BUUnlr7g.mjs} +18 -9
- package/fesm2022/acorex-modules-assessment-management-preview-questionnaire.command-BUUnlr7g.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-BCtQO_j7.mjs → acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-BvqEePUh.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-BCtQO_j7.mjs.map → acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-BvqEePUh.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-question-bank-item.entity-RLIfWCzq.mjs → acorex-modules-assessment-management-question-bank-item.entity-DZBQOgAg.mjs} +3 -2
- package/fesm2022/acorex-modules-assessment-management-question-bank-item.entity-DZBQOgAg.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-questionnaire-viewer-popup.component-B8LMKqVO.mjs → acorex-modules-assessment-management-questionnaire-viewer-popup.component-BMv-XkZk.mjs} +19 -5
- package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-BMv-XkZk.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-questionnaire.entity-CZBnfCYE.mjs → acorex-modules-assessment-management-questionnaire.entity-BGkWU83k.mjs} +4 -2
- package/fesm2022/acorex-modules-assessment-management-questionnaire.entity-BGkWU83k.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-review-assessment-session.command-hB_LFUSE.mjs → acorex-modules-assessment-management-review-assessment-session.command-Bqi7YO0X.mjs} +3 -3
- package/fesm2022/{acorex-modules-assessment-management-review-assessment-session.command-hB_LFUSE.mjs.map → acorex-modules-assessment-management-review-assessment-session.command-Bqi7YO0X.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-BN-nYHha.mjs → acorex-modules-assessment-management-view-session-answers.command-2LB7JKZx.mjs} +3 -3
- package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-BN-nYHha.mjs.map → acorex-modules-assessment-management-view-session-answers.command-2LB7JKZx.mjs.map} +1 -1
- package/fesm2022/acorex-modules-assessment-management.mjs +1 -1
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-BUuEzfsI.mjs → acorex-modules-auth-acorex-modules-auth-BKMD5v6t.mjs} +17 -13
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-BKMD5v6t.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-app-chooser.component-DnmLfX5x.mjs → acorex-modules-auth-app-chooser.component-DTlzE1Rd.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-app-chooser.component-DnmLfX5x.mjs.map → acorex-modules-auth-app-chooser.component-DTlzE1Rd.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-login.module-D1-POhQk.mjs → acorex-modules-auth-login.module-DSQfhKUZ.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-login.module-D1-POhQk.mjs.map → acorex-modules-auth-login.module-DSQfhKUZ.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-master.layout-BDM5XtcM.mjs +25 -0
- package/fesm2022/acorex-modules-auth-master.layout-BDM5XtcM.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-oauth-callback.component-BhfFPeWT.mjs → acorex-modules-auth-oauth-callback.component-C4Q78fuo.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-oauth-callback.component-BhfFPeWT.mjs.map → acorex-modules-auth-oauth-callback.component-C4Q78fuo.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-BMVSHYy7.mjs → acorex-modules-auth-password.component-C_55t9er.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-BMVSHYy7.mjs.map → acorex-modules-auth-password.component-C_55t9er.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-Cm8DsDvu.mjs → acorex-modules-auth-password.component-VwEsbfR1.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-Cm8DsDvu.mjs.map → acorex-modules-auth-password.component-VwEsbfR1.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-routes-B85OzgW1.mjs → acorex-modules-auth-routes-prPiMAL6.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-B85OzgW1.mjs.map → acorex-modules-auth-routes-prPiMAL6.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-tenant-chooser.component-D6_rL2WP.mjs → acorex-modules-auth-tenant-chooser.component-DVyI9cGU.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-tenant-chooser.component-D6_rL2WP.mjs.map → acorex-modules-auth-tenant-chooser.component-DVyI9cGU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-two-factor.module-DfyDQIw-.mjs → acorex-modules-auth-two-factor.module-C7vZrBHK.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-two-factor.module-DfyDQIw-.mjs.map → acorex-modules-auth-two-factor.module-C7vZrBHK.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-user-sessions.component-gJSHI_eh.mjs → acorex-modules-auth-user-sessions.component-ChF8OYdd.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-user-sessions.component-gJSHI_eh.mjs.map → acorex-modules-auth-user-sessions.component-ChF8OYdd.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-common.mjs +462 -5
- package/fesm2022/acorex-modules-common.mjs.map +1 -1
- package/fesm2022/{acorex-modules-content-management-acorex-modules-content-management-txpooXrE.mjs → acorex-modules-content-management-acorex-modules-content-management-Bc_tCoHa.mjs} +6 -6
- package/fesm2022/acorex-modules-content-management-acorex-modules-content-management-Bc_tCoHa.mjs.map +1 -0
- package/fesm2022/{acorex-modules-content-management-permission-definition.provider-D9woYm2m.mjs → acorex-modules-content-management-permission-definition.provider-2-_i1Kxd.mjs} +2 -2
- package/fesm2022/{acorex-modules-content-management-permission-definition.provider-D9woYm2m.mjs.map → acorex-modules-content-management-permission-definition.provider-2-_i1Kxd.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-edit.component-CQa1h31v.mjs → acorex-modules-content-management-template-content-editor-widget-edit.component-BdNwhaJ8.mjs} +2 -2
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-edit.component-CQa1h31v.mjs.map → acorex-modules-content-management-template-content-editor-widget-edit.component-BdNwhaJ8.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-view.component-DzM4oMNV.mjs → acorex-modules-content-management-template-content-editor-widget-view.component-Cwnqyt0U.mjs} +2 -2
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-view.component-DzM4oMNV.mjs.map → acorex-modules-content-management-template-content-editor-widget-view.component-Cwnqyt0U.mjs.map} +1 -1
- package/fesm2022/acorex-modules-content-management.mjs +1 -1
- package/fesm2022/{acorex-modules-conversation-acorex-modules-conversation-DYW31fEm.mjs → acorex-modules-conversation-acorex-modules-conversation-B1ijk48q.mjs} +640 -219
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-B1ijk48q.mjs.map +1 -0
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Mlan0ADR.mjs +329 -0
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Mlan0ADR.mjs.map +1 -0
- package/fesm2022/{acorex-modules-conversation-comments-page.component-CNqL-HdS.mjs → acorex-modules-conversation-comments-page.component--Q5RxEyI.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-comments-page.component-CNqL-HdS.mjs.map → acorex-modules-conversation-comments-page.component--Q5RxEyI.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-CuYYEqhb.mjs → acorex-modules-conversation-send-assist-chat-message.command--_hCn9Et.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-CuYYEqhb.mjs.map → acorex-modules-conversation-send-assist-chat-message.command--_hCn9Et.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-BKwrZJDs.mjs → acorex-modules-conversation-start-assist-chat.command-BE1BPjj2.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-BKwrZJDs.mjs.map → acorex-modules-conversation-start-assist-chat.command-BE1BPjj2.mjs.map} +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +1 -1
- package/fesm2022/{acorex-modules-dashboard-management-acorex-modules-dashboard-management-kk0CINL1.mjs → acorex-modules-dashboard-management-acorex-modules-dashboard-management-DJMJFziT.mjs} +50 -18
- package/fesm2022/acorex-modules-dashboard-management-acorex-modules-dashboard-management-DJMJFziT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-dashboard-management-index-Bhm8mAON.mjs → acorex-modules-dashboard-management-index-DoTVg9ro.mjs} +2 -2
- package/fesm2022/{acorex-modules-dashboard-management-index-Bhm8mAON.mjs.map → acorex-modules-dashboard-management-index-DoTVg9ro.mjs.map} +1 -1
- package/fesm2022/acorex-modules-dashboard-management.mjs +1 -1
- package/fesm2022/acorex-modules-document-management.mjs +1 -1
- package/fesm2022/acorex-modules-document-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-acorex-modules-human-capital-management-DrKulwY-.mjs → acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs} +189 -49
- package/fesm2022/acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-approve-leave-request.command-TavX6h7z.mjs → acorex-modules-human-capital-management-approve-leave-request.command-CDBhDXr8.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-approve-leave-request.command-TavX6h7z.mjs.map → acorex-modules-human-capital-management-approve-leave-request.command-CDBhDXr8.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-assign-position-assignment.command-ZEmi88vf.mjs → acorex-modules-human-capital-management-assign-position-assignment.command-pz0IOxa3.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-assign-position-assignment.command-ZEmi88vf.mjs.map → acorex-modules-human-capital-management-assign-position-assignment.command-pz0IOxa3.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-cancel-leave-request.command-DzIMYIhe.mjs → acorex-modules-human-capital-management-cancel-leave-request.command-Czwdu-nH.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-cancel-leave-request.command-DzIMYIhe.mjs.map → acorex-modules-human-capital-management-cancel-leave-request.command-Czwdu-nH.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-employee.entity-CrVU_3Jv.mjs → acorex-modules-human-capital-management-employee.entity-ZTRqQfRv.mjs} +21 -17
- package/fesm2022/acorex-modules-human-capital-management-employee.entity-ZTRqQfRv.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-BeiaEsNZ.mjs → acorex-modules-human-capital-management-employment-type.entity-BIIc7EpP.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-BeiaEsNZ.mjs.map → acorex-modules-human-capital-management-employment-type.entity-BIIc7EpP.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-leave-request.entity-QeY6lcUY.mjs → acorex-modules-human-capital-management-leave-request.entity-Bmv7oLAr.mjs} +19 -24
- package/fesm2022/acorex-modules-human-capital-management-leave-request.entity-Bmv7oLAr.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-leave-type.entity-D7B3adkZ.mjs → acorex-modules-human-capital-management-leave-type.entity-OwdxjYKk.mjs} +10 -4
- package/fesm2022/acorex-modules-human-capital-management-leave-type.entity-OwdxjYKk.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-lifecycle-event-type.entity-Dim-8hT7.mjs → acorex-modules-human-capital-management-lifecycle-event-type.entity-C_XVrmZt.mjs} +19 -74
- package/fesm2022/acorex-modules-human-capital-management-lifecycle-event-type.entity-C_XVrmZt.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-lifecycle-event.entity-3HtYOKrY.mjs → acorex-modules-human-capital-management-lifecycle-event.entity-BwLAEtqA.mjs} +3 -3
- package/fesm2022/acorex-modules-human-capital-management-lifecycle-event.entity-BwLAEtqA.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-Byxt921P.mjs → acorex-modules-human-capital-management-position-assignment.entity-DdMmiGbn.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-Byxt921P.mjs.map → acorex-modules-human-capital-management-position-assignment.entity-DdMmiGbn.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-reject-leave-request.command-CAvjZTG9.mjs → acorex-modules-human-capital-management-reject-leave-request.command-Bdwwkcs3.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-reject-leave-request.command-CAvjZTG9.mjs.map → acorex-modules-human-capital-management-reject-leave-request.command-Bdwwkcs3.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-revoke-position-assignment.command-BeWrsQo8.mjs → acorex-modules-human-capital-management-revoke-position-assignment.command-Cq-aA79w.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-revoke-position-assignment.command-BeWrsQo8.mjs.map → acorex-modules-human-capital-management-revoke-position-assignment.command-Cq-aA79w.mjs.map} +1 -1
- package/fesm2022/acorex-modules-human-capital-management-start-leave-request-flow.command-Cx9TRMlY.mjs +230 -0
- package/fesm2022/acorex-modules-human-capital-management-start-leave-request-flow.command-Cx9TRMlY.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-start-lifecycle-event-flow.command-Bz2SZcmm.mjs → acorex-modules-human-capital-management-start-lifecycle-event-flow.command-DjepuAcu.mjs} +9 -14
- package/fesm2022/acorex-modules-human-capital-management-start-lifecycle-event-flow.command-DjepuAcu.mjs.map +1 -0
- package/fesm2022/acorex-modules-human-capital-management.mjs +1 -1
- package/fesm2022/acorex-modules-report-management.mjs +2 -2
- package/fesm2022/acorex-modules-report-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-settings-management-acorex-modules-settings-management-Dj9u0VEL.mjs → acorex-modules-settings-management-acorex-modules-settings-management-BfbVV7di.mjs} +5 -5
- package/fesm2022/{acorex-modules-settings-management-acorex-modules-settings-management-Dj9u0VEL.mjs.map → acorex-modules-settings-management-acorex-modules-settings-management-BfbVV7di.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-settings-management-permission-definition.provider-DpRn1jAo.mjs → acorex-modules-settings-management-permission-definition.provider-BBb5hqkc.mjs} +2 -2
- package/fesm2022/{acorex-modules-settings-management-permission-definition.provider-DpRn1jAo.mjs.map → acorex-modules-settings-management-permission-definition.provider-BBb5hqkc.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-settings-management-setting-page.component-C9wPgm_P.mjs → acorex-modules-settings-management-setting-page.component-Dn8CYgux.mjs} +4 -4
- package/fesm2022/{acorex-modules-settings-management-setting-page.component-C9wPgm_P.mjs.map → acorex-modules-settings-management-setting-page.component-Dn8CYgux.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-settings-management-setting-view.component-BQ69Bx8C.mjs → acorex-modules-settings-management-setting-view.component-B5jpPo9k.mjs} +2 -2
- package/fesm2022/{acorex-modules-settings-management-setting-view.component-BQ69Bx8C.mjs.map → acorex-modules-settings-management-setting-view.component-B5jpPo9k.mjs.map} +1 -1
- package/fesm2022/acorex-modules-settings-management.mjs +1 -1
- package/fesm2022/{acorex-modules-workflow-management-index-CxheG2ry.mjs → acorex-modules-workflow-management-index-CztICioV.mjs} +64 -4
- package/fesm2022/acorex-modules-workflow-management-index-CztICioV.mjs.map +1 -0
- package/fesm2022/acorex-modules-workflow-management-workflow-configurator-widget-column.component-Cpi0Pq3n.mjs +79 -0
- package/fesm2022/acorex-modules-workflow-management-workflow-configurator-widget-column.component-Cpi0Pq3n.mjs.map +1 -0
- package/fesm2022/acorex-modules-workflow-management-workflow-configurator-widget-edit.component-RbwX6Nd_.mjs +466 -0
- package/fesm2022/acorex-modules-workflow-management-workflow-configurator-widget-edit.component-RbwX6Nd_.mjs.map +1 -0
- package/fesm2022/{acorex-modules-workflow-management-workflow-definition.entity-DISpkWE4.mjs → acorex-modules-workflow-management-workflow-definition.entity-BfACGpo4.mjs} +2 -1
- package/fesm2022/acorex-modules-workflow-management-workflow-definition.entity-BfACGpo4.mjs.map +1 -0
- package/fesm2022/acorex-modules-workflow-management.mjs +175 -29
- package/fesm2022/acorex-modules-workflow-management.mjs.map +1 -1
- package/package.json +2 -2
- package/types/acorex-modules-ai-management.d.ts +2 -2
- package/types/acorex-modules-assessment-management.d.ts +214 -188
- package/types/acorex-modules-common.d.ts +13 -3
- package/types/acorex-modules-conversation.d.ts +22 -11
- package/types/acorex-modules-dashboard-management.d.ts +14 -2
- package/types/acorex-modules-document-management.d.ts +6 -0
- package/types/acorex-modules-human-capital-management.d.ts +28 -14
- package/types/acorex-modules-report-management.d.ts +3 -0
- package/types/acorex-modules-workflow-management.d.ts +18 -11
- package/fesm2022/acorex-modules-assessment-management-acorex-modules-assessment-management-IHgQ8RVH.mjs.map +0 -1
- package/fesm2022/acorex-modules-assessment-management-fill-assessment-session.command-nkFpnKE2.mjs.map +0 -1
- package/fesm2022/acorex-modules-assessment-management-preview-questionnaire.command-Sd4gRHo5.mjs.map +0 -1
- package/fesm2022/acorex-modules-assessment-management-question-bank-item.entity-RLIfWCzq.mjs.map +0 -1
- package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-B8LMKqVO.mjs.map +0 -1
- package/fesm2022/acorex-modules-assessment-management-questionnaire.entity-CZBnfCYE.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-BUuEzfsI.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-master.layout-DMP4RC6L.mjs +0 -25
- package/fesm2022/acorex-modules-auth-master.layout-DMP4RC6L.mjs.map +0 -1
- package/fesm2022/acorex-modules-content-management-acorex-modules-content-management-txpooXrE.mjs.map +0 -1
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-DYW31fEm.mjs.map +0 -1
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-DQlE8l4c.mjs +0 -329
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-DQlE8l4c.mjs.map +0 -1
- package/fesm2022/acorex-modules-dashboard-management-acorex-modules-dashboard-management-kk0CINL1.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-acorex-modules-human-capital-management-DrKulwY-.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-employee.entity-CrVU_3Jv.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-leave-request.entity-QeY6lcUY.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-leave-type.entity-D7B3adkZ.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-lifecycle-event-type.entity-Dim-8hT7.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-lifecycle-event.entity-3HtYOKrY.mjs.map +0 -1
- package/fesm2022/acorex-modules-human-capital-management-start-lifecycle-event-flow.command-Bz2SZcmm.mjs.map +0 -1
- package/fesm2022/acorex-modules-workflow-management-index-CxheG2ry.mjs.map +0 -1
- package/fesm2022/acorex-modules-workflow-management-workflow-definition.entity-DISpkWE4.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAllQueryView, AXPEntityCommandScope } from '@acorex/platform/common';
|
|
2
2
|
import { entityMasterCrudActions } from '@acorex/platform/layout/entity';
|
|
3
3
|
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
4
|
-
import { b as AXPHumanCapitalManagementCommandKeys, R as RootConfig } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-
|
|
4
|
+
import { b as AXPHumanCapitalManagementCommandKeys, R as RootConfig } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs';
|
|
5
5
|
|
|
6
6
|
async function factory() {
|
|
7
7
|
const entityDef = {
|
|
@@ -265,4 +265,4 @@ async function factory() {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
export { factory };
|
|
268
|
-
//# sourceMappingURL=acorex-modules-human-capital-management-position-assignment.entity-
|
|
268
|
+
//# sourceMappingURL=acorex-modules-human-capital-management-position-assignment.entity-DdMmiGbn.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-modules-human-capital-management-position-assignment.entity-Byxt921P.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/entities/position-assignment/position-assignment.entity.ts"],"sourcesContent":["import { AXPEntity, AXPEntityCommandScope, createAllQueryView } from '@acorex/platform/common';\nimport { entityMasterCrudActions } from '@acorex/platform/layout/entity';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';\nimport { AXPHumanCapitalManagementCommandKeys } from '../../commands.keys';\nimport { RootConfig } from '../../const';\n\nexport async function factory(): Promise<AXPEntity | null> {\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.positionAssignment.name,\n icon: 'fa-light fa-user-tie-hair',\n plugins: [\n { name: 'history' },\n { name: 'lock' },\n { name: 'compare' },\n {\n name: 'status',\n options: {\n field: 'statusId',\n definition: 'human-capital-management.status.position-assignment',\n },\n },\n ],\n title: RootConfig.entities.positionAssignment.title,\n formats: {\n individual: RootConfig.entities.positionAssignment.title,\n plural: RootConfig.entities.positionAssignment.titlePlural,\n searchResult: { title: '{{ position.title }}', description: RootConfig.module.title },\n },\n relatedEntities: [],\n groups: [\n {\n id: 'assignment',\n title: '@human-capital-management:position-assignments.entities.position-assignment.groups.assignment',\n },\n { id: 'period', title: '@general:terms.datetime.period' },\n { id: 'additional', title: '@general:terms.interface.additional-info' },\n ],\n properties: [\n {\n name: 'id',\n title: 'ID',\n groupId: 'assignment',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'employeeId',\n title: '@general:terms.people.employee',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `HumanCapitalManagement.Employee`,\n textField: 'person.fullName',\n valueField: 'id',\n look: 'select',\n columns: ['person.fullName', 'employeeCode'],\n expose: [\n { source: 'id', target: 'employee.id' },\n { source: 'person.fullName', target: 'employee.person.fullName' },\n ],\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'businessUnitId',\n title: '@organization-management:business-units.terms.individual-title',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'object',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `OrganizationManagement.BusinessUnit`,\n textField: 'title',\n valueField: 'id',\n look: 'lookup',\n expose: [\n { source: 'id', target: 'businessUnit.id' },\n { source: 'title', target: 'businessUnit.title' },\n { source: 'positionIds', target: 'businessUnit.positionIds' },\n { source: 'positions', target: 'businessUnit.positions' },\n ],\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'positionId',\n title: '@general:terms.organizations.position',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `OrganizationManagement.Position`,\n textField: 'title',\n valueField: 'id',\n look: 'select',\n columns: ['title'],\n expose: [\n { source: 'id', target: 'position.id' },\n { source: 'title', target: 'position.title' },\n ],\n filter: {\n logic: 'and',\n filters: [\n { field: 'id', operator: { type: 'in' }, value: '{{ context.eval(\"businessUnit.positionIds\") }}' },\n ],\n },\n },\n triggers: [{ event: \"{{ events.context('businessUnitId') }}\", action: `{{ widget.refresh() }}` }],\n },\n },\n validations: [{ rule: 'required' }],\n },\n\n {\n name: 'startDate',\n title: '@general:terms.datetime.start-date',\n groupId: 'period',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'date', interface: { type: AXPWidgetsCatalog.dateTime } },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'endDate',\n title: '@general:terms.datetime.end-date',\n groupId: 'period',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'date', interface: { type: AXPWidgetsCatalog.dateTime } },\n },\n {\n name: 'isPrimary',\n title: '@general:terms.status.states.is-primary',\n groupId: 'additional',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'boolean', interface: { type: AXPWidgetsCatalog.toggle } },\n },\n {\n name: 'notes',\n title: '@general:terms.common.notes',\n groupId: 'additional',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.largeText } },\n },\n ],\n columns: [\n { name: 'employeeId', options: { dataPath: 'employee.person.fullName' } },\n { name: 'businessUnitId', options: { dataPath: 'businessUnit.title' } },\n { name: 'positionId', options: { dataPath: 'position.title' } },\n { name: 'startDate' },\n { name: 'endDate' },\n { name: 'isPrimary' },\n ],\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n },\n update: {\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n },\n single: {\n title: `{{position.title}}`,\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'employeeId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n actions: [\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ],\n },\n list: {\n actions: [\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.assign.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Assign,\n },\n priority: 'primary',\n type: 'create',\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'primary',\n type: 'delete',\n scope: AXPEntityCommandScope.Selected,\n },\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ...entityMasterCrudActions({ create: false, delete: false, view: true, edit: false }),\n ],\n views: [createAllQueryView({ sorts: [{ name: 'startDate', dir: 'desc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n"],"names":[],"mappings":";;;;;AAMO,eAAe,OAAO,GAAA;AAE3B,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AACjD,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,SAAS,EAAE;YACnB,EAAE,IAAI,EAAE,MAAM,EAAE;YAChB,EAAE,IAAI,EAAE,SAAS,EAAE;AACnB,YAAA;AACE,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,KAAK,EAAE,UAAU;AACjB,oBAAA,UAAU,EAAE,qDAAqD;AAClE,iBAAA;AACF,aAAA;AACF,SAAA;AACD,QAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK;AACnD,QAAA,OAAO,EAAE;AACP,YAAA,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK;AACxD,YAAA,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,WAAW;AAC1D,YAAA,YAAY,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE;AACtF,SAAA;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;AACD,4BAAA,QAAQ,EAAE,SAAS;AACnB,4BAAA,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,qBAAqB,CAAC,SAAS;AACvC,yBAAA;AACD,wBAAA;AACE,4BAAA,KAAK,EAAE,kGAAkG;AACzG,4BAAA,OAAO,EAAE;AACP,gCAAA,IAAI,EAAE,oCAAoC,CAAC,kBAAkB,CAAC,MAAM;AACrE,6BAAA;AACD,4BAAA,QAAQ,EAAE,SAAS;AACnB,4BAAA,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,qBAAqB,CAAC,QAAQ;AACtC,yBAAA;AACD,wBAAA;AACE,4BAAA,KAAK,EAAE,kGAAkG;AACzG,4BAAA,OAAO,EAAE;AACP,gCAAA,IAAI,EAAE,oCAAoC,CAAC,kBAAkB,CAAC,MAAM;AACrE,6BAAA;AACD,4BAAA,QAAQ,EAAE,WAAW;AACrB,4BAAA,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,qBAAqB,CAAC,UAAU;AACxC,yBAAA;AACD,wBAAA,GAAG,uBAAuB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACtF,qBAAA;oBACD,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7E,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-modules-human-capital-management-position-assignment.entity-DdMmiGbn.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/entities/position-assignment/position-assignment.entity.ts"],"sourcesContent":["import { AXPEntity, AXPEntityCommandScope, createAllQueryView } from '@acorex/platform/common';\nimport { entityMasterCrudActions } from '@acorex/platform/layout/entity';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';\nimport { AXPHumanCapitalManagementCommandKeys } from '../../commands.keys';\nimport { RootConfig } from '../../const';\n\nexport async function factory(): Promise<AXPEntity | null> {\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.positionAssignment.name,\n icon: 'fa-light fa-user-tie-hair',\n plugins: [\n { name: 'history' },\n { name: 'lock' },\n { name: 'compare' },\n {\n name: 'status',\n options: {\n field: 'statusId',\n definition: 'human-capital-management.status.position-assignment',\n },\n },\n ],\n title: RootConfig.entities.positionAssignment.title,\n formats: {\n individual: RootConfig.entities.positionAssignment.title,\n plural: RootConfig.entities.positionAssignment.titlePlural,\n searchResult: { title: '{{ position.title }}', description: RootConfig.module.title },\n },\n relatedEntities: [],\n groups: [\n {\n id: 'assignment',\n title: '@human-capital-management:position-assignments.entities.position-assignment.groups.assignment',\n },\n { id: 'period', title: '@general:terms.datetime.period' },\n { id: 'additional', title: '@general:terms.interface.additional-info' },\n ],\n properties: [\n {\n name: 'id',\n title: 'ID',\n groupId: 'assignment',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'employeeId',\n title: '@general:terms.people.employee',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `HumanCapitalManagement.Employee`,\n textField: 'person.fullName',\n valueField: 'id',\n look: 'select',\n columns: ['person.fullName', 'employeeCode'],\n expose: [\n { source: 'id', target: 'employee.id' },\n { source: 'person.fullName', target: 'employee.person.fullName' },\n ],\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'businessUnitId',\n title: '@organization-management:business-units.terms.individual-title',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'object',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `OrganizationManagement.BusinessUnit`,\n textField: 'title',\n valueField: 'id',\n look: 'lookup',\n expose: [\n { source: 'id', target: 'businessUnit.id' },\n { source: 'title', target: 'businessUnit.title' },\n { source: 'positionIds', target: 'businessUnit.positionIds' },\n { source: 'positions', target: 'businessUnit.positions' },\n ],\n },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'positionId',\n title: '@general:terms.organizations.position',\n groupId: 'assignment',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `OrganizationManagement.Position`,\n textField: 'title',\n valueField: 'id',\n look: 'select',\n columns: ['title'],\n expose: [\n { source: 'id', target: 'position.id' },\n { source: 'title', target: 'position.title' },\n ],\n filter: {\n logic: 'and',\n filters: [\n { field: 'id', operator: { type: 'in' }, value: '{{ context.eval(\"businessUnit.positionIds\") }}' },\n ],\n },\n },\n triggers: [{ event: \"{{ events.context('businessUnitId') }}\", action: `{{ widget.refresh() }}` }],\n },\n },\n validations: [{ rule: 'required' }],\n },\n\n {\n name: 'startDate',\n title: '@general:terms.datetime.start-date',\n groupId: 'period',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'date', interface: { type: AXPWidgetsCatalog.dateTime } },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'endDate',\n title: '@general:terms.datetime.end-date',\n groupId: 'period',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'date', interface: { type: AXPWidgetsCatalog.dateTime } },\n },\n {\n name: 'isPrimary',\n title: '@general:terms.status.states.is-primary',\n groupId: 'additional',\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n schema: { dataType: 'boolean', interface: { type: AXPWidgetsCatalog.toggle } },\n },\n {\n name: 'notes',\n title: '@general:terms.common.notes',\n groupId: 'additional',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.largeText } },\n },\n ],\n columns: [\n { name: 'employeeId', options: { dataPath: 'employee.person.fullName' } },\n { name: 'businessUnitId', options: { dataPath: 'businessUnit.title' } },\n { name: 'positionId', options: { dataPath: 'position.title' } },\n { name: 'startDate' },\n { name: 'endDate' },\n { name: 'isPrimary' },\n ],\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n },\n update: {\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n },\n single: {\n title: `{{position.title}}`,\n sections: [{ id: 'assignment' }, { id: 'period' }, { id: 'additional' }],\n properties: [\n { name: 'employeeId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'positionId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'businessUnitId', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'startDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'endDate', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'isPrimary', layout: { positions: { lg: { colSpan: 6 } } } },\n { name: 'notes', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n actions: [\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ],\n },\n list: {\n actions: [\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.assign.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Assign,\n },\n priority: 'primary',\n type: 'create',\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'primary',\n type: 'delete',\n scope: AXPEntityCommandScope.Selected,\n },\n {\n title: '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.title',\n command: {\n name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Revoke,\n },\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ...entityMasterCrudActions({ create: false, delete: false, view: true, edit: false }),\n ],\n views: [createAllQueryView({ sorts: [{ name: 'startDate', dir: 'desc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n"],"names":[],"mappings":";;;;;AAMO,eAAe,OAAO,GAAA;AAE3B,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AACjD,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,SAAS,EAAE;YACnB,EAAE,IAAI,EAAE,MAAM,EAAE;YAChB,EAAE,IAAI,EAAE,SAAS,EAA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AAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACtF,qBAAA;oBACD,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7E,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;;;;"}
|
|
@@ -2,7 +2,7 @@ import { AXPSystemStatuses } from '@acorex/platform/common';
|
|
|
2
2
|
import { AXPEntityService } from '@acorex/platform/layout/entity';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, Injectable } from '@angular/core';
|
|
5
|
-
import { R as RootConfig } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-
|
|
5
|
+
import { R as RootConfig } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs';
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
/**
|
|
@@ -59,4 +59,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
59
59
|
}] });
|
|
60
60
|
|
|
61
61
|
export { RejectLeaveRequestCommand };
|
|
62
|
-
//# sourceMappingURL=acorex-modules-human-capital-management-reject-leave-request.command-
|
|
62
|
+
//# sourceMappingURL=acorex-modules-human-capital-management-reject-leave-request.command-Bdwwkcs3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-modules-human-capital-management-reject-leave-request.command-
|
|
1
|
+
{"version":3,"file":"acorex-modules-human-capital-management-reject-leave-request.command-Bdwwkcs3.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/features/leave-request/commands/reject-leave-request.command.ts"],"sourcesContent":["import { AXPSystemStatuses } from '@acorex/platform/common';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '../../../const';\n\n//#region ---- Types ----\n\nexport interface RejectLeaveRequestInput {\n id: string;\n reason?: string;\n note?: string;\n}\n\n//#endregion\n\n/**\n * Reject Leave Request Command\n * Updates the leave request status to Rejected\n */\n@Injectable({ providedIn: 'root' })\nexport class RejectLeaveRequestCommand implements AXPCommand<RejectLeaveRequestInput, void> {\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: RejectLeaveRequestInput): Promise<AXPExecuteCommandResult<void>> {\n try {\n console.log('[RejectLeaveRequestCommand] Executing with input:', input);\n\n const dataAccessor = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.leaveRequest.name)\n .data<string, any>();\n\n // Update the leave request status to Rejected\n const updateData: any = {\n statusId: AXPSystemStatuses.Rejected.name,\n };\n\n // Add reason/note if provided (these fields might not exist in entity model)\n if (input.reason) {\n updateData.reason = input.reason;\n }\n if (input.note) {\n updateData.note = input.note;\n }\n\n console.log('[RejectLeaveRequestCommand] Updating entity with:', updateData);\n\n await dataAccessor.update(input.id, updateData);\n\n console.log('[RejectLeaveRequestCommand] Update successful');\n\n return {\n success: true,\n };\n } catch (error: any) {\n console.error('[RejectLeaveRequestCommand] Error:', error);\n return {\n success: false,\n message: {\n text: error.message || 'Failed to reject leave request',\n },\n };\n }\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAeA;AAEA;;;AAGG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAgD1D,IAAA;;;IA1CC,MAAM,OAAO,CAAC,KAA8B,EAAA;AAC1C,QAAA,IAAI;AACF,YAAA,OAAO,CAAC,GAAG,CAAC,mDAAmD,EAAE,KAAK,CAAC;AAEvE,YAAA,MAAM,Y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CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { AXTranslationService } from '@acorex/core/translation';
|
|
|
3
3
|
import { AXPEntityService } from '@acorex/platform/layout/entity';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, Injectable } from '@angular/core';
|
|
6
|
-
import { A as AXM_POSITION_ASSIGNMENT_STATUS, R as RootConfig, a as AXM_POSITION_ASSIGNMENT_OVERLAPPING_STATUS_IDS } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-
|
|
6
|
+
import { A as AXM_POSITION_ASSIGNMENT_STATUS, R as RootConfig, a as AXM_POSITION_ASSIGNMENT_OVERLAPPING_STATUS_IDS } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs';
|
|
7
7
|
|
|
8
8
|
class AXMRevokePositionAssignmentByIdCommand {
|
|
9
9
|
constructor() {
|
|
@@ -105,4 +105,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
105
105
|
}] });
|
|
106
106
|
|
|
107
107
|
export { AXMRevokePositionAssignmentByIdCommand };
|
|
108
|
-
//# sourceMappingURL=acorex-modules-human-capital-management-revoke-position-assignment.command-
|
|
108
|
+
//# sourceMappingURL=acorex-modules-human-capital-management-revoke-position-assignment.command-Cq-aA79w.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-modules-human-capital-management-revoke-position-assignment.command-
|
|
1
|
+
{"version":3,"file":"acorex-modules-human-capital-management-revoke-position-assignment.command-Cq-aA79w.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/features/organization-chart/commands/revoke-position-assignment.command.ts"],"sourcesContent":["import { AXDataSourceFilterOption } from '@acorex/cdk/common';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '../../../const';\nimport {\n AXM_POSITION_ASSIGNMENT_OVERLAPPING_STATUS_IDS,\n AXM_POSITION_ASSIGNMENT_STATUS,\n} from '../../shared/position-assignment-status.provider';\n\nexport interface AXMRevokePositionAssignmentByIdInput {\n __context__?: {\n data?: unknown;\n };\n data?: unknown;\n id?: unknown;\n positionId?: string;\n employeeId?: string;\n businessUnitId?: string;\n /** When true, do not show the revoke confirmation (caller already confirmed). */\n skipConfirmation?: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXMRevokePositionAssignmentByIdCommand\n implements AXPCommand<AXMRevokePositionAssignmentByIdInput, { revokedCount: number }>\n{\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly entityService = inject(AXPEntityService);\n\n async execute(\n input: AXMRevokePositionAssignmentByIdInput,\n ): Promise<AXPExecuteCommandResult<{ revokedCount: number }>> {\n let ids = this.extractIds(input);\n if (!ids.length && input.positionId && input.employeeId) {\n ids = await this.findOverlappingLifecycleAssignmentIds(\n input.positionId,\n input.employeeId,\n input.businessUnitId,\n );\n }\n if (!ids.length) {\n if (input.skipConfirmation) {\n return { success: true, data: { revokedCount: 0 } };\n }\n return { success: false };\n }\n\n if (!input.skipConfirmation) {\n const confirmed = await this.confirmRevoke();\n if (!confirmed) {\n return { success: false };\n }\n }\n\n const payload: Record<string, unknown> = {\n endDate: new Date().toISOString(),\n statusId: AXM_POSITION_ASSIGNMENT_STATUS.revoked,\n };\n const data = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.positionAssignment.name)\n .data();\n for (const id of ids) {\n await data.update(id, payload as never);\n }\n\n return { success: true, data: { revokedCount: ids.length } };\n }\n\n private async confirmRevoke(): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@human-capital-management:position-assignments.entities.position-assignment.actions.revoke.confirm.message',\n );\n const result = await this.dialogService.confirm(title, message, 'danger', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n private extractIds(input: AXMRevokePositionAssignmentByIdInput): string[] {\n const raw = input?.__context__?.data ?? input?.data ?? input?.id ?? input;\n const values = Array.isArray(raw) ? raw : [raw];\n return values\n .map((value) => {\n if (typeof value === 'string') {\n return value;\n }\n if (value && typeof value === 'object') {\n const id = (value as { id?: unknown })['id'];\n return typeof id === 'string' ? id : '';\n }\n return '';\n })\n .filter((id) => id.trim().length > 0);\n }\n\n /**\n * Resolves assignment rows that still participate in overlap checks (active + scheduled).\n * Revoking only `active` left future-dated `scheduled` rows and blocked new assignments.\n */\n private async findOverlappingLifecycleAssignmentIds(\n positionId: string,\n employeeId: string,\n businessUnitId?: string,\n ): Promise<string[]> {\n const filters: AXDataSourceFilterOption[] = [\n { field: 'positionId', operator: { type: 'equal' }, value: positionId },\n { field: 'employeeId', operator: { type: 'equal' }, value: employeeId },\n { field: 'statusId', operator: { type: 'in' }, value: [...AXM_POSITION_ASSIGNMENT_OVERLAPPING_STATUS_IDS] },\n ];\n if (businessUnitId) {\n filters.push({ field: 'businessUnitId', operator: { type: 'equal' }, value: businessUnitId });\n }\n\n const result = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.positionAssignment.name)\n .data()\n .query({\n skip: 0,\n take: 50,\n sort: [{ field: 'startDate', dir: 'desc' }],\n filter: { logic: 'and', filters },\n });\n\n const items = (result.items ?? []) as Array<{ id?: string }>;\n const seen = new Set<string>();\n const ids: string[] = [];\n for (const item of items) {\n const id = typeof item.id === 'string' && item.id.trim().length > 0 ? item.id.trim() : '';\n if (id && !seen.has(id)) {\n seen.add(id);\n ids.push(id);\n }\n }\n return ids;\n }\n}\n\n"],"names":[],"mappings":";;;;;;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,CAAC;AAC3C,YAAA,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;AAClC,SAAA,CAAC;QAEJ,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAA2B;AAC5D,QAAA,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU;QAC9B,MAAM,GAAG,GAAa,EAAE;AACxB,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,YAAA,MAAM,EAAE,GAAG,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;YACzF,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;AACvB,gBAAA,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACZ,gBAAA,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACd;QACF;AACA,QAAA,OAAO,GAAG;IACZ;8GAjHW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sCAAsC,cADzB,MAAM,EAAA,CAAA,CAAA;;2FACnB,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
2
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
3
|
+
import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
|
|
4
|
+
import { AXPSystemStatusType } from '@acorex/platform/common';
|
|
5
|
+
import { AXPEntityService, AXPEntityStorageService, getRecordWorkflowInstanceId } from '@acorex/platform/layout/entity';
|
|
6
|
+
import { AXPWorkflowManager, AXP_WORKFLOW_ENGINE } from '@acorex/platform/workflow';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { inject, Injectable } from '@angular/core';
|
|
9
|
+
import { R as RootConfig, d as AXMLeaveRequestOpenStatusIds } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs';
|
|
10
|
+
|
|
11
|
+
//#region ---- Imports ----
|
|
12
|
+
//#endregion
|
|
13
|
+
/**
|
|
14
|
+
* Starts the leave request workflow after ensuring at most one pending request per employee and leave type.
|
|
15
|
+
*/
|
|
16
|
+
class StartLeaveRequestFlowCommand {
|
|
17
|
+
constructor() {
|
|
18
|
+
//#region ---- Services & Dependencies ----
|
|
19
|
+
this.dialogService = inject(AXDialogService);
|
|
20
|
+
this.translationService = inject(AXTranslationService);
|
|
21
|
+
this.toastService = inject(AXToastService);
|
|
22
|
+
this.entityService = inject(AXPEntityService);
|
|
23
|
+
this.entityStorageService = inject(AXPEntityStorageService);
|
|
24
|
+
this.workflowManager = inject(AXPWorkflowManager);
|
|
25
|
+
this.workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region ---- Command Implementation ----
|
|
29
|
+
async execute(input) {
|
|
30
|
+
const options = (input?.__context__?.options ?? input);
|
|
31
|
+
const flowInput = options.input;
|
|
32
|
+
const workflowId = options.workflowId?.trim();
|
|
33
|
+
const leaveTypeId = flowInput?.leaveTypeId?.trim();
|
|
34
|
+
const employeeId = this.resolveFlowText(flowInput?.employeeId);
|
|
35
|
+
const employeeDisplayName = this.resolveFlowText(flowInput?.employeeDisplayName);
|
|
36
|
+
const leaveTypeTitle = this.resolveFlowText(flowInput?.leaveTypeTitle);
|
|
37
|
+
if (!workflowId || !leaveTypeId) {
|
|
38
|
+
return { success: false, message: { text: 'Missing workflow or leave type context.' } };
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const openRequests = employeeId
|
|
42
|
+
? await this.findOpenLeaveRequests(employeeId, leaveTypeId)
|
|
43
|
+
: [];
|
|
44
|
+
const orphanInstanceIds = employeeId
|
|
45
|
+
? await this.findOrphanRunningWorkflowInstanceIds(employeeId, leaveTypeId, workflowId, openRequests)
|
|
46
|
+
: [];
|
|
47
|
+
if (openRequests.length > 0 || orphanInstanceIds.length > 0) {
|
|
48
|
+
const confirmed = await this.confirmReplace(leaveTypeTitle);
|
|
49
|
+
if (!confirmed) {
|
|
50
|
+
return { success: false };
|
|
51
|
+
}
|
|
52
|
+
await this.closeOpenRuns(openRequests, orphanInstanceIds);
|
|
53
|
+
}
|
|
54
|
+
const correlationId = employeeId
|
|
55
|
+
? this.buildCorrelationId(employeeId, leaveTypeId, workflowId)
|
|
56
|
+
: undefined;
|
|
57
|
+
const startResult = await this.workflowManager.start(workflowId, {
|
|
58
|
+
leaveTypeId,
|
|
59
|
+
leaveTypeTitle,
|
|
60
|
+
...(employeeId ? { employeeId, employeeDisplayName } : {}),
|
|
61
|
+
...(employeeId
|
|
62
|
+
? {
|
|
63
|
+
refId: employeeId,
|
|
64
|
+
refType: `${RootConfig.module.name}.Employee`,
|
|
65
|
+
correlationId,
|
|
66
|
+
}
|
|
67
|
+
: {}),
|
|
68
|
+
});
|
|
69
|
+
if (!startResult.success) {
|
|
70
|
+
this.toastService.show({
|
|
71
|
+
color: 'danger',
|
|
72
|
+
title: 'Workflow Execution Failed',
|
|
73
|
+
content: startResult.error ?? 'Unknown error',
|
|
74
|
+
closeButton: true,
|
|
75
|
+
timeOut: 5000,
|
|
76
|
+
});
|
|
77
|
+
return { success: false, message: { text: startResult.error ?? 'Unknown error' } };
|
|
78
|
+
}
|
|
79
|
+
return { success: true };
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
83
|
+
console.error('[StartLeaveRequestFlowCommand]', error);
|
|
84
|
+
this.toastService.show({
|
|
85
|
+
color: 'danger',
|
|
86
|
+
title: 'Workflow Execution Error',
|
|
87
|
+
content: message,
|
|
88
|
+
closeButton: true,
|
|
89
|
+
timeOut: 5000,
|
|
90
|
+
});
|
|
91
|
+
return { success: false, message: { text: message } };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region ---- Open-run detection ----
|
|
96
|
+
async findOpenLeaveRequests(employeeId, leaveTypeId) {
|
|
97
|
+
const page = await this.entityService
|
|
98
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.leaveRequest.name)
|
|
99
|
+
.data()
|
|
100
|
+
.query({
|
|
101
|
+
skip: 0,
|
|
102
|
+
take: 10,
|
|
103
|
+
filter: {
|
|
104
|
+
logic: 'and',
|
|
105
|
+
filters: [
|
|
106
|
+
{ field: 'employeeId', operator: { type: 'equal' }, value: employeeId },
|
|
107
|
+
{ field: 'leaveTypeId', operator: { type: 'equal' }, value: leaveTypeId },
|
|
108
|
+
{
|
|
109
|
+
field: 'statusId',
|
|
110
|
+
operator: { type: 'in' },
|
|
111
|
+
value: [...AXMLeaveRequestOpenStatusIds],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
return (page.items ?? []);
|
|
117
|
+
}
|
|
118
|
+
async findOrphanRunningWorkflowInstanceIds(employeeId, leaveTypeId, workflowId, openRequests) {
|
|
119
|
+
const linkedInstanceIds = new Set(openRequests
|
|
120
|
+
.map((row) => getRecordWorkflowInstanceId(row))
|
|
121
|
+
.filter((id) => !!id));
|
|
122
|
+
try {
|
|
123
|
+
const page = await this.entityStorageService.query('WorkflowManagement.WorkflowInstance', {
|
|
124
|
+
skip: 0,
|
|
125
|
+
take: 50,
|
|
126
|
+
filter: {
|
|
127
|
+
logic: 'and',
|
|
128
|
+
filters: [
|
|
129
|
+
{
|
|
130
|
+
field: 'definitionId',
|
|
131
|
+
operator: { type: 'equal' },
|
|
132
|
+
value: workflowId,
|
|
133
|
+
},
|
|
134
|
+
{ field: 'status', operator: { type: 'equal' }, value: 'Running' },
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
const items = (page.items ?? []);
|
|
139
|
+
return items
|
|
140
|
+
.filter((row) => {
|
|
141
|
+
const id = row.id?.trim();
|
|
142
|
+
if (!id || linkedInstanceIds.has(id)) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
const runInput = row.workflowInstance?.workflowState?.input ?? {};
|
|
146
|
+
return runInput['employeeId'] === employeeId && runInput['leaveTypeId'] === leaveTypeId;
|
|
147
|
+
})
|
|
148
|
+
.map((row) => row.id);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region ---- Close and replace ----
|
|
156
|
+
async confirmReplace(leaveTypeTitle) {
|
|
157
|
+
const title = await this.translationService.translateAsync('@human-capital-management:leave-requests.messages.replace-open.confirm.title');
|
|
158
|
+
const message = await this.translationService.translateAsync('@human-capital-management:leave-requests.messages.replace-open.confirm.message', {
|
|
159
|
+
params: {
|
|
160
|
+
leaveTypeTitle: String(leaveTypeTitle ?? '').trim() || '—',
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
const result = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');
|
|
164
|
+
return result.result === true;
|
|
165
|
+
}
|
|
166
|
+
async closeOpenRuns(openRequests, orphanInstanceIds) {
|
|
167
|
+
const data = this.entityService
|
|
168
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.leaveRequest.name)
|
|
169
|
+
.data();
|
|
170
|
+
const supersedeNote = 'Closed to start a new leave request run.';
|
|
171
|
+
for (const request of openRequests) {
|
|
172
|
+
await data.update(request.id, {
|
|
173
|
+
statusId: AXPSystemStatusType.Cancelled,
|
|
174
|
+
reason: supersedeNote,
|
|
175
|
+
});
|
|
176
|
+
const instanceId = getRecordWorkflowInstanceId(request);
|
|
177
|
+
if (instanceId) {
|
|
178
|
+
await this.cancelWorkflowInstance(instanceId);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const instanceId of orphanInstanceIds) {
|
|
182
|
+
await this.cancelWorkflowInstance(instanceId);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async cancelWorkflowInstance(instanceId) {
|
|
186
|
+
const engine = this.workflowEngine;
|
|
187
|
+
if (engine?.cancelInstance) {
|
|
188
|
+
await engine.cancelInstance(instanceId, 'superseded');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const now = new Date().toISOString();
|
|
192
|
+
try {
|
|
193
|
+
await this.entityStorageService.updateOne('WorkflowManagement.WorkflowInstance', instanceId, {
|
|
194
|
+
status: 'Finished',
|
|
195
|
+
subStatus: 'Cancelled',
|
|
196
|
+
finishedAt: now,
|
|
197
|
+
updatedAt: now,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
console.warn('[StartLeaveRequestFlowCommand] Failed to cancel workflow instance:', instanceId, error);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region ---- Helpers ----
|
|
206
|
+
resolveFlowText(value) {
|
|
207
|
+
if (value == null || value === false) {
|
|
208
|
+
return '';
|
|
209
|
+
}
|
|
210
|
+
if (typeof value === 'string') {
|
|
211
|
+
return value.trim();
|
|
212
|
+
}
|
|
213
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
214
|
+
return String(value).trim();
|
|
215
|
+
}
|
|
216
|
+
return resolveMultiLanguageString(value, this.translationService.getActiveLang()).trim();
|
|
217
|
+
}
|
|
218
|
+
buildCorrelationId(employeeId, leaveTypeId, workflowId) {
|
|
219
|
+
return `${RootConfig.module.name}.Employee:${employeeId}:${leaveTypeId}:${workflowId}`;
|
|
220
|
+
}
|
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StartLeaveRequestFlowCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
222
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StartLeaveRequestFlowCommand, providedIn: 'root' }); }
|
|
223
|
+
}
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StartLeaveRequestFlowCommand, decorators: [{
|
|
225
|
+
type: Injectable,
|
|
226
|
+
args: [{ providedIn: 'root' }]
|
|
227
|
+
}] });
|
|
228
|
+
|
|
229
|
+
export { StartLeaveRequestFlowCommand };
|
|
230
|
+
//# sourceMappingURL=acorex-modules-human-capital-management-start-leave-request-flow.command-Cx9TRMlY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-modules-human-capital-management-start-leave-request-flow.command-Cx9TRMlY.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/features/leave-request/commands/start-leave-request-flow.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSystemStatusType } from '@acorex/platform/common';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport {\n AXPEntityService,\n AXPEntityStorageService,\n getRecordWorkflowInstanceId,\n} from '@acorex/platform/layout/entity';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport {\n AXP_WORKFLOW_ENGINE,\n AXPWorkflowEngine,\n AXPWorkflowManager,\n} from '@acorex/platform/workflow';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '../../../const';\nimport { AXMLeaveRequestOpenStatusIds } from '../../../entities/leave-request/leave-request-status.constants';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface StartLeaveRequestFlowInput {\n __context__?: {\n options?: StartLeaveRequestFlowOptions;\n };\n workflowId?: string;\n employeeId?: string;\n employeeDisplayName?: string;\n leaveTypeId?: string;\n leaveTypeTitle?: string;\n}\n\nexport interface StartLeaveRequestFlowOptions {\n workflowId: string;\n input: {\n employeeId?: string;\n employeeDisplayName?: string;\n leaveTypeId: string;\n leaveTypeTitle: string;\n };\n}\n\ninterface OpenLeaveRequestRow {\n id: string;\n workflowInfo?: { instanceId?: string | null; correlationId?: string | null };\n leaveType?: { title?: unknown };\n}\n\n//#endregion\n\n/**\n * Starts the leave request workflow after ensuring at most one pending request per employee and leave type.\n */\n@Injectable({ providedIn: 'root' })\nexport class StartLeaveRequestFlowCommand implements AXPCommand<StartLeaveRequestFlowInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityService = inject(AXPEntityService);\n private readonly entityStorageService = inject(AXPEntityStorageService);\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: StartLeaveRequestFlowInput): Promise<AXPExecuteCommandResult<void>> {\n const options = (input?.__context__?.options ?? input) as StartLeaveRequestFlowOptions;\n const flowInput = options.input;\n const workflowId = options.workflowId?.trim();\n const leaveTypeId = flowInput?.leaveTypeId?.trim();\n const employeeId = this.resolveFlowText(flowInput?.employeeId);\n const employeeDisplayName = this.resolveFlowText(flowInput?.employeeDisplayName);\n const leaveTypeTitle = this.resolveFlowText(flowInput?.leaveTypeTitle);\n\n if (!workflowId || !leaveTypeId) {\n return { success: false, message: { text: 'Missing workflow or leave type context.' } };\n }\n\n try {\n const openRequests = employeeId\n ? await this.findOpenLeaveRequests(employeeId, leaveTypeId)\n : [];\n const orphanInstanceIds = employeeId\n ? await this.findOrphanRunningWorkflowInstanceIds(\n employeeId,\n leaveTypeId,\n workflowId,\n openRequests,\n )\n : [];\n\n if (openRequests.length > 0 || orphanInstanceIds.length > 0) {\n const confirmed = await this.confirmReplace(leaveTypeTitle);\n if (!confirmed) {\n return { success: false };\n }\n await this.closeOpenRuns(openRequests, orphanInstanceIds);\n }\n\n const correlationId = employeeId\n ? this.buildCorrelationId(employeeId, leaveTypeId, workflowId)\n : undefined;\n\n const startResult = await this.workflowManager.start(workflowId, {\n leaveTypeId,\n leaveTypeTitle,\n ...(employeeId ? { employeeId, employeeDisplayName } : {}),\n ...(employeeId\n ? {\n refId: employeeId,\n refType: `${RootConfig.module.name}.Employee`,\n correlationId,\n }\n : {}),\n });\n\n if (!startResult.success) {\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Failed',\n content: startResult.error ?? 'Unknown error',\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: startResult.error ?? 'Unknown error' } };\n }\n\n return { success: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n console.error('[StartLeaveRequestFlowCommand]', error);\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Error',\n content: message,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n\n //#region ---- Open-run detection ----\n\n private async findOpenLeaveRequests(\n employeeId: string,\n leaveTypeId: string,\n ): Promise<OpenLeaveRequestRow[]> {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.leaveRequest.name)\n .data()\n .query({\n skip: 0,\n take: 10,\n filter: {\n logic: 'and',\n filters: [\n { field: 'employeeId', operator: { type: 'equal' }, value: employeeId },\n { field: 'leaveTypeId', operator: { type: 'equal' }, value: leaveTypeId },\n {\n field: 'statusId',\n operator: { type: 'in' },\n value: [...AXMLeaveRequestOpenStatusIds],\n },\n ],\n },\n });\n\n return (page.items ?? []) as OpenLeaveRequestRow[];\n }\n\n private async findOrphanRunningWorkflowInstanceIds(\n employeeId: string,\n leaveTypeId: string,\n workflowId: string,\n openRequests: OpenLeaveRequestRow[],\n ): Promise<string[]> {\n const linkedInstanceIds = new Set(\n openRequests\n .map((row) => getRecordWorkflowInstanceId(row))\n .filter((id): id is string => !!id),\n );\n\n try {\n const page = await this.entityStorageService.query('WorkflowManagement.WorkflowInstance', {\n skip: 0,\n take: 50,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'definitionId',\n operator: { type: 'equal' },\n value: workflowId,\n },\n { field: 'status', operator: { type: 'equal' }, value: 'Running' },\n ],\n },\n });\n\n const items = (page.items ?? []) as Array<{\n id?: string;\n workflowInstance?: { workflowState?: { input?: Record<string, unknown> } };\n }>;\n\n return items\n .filter((row) => {\n const id = row.id?.trim();\n if (!id || linkedInstanceIds.has(id)) {\n return false;\n }\n const runInput = row.workflowInstance?.workflowState?.input ?? {};\n return runInput['employeeId'] === employeeId && runInput['leaveTypeId'] === leaveTypeId;\n })\n .map((row) => row.id as string);\n } catch {\n return [];\n }\n }\n\n //#endregion\n\n //#region ---- Close and replace ----\n\n private async confirmReplace(leaveTypeTitle: string | undefined): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@human-capital-management:leave-requests.messages.replace-open.confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@human-capital-management:leave-requests.messages.replace-open.confirm.message',\n {\n params: {\n leaveTypeTitle: String(leaveTypeTitle ?? '').trim() || '—',\n },\n },\n );\n const result = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n private async closeOpenRuns(\n openRequests: OpenLeaveRequestRow[],\n orphanInstanceIds: string[],\n ): Promise<void> {\n const data = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.leaveRequest.name)\n .data();\n\n const supersedeNote = 'Closed to start a new leave request run.';\n\n for (const request of openRequests) {\n await data.update(request.id, {\n statusId: AXPSystemStatusType.Cancelled,\n reason: supersedeNote,\n } as never);\n\n const instanceId = getRecordWorkflowInstanceId(request);\n if (instanceId) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n for (const instanceId of orphanInstanceIds) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n private async cancelWorkflowInstance(instanceId: string): Promise<void> {\n const engine = this.workflowEngine as AXPWorkflowEngine | null;\n if (engine?.cancelInstance) {\n await engine.cancelInstance(instanceId, 'superseded');\n return;\n }\n\n const now = new Date().toISOString();\n try {\n await this.entityStorageService.updateOne('WorkflowManagement.WorkflowInstance', instanceId, {\n status: 'Finished',\n subStatus: 'Cancelled',\n finishedAt: now,\n updatedAt: now,\n });\n } catch (error: unknown) {\n console.warn('[StartLeaveRequestFlowCommand] Failed to cancel workflow instance:', instanceId, error);\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private resolveFlowText(value: unknown): string {\n if (value == null || value === false) {\n return '';\n }\n if (typeof value === 'string') {\n return value.trim();\n }\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value).trim();\n }\n return resolveMultiLanguageString(value as never, this.translationService.getActiveLang()).trim();\n }\n\n private buildCorrelationId(employeeId: string, leaveTypeId: string, workflowId: string): string {\n return `${RootConfig.module.name}.Employee:${employeeId}:${leaveTypeId}:${workflowId}`;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAqDA;AAEA;;AAEG;MAEU,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,oB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AAC3D,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;QAC7B;AACA,QAAA,OAAO,0BAA0B,CAAC,KAAc,EAAE,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,EAAE;IACnG;AAEQ,IAAA,kBAAkB,CAAC,UAAkB,EAAE,WAAmB,EAAE,UAAkB,EAAA;AACpF,QAAA,OAAO,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,UAAA,EAAa,UAAU,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA,EAAI,UAAU,EAAE;IACxF;8GAlQW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -6,14 +6,10 @@ import { AXPEntityService, AXPEntityStorageService, getRecordWorkflowInstanceId
|
|
|
6
6
|
import { AXPWorkflowManager, AXP_WORKFLOW_ENGINE } from '@acorex/platform/workflow';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { inject, Injectable } from '@angular/core';
|
|
9
|
-
import { R as RootConfig, c as AXMLifecycleEventOpenStatusIds } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-
|
|
9
|
+
import { R as RootConfig, c as AXMLifecycleEventOpenStatusIds } from './acorex-modules-human-capital-management-acorex-modules-human-capital-management-C1lNgBrC.mjs';
|
|
10
10
|
|
|
11
11
|
//#region ---- Imports ----
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ---- Constants ----
|
|
14
|
-
/** Workflow definition name for guided employee lifecycle flows (onboarding, separation, …). */
|
|
15
|
-
const EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_NAME = 'employee-lifecycle-event-flow';
|
|
16
|
-
//#endregion
|
|
17
13
|
/**
|
|
18
14
|
* Starts the guided lifecycle workflow after ensuring at most one in-progress event per employee and event type.
|
|
19
15
|
*/
|
|
@@ -45,7 +41,7 @@ class StartLifecycleEventFlowCommand {
|
|
|
45
41
|
}
|
|
46
42
|
try {
|
|
47
43
|
const openEvents = await this.findOpenLifecycleEvents(employeeId, eventTypeId);
|
|
48
|
-
const orphanInstanceIds = await this.findOrphanRunningWorkflowInstanceIds(employeeId, eventTypeId, openEvents);
|
|
44
|
+
const orphanInstanceIds = await this.findOrphanRunningWorkflowInstanceIds(employeeId, eventTypeId, workflowId, openEvents);
|
|
49
45
|
if (openEvents.length > 0 || orphanInstanceIds.length > 0) {
|
|
50
46
|
const confirmed = await this.confirmReplace(eventTypeTitle);
|
|
51
47
|
if (!confirmed) {
|
|
@@ -60,11 +56,10 @@ class StartLifecycleEventFlowCommand {
|
|
|
60
56
|
eventTypeTitle,
|
|
61
57
|
assessmentCaseTitle,
|
|
62
58
|
questionnaireId: flowInput.questionnaireId,
|
|
63
|
-
targetEmployeeStatusId: flowInput.targetEmployeeStatusId,
|
|
64
59
|
...(flowInput.effectiveDate ? { effectiveDate: flowInput.effectiveDate } : {}),
|
|
65
60
|
refId: employeeId,
|
|
66
61
|
refType: `${RootConfig.module.name}.Employee`,
|
|
67
|
-
correlationId: this.buildCorrelationId(employeeId, eventTypeId),
|
|
62
|
+
correlationId: this.buildCorrelationId(employeeId, eventTypeId, workflowId),
|
|
68
63
|
});
|
|
69
64
|
if (!startResult.success) {
|
|
70
65
|
this.toastService.show({
|
|
@@ -115,7 +110,7 @@ class StartLifecycleEventFlowCommand {
|
|
|
115
110
|
});
|
|
116
111
|
return (page.items ?? []);
|
|
117
112
|
}
|
|
118
|
-
async findOrphanRunningWorkflowInstanceIds(employeeId, eventTypeId, openEvents) {
|
|
113
|
+
async findOrphanRunningWorkflowInstanceIds(employeeId, eventTypeId, workflowId, openEvents) {
|
|
119
114
|
const linkedInstanceIds = new Set(openEvents
|
|
120
115
|
.map((row) => getRecordWorkflowInstanceId(row))
|
|
121
116
|
.filter((id) => !!id));
|
|
@@ -129,7 +124,7 @@ class StartLifecycleEventFlowCommand {
|
|
|
129
124
|
{
|
|
130
125
|
field: 'definitionId',
|
|
131
126
|
operator: { type: 'equal' },
|
|
132
|
-
value:
|
|
127
|
+
value: workflowId,
|
|
133
128
|
},
|
|
134
129
|
{ field: 'status', operator: { type: 'equal' }, value: 'Running' },
|
|
135
130
|
],
|
|
@@ -222,8 +217,8 @@ class StartLifecycleEventFlowCommand {
|
|
|
222
217
|
}
|
|
223
218
|
return eventTypeTitle || employeeDisplayName;
|
|
224
219
|
}
|
|
225
|
-
buildCorrelationId(employeeId, eventTypeId) {
|
|
226
|
-
return `${RootConfig.module.name}.Employee:${employeeId}:${eventTypeId}:${
|
|
220
|
+
buildCorrelationId(employeeId, eventTypeId, workflowId) {
|
|
221
|
+
return `${RootConfig.module.name}.Employee:${employeeId}:${eventTypeId}:${workflowId}`;
|
|
227
222
|
}
|
|
228
223
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StartLifecycleEventFlowCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
229
224
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StartLifecycleEventFlowCommand, providedIn: 'root' }); }
|
|
@@ -233,5 +228,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
233
228
|
args: [{ providedIn: 'root' }]
|
|
234
229
|
}] });
|
|
235
230
|
|
|
236
|
-
export {
|
|
237
|
-
//# sourceMappingURL=acorex-modules-human-capital-management-start-lifecycle-event-flow.command-
|
|
231
|
+
export { StartLifecycleEventFlowCommand };
|
|
232
|
+
//# sourceMappingURL=acorex-modules-human-capital-management-start-lifecycle-event-flow.command-DjepuAcu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-modules-human-capital-management-start-lifecycle-event-flow.command-DjepuAcu.mjs","sources":["../../../../libs/modules/human-capital-management/src/lib/features/lifecycle-event/commands/start-lifecycle-event-flow.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSystemStatusType } from '@acorex/platform/common';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport {\n AXPEntityStorageService,\n AXPEntityService,\n getRecordWorkflowInstanceId,\n} from '@acorex/platform/layout/entity';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport {\n AXP_WORKFLOW_ENGINE,\n AXPWorkflowEngine,\n AXPWorkflowManager,\n} from '@acorex/platform/workflow';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '../../../const';\nimport { AXMLifecycleEventOpenStatusIds } from '../../../entities/lifecycle-event/lifecycle-event-status.constants';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface StartLifecycleEventFlowInput {\n __context__?: {\n options?: StartLifecycleEventFlowOptions;\n };\n workflowId?: string;\n employeeId?: string;\n employeeDisplayName?: string;\n eventTypeId?: string;\n eventTypeTitle?: string;\n questionnaireId?: string;\n targetEmployeeStatusId?: string;\n effectiveDate?: string;\n}\n\nexport interface StartLifecycleEventFlowOptions {\n workflowId: string;\n input: {\n employeeId: string;\n employeeDisplayName: string;\n eventTypeId: string;\n eventTypeTitle: string;\n questionnaireId: string;\n effectiveDate?: string;\n /** Precomposed case/popup title; computed by StartFlow when omitted. */\n assessmentCaseTitle?: string;\n };\n}\n\ninterface OpenLifecycleEventRow {\n id: string;\n workflowInfo?: { instanceId?: string | null; correlationId?: string | null };\n eventType?: { title?: unknown };\n}\n\n//#endregion\n\n/**\n * Starts the guided lifecycle workflow after ensuring at most one in-progress event per employee and event type.\n */\n@Injectable({ providedIn: 'root' })\nexport class StartLifecycleEventFlowCommand implements AXPCommand<StartLifecycleEventFlowInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityService = inject(AXPEntityService);\n private readonly entityStorageService = inject(AXPEntityStorageService);\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: StartLifecycleEventFlowInput): Promise<AXPExecuteCommandResult<void>> {\n const options = (input?.__context__?.options ?? input) as StartLifecycleEventFlowOptions;\n const flowInput = options.input;\n const workflowId = options.workflowId?.trim();\n const employeeId = this.resolveFlowText(flowInput?.employeeId);\n const eventTypeId = flowInput?.eventTypeId?.trim();\n const employeeDisplayName = this.resolveFlowText(flowInput?.employeeDisplayName);\n const eventTypeTitle = this.resolveFlowText(flowInput?.eventTypeTitle);\n const assessmentCaseTitle =\n this.resolveFlowText(flowInput?.assessmentCaseTitle) ||\n this.buildAssessmentCaseTitle(eventTypeTitle, employeeDisplayName);\n\n if (!workflowId || !employeeId || !eventTypeId) {\n return { success: false, message: { text: 'Missing workflow or employee context.' } };\n }\n\n try {\n const openEvents = await this.findOpenLifecycleEvents(employeeId, eventTypeId);\n const orphanInstanceIds = await this.findOrphanRunningWorkflowInstanceIds(\n employeeId,\n eventTypeId,\n workflowId,\n openEvents,\n );\n\n if (openEvents.length > 0 || orphanInstanceIds.length > 0) {\n const confirmed = await this.confirmReplace(eventTypeTitle);\n if (!confirmed) {\n return { success: false };\n }\n await this.closeOpenRuns(openEvents, orphanInstanceIds);\n }\n\n const startResult = await this.workflowManager.start(workflowId, {\n employeeId,\n employeeDisplayName,\n eventTypeId: flowInput.eventTypeId,\n eventTypeTitle,\n assessmentCaseTitle,\n questionnaireId: flowInput.questionnaireId,\n ...(flowInput.effectiveDate ? { effectiveDate: flowInput.effectiveDate } : {}),\n refId: employeeId,\n refType: `${RootConfig.module.name}.Employee`,\n correlationId: this.buildCorrelationId(employeeId, eventTypeId, workflowId),\n });\n\n if (!startResult.success) {\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Failed',\n content: startResult.error ?? 'Unknown error',\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: startResult.error ?? 'Unknown error' } };\n }\n\n return { success: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n console.error('[StartLifecycleEventFlowCommand]', error);\n this.toastService.show({\n color: 'danger',\n title: 'Workflow Execution Error',\n content: message,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n\n //#region ---- Open-run detection ----\n\n private async findOpenLifecycleEvents(\n employeeId: string,\n eventTypeId: string,\n ): Promise<OpenLifecycleEventRow[]> {\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.lifecycleEvent.name)\n .data()\n .query({\n skip: 0,\n take: 10,\n filter: {\n logic: 'and',\n filters: [\n { field: 'employeeId', operator: { type: 'equal' }, value: employeeId },\n { field: 'eventTypeId', operator: { type: 'equal' }, value: eventTypeId },\n {\n field: 'statusId',\n operator: { type: 'in' },\n value: [...AXMLifecycleEventOpenStatusIds],\n },\n ],\n },\n });\n\n return (page.items ?? []) as OpenLifecycleEventRow[];\n }\n\n private async findOrphanRunningWorkflowInstanceIds(\n employeeId: string,\n eventTypeId: string,\n workflowId: string,\n openEvents: OpenLifecycleEventRow[],\n ): Promise<string[]> {\n const linkedInstanceIds = new Set(\n openEvents\n .map((row) => getRecordWorkflowInstanceId(row))\n .filter((id): id is string => !!id),\n );\n\n try {\n const page = await this.entityStorageService.query('WorkflowManagement.WorkflowInstance', {\n skip: 0,\n take: 50,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'definitionId',\n operator: { type: 'equal' },\n value: workflowId,\n },\n { field: 'status', operator: { type: 'equal' }, value: 'Running' },\n ],\n },\n });\n\n const items = (page.items ?? []) as Array<{\n id?: string;\n workflowInstance?: { workflowState?: { input?: Record<string, unknown> } };\n }>;\n\n return items\n .filter((row) => {\n const id = row.id?.trim();\n if (!id || linkedInstanceIds.has(id)) {\n return false;\n }\n const runInput = row.workflowInstance?.workflowState?.input ?? {};\n return runInput['employeeId'] === employeeId && runInput['eventTypeId'] === eventTypeId;\n })\n .map((row) => row.id as string);\n } catch {\n return [];\n }\n }\n\n //#endregion\n\n //#region ---- Close and replace ----\n\n private async confirmReplace(eventTypeTitle: string | undefined): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@human-capital-management:lifecycle-events.messages.replace-open.confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@human-capital-management:lifecycle-events.messages.replace-open.confirm.message',\n {\n params: {\n eventTypeTitle: String(eventTypeTitle ?? '').trim() || '—',\n },\n },\n );\n const result = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n private async closeOpenRuns(\n openEvents: OpenLifecycleEventRow[],\n orphanInstanceIds: string[],\n ): Promise<void> {\n const data = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.lifecycleEvent.name)\n .data();\n\n const supersedeNote = 'Closed to start a new lifecycle run.';\n\n for (const event of openEvents) {\n await data.update(event.id, {\n statusId: AXPSystemStatusType.Cancelled,\n notes: supersedeNote,\n } as never);\n\n const instanceId = getRecordWorkflowInstanceId(event);\n if (instanceId) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n for (const instanceId of orphanInstanceIds) {\n await this.cancelWorkflowInstance(instanceId);\n }\n }\n\n private async cancelWorkflowInstance(instanceId: string): Promise<void> {\n const engine = this.workflowEngine as AXPWorkflowEngine | null;\n if (engine?.cancelInstance) {\n await engine.cancelInstance(instanceId, 'superseded');\n return;\n }\n\n const now = new Date().toISOString();\n try {\n await this.entityStorageService.updateOne('WorkflowManagement.WorkflowInstance', instanceId, {\n status: 'Finished',\n subStatus: 'Cancelled',\n finishedAt: now,\n updatedAt: now,\n });\n } catch (error: unknown) {\n console.warn('[StartLifecycleEventFlowCommand] Failed to cancel workflow instance:', instanceId, error);\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n /** Normalizes workflow start input that may be plain text, ML, or a failed expression (`false`). */\n private resolveFlowText(value: unknown): string {\n if (value == null || value === false) {\n return '';\n }\n if (typeof value === 'string') {\n return value.trim();\n }\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value).trim();\n }\n return resolveMultiLanguageString(value as never, this.translationService.getActiveLang()).trim();\n }\n\n private buildAssessmentCaseTitle(eventTypeTitle: string, employeeDisplayName: string): string {\n if (eventTypeTitle && employeeDisplayName) {\n return `${eventTypeTitle} — ${employeeDisplayName}`;\n }\n return eventTypeTitle || employeeDisplayName;\n }\n\n private buildCorrelationId(employeeId: string, eventTypeId: string, workflowId: string): string {\n return `${RootConfig.module.name}.Employee:${employeeId}:${eventTypeId}:${workflowId}`;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AA4DA;AAEA;;AAEG;MAEU,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,CAAC;AACtD,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