@acorex-platform/module-human-capital-management-client 0.0.32 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/fesm2022/{acorex-platform-module-human-capital-management-client-acorex-platform-module-human-capital-management-client-DmqiCOti.mjs → acorex-platform-module-human-capital-management-client-acorex-platform-module-human-capital-management-client-YulnMbkF.mjs} +8 -8
  2. package/fesm2022/{acorex-platform-module-human-capital-management-client-acorex-platform-module-human-capital-management-client-DmqiCOti.mjs.map → acorex-platform-module-human-capital-management-client-acorex-platform-module-human-capital-management-client-YulnMbkF.mjs.map} +1 -1
  3. package/fesm2022/acorex-platform-module-human-capital-management-client-approve-leave-request.command-Om_S0k9L.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-module-human-capital-management-client-assign-position-assignment.command-2iHIogn6.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-human-capital-management-client-cancel-leave-request.command-DGriRFiQ.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-employee.mjs +559 -0
  7. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-employee.mjs.map +1 -0
  8. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-employment-type.mjs +182 -0
  9. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-employment-type.mjs.map +1 -0
  10. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-leave-request.mjs +374 -0
  11. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-leave-request.mjs.map +1 -0
  12. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-leave-type.mjs +182 -0
  13. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-leave-type.mjs.map +1 -0
  14. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event-type.mjs +189 -0
  15. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event-type.mjs.map +1 -0
  16. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event.mjs +307 -0
  17. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event.mjs.map +1 -0
  18. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-position-assignment.mjs +377 -0
  19. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entities-position-assignment.mjs.map +1 -0
  20. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-acorex-platform-module-human-capital-management-client-contracts-entity-catalog-YSqg0InM.mjs +109 -0
  21. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-acorex-platform-module-human-capital-management-client-contracts-entity-catalog-YSqg0InM.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-catalog-scope.keys-D8MsCaj5.mjs +5 -0
  23. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-catalog-scope.keys-D8MsCaj5.mjs.map +1 -0
  24. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-commands.keys-B5rEwAkf.mjs +19 -0
  25. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-commands.keys-B5rEwAkf.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-employee.entity-DkVdcMBo.mjs +459 -0
  27. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-employee.entity-DkVdcMBo.mjs.map +1 -0
  28. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-employment-type.entity-DtYMx-Fh.mjs +98 -0
  29. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-employment-type.entity-DtYMx-Fh.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-leave-request.entity-0NDmiYk0.mjs +290 -0
  31. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-leave-request.entity-0NDmiYk0.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-leave-type.entity-DWkv-dnA.mjs +96 -0
  33. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-leave-type.entity-DWkv-dnA.mjs.map +1 -0
  34. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-lifecycle-event-type.entity-CDfVNrc0.mjs +103 -0
  35. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-lifecycle-event-type.entity-CDfVNrc0.mjs.map +1 -0
  36. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-lifecycle-event.entity-Dp-_0o-1.mjs +223 -0
  37. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-lifecycle-event.entity-Dp-_0o-1.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-position-assignment.entity-rQe7-CDe.mjs +277 -0
  39. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog-position-assignment.entity-rQe7-CDe.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog.mjs +2 -0
  41. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts-entity-catalog.mjs.map +1 -0
  42. package/fesm2022/acorex-platform-module-human-capital-management-client-contracts.mjs.map +1 -1
  43. package/fesm2022/{acorex-platform-module-human-capital-management-client-edit-personal-info.command-CRUNursl.mjs → acorex-platform-module-human-capital-management-client-edit-personal-info.command-6VRu0_a1.mjs} +2 -2
  44. package/fesm2022/{acorex-platform-module-human-capital-management-client-edit-personal-info.command-CRUNursl.mjs.map → acorex-platform-module-human-capital-management-client-edit-personal-info.command-6VRu0_a1.mjs.map} +1 -1
  45. package/fesm2022/{acorex-platform-module-human-capital-management-client-edit-signature.command-Bb3mxwBE.mjs → acorex-platform-module-human-capital-management-client-edit-signature.command-BT_kCp6U.mjs} +2 -2
  46. package/fesm2022/{acorex-platform-module-human-capital-management-client-edit-signature.command-Bb3mxwBE.mjs.map → acorex-platform-module-human-capital-management-client-edit-signature.command-BT_kCp6U.mjs.map} +1 -1
  47. package/fesm2022/acorex-platform-module-human-capital-management-client-local-entities.mjs +35 -0
  48. package/fesm2022/acorex-platform-module-human-capital-management-client-local-entities.mjs.map +1 -0
  49. package/fesm2022/{acorex-platform-module-human-capital-management-client-profile-documents-panel.component-L-Wq--5e.mjs → acorex-platform-module-human-capital-management-client-profile-documents-panel.component-OTrhvB6P.mjs} +2 -2
  50. package/fesm2022/{acorex-platform-module-human-capital-management-client-profile-documents-panel.component-L-Wq--5e.mjs.map → acorex-platform-module-human-capital-management-client-profile-documents-panel.component-OTrhvB6P.mjs.map} +1 -1
  51. package/fesm2022/{acorex-platform-module-human-capital-management-client-profile-documents-panel.component.provider-n9sEfOE2.mjs → acorex-platform-module-human-capital-management-client-profile-documents-panel.component.provider-Cwtz43uK.mjs} +3 -3
  52. package/fesm2022/{acorex-platform-module-human-capital-management-client-profile-documents-panel.component.provider-n9sEfOE2.mjs.map → acorex-platform-module-human-capital-management-client-profile-documents-panel.component.provider-Cwtz43uK.mjs.map} +1 -1
  53. package/fesm2022/acorex-platform-module-human-capital-management-client-reject-leave-request.command-O9gipd8g.mjs.map +1 -1
  54. package/fesm2022/acorex-platform-module-human-capital-management-client-revoke-position-assignment.command-DmVlDQ8_.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-module-human-capital-management-client-start-leave-request-flow.command-BcyCI_vr.mjs.map +1 -1
  56. package/fesm2022/acorex-platform-module-human-capital-management-client-start-lifecycle-event-flow.command-Cp_7ZyWU.mjs.map +1 -1
  57. package/fesm2022/acorex-platform-module-human-capital-management-client.mjs +1 -1
  58. package/package.json +38 -2
  59. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-employee.d.ts +5 -0
  60. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-employment-type.d.ts +5 -0
  61. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-leave-request.d.ts +5 -0
  62. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-leave-type.d.ts +5 -0
  63. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event-type.d.ts +5 -0
  64. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-lifecycle-event.d.ts +5 -0
  65. package/types/acorex-platform-module-human-capital-management-client-contracts-entities-position-assignment.d.ts +5 -0
  66. package/types/acorex-platform-module-human-capital-management-client-contracts-entity-catalog.d.ts +10 -0
  67. package/types/acorex-platform-module-human-capital-management-client-local-entities.d.ts +12 -0
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-human-capital-management-client-approve-leave-request.command-Om_S0k9L.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/leave-request/commands/approve-leave-request.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPSystemStatuses } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\n\n//#region ---- Types ----\n\nexport interface ApproveLeaveRequestInput {\n id: string;\n reason?: string;\n note?: string;\n}\n\n//#endregion\n\n/**\n * Approve Leave Request Command\n * Updates the leave request status to Approved\n */\n@Injectable({ providedIn: 'root' })\nexport class ApproveLeaveRequestCommand implements AXPCommand<ApproveLeaveRequestInput, void> {\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: ApproveLeaveRequestInput): AXPCommandExecuteResultPromise<void> {\n try {\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 Approved\n const updateData: any = {\n statusId: AXPSystemStatuses.Approved.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 await dataAccessor.update(input.id, updateData);\n\n return { success: true, kind: 'object', data: undefined,\n };\n } catch (error: any) {\n console.error('[ApproveLeaveRequestCommand] Error:', error);\n return {\n success: false,\n message: {\n text: error.message || 'Failed to approve leave request',\n },\n };\n }\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;;;AAGG;MAEU,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAyC1D,IAAA;;;IAnCC,MAAM,OAAO,CAAC,KAA+B,EAAA;AAC3C,QAAA,IAAI;AACF,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC;AACvB,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI;AACxE,iBAAA,IAAI,EAAe;;AAGtB,YAAA,MAAM,UAAU,GAAQ;AACtB,gBAAA,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,IAAI;aAC1C;;AAGD,YAAA,IAAI,KAAK,CAAC,MAAM,EAAE;AAChB,gBAAA,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;YAClC;AACA,YAAA,IAAI,KAAK,CAAC,IAAI,EAAE;AACd,gBAAA,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAC9B;YAEA,MAAM,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC;YAE/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS;aACtD;QACH;QAAE,OAAO,KAAU,EAAE;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC;YAC3D,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,iCAAiC;AACzD,iBAAA;aACF;QACH;IACF;8GAzCW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-human-capital-management-client-approve-leave-request.command-Om_S0k9L.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/leave-request/commands/approve-leave-request.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPSystemStatuses } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\n\n//#region ---- Types ----\n\nexport interface ApproveLeaveRequestInput {\n id: string;\n reason?: string;\n note?: string;\n}\n\n//#endregion\n\n/**\n * Approve Leave Request Command\n * Updates the leave request status to Approved\n */\n@Injectable({ providedIn: 'root' })\nexport class ApproveLeaveRequestCommand implements AXPCommand<ApproveLeaveRequestInput, void> {\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: ApproveLeaveRequestInput): AXPCommandExecuteResultPromise<void> {\n try {\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 Approved\n const updateData: any = {\n statusId: AXPSystemStatuses.Approved.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 await dataAccessor.update(input.id, updateData);\n\n return { success: true, kind: 'object', data: undefined,\n };\n } catch (error: any) {\n console.error('[ApproveLeaveRequestCommand] Error:', error);\n return {\n success: false,\n message: {\n text: error.message || 'Failed to approve leave request',\n },\n };\n }\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;;;AAGG;MAEU,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAyC1D,IAAA;;;IAnCC,MAAM,OAAO,CAAC,KAA+B,EAAA;AAC3C,QAAA,IAAI;AACF,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC;AACvB,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI;AACxE,iBAAA,IAAI,EAAe;;AAGtB,YAAA,MAAM,UAAU,GAAQ;AACtB,gBAAA,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,IAAI;aAC1C;;AAGD,YAAA,IAAI,KAAK,CAAC,MAAM,EAAE;AAChB,gBAAA,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;YAClC;AACA,YAAA,IAAI,KAAK,CAAC,IAAI,EAAE;AACd,gBAAA,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAC9B;YAEA,MAAM,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC;YAE/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS;aACtD;QACH;QAAE,OAAO,KAAU,EAAE;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC;YAC3D,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,iCAAiC;AACzD,iBAAA;aACF;QACH;IACF;8GAzCW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-human-capital-management-client-assign-position-assignment.command-2iHIogn6.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/organization-chart/commands/assign-position-assignment.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\nimport { AXM_POSITION_ASSIGNMENT_STATUS } from '@acorex-platform/module-human-capital-management-client/contracts';\n\nexport interface AXMAssignPositionAssignmentInput {\n data?: Record<string, unknown>;\n options?: {\n process?: {\n data?: Record<string, unknown>;\n };\n };\n employeeId?: string;\n}\n\nfunction isUsableEmployeeId(value: unknown): value is string {\n if (typeof value !== 'string') {\n return false;\n }\n const trimmed = value.trim();\n // Reject unresolved expression templates (e.g. '{{ context.eval(\"id\") }}').\n return trimmed.length > 0 && !trimmed.includes('{{');\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXMAssignPositionAssignmentCommand implements AXPCommand<AXMAssignPositionAssignmentInput, unknown> {\n private readonly commandService = inject(AXPCommandService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly entitySelector = inject(AXPEntityDataSelectorService);\n private readonly translationService = inject(AXTranslationService);\n\n private readonly positionAssignmentSource = RootConfig.entities.positionAssignment.source;\n private readonly positionAssignmentEntityInfo = {\n module: RootConfig.module.name,\n name: RootConfig.entities.positionAssignment.name,\n title: RootConfig.entities.positionAssignment.title,\n };\n\n async execute(input: AXMAssignPositionAssignmentInput): AXPCommandExecuteResultPromise<unknown> {\n const contextData = (input?.data ?? {}) as Record<string, unknown>;\n const evaluatedProcessData = input?.options?.process?.data ?? {};\n const payload: Record<string, unknown> = {\n ...contextData,\n ...evaluatedProcessData,\n };\n const rawEmployeeId = input?.employeeId ?? payload['employeeId'];\n // Related-list / create-wizard always seeds employeeId (expression or injected FK).\n // Do not fall back to the employee picker there — that would orphan the assignment.\n const expectsParentEmployeeId =\n Object.prototype.hasOwnProperty.call(contextData, 'employeeId') ||\n Object.prototype.hasOwnProperty.call(evaluatedProcessData, 'employeeId') ||\n input?.employeeId !== undefined;\n const employeeId = isUsableEmployeeId(rawEmployeeId)\n ? rawEmployeeId.trim()\n : expectsParentEmployeeId\n ? undefined\n : await this.selectEmployeeId();\n if (!employeeId) {\n return { success: false };\n }\n payload['employeeId'] = employeeId;\n payload['statusId'] = this.resolveStatusId(payload['startDate'], payload['endDate']);\n\n return (\n await this.commandService.execute('Entity:Create', {\n entity: this.positionAssignmentSource,\n entityInfo: this.positionAssignmentEntityInfo,\n data: payload,\n options: {\n process: {\n redirect: false,\n // Keep employeeId in seed/submit; only hide it in the create UI.\n data: { employeeId },\n },\n excludeProperties: ['employeeId'],\n },\n \n })\n ) ?? { success: false };\n }\n\n private async selectEmployeeId(): Promise<string | undefined> {\n const employeeEntity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.employee.name);\n if (!employeeEntity) {\n return undefined;\n }\n\n const title = await this.translationService.translateAsync(\n '@human-capital-management:organization-chart.node-actions.select-employee',\n );\n const result = await this.entitySelector.open({\n entity: employeeEntity,\n title,\n allowMultiple: false,\n columns: ['person.fullName', 'employeeCode'],\n });\n\n const selected = result?.items?.[0];\n const selectedId = selected?.['id'] ?? selected?.['_id'];\n return typeof selectedId === 'string' && selectedId.trim().length > 0 ? selectedId : undefined;\n }\n\n private resolveStatusId(startDate: unknown, endDate: unknown): string {\n const nowTime = Date.now();\n const startTime = this.parseTime(startDate);\n const endTime = this.parseTime(endDate);\n if (endTime !== undefined && endTime <= nowTime) {\n return AXM_POSITION_ASSIGNMENT_STATUS.expired;\n }\n if (startTime !== undefined && startTime > nowTime) {\n return AXM_POSITION_ASSIGNMENT_STATUS.scheduled;\n }\n return AXM_POSITION_ASSIGNMENT_STATUS.active;\n }\n\n private parseTime(value: unknown): number | undefined {\n if (!value) {\n return undefined;\n }\n const dateValue = value instanceof Date ? value : new Date(String(value));\n const time = dateValue.getTime();\n return Number.isFinite(time) ? time : undefined;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;AAmBA,SAAS,kBAAkB,CAAC,KAAc,EAAA;AACxC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK;IACd;AACA,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE;;AAE5B,IAAA,OAAO,OAAO,CAAC,MAAM,GAAG,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AAG,SAAS;IACjD;8GAjGW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-human-capital-management-client-assign-position-assignment.command-2iHIogn6.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/organization-chart/commands/assign-position-assignment.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\nimport { AXM_POSITION_ASSIGNMENT_STATUS } from '@acorex-platform/module-human-capital-management-client/contracts';\n\nexport interface AXMAssignPositionAssignmentInput {\n data?: Record<string, unknown>;\n options?: {\n process?: {\n data?: Record<string, unknown>;\n };\n };\n employeeId?: string;\n}\n\nfunction isUsableEmployeeId(value: unknown): value is string {\n if (typeof value !== 'string') {\n return false;\n }\n const trimmed = value.trim();\n // Reject unresolved expression templates (e.g. '{{ context.eval(\"id\") }}').\n return trimmed.length > 0 && !trimmed.includes('{{');\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXMAssignPositionAssignmentCommand implements AXPCommand<AXMAssignPositionAssignmentInput, unknown> {\n private readonly commandService = inject(AXPCommandService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly entitySelector = inject(AXPEntityDataSelectorService);\n private readonly translationService = inject(AXTranslationService);\n\n private readonly positionAssignmentSource = RootConfig.entities.positionAssignment.source;\n private readonly positionAssignmentEntityInfo = {\n module: RootConfig.module.name,\n name: RootConfig.entities.positionAssignment.name,\n title: RootConfig.entities.positionAssignment.title,\n };\n\n async execute(input: AXMAssignPositionAssignmentInput): AXPCommandExecuteResultPromise<unknown> {\n const contextData = (input?.data ?? {}) as Record<string, unknown>;\n const evaluatedProcessData = input?.options?.process?.data ?? {};\n const payload: Record<string, unknown> = {\n ...contextData,\n ...evaluatedProcessData,\n };\n const rawEmployeeId = input?.employeeId ?? payload['employeeId'];\n // Related-list / create-wizard always seeds employeeId (expression or injected FK).\n // Do not fall back to the employee picker there — that would orphan the assignment.\n const expectsParentEmployeeId =\n Object.prototype.hasOwnProperty.call(contextData, 'employeeId') ||\n Object.prototype.hasOwnProperty.call(evaluatedProcessData, 'employeeId') ||\n input?.employeeId !== undefined;\n const employeeId = isUsableEmployeeId(rawEmployeeId)\n ? rawEmployeeId.trim()\n : expectsParentEmployeeId\n ? undefined\n : await this.selectEmployeeId();\n if (!employeeId) {\n return { success: false };\n }\n payload['employeeId'] = employeeId;\n payload['statusId'] = this.resolveStatusId(payload['startDate'], payload['endDate']);\n\n return (\n await this.commandService.execute('Entity:Create', {\n entity: this.positionAssignmentSource,\n entityInfo: this.positionAssignmentEntityInfo,\n data: payload,\n options: {\n process: {\n redirect: false,\n // Keep employeeId in seed/submit; only hide it in the create UI.\n data: { employeeId },\n },\n excludeProperties: ['employeeId'],\n },\n \n })\n ) ?? { success: false };\n }\n\n private async selectEmployeeId(): Promise<string | undefined> {\n const employeeEntity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.employee.name);\n if (!employeeEntity) {\n return undefined;\n }\n\n const title = await this.translationService.translateAsync(\n '@human-capital-management:organization-chart.node-actions.select-employee',\n );\n const result = await this.entitySelector.open({\n entity: employeeEntity,\n title,\n allowMultiple: false,\n columns: ['person.fullName', 'employeeCode'],\n });\n\n const selected = result?.items?.[0];\n const selectedId = selected?.['id'] ?? selected?.['_id'];\n return typeof selectedId === 'string' && selectedId.trim().length > 0 ? selectedId : undefined;\n }\n\n private resolveStatusId(startDate: unknown, endDate: unknown): string {\n const nowTime = Date.now();\n const startTime = this.parseTime(startDate);\n const endTime = this.parseTime(endDate);\n if (endTime !== undefined && endTime <= nowTime) {\n return AXM_POSITION_ASSIGNMENT_STATUS.expired;\n }\n if (startTime !== undefined && startTime > nowTime) {\n return AXM_POSITION_ASSIGNMENT_STATUS.scheduled;\n }\n return AXM_POSITION_ASSIGNMENT_STATUS.active;\n }\n\n private parseTime(value: unknown): number | undefined {\n if (!value) {\n return undefined;\n }\n const dateValue = value instanceof Date ? value : new Date(String(value));\n const time = dateValue.getTime();\n return Number.isFinite(time) ? time : undefined;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;AAmBA,SAAS,kBAAkB,CAAC,KAAc,EAAA;AACxC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK;IACd;AACA,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE;;AAE5B,IAAA,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AACtD;MAGa,kCAAkC,CAAA;AAD/C,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC3D,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACrD,QAAA,IAAA,CAAA,kBAAkB,GA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AkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-human-capital-management-client-cancel-leave-request.command-DGriRFiQ.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/leave-request/commands/cancel-leave-request.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPSystemStatuses } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\n\n//#region ---- Types ----\n\nexport interface CancelLeaveRequestInput {\n id: string;\n reason?: string;\n note?: string;\n}\n\n//#endregion\n\n/**\n * Cancel Leave Request Command\n * Updates the leave request status to Cancelled\n */\n@Injectable({ providedIn: 'root' })\nexport class CancelLeaveRequestCommand implements AXPCommand<CancelLeaveRequestInput, void> {\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: CancelLeaveRequestInput): AXPCommandExecuteResultPromise<void> {\n try {\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 Cancelled\n const updateData: any = {\n statusId: AXPSystemStatuses.Cancelled.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 await dataAccessor.update(input.id, updateData);\n\n return { success: true, kind: 'object', data: undefined,\n };\n } catch (error: any) {\n console.error('[CancelLeaveRequestCommand] Error:', error);\n return {\n success: false,\n message: {\n text: error.message || 'Failed to cancel leave request',\n },\n };\n }\n }\n\n //#endregion\n}\n"],"names":[],"mapp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CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-human-capital-management-client-cancel-leave-request.command-DGriRFiQ.mjs","sources":["../../../../libs/modules/human-capital-management/client/src/lib/features/leave-request/commands/cancel-leave-request.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPSystemStatuses } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\n\n//#region ---- Types ----\n\nexport interface CancelLeaveRequestInput {\n id: string;\n reason?: string;\n note?: string;\n}\n\n//#endregion\n\n/**\n * Cancel Leave Request Command\n * Updates the leave request status to Cancelled\n */\n@Injectable({ providedIn: 'root' })\nexport class CancelLeaveRequestCommand implements AXPCommand<CancelLeaveRequestInput, void> {\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: CancelLeaveRequestInput): AXPCommandExecuteResultPromise<void> {\n try {\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 Cancelled\n const updateData: any = {\n statusId: AXPSystemStatuses.Cancelled.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 await dataAccessor.update(input.id, updateData);\n\n return { success: true, kind: 'object', data: undefined,\n };\n } catch (error: any) {\n console.error('[CancelLeaveRequestCommand] Error:', error);\n return {\n success: false,\n message: {\n text: error.message || 'Failed to cancel leave request',\n },\n };\n }\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;;;AAGG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAyC1D,IAAA;;;IAnCC,MAAM,OAAO,CAAC,KAA8B,EAAA;AAC1C,QAAA,IAAI;AACF,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC;AACvB,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI;AACxE,iBAAA,IAAI,EAAe;;AAGtB,YAAA,MAAM,UAAU,GAAQ;AACtB,gBAAA,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,IAAI;aAC3C;;AAGD,YAAA,IAAI,KAAK,CAAC,MAAM,EAAE;AAChB,gBAAA,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;YAClC;AACA,YAAA,IAAI,KAAK,CAAC,IAAI,EAAE;AACd,gBAAA,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAC9B;YAEA,MAAM,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC;YAE/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS;aACtD;QACH;QAAE,OAAO,KAAU,EAAE;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC;YAC1D,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,gCAAgC;AACxD,iBAAA;aACF;QACH;IACF;8GAzCW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,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,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,559 @@
1
+ import { AXPWidgetsCatalog, AXPWidgetsList } from '@acorex-platform/framework-shared/core';
2
+ import { createAllQueryView, entityMasterCrudActions, entityMasterRecordActions, AXPEntityCommandScope, entityDetailsCrudActions, entityDetailsSimpleCondition } from '@acorex-platform/framework-shared/entity';
3
+
4
+ const AXPHumanCapitalManagementCommandKeys = {
5
+ PositionAssignment: {
6
+ Assign: 'HumanCapitalManagement.PositionAssignment:Assign',
7
+ Revoke: 'HumanCapitalManagement.PositionAssignment:Revoke',
8
+ },
9
+ LifecycleEvent: {
10
+ StartFlow: 'HumanCapitalManagement.LifecycleEvent:StartFlow',
11
+ },
12
+ LeaveRequest: {
13
+ StartFlow: 'HumanCapitalManagement.LeaveRequest:StartFlow',
14
+ },
15
+ Profile: {
16
+ EditPersonalInfo: 'HumanCapitalManagement.Profile:EditPersonalInfo',
17
+ EditSignature: 'HumanCapitalManagement.Profile:EditSignature',
18
+ },
19
+ };
20
+
21
+ const config = {
22
+ i18n: 'human-capital-management',
23
+ module: 'HumanCapitalManagement',
24
+ };
25
+ const RootConfig = {
26
+ config,
27
+ module: {
28
+ route: 'human-capital-management',
29
+ name: config.module,
30
+ title: '@human-capital-management:module.title',
31
+ icon: 'fa-light fa-users',
32
+ },
33
+ entities: {
34
+ employee: {
35
+ name: 'Employee',
36
+ source: `${config.module}.Employee`,
37
+ title: '@human-capital-management:employees.entities.employee.title',
38
+ titlePlural: '@human-capital-management:employees.entities.employee.plural',
39
+ icon: 'fa-light fa-address-card',
40
+ },
41
+ employmentType: {
42
+ name: 'EmploymentType',
43
+ source: `${config.module}.EmploymentType`,
44
+ title: '@human-capital-management:employment-types.entities.employment-type.title',
45
+ titlePlural: '@human-capital-management:employment-types.entities.employment-type.plural',
46
+ icon: 'fa-light fa-file-signature',
47
+ },
48
+ positionAssignment: {
49
+ name: 'PositionAssignment',
50
+ source: `${config.module}.PositionAssignment`,
51
+ title: '@human-capital-management:position-assignments.entities.position-assignment.title',
52
+ titlePlural: '@human-capital-management:position-assignments.entities.position-assignment.plural',
53
+ icon: 'fa-light fa-user-tie-hair',
54
+ },
55
+ leaveType: {
56
+ name: 'LeaveType',
57
+ source: `${config.module}.LeaveType`,
58
+ title: '@human-capital-management:leave-types.entities.leave-type.title',
59
+ titlePlural: '@human-capital-management:leave-types.entities.leave-type.plural',
60
+ icon: 'fa-light fa-calendar-days',
61
+ },
62
+ leaveRequest: {
63
+ name: 'LeaveRequest',
64
+ source: `${config.module}.LeaveRequest`,
65
+ title: '@human-capital-management:leave-requests.entities.leave-request.title',
66
+ titlePlural: '@human-capital-management:leave-requests.entities.leave-request.plural',
67
+ icon: 'fa-light fa-plane-departure',
68
+ },
69
+ lifecycleEventType: {
70
+ name: 'LifecycleEventType',
71
+ source: `${config.module}.LifecycleEventType`,
72
+ title: '@human-capital-management:lifecycle-event-types.entities.lifecycle-event-type.title',
73
+ titlePlural: '@human-capital-management:lifecycle-event-types.entities.lifecycle-event-type.plural',
74
+ icon: 'fa-light fa-diagram-next',
75
+ },
76
+ lifecycleEvent: {
77
+ name: 'LifecycleEvent',
78
+ source: `${config.module}.LifecycleEvent`,
79
+ title: '@human-capital-management:lifecycle-events.entities.lifecycle-event.title',
80
+ titlePlural: '@human-capital-management:lifecycle-events.entities.lifecycle-event.plural',
81
+ icon: 'fa-light fa-clipboard-list-check',
82
+ },
83
+ },
84
+ pages: {
85
+ appointmentBoard: {
86
+ path: 'Boards/ResourceAppointment',
87
+ title: '@human-capital-management:leave-requests.menus.appointment-board.title',
88
+ icon: 'fa-light fa-calendar-lines',
89
+ },
90
+ },
91
+ queries: {
92
+ dashboard: {
93
+ employeesKpi: `${config.module}:Dashboard:EmployeesKpi`,
94
+ },
95
+ reports: {
96
+ getHeadcountByDepartment: `${config.module}:Reports:GetHeadcountByDepartment`,
97
+ getLeaveUsageByType: `${config.module}:Reports:GetLeaveUsageByType`,
98
+ },
99
+ },
100
+ };
101
+
102
+ async function factoryEmployee() {
103
+ const entityDef = {
104
+ module: RootConfig.module.name,
105
+ name: RootConfig.entities.employee.name,
106
+ title: RootConfig.entities.employee.title,
107
+ icon: 'fa-light fa-building',
108
+ formats: {
109
+ individual: RootConfig.entities.employee.title,
110
+ plural: RootConfig.entities.employee.titlePlural,
111
+ displayName: '@general:terms.common.profile',
112
+ searchResult: {
113
+ title: '{{ context.eval("person.fullName") || (context.eval("person.firstName") + " " + context.eval("person.lastName")) }}',
114
+ description: RootConfig.module.title,
115
+ },
116
+ },
117
+ plugins: [
118
+ { name: 'identifier', options: { field: 'employeeCode', rule: 'employee-code' } },
119
+ {
120
+ name: 'status',
121
+ options: {
122
+ definition: 'human-capital-management.status.employee',
123
+ field: 'statusId',
124
+ generate: { views: { enabled: true } },
125
+ },
126
+ },
127
+ { name: 'history' },
128
+ { name: 'lock' },
129
+ { name: 'compare' },
130
+ {
131
+ name: 'documents',
132
+ options: {
133
+ documentTypeNames: ['certificate', 'licence', 'form'],
134
+ },
135
+ },
136
+ { name: 'reports' },
137
+ ],
138
+ relatedEntities: [
139
+ {
140
+ entity: `PersonCore.Person`,
141
+ title: 'Personal Information',
142
+ conditions: [{ name: 'id', operator: { type: 'equal' }, value: '{{ context.eval("personId") }}' }],
143
+ layout: { type: 'merge-detail' },
144
+ persistence: {
145
+ dataPath: 'person',
146
+ strategy: 'referenced',
147
+ idField: 'personId',
148
+ },
149
+ },
150
+ {
151
+ entity: `${RootConfig.module.name}.${RootConfig.entities.leaveRequest.name}`,
152
+ title: RootConfig.entities.leaveRequest.titlePlural,
153
+ columns: ['leaveTypeId', 'startDate', 'endDate', 'durationDays', 'statusId', 'reason'],
154
+ conditions: [entityDetailsSimpleCondition('employeeId')],
155
+ persistence: { foreignKeyField: 'employeeId' },
156
+ excludeProperties: ['employeeId'],
157
+ actions: [
158
+ {
159
+ title: '@human-capital-management:employees.entities.employee.related-entities.leave-request-start.title',
160
+ icon: 'fa-light fa-play',
161
+ command: {
162
+ name: 'Entity:Create',
163
+ options: {
164
+ process: {
165
+ redirect: false,
166
+ canCreateNewOne: true,
167
+ data: {},
168
+ },
169
+ },
170
+ },
171
+ priority: 'primary',
172
+ type: 'create',
173
+ scope: AXPEntityCommandScope.TypeLevel,
174
+ items: `{{ await ${RootConfig.module.name}.LeaveRequests() }}`,
175
+ },
176
+ {
177
+ title: '@general:actions.detail.title',
178
+ icon: 'fa-light fa-eye',
179
+ command: 'Entity:View',
180
+ priority: 'secondary',
181
+ type: 'view',
182
+ scope: AXPEntityCommandScope.Individual,
183
+ default: true,
184
+ },
185
+ ...entityDetailsCrudActions('employeeId', { create: false, edit: false, delete: false, view: false }),
186
+ ],
187
+ layout: { type: 'page-list', position: 'after', order: 4 },
188
+ },
189
+ {
190
+ entity: `${RootConfig.module.name}.${RootConfig.entities.lifecycleEvent.name}`,
191
+ title: '@human-capital-management:employees.entities.employee.related-entities.lifecycle-events',
192
+ columns: ['eventTypeId', 'effectiveDate', 'assignedToUserId', 'statusId', 'attachments'],
193
+ conditions: [entityDetailsSimpleCondition('employeeId')],
194
+ persistence: { foreignKeyField: 'employeeId' },
195
+ excludeProperties: ['employeeId'],
196
+ actions: [
197
+ {
198
+ title: '@human-capital-management:employees.entities.employee.related-entities.lifecycle-event-start.title',
199
+ icon: 'fa-light fa-play',
200
+ command: {
201
+ name: 'Entity:Create',
202
+ options: {
203
+ process: {
204
+ redirect: false,
205
+ canCreateNewOne: true,
206
+ data: {},
207
+ },
208
+ },
209
+ },
210
+ priority: 'primary',
211
+ type: 'create',
212
+ scope: AXPEntityCommandScope.TypeLevel,
213
+ items: `{{ await ${RootConfig.module.name}.LifecycleEvents() }}`,
214
+ },
215
+ ...entityDetailsCrudActions('employeeId', { create: false, edit: false, delete: false, view: false }),
216
+ ],
217
+ layout: { type: 'page-list', position: 'after', order: 5 },
218
+ },
219
+ {
220
+ entity: `${RootConfig.module.name}.${RootConfig.entities.positionAssignment.name}`,
221
+ title: '@human-capital-management:employees.entities.employee.related-entities.positions',
222
+ columns: ['positionId', 'businessUnitId', 'startDate', 'endDate', 'statusId', 'isPrimary'],
223
+ conditions: [entityDetailsSimpleCondition('employeeId')],
224
+ persistence: { foreignKeyField: 'employeeId' },
225
+ excludeProperties: ['employeeId'],
226
+ appearOn: {
227
+ create: true,
228
+ },
229
+ actions: [
230
+ {
231
+ title: '@human-capital-management:position-assignments.entities.position-assignment.actions.assign.title',
232
+ command: {
233
+ name: AXPHumanCapitalManagementCommandKeys.PositionAssignment.Assign,
234
+ options: {
235
+ process: {
236
+ data: {
237
+ employeeId: '{{ context.eval("id") }}',
238
+ },
239
+ },
240
+ },
241
+ },
242
+ priority: 'primary',
243
+ type: 'create',
244
+ scope: AXPEntityCommandScope.TypeLevel,
245
+ },
246
+ ...entityDetailsCrudActions('employeeId', { create: false, delete: false, view: true, edit: false }),
247
+ ],
248
+ layout: { type: 'page-list', position: 'after', order: 3 },
249
+ },
250
+ ],
251
+ groups: [
252
+ {
253
+ id: 'organizationalStructure',
254
+ title: '@human-capital-management:employees.entities.employee.groups.organizational-structure',
255
+ },
256
+ {
257
+ id: 'employmentProfile',
258
+ title: '@human-capital-management:employees.entities.employee.groups.employment-profile',
259
+ },
260
+ {
261
+ id: 'signature',
262
+ title: '@human-capital-management:employees.entities.employee.groups.signature',
263
+ icon: 'fa-light fa-signature',
264
+ },
265
+ ],
266
+ properties: [
267
+ {
268
+ name: 'id',
269
+ title: 'ID',
270
+ groupId: 'personalInformation',
271
+ schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
272
+ },
273
+ {
274
+ name: 'employeeCode',
275
+ title: '@human-capital-management:employees.entities.employee.fields.employee-code',
276
+ groupId: 'employmentProfile',
277
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
278
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
279
+ validations: [{ rule: 'required' }],
280
+ },
281
+ {
282
+ name: 'employmentTypeId',
283
+ title: '@human-capital-management:employees.entities.employee.fields.employment-type-id',
284
+ groupId: 'employmentProfile',
285
+ schema: {
286
+ dataType: 'string',
287
+ interface: {
288
+ type: AXPWidgetsList.Editors.LookupBox,
289
+ options: {
290
+ entity: `${RootConfig.module.name}.${RootConfig.entities.employmentType.name}`,
291
+ textField: 'title',
292
+ valueField: 'id',
293
+ look: 'select',
294
+ create: {
295
+ enable: true,
296
+ },
297
+ expose: [
298
+ { source: 'id', target: 'employmentType.id' },
299
+ { source: 'title', target: 'employmentType.title' },
300
+ ],
301
+ },
302
+ },
303
+ },
304
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
305
+ validations: [{ rule: 'required' }],
306
+ },
307
+ {
308
+ name: 'jobDefinitionId',
309
+ title: '@human-capital-management:employees.entities.employee.fields.job-definition',
310
+ groupId: 'employmentProfile',
311
+ schema: {
312
+ dataType: 'string',
313
+ interface: {
314
+ type: AXPWidgetsList.Editors.LookupBox,
315
+ options: {
316
+ entity: 'OrganizationManagement.JobDefinition',
317
+ textField: 'title',
318
+ valueField: 'id',
319
+ look: 'select',
320
+ expose: [
321
+ { source: 'id', target: 'jobDefinition.id' },
322
+ { source: 'title', target: 'jobDefinition.title' },
323
+ ],
324
+ },
325
+ },
326
+ },
327
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
328
+ },
329
+ {
330
+ name: 'hireDate',
331
+ title: '@human-capital-management:employees.entities.employee.fields.hire-date',
332
+ groupId: 'employmentProfile',
333
+ schema: {
334
+ dataType: 'date',
335
+ interface: {
336
+ type: AXPWidgetsCatalog.dateTime,
337
+ options: {
338
+ filterUi: 'simple',
339
+ },
340
+ },
341
+ },
342
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
343
+ },
344
+ {
345
+ name: 'signature',
346
+ title: '@human-capital-management:employees.entities.employee.fields.signature',
347
+ groupId: 'signature',
348
+ schema: {
349
+ dataType: 'string',
350
+ interface: {
351
+ type: AXPWidgetsList.Editors.SignatureBox,
352
+ },
353
+ },
354
+ },
355
+ {
356
+ name: 'activePrimaryBusinessUnitId',
357
+ title: '@human-capital-management:employees.entities.employee.fields.primary-business-unit',
358
+ description: '@human-capital-management:employees.entities.employee.fields.primary-business-unit-description',
359
+ groupId: 'organizationalStructure',
360
+ schema: {
361
+ dataType: 'string',
362
+ nullable: true,
363
+ readonly: true,
364
+ interface: {
365
+ type: AXPWidgetsList.Editors.LookupBox,
366
+ options: {
367
+ entity: `OrganizationManagement.BusinessUnit`,
368
+ textField: 'title',
369
+ valueField: 'id',
370
+ look: 'select',
371
+ placeholder: '@human-capital-management:employees.entities.employee.fields.primary-business-unit-placeholder',
372
+ disabled: true,
373
+ readonly: true,
374
+ expose: [
375
+ { source: 'id', target: 'activePrimaryBusinessUnit.id' },
376
+ { source: 'title', target: 'activePrimaryBusinessUnit.title' },
377
+ ],
378
+ },
379
+ },
380
+ },
381
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
382
+ },
383
+ {
384
+ name: 'activePrimaryPositionId',
385
+ title: '@human-capital-management:employees.entities.employee.fields.primary-position',
386
+ description: '@human-capital-management:employees.entities.employee.fields.primary-position-description',
387
+ groupId: 'organizationalStructure',
388
+ schema: {
389
+ dataType: 'string',
390
+ nullable: true,
391
+ readonly: true,
392
+ interface: {
393
+ type: AXPWidgetsList.Editors.LookupBox,
394
+ options: {
395
+ entity: `OrganizationManagement.Position`,
396
+ textField: 'title',
397
+ valueField: 'id',
398
+ look: 'select',
399
+ placeholder: '@human-capital-management:employees.entities.employee.fields.primary-position-placeholder',
400
+ disabled: true,
401
+ readonly: true,
402
+ expose: [
403
+ { source: 'id', target: 'activePrimaryPosition.id' },
404
+ { source: 'title', target: 'activePrimaryPosition.title' },
405
+ ],
406
+ },
407
+ },
408
+ },
409
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
410
+ },
411
+ {
412
+ name: 'managerId',
413
+ title: '@human-capital-management:employees.entities.employee.fields.manager-id',
414
+ description: '@human-capital-management:employees.entities.employee.fields.manager-id-description',
415
+ groupId: 'organizationalStructure',
416
+ schema: {
417
+ dataType: 'string',
418
+ nullable: true,
419
+ readonly: true,
420
+ interface: {
421
+ type: AXPWidgetsList.Editors.LookupBox,
422
+ options: {
423
+ entity: `${RootConfig.module.name}.${RootConfig.entities.employee.name}`,
424
+ textField: 'person.fullName',
425
+ valueField: 'id',
426
+ look: 'select',
427
+ placeholder: '@human-capital-management:employees.entities.employee.fields.manager-id-placeholder',
428
+ disabled: true,
429
+ readonly: true,
430
+ expose: [
431
+ { source: 'id', target: 'manager.id' },
432
+ { source: 'person.fullName', target: 'manager.person.fullName' },
433
+ ],
434
+ },
435
+ },
436
+ },
437
+ options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
438
+ },
439
+ {
440
+ name: 'integrationRef',
441
+ title: '@human-capital-management:employees.entities.employee.fields.integration-ref',
442
+ groupId: 'employmentProfile',
443
+ schema: {
444
+ dataType: 'object',
445
+ visible: false,
446
+ nullable: true,
447
+ readonly: true,
448
+ },
449
+ },
450
+ ],
451
+ columns: [
452
+ { name: 'employeeCode' },
453
+ {
454
+ name: 'person.fullName',
455
+ title: '@general:terms.common.full-name',
456
+ showAs: { type: AXPWidgetsCatalog.text },
457
+ options: { visible: false },
458
+ },
459
+ { name: 'person.firstName' },
460
+ { name: 'person.lastName' },
461
+ { name: 'person.phones', options: { width: '250px' } },
462
+ { name: 'person.emails', options: { width: '250px' } },
463
+ { name: 'jobDefinitionId', options: { dataPath: 'jobDefinition.title' } },
464
+ { name: 'employmentTypeId', options: { dataPath: 'employmentType.title' } },
465
+ {
466
+ name: 'activePrimaryBusinessUnitId',
467
+ options: { dataPath: 'activePrimaryBusinessUnit.title' },
468
+ },
469
+ {
470
+ name: 'activePrimaryPositionId',
471
+ options: { dataPath: 'activePrimaryPosition.title' },
472
+ },
473
+ {
474
+ name: 'managerId',
475
+ options: { dataPath: 'manager.person.fullName' },
476
+ },
477
+ { name: 'hireDate', options: { visible: false } },
478
+ ],
479
+ interfaces: {
480
+ master: {
481
+ create: {
482
+ sections: [
483
+ { id: 'personalInformation', order: 2, layout: { positions: { lg: { colSpan: 12 } } } },
484
+ { id: 'employmentProfile', order: 3, layout: { positions: { lg: { colSpan: 8, colStart: 1 } } } },
485
+ { id: 'signature', order: 4, layout: { positions: { lg: { colSpan: 4, colStart: 9 } } } },
486
+ { id: 'organizationalStructure', order: 8, layout: { positions: { lg: { colSpan: 12 } } } },
487
+ ],
488
+ properties: [
489
+ { name: 'employeeCode', layout: { positions: { lg: { colSpan: 6 } } } },
490
+ { name: 'employmentTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
491
+ { name: 'hireDate', layout: { positions: { lg: { colSpan: 6 } } } },
492
+ { name: 'signature', layout: { label: { visible: false }, positions: { lg: { colSpan: 12, order: 0 } } } },
493
+ ],
494
+ },
495
+ update: {
496
+ sections: [{ id: 'personalInformation' }, { id: 'organizationalStructure' }, { id: 'employmentProfile' }, { id: 'signature' }],
497
+ properties: [
498
+ { name: 'employeeCode', layout: { positions: { lg: { colSpan: 6 } } } },
499
+ { name: 'employmentTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
500
+ { name: 'hireDate', layout: { positions: { lg: { colSpan: 6 } } } },
501
+ { name: 'signature', layout: { label: { visible: false } } },
502
+ {
503
+ name: 'activePrimaryBusinessUnitId',
504
+ layout: { positions: { lg: { colSpan: 4, colStart: 1, order: 10 } } },
505
+ },
506
+ {
507
+ name: 'activePrimaryPositionId',
508
+ layout: { positions: { lg: { colSpan: 4, colStart: 5, order: 11 } } },
509
+ },
510
+ {
511
+ name: 'managerId',
512
+ layout: { positions: { lg: { colSpan: 4, colStart: 9, order: 12 } } },
513
+ },
514
+ ],
515
+ },
516
+ single: {
517
+ title: '{{ context.eval("person.firstName") + " " + context.eval("person.lastName") }}',
518
+ sections: [
519
+ { id: 'personalInformation', order: 2, layout: { positions: { lg: { colSpan: 12 } } } },
520
+ { id: 'employmentProfile', order: 3, layout: { positions: { lg: { colSpan: 8, colStart: 1 } } } },
521
+ { id: 'signature', order: 4, layout: { positions: { lg: { colSpan: 4, colStart: 9 } } } },
522
+ { id: 'organizationalStructure', order: 8, layout: { positions: { lg: { colSpan: 12 } } } },
523
+ ],
524
+ properties: [
525
+ { name: 'employeeCode', layout: { positions: { lg: { colSpan: 6 } } } },
526
+ { name: 'employmentTypeId', layout: { positions: { lg: { colSpan: 6 } } } },
527
+ { name: 'hireDate', layout: { positions: { lg: { colSpan: 6 } } } },
528
+ { name: 'signature', layout: { label: { visible: false }, positions: { lg: { colSpan: 12, order: 0 } } } },
529
+ {
530
+ name: 'activePrimaryBusinessUnitId',
531
+ layout: { positions: { lg: { colSpan: 4, colStart: 1, order: 10 } } },
532
+ },
533
+ {
534
+ name: 'activePrimaryPositionId',
535
+ layout: { positions: { lg: { colSpan: 4, colStart: 5, order: 11 } } },
536
+ },
537
+ {
538
+ name: 'managerId',
539
+ layout: { positions: { lg: { colSpan: 4, colStart: 9, order: 12 } } },
540
+ },
541
+ ],
542
+ actions: [...entityMasterRecordActions()],
543
+ },
544
+ list: {
545
+ actions: [...entityMasterCrudActions()],
546
+ views: [createAllQueryView({ sorts: [{ name: 'person.fullName', dir: 'asc' }] })],
547
+ },
548
+ },
549
+ },
550
+ };
551
+ return entityDef;
552
+ }
553
+
554
+ /**
555
+ * Generated bundle index. Do not edit.
556
+ */
557
+
558
+ export { factoryEmployee };
559
+ //# sourceMappingURL=acorex-platform-module-human-capital-management-client-contracts-entities-employee.mjs.map