@rippling/rippling-sdk 0.2.0-alpha.86 → 0.2.0-alpha.87
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/client.d.mts +15 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -0
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/lib/leave-programs/advanced.d.mts +5 -0
- package/lib/leave-programs/advanced.d.mts.map +1 -0
- package/lib/leave-programs/advanced.d.ts +5 -0
- package/lib/leave-programs/advanced.d.ts.map +1 -0
- package/lib/leave-programs/advanced.js +13 -0
- package/lib/leave-programs/advanced.js.map +1 -0
- package/lib/leave-programs/advanced.mjs +4 -0
- package/lib/leave-programs/advanced.mjs.map +1 -0
- package/lib/leave-programs/context.d.mts +3 -0
- package/lib/leave-programs/context.d.mts.map +1 -0
- package/lib/leave-programs/context.d.ts +3 -0
- package/lib/leave-programs/context.d.ts.map +1 -0
- package/lib/leave-programs/context.js +89 -0
- package/lib/leave-programs/context.js.map +1 -0
- package/lib/leave-programs/context.mjs +86 -0
- package/lib/leave-programs/context.mjs.map +1 -0
- package/lib/leave-programs/define-company-leave-program.d.mts +3 -0
- package/lib/leave-programs/define-company-leave-program.d.mts.map +1 -0
- package/lib/leave-programs/define-company-leave-program.d.ts +3 -0
- package/lib/leave-programs/define-company-leave-program.d.ts.map +1 -0
- package/lib/leave-programs/define-company-leave-program.js +47 -0
- package/lib/leave-programs/define-company-leave-program.js.map +1 -0
- package/lib/leave-programs/define-company-leave-program.mjs +44 -0
- package/lib/leave-programs/define-company-leave-program.mjs.map +1 -0
- package/lib/leave-programs/duration.d.mts +5 -0
- package/lib/leave-programs/duration.d.mts.map +1 -0
- package/lib/leave-programs/duration.d.ts +5 -0
- package/lib/leave-programs/duration.d.ts.map +1 -0
- package/lib/leave-programs/duration.js +21 -0
- package/lib/leave-programs/duration.js.map +1 -0
- package/lib/leave-programs/duration.mjs +16 -0
- package/lib/leave-programs/duration.mjs.map +1 -0
- package/lib/leave-programs/pay.d.mts +4 -0
- package/lib/leave-programs/pay.d.mts.map +1 -0
- package/lib/leave-programs/pay.d.ts +4 -0
- package/lib/leave-programs/pay.d.ts.map +1 -0
- package/lib/leave-programs/pay.js +20 -0
- package/lib/leave-programs/pay.js.map +1 -0
- package/lib/leave-programs/pay.mjs +16 -0
- package/lib/leave-programs/pay.mjs.map +1 -0
- package/lib/leave-programs/policy-builder.d.mts +20 -0
- package/lib/leave-programs/policy-builder.d.mts.map +1 -0
- package/lib/leave-programs/policy-builder.d.ts +20 -0
- package/lib/leave-programs/policy-builder.d.ts.map +1 -0
- package/lib/leave-programs/policy-builder.js +89 -0
- package/lib/leave-programs/policy-builder.js.map +1 -0
- package/lib/leave-programs/policy-builder.mjs +85 -0
- package/lib/leave-programs/policy-builder.mjs.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.mts +25 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.mts.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.ts +25 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.ts.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.js +56 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.js.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.mjs +53 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.mjs.map +1 -0
- package/lib/leave-programs/testing.d.mts +8 -0
- package/lib/leave-programs/testing.d.mts.map +1 -0
- package/lib/leave-programs/testing.d.ts +8 -0
- package/lib/leave-programs/testing.d.ts.map +1 -0
- package/lib/leave-programs/testing.js +11 -0
- package/lib/leave-programs/testing.js.map +1 -0
- package/lib/leave-programs/testing.mjs +7 -0
- package/lib/leave-programs/testing.mjs.map +1 -0
- package/lib/leave-programs/types.d.mts +223 -0
- package/lib/leave-programs/types.d.mts.map +1 -0
- package/lib/leave-programs/types.d.ts +223 -0
- package/lib/leave-programs/types.d.ts.map +1 -0
- package/lib/leave-programs/types.js +10 -0
- package/lib/leave-programs/types.js.map +1 -0
- package/lib/leave-programs/types.mjs +7 -0
- package/lib/leave-programs/types.mjs.map +1 -0
- package/lib/leave-programs.d.mts +7 -0
- package/lib/leave-programs.d.mts.map +1 -0
- package/lib/leave-programs.d.ts +7 -0
- package/lib/leave-programs.d.ts.map +1 -0
- package/lib/leave-programs.js +19 -0
- package/lib/leave-programs.js.map +1 -0
- package/lib/leave-programs.mjs +7 -0
- package/lib/leave-programs.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +208 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +208 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +64 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +59 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/deployments.d.mts +180 -0
- package/resources/agents/deployments.d.mts.map +1 -0
- package/resources/agents/deployments.d.ts +180 -0
- package/resources/agents/deployments.d.ts.map +1 -0
- package/resources/agents/deployments.js +32 -0
- package/resources/agents/deployments.js.map +1 -0
- package/resources/agents/deployments.mjs +28 -0
- package/resources/agents/deployments.mjs.map +1 -0
- package/resources/agents/index.d.mts +5 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +5 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +13 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +6 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/sessions/events.d.mts +80 -0
- package/resources/agents/sessions/events.d.mts.map +1 -0
- package/resources/agents/sessions/events.d.ts +80 -0
- package/resources/agents/sessions/events.d.ts.map +1 -0
- package/resources/agents/sessions/events.js +19 -0
- package/resources/agents/sessions/events.js.map +1 -0
- package/resources/agents/sessions/events.mjs +15 -0
- package/resources/agents/sessions/events.mjs.map +1 -0
- package/resources/agents/sessions/index.d.mts +3 -0
- package/resources/agents/sessions/index.d.mts.map +1 -0
- package/resources/agents/sessions/index.d.ts +3 -0
- package/resources/agents/sessions/index.d.ts.map +1 -0
- package/resources/agents/sessions/index.js +9 -0
- package/resources/agents/sessions/index.js.map +1 -0
- package/resources/agents/sessions/index.mjs +4 -0
- package/resources/agents/sessions/index.mjs.map +1 -0
- package/resources/agents/sessions/sessions.d.mts +153 -0
- package/resources/agents/sessions/sessions.d.mts.map +1 -0
- package/resources/agents/sessions/sessions.d.ts +153 -0
- package/resources/agents/sessions/sessions.d.ts.map +1 -0
- package/resources/agents/sessions/sessions.js +44 -0
- package/resources/agents/sessions/sessions.js.map +1 -0
- package/resources/agents/sessions/sessions.mjs +39 -0
- package/resources/agents/sessions/sessions.mjs.map +1 -0
- package/resources/agents/sessions.d.mts +2 -0
- package/resources/agents/sessions.d.mts.map +1 -0
- package/resources/agents/sessions.d.ts +2 -0
- package/resources/agents/sessions.d.ts.map +1 -0
- package/resources/agents/sessions.js +6 -0
- package/resources/agents/sessions.js.map +1 -0
- package/resources/agents/sessions.mjs +3 -0
- package/resources/agents/sessions.mjs.map +1 -0
- package/resources/agents/source-revisions.d.mts +195 -0
- package/resources/agents/source-revisions.d.mts.map +1 -0
- package/resources/agents/source-revisions.d.ts +195 -0
- package/resources/agents/source-revisions.d.ts.map +1 -0
- package/resources/agents/source-revisions.js +32 -0
- package/resources/agents/source-revisions.js.map +1 -0
- package/resources/agents/source-revisions.mjs +28 -0
- package/resources/agents/source-revisions.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/break-policies.d.mts +1 -1
- package/resources/break-policies.d.ts +1 -1
- package/resources/break-policies.js +1 -1
- package/resources/break-policies.mjs +1 -1
- package/resources/break-types.d.mts +1 -1
- package/resources/break-types.d.ts +1 -1
- package/resources/break-types.js +1 -1
- package/resources/break-types.mjs +1 -1
- package/resources/business-structure-paths.d.mts +1 -1
- package/resources/business-structure-paths.d.ts +1 -1
- package/resources/business-structure-paths.js +1 -1
- package/resources/business-structure-paths.mjs +1 -1
- package/resources/candidate-applications.d.mts +1 -1
- package/resources/candidate-applications.d.ts +1 -1
- package/resources/candidate-applications.js +1 -1
- package/resources/candidate-applications.mjs +1 -1
- package/resources/candidates.d.mts +1 -1
- package/resources/candidates.d.ts +1 -1
- package/resources/candidates.js +1 -1
- package/resources/candidates.mjs +1 -1
- package/resources/company-legal-entities.d.mts +1 -1
- package/resources/company-legal-entities.d.ts +1 -1
- package/resources/company-legal-entities.js +1 -1
- package/resources/company-legal-entities.mjs +1 -1
- package/resources/company-legal-entity-workers.d.mts +1 -1
- package/resources/company-legal-entity-workers.d.ts +1 -1
- package/resources/company-legal-entity-workers.js +1 -1
- package/resources/company-legal-entity-workers.mjs +1 -1
- package/resources/compensation-bands-details.d.mts +1 -1
- package/resources/compensation-bands-details.d.ts +1 -1
- package/resources/compensation-bands-details.js +1 -1
- package/resources/compensation-bands-details.mjs +1 -1
- package/resources/compensations.d.mts +1 -1
- package/resources/compensations.d.ts +1 -1
- package/resources/compensations.js +1 -1
- package/resources/compensations.mjs +1 -1
- package/resources/device-orders.d.mts +1 -1
- package/resources/device-orders.d.ts +1 -1
- package/resources/device-orders.js +1 -1
- package/resources/device-orders.mjs +1 -1
- package/resources/devices.d.mts +1 -1
- package/resources/devices.d.ts +1 -1
- package/resources/devices.js +1 -1
- package/resources/devices.mjs +1 -1
- package/resources/functions/deployments.d.mts +2 -2
- package/resources/functions/deployments.d.ts +2 -2
- package/resources/functions/deployments.js +2 -2
- package/resources/functions/deployments.mjs +2 -2
- package/resources/functions/executions.d.mts +2 -2
- package/resources/functions/executions.d.ts +2 -2
- package/resources/functions/executions.js +2 -2
- package/resources/functions/executions.mjs +2 -2
- package/resources/functions/functions.d.mts +1 -1
- package/resources/functions/functions.d.ts +1 -1
- package/resources/functions/functions.js +1 -1
- package/resources/functions/functions.mjs +1 -1
- package/resources/headcount-positions.d.mts +1 -1
- package/resources/headcount-positions.d.ts +1 -1
- package/resources/headcount-positions.js +1 -1
- package/resources/headcount-positions.mjs +1 -1
- package/resources/headcount-priorities.d.mts +1 -1
- package/resources/headcount-priorities.d.ts +1 -1
- package/resources/headcount-priorities.js +1 -1
- package/resources/headcount-priorities.mjs +1 -1
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +8 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/job-assignments.d.mts +2 -2
- package/resources/job-assignments.d.ts +2 -2
- package/resources/job-assignments.js +2 -2
- package/resources/job-assignments.mjs +2 -2
- package/resources/job-codes.d.mts +2 -2
- package/resources/job-codes.d.ts +2 -2
- package/resources/job-codes.js +2 -2
- package/resources/job-codes.mjs +2 -2
- package/resources/job-dimensions.d.mts +1 -1
- package/resources/job-dimensions.d.ts +1 -1
- package/resources/job-dimensions.js +1 -1
- package/resources/job-dimensions.mjs +1 -1
- package/resources/job-pay-rate-exceptions.d.mts +2 -2
- package/resources/job-pay-rate-exceptions.d.ts +2 -2
- package/resources/job-pay-rate-exceptions.js +2 -2
- package/resources/job-pay-rate-exceptions.mjs +2 -2
- package/resources/job-requisitions.d.mts +1 -1
- package/resources/job-requisitions.d.ts +1 -1
- package/resources/job-requisitions.js +1 -1
- package/resources/job-requisitions.mjs +1 -1
- package/resources/kiosk-badges.d.mts +1 -1
- package/resources/kiosk-badges.d.ts +1 -1
- package/resources/kiosk-badges.js +1 -1
- package/resources/kiosk-badges.mjs +1 -1
- package/resources/leave-accruals.d.mts +1 -1
- package/resources/leave-accruals.d.ts +1 -1
- package/resources/leave-accruals.js +1 -1
- package/resources/leave-accruals.mjs +1 -1
- package/resources/leave-balances.d.mts +1 -1
- package/resources/leave-balances.d.ts +1 -1
- package/resources/leave-balances.js +1 -1
- package/resources/leave-balances.mjs +1 -1
- package/resources/leave-requests.d.mts +1 -1
- package/resources/leave-requests.d.ts +1 -1
- package/resources/leave-requests.js +1 -1
- package/resources/leave-requests.mjs +1 -1
- package/resources/leave-types.d.mts +1 -1
- package/resources/leave-types.d.ts +1 -1
- package/resources/leave-types.js +1 -1
- package/resources/leave-types.mjs +1 -1
- package/resources/legal-entities.d.mts +1 -1
- package/resources/legal-entities.d.ts +1 -1
- package/resources/legal-entities.js +1 -1
- package/resources/legal-entities.mjs +1 -1
- package/resources/levels.d.mts +1 -1
- package/resources/levels.d.ts +1 -1
- package/resources/levels.js +1 -1
- package/resources/levels.mjs +1 -1
- package/resources/location-factors.d.mts +1 -1
- package/resources/location-factors.d.ts +1 -1
- package/resources/location-factors.js +1 -1
- package/resources/location-factors.mjs +1 -1
- package/resources/packages/index.d.mts +3 -0
- package/resources/packages/index.d.mts.map +1 -0
- package/resources/packages/index.d.ts +3 -0
- package/resources/packages/index.d.ts.map +1 -0
- package/resources/packages/index.js +9 -0
- package/resources/packages/index.js.map +1 -0
- package/resources/packages/index.mjs +4 -0
- package/resources/packages/index.mjs.map +1 -0
- package/resources/packages/packages.d.mts +239 -0
- package/resources/packages/packages.d.mts.map +1 -0
- package/resources/packages/packages.d.ts +239 -0
- package/resources/packages/packages.d.ts.map +1 -0
- package/resources/packages/packages.js +60 -0
- package/resources/packages/packages.js.map +1 -0
- package/resources/packages/packages.mjs +55 -0
- package/resources/packages/packages.mjs.map +1 -0
- package/resources/packages/versions.d.mts +72 -0
- package/resources/packages/versions.d.mts.map +1 -0
- package/resources/packages/versions.d.ts +72 -0
- package/resources/packages/versions.d.ts.map +1 -0
- package/resources/packages/versions.js +19 -0
- package/resources/packages/versions.js.map +1 -0
- package/resources/packages/versions.mjs +15 -0
- package/resources/packages/versions.mjs.map +1 -0
- package/resources/packages.d.mts +2 -0
- package/resources/packages.d.mts.map +1 -0
- package/resources/packages.d.ts +2 -0
- package/resources/packages.d.ts.map +1 -0
- package/resources/packages.js +6 -0
- package/resources/packages.js.map +1 -0
- package/resources/packages.mjs +3 -0
- package/resources/packages.mjs.map +1 -0
- package/resources/scheduled-job-assignments.d.mts +1 -1
- package/resources/scheduled-job-assignments.d.ts +1 -1
- package/resources/scheduled-job-assignments.js +1 -1
- package/resources/scheduled-job-assignments.mjs +1 -1
- package/resources/schedules.d.mts +1 -1
- package/resources/schedules.d.ts +1 -1
- package/resources/schedules.js +1 -1
- package/resources/schedules.mjs +1 -1
- package/resources/shift-assignments.d.mts +1 -1
- package/resources/shift-assignments.d.ts +1 -1
- package/resources/shift-assignments.js +1 -1
- package/resources/shift-assignments.mjs +1 -1
- package/resources/shift-inputs.d.mts +1 -1
- package/resources/shift-inputs.d.ts +1 -1
- package/resources/shift-inputs.js +1 -1
- package/resources/shift-inputs.mjs +1 -1
- package/resources/shiftassignments.d.mts +1 -1
- package/resources/shiftassignments.d.ts +1 -1
- package/resources/shiftassignments.js +1 -1
- package/resources/shiftassignments.mjs +1 -1
- package/resources/sites.d.mts +572 -0
- package/resources/sites.d.mts.map +1 -0
- package/resources/sites.d.ts +572 -0
- package/resources/sites.d.ts.map +1 -0
- package/resources/sites.js +154 -0
- package/resources/sites.js.map +1 -0
- package/resources/sites.mjs +150 -0
- package/resources/sites.mjs.map +1 -0
- package/resources/software-deployments.d.mts +1 -1
- package/resources/software-deployments.d.ts +1 -1
- package/resources/software-deployments.js +1 -1
- package/resources/software-deployments.mjs +1 -1
- package/resources/time-cards.d.mts +1 -1
- package/resources/time-cards.d.ts +1 -1
- package/resources/time-cards.js +1 -1
- package/resources/time-cards.mjs +1 -1
- package/resources/time-entries.d.mts +1 -1
- package/resources/time-entries.d.ts +1 -1
- package/resources/time-entries.js +1 -1
- package/resources/time-entries.mjs +1 -1
- package/resources/tracks.d.mts +1 -1
- package/resources/tracks.d.ts +1 -1
- package/resources/tracks.js +1 -1
- package/resources/tracks.mjs +1 -1
- package/resources/unassigned-shifts.d.mts +2 -2
- package/resources/unassigned-shifts.d.ts +2 -2
- package/resources/unassigned-shifts.js +2 -2
- package/resources/unassigned-shifts.mjs +2 -2
- package/resources/unassignedshifts.d.mts +1 -1
- package/resources/unassignedshifts.d.ts +1 -1
- package/resources/unassignedshifts.js +1 -1
- package/resources/unassignedshifts.mjs +1 -1
- package/resources/worker-time-splits.d.mts +1 -1
- package/resources/worker-time-splits.d.ts +1 -1
- package/resources/worker-time-splits.js +1 -1
- package/resources/worker-time-splits.mjs +1 -1
- package/src/client.ts +91 -0
- package/src/lib/leave-programs/README.md +160 -0
- package/src/lib/leave-programs/advanced.ts +11 -0
- package/src/lib/leave-programs/context.ts +101 -0
- package/src/lib/leave-programs/define-company-leave-program.ts +58 -0
- package/src/lib/leave-programs/duration.ts +20 -0
- package/src/lib/leave-programs/pay.ts +18 -0
- package/src/lib/leave-programs/policy-builder.ts +113 -0
- package/src/lib/leave-programs/recipes/parental-top-up-policy.ts +85 -0
- package/src/lib/leave-programs/testing.ts +16 -0
- package/src/lib/leave-programs/types.ts +274 -0
- package/src/lib/leave-programs.ts +35 -0
- package/src/resources/agents/agents.ts +340 -0
- package/src/resources/agents/deployments.ts +249 -0
- package/src/resources/agents/index.ts +40 -0
- package/src/resources/agents/sessions/events.ts +107 -0
- package/src/resources/agents/sessions/index.ts +12 -0
- package/src/resources/agents/sessions/sessions.ts +216 -0
- package/src/resources/agents/sessions.ts +3 -0
- package/src/resources/agents/source-revisions.ts +267 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/break-policies.ts +1 -1
- package/src/resources/break-types.ts +1 -1
- package/src/resources/business-structure-paths.ts +1 -1
- package/src/resources/candidate-applications.ts +1 -1
- package/src/resources/candidates.ts +1 -1
- package/src/resources/company-legal-entities.ts +1 -1
- package/src/resources/company-legal-entity-workers.ts +1 -1
- package/src/resources/compensation-bands-details.ts +1 -1
- package/src/resources/compensations.ts +1 -1
- package/src/resources/device-orders.ts +1 -1
- package/src/resources/devices.ts +1 -1
- package/src/resources/functions/deployments.ts +2 -2
- package/src/resources/functions/executions.ts +2 -2
- package/src/resources/functions/functions.ts +1 -1
- package/src/resources/headcount-positions.ts +1 -1
- package/src/resources/headcount-priorities.ts +1 -1
- package/src/resources/index.ts +38 -0
- package/src/resources/job-assignments.ts +2 -2
- package/src/resources/job-codes.ts +2 -2
- package/src/resources/job-dimensions.ts +1 -1
- package/src/resources/job-pay-rate-exceptions.ts +2 -2
- package/src/resources/job-requisitions.ts +1 -1
- package/src/resources/kiosk-badges.ts +1 -1
- package/src/resources/leave-accruals.ts +1 -1
- package/src/resources/leave-balances.ts +1 -1
- package/src/resources/leave-requests.ts +1 -1
- package/src/resources/leave-types.ts +1 -1
- package/src/resources/legal-entities.ts +1 -1
- package/src/resources/levels.ts +1 -1
- package/src/resources/location-factors.ts +1 -1
- package/src/resources/packages/index.ts +14 -0
- package/src/resources/packages/packages.ts +329 -0
- package/src/resources/packages/versions.ts +98 -0
- package/src/resources/packages.ts +3 -0
- package/src/resources/scheduled-job-assignments.ts +1 -1
- package/src/resources/schedules.ts +1 -1
- package/src/resources/shift-assignments.ts +1 -1
- package/src/resources/shift-inputs.ts +1 -1
- package/src/resources/shiftassignments.ts +1 -1
- package/src/resources/sites.ts +736 -0
- package/src/resources/software-deployments.ts +1 -1
- package/src/resources/time-cards.ts +1 -1
- package/src/resources/time-entries.ts +1 -1
- package/src/resources/tracks.ts +1 -1
- package/src/resources/unassigned-shifts.ts +2 -2
- package/src/resources/unassignedshifts.ts +1 -1
- package/src/resources/worker-time-splits.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCompanyLeaveProgram = defineCompanyLeaveProgram;
|
|
4
|
+
const context_1 = require("./context.js");
|
|
5
|
+
function asArray(value) {
|
|
6
|
+
if (value === undefined) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return Array.isArray(value) ? value : [value];
|
|
10
|
+
}
|
|
11
|
+
function defineCompanyLeaveProgram(config) {
|
|
12
|
+
const dependsOn = config.dependsOn === undefined ? [] : [...config.dependsOn];
|
|
13
|
+
const capabilities = config.capabilities === undefined ? [] : [...config.capabilities];
|
|
14
|
+
return {
|
|
15
|
+
contractVersion: 'company_leave_program.v1',
|
|
16
|
+
code: config.code,
|
|
17
|
+
displayName: config.displayName,
|
|
18
|
+
jurisdiction: { ...config.jurisdiction },
|
|
19
|
+
dependsOn,
|
|
20
|
+
toResult(context = (0, context_1.createCompanyLeaveProgramContext)()) {
|
|
21
|
+
const result = config.evaluate(context);
|
|
22
|
+
return {
|
|
23
|
+
contractVersion: 'company_leave_program.v1',
|
|
24
|
+
program: {
|
|
25
|
+
code: config.code,
|
|
26
|
+
displayName: config.displayName,
|
|
27
|
+
...(config.description === undefined ? {} : { description: config.description }),
|
|
28
|
+
programKind: config.programKind ?? 'COMPANY_POLICY',
|
|
29
|
+
jurisdiction: { ...config.jurisdiction },
|
|
30
|
+
dependsOn,
|
|
31
|
+
capabilities,
|
|
32
|
+
},
|
|
33
|
+
appliesTo: asArray(config.appliesTo?.(context)),
|
|
34
|
+
eligibility: {
|
|
35
|
+
conditions: result.conditions,
|
|
36
|
+
requiredEvidence: result.requiredEvidence,
|
|
37
|
+
},
|
|
38
|
+
...(result.entitlement === undefined ? {} : { entitlement: result.entitlement }),
|
|
39
|
+
pay: result.pay,
|
|
40
|
+
requirements: result.requirements,
|
|
41
|
+
jobProtection: result.jobProtection,
|
|
42
|
+
diagnostics: result.diagnostics,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=define-company-leave-program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-company-leave-program.js","sourceRoot":"","sources":["../../src/lib/leave-programs/define-company-leave-program.ts"],"names":[],"mappings":";;AAgBA,8DAyCC;AAzDD,0CAA6D;AAS7D,SAAS,OAAO,CAAC,KAAsD;IACrE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAgB,yBAAyB,CACvC,MAA2C;IAE3C,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9E,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IAEvF,OAAO;QACL,eAAe,EAAE,0BAA0B;QAC3C,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,YAAY,EAAE,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE;QACxC,SAAS;QAET,QAAQ,CACN,UAAsC,IAAA,0CAAgC,GAAE;YAExE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO;gBACL,eAAe,EAAE,0BAA0B;gBAC3C,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,GAAG,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;oBAChF,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,gBAAgB;oBACnD,YAAY,EAAE,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE;oBACxC,SAAS;oBACT,YAAY;iBACb;gBACD,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC;gBAC/C,WAAW,EAAE;oBACX,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;iBAC1C;gBACD,GAAG,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;gBAChF,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createCompanyLeaveProgramContext } from "./context.mjs";
|
|
2
|
+
function asArray(value) {
|
|
3
|
+
if (value === undefined) {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
6
|
+
return Array.isArray(value) ? value : [value];
|
|
7
|
+
}
|
|
8
|
+
export function defineCompanyLeaveProgram(config) {
|
|
9
|
+
const dependsOn = config.dependsOn === undefined ? [] : [...config.dependsOn];
|
|
10
|
+
const capabilities = config.capabilities === undefined ? [] : [...config.capabilities];
|
|
11
|
+
return {
|
|
12
|
+
contractVersion: 'company_leave_program.v1',
|
|
13
|
+
code: config.code,
|
|
14
|
+
displayName: config.displayName,
|
|
15
|
+
jurisdiction: { ...config.jurisdiction },
|
|
16
|
+
dependsOn,
|
|
17
|
+
toResult(context = createCompanyLeaveProgramContext()) {
|
|
18
|
+
const result = config.evaluate(context);
|
|
19
|
+
return {
|
|
20
|
+
contractVersion: 'company_leave_program.v1',
|
|
21
|
+
program: {
|
|
22
|
+
code: config.code,
|
|
23
|
+
displayName: config.displayName,
|
|
24
|
+
...(config.description === undefined ? {} : { description: config.description }),
|
|
25
|
+
programKind: config.programKind ?? 'COMPANY_POLICY',
|
|
26
|
+
jurisdiction: { ...config.jurisdiction },
|
|
27
|
+
dependsOn,
|
|
28
|
+
capabilities,
|
|
29
|
+
},
|
|
30
|
+
appliesTo: asArray(config.appliesTo?.(context)),
|
|
31
|
+
eligibility: {
|
|
32
|
+
conditions: result.conditions,
|
|
33
|
+
requiredEvidence: result.requiredEvidence,
|
|
34
|
+
},
|
|
35
|
+
...(result.entitlement === undefined ? {} : { entitlement: result.entitlement }),
|
|
36
|
+
pay: result.pay,
|
|
37
|
+
requirements: result.requirements,
|
|
38
|
+
jobProtection: result.jobProtection,
|
|
39
|
+
diagnostics: result.diagnostics,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=define-company-leave-program.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-company-leave-program.mjs","sourceRoot":"","sources":["../../src/lib/leave-programs/define-company-leave-program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,sBAAkB;AAS7D,SAAS,OAAO,CAAC,KAAsD;IACrE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,MAA2C;IAE3C,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAA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AC;gBAChF,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.mts","sourceRoot":"","sources":["../../src/lib/leave-programs/duration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAgB;AASxC,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE7C;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../src/lib/leave-programs/duration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAgB;AASxC,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE7C;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE9C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.weeks = weeks;
|
|
4
|
+
exports.days = days;
|
|
5
|
+
exports.hours = hours;
|
|
6
|
+
function duration(amount, unit) {
|
|
7
|
+
if (!Number.isFinite(amount) || amount < 0) {
|
|
8
|
+
throw new Error('Duration amount must be a non-negative finite number.');
|
|
9
|
+
}
|
|
10
|
+
return { kind: 'duration', amount, unit };
|
|
11
|
+
}
|
|
12
|
+
function weeks(amount) {
|
|
13
|
+
return duration(amount, 'WEEKS');
|
|
14
|
+
}
|
|
15
|
+
function days(amount) {
|
|
16
|
+
return duration(amount, 'DAYS');
|
|
17
|
+
}
|
|
18
|
+
function hours(amount) {
|
|
19
|
+
return duration(amount, 'HOURS');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../src/lib/leave-programs/duration.ts"],"names":[],"mappings":";;AASA,sBAEC;AAED,oBAEC;AAED,sBAEC;AAjBD,SAAS,QAAQ,CAAC,MAAc,EAAE,IAAsB;IACtD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,SAAgB,KAAK,CAAC,MAAc;IAClC,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,SAAgB,IAAI,CAAC,MAAc;IACjC,OAAO,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,SAAgB,KAAK,CAAC,MAAc;IAClC,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function duration(amount, unit) {
|
|
2
|
+
if (!Number.isFinite(amount) || amount < 0) {
|
|
3
|
+
throw new Error('Duration amount must be a non-negative finite number.');
|
|
4
|
+
}
|
|
5
|
+
return { kind: 'duration', amount, unit };
|
|
6
|
+
}
|
|
7
|
+
export function weeks(amount) {
|
|
8
|
+
return duration(amount, 'WEEKS');
|
|
9
|
+
}
|
|
10
|
+
export function days(amount) {
|
|
11
|
+
return duration(amount, 'DAYS');
|
|
12
|
+
}
|
|
13
|
+
export function hours(amount) {
|
|
14
|
+
return duration(amount, 'HOURS');
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=duration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.mjs","sourceRoot":"","sources":["../../src/lib/leave-programs/duration.ts"],"names":[],"mappings":"AAEA,SAAS,QAAQ,CAAC,MAAc,EAAE,IAAsB;IACtD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,MAAc;IACjC,OAAO,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.d.mts","sourceRoot":"","sources":["../../src/lib/leave-programs/pay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAgB;AAEzD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAK1D;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,CAQzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../src/lib/leave-programs/pay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAgB;AAEzD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAK1D;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,CAQzE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.percentOfPay = percentOfPay;
|
|
4
|
+
exports.fixedAmount = fixedAmount;
|
|
5
|
+
function percentOfPay(percent) {
|
|
6
|
+
if (!Number.isFinite(percent) || percent < 0) {
|
|
7
|
+
throw new Error('Percent of pay must be a non-negative finite number.');
|
|
8
|
+
}
|
|
9
|
+
return { kind: 'percent_of_pay', percent };
|
|
10
|
+
}
|
|
11
|
+
function fixedAmount(amount, currency) {
|
|
12
|
+
if (amount.trim() === '') {
|
|
13
|
+
throw new Error('Fixed amount must be a non-empty decimal string.');
|
|
14
|
+
}
|
|
15
|
+
if (currency.trim() === '') {
|
|
16
|
+
throw new Error('Currency must be a non-empty ISO currency code.');
|
|
17
|
+
}
|
|
18
|
+
return { kind: 'money_amount', amount, currency };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=pay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../src/lib/leave-programs/pay.ts"],"names":[],"mappings":";;AAEA,oCAKC;AAED,kCAQC;AAfD,SAAgB,YAAY,CAAC,OAAe;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED,SAAgB,WAAW,CAAC,MAAc,EAAE,QAAgB;IAC1D,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function percentOfPay(percent) {
|
|
2
|
+
if (!Number.isFinite(percent) || percent < 0) {
|
|
3
|
+
throw new Error('Percent of pay must be a non-negative finite number.');
|
|
4
|
+
}
|
|
5
|
+
return { kind: 'percent_of_pay', percent };
|
|
6
|
+
}
|
|
7
|
+
export function fixedAmount(amount, currency) {
|
|
8
|
+
if (amount.trim() === '') {
|
|
9
|
+
throw new Error('Fixed amount must be a non-empty decimal string.');
|
|
10
|
+
}
|
|
11
|
+
if (currency.trim() === '') {
|
|
12
|
+
throw new Error('Currency must be a non-empty ISO currency code.');
|
|
13
|
+
}
|
|
14
|
+
return { kind: 'money_amount', amount, currency };
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=pay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.mjs","sourceRoot":"","sources":["../../src/lib/leave-programs/pay.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,QAAgB;IAC1D,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AdminTask, DurationExpression, FactRef, GrantPaidLeaveOptions, MoneyAmount, PayFixedAmountOptions, PayPercentOfPayOptions, PercentOfPay, PolicyBuilder, PolicyBuilderResult, PolicyCondition, RequireKnownOptions, TopUpToOptions, WageReplacementRef } from "./types.mjs";
|
|
2
|
+
export declare class CompanyPolicyBuilder implements PolicyBuilder {
|
|
3
|
+
private readonly conditions;
|
|
4
|
+
private readonly requiredEvidence;
|
|
5
|
+
private entitlementDecision;
|
|
6
|
+
private payDecision;
|
|
7
|
+
private readonly requirementDecisions;
|
|
8
|
+
private jobProtectionDecision;
|
|
9
|
+
eligibleWhen(condition: PolicyCondition): PolicyBuilder;
|
|
10
|
+
requireKnown(_fact: FactRef | WageReplacementRef, options: RequireKnownOptions): PolicyBuilder;
|
|
11
|
+
grantPaidLeave(duration: DurationExpression, options?: GrantPaidLeaveOptions): PolicyBuilder;
|
|
12
|
+
noCompanyPay(): PolicyBuilder;
|
|
13
|
+
payFixedAmount(amount: MoneyAmount, options: PayFixedAmountOptions): PolicyBuilder;
|
|
14
|
+
payPercentOfPay(target: PercentOfPay, options: PayPercentOfPayOptions): PolicyBuilder;
|
|
15
|
+
topUpTo(target: PercentOfPay, options: TopUpToOptions): PolicyBuilder;
|
|
16
|
+
requireAdminTask(key: AdminTask | string): PolicyBuilder;
|
|
17
|
+
doesNotProvideJobProtection(): PolicyBuilder;
|
|
18
|
+
build(): PolicyBuilderResult;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=policy-builder.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-builder.d.mts","sourceRoot":"","sources":["../../src/lib/leave-programs/policy-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAElB,OAAO,EACP,qBAAqB,EACrB,WAAW,EAEX,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EAEnB,cAAc,EACd,kBAAkB,EACnB,oBAAgB;AAEjB,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+C;IAChF,OAAO,CAAC,mBAAmB,CAAkC;IAC7D,OAAO,CAAC,WAAW,CAA2C;IAC9D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA6B;IAClE,OAAO,CAAC,qBAAqB,CAAqD;IAElF,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,aAAa;IAKvD,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,EAAE,OAAO,EAAE,mBAAmB,GAAG,aAAa;IAQ9F,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,GAAE,qBAA0B,GAAG,aAAa;IAShG,YAAY,IAAI,aAAa;IAK7B,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,GAAG,aAAa;IAUlF,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,sBAAsB,GAAG,aAAa;IAWrF,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa;IAWrE,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,aAAa;IASxD,2BAA2B,IAAI,aAAa;IAK5C,KAAK,IAAI,mBAAmB;CAW7B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AdminTask, DurationExpression, FactRef, GrantPaidLeaveOptions, MoneyAmount, PayFixedAmountOptions, PayPercentOfPayOptions, PercentOfPay, PolicyBuilder, PolicyBuilderResult, PolicyCondition, RequireKnownOptions, TopUpToOptions, WageReplacementRef } from "./types.js";
|
|
2
|
+
export declare class CompanyPolicyBuilder implements PolicyBuilder {
|
|
3
|
+
private readonly conditions;
|
|
4
|
+
private readonly requiredEvidence;
|
|
5
|
+
private entitlementDecision;
|
|
6
|
+
private payDecision;
|
|
7
|
+
private readonly requirementDecisions;
|
|
8
|
+
private jobProtectionDecision;
|
|
9
|
+
eligibleWhen(condition: PolicyCondition): PolicyBuilder;
|
|
10
|
+
requireKnown(_fact: FactRef | WageReplacementRef, options: RequireKnownOptions): PolicyBuilder;
|
|
11
|
+
grantPaidLeave(duration: DurationExpression, options?: GrantPaidLeaveOptions): PolicyBuilder;
|
|
12
|
+
noCompanyPay(): PolicyBuilder;
|
|
13
|
+
payFixedAmount(amount: MoneyAmount, options: PayFixedAmountOptions): PolicyBuilder;
|
|
14
|
+
payPercentOfPay(target: PercentOfPay, options: PayPercentOfPayOptions): PolicyBuilder;
|
|
15
|
+
topUpTo(target: PercentOfPay, options: TopUpToOptions): PolicyBuilder;
|
|
16
|
+
requireAdminTask(key: AdminTask | string): PolicyBuilder;
|
|
17
|
+
doesNotProvideJobProtection(): PolicyBuilder;
|
|
18
|
+
build(): PolicyBuilderResult;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=policy-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-builder.d.ts","sourceRoot":"","sources":["../../src/lib/leave-programs/policy-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAElB,OAAO,EACP,qBAAqB,EACrB,WAAW,EAEX,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EAEnB,cAAc,EACd,kBAAkB,EACnB,mBAAgB;AAEjB,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+C;IAChF,OAAO,CAAC,mBAAmB,CAAkC;IAC7D,OAAO,CAAC,WAAW,CAA2C;IAC9D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA6B;IAClE,OAAO,CAAC,qBAAqB,CAAqD;IAElF,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,aAAa;IAKvD,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,EAAE,OAAO,EAAE,mBAAmB,GAAG,aAAa;IAQ9F,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,GAAE,qBAA0B,GAAG,aAAa;IAShG,YAAY,IAAI,aAAa;IAK7B,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,GAAG,aAAa;IAUlF,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,sBAAsB,GAAG,aAAa;IAWrF,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa;IAWrE,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,aAAa;IASxD,2BAA2B,IAAI,aAAa;IAK5C,KAAK,IAAI,mBAAmB;CAW7B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanyPolicyBuilder = void 0;
|
|
4
|
+
class CompanyPolicyBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.conditions = [];
|
|
7
|
+
this.requiredEvidence = [];
|
|
8
|
+
this.payDecision = { type: 'NO_COMPANY_PAY' };
|
|
9
|
+
this.requirementDecisions = [];
|
|
10
|
+
this.jobProtectionDecision = 'UNCHANGED';
|
|
11
|
+
}
|
|
12
|
+
eligibleWhen(condition) {
|
|
13
|
+
this.conditions.push(condition);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
requireKnown(_fact, options) {
|
|
17
|
+
this.requiredEvidence.push({
|
|
18
|
+
key: options.evidenceKey,
|
|
19
|
+
...(options.message === undefined ? {} : { message: options.message }),
|
|
20
|
+
});
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
grantPaidLeave(duration, options = {}) {
|
|
24
|
+
this.entitlementDecision = {
|
|
25
|
+
type: 'PAID_LEAVE',
|
|
26
|
+
duration,
|
|
27
|
+
...(options.leaveType === undefined ? {} : { leaveType: options.leaveType }),
|
|
28
|
+
};
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
noCompanyPay() {
|
|
32
|
+
this.payDecision = { type: 'NO_COMPANY_PAY' };
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
payFixedAmount(amount, options) {
|
|
36
|
+
this.payDecision = {
|
|
37
|
+
type: 'FIXED_AMOUNT',
|
|
38
|
+
amount,
|
|
39
|
+
duration: options.duration,
|
|
40
|
+
earningType: options.earningType,
|
|
41
|
+
};
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
payPercentOfPay(target, options) {
|
|
45
|
+
this.payDecision = {
|
|
46
|
+
type: 'PERCENT_OF_PAY',
|
|
47
|
+
target,
|
|
48
|
+
base: options.base,
|
|
49
|
+
duration: options.duration,
|
|
50
|
+
earningType: options.earningType,
|
|
51
|
+
};
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
topUpTo(target, options) {
|
|
55
|
+
this.payDecision = {
|
|
56
|
+
type: 'MAKE_WHOLE_TOPUP',
|
|
57
|
+
target,
|
|
58
|
+
base: options.base,
|
|
59
|
+
offsetBy: options.offsetBy,
|
|
60
|
+
earningType: options.earningType,
|
|
61
|
+
};
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
requireAdminTask(key) {
|
|
65
|
+
this.requirementDecisions.push({
|
|
66
|
+
type: 'ADMIN_TASK',
|
|
67
|
+
key,
|
|
68
|
+
blocksPayment: false,
|
|
69
|
+
});
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
doesNotProvideJobProtection() {
|
|
73
|
+
this.jobProtectionDecision = 'NONE';
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
build() {
|
|
77
|
+
return {
|
|
78
|
+
conditions: [...this.conditions],
|
|
79
|
+
requiredEvidence: [...this.requiredEvidence],
|
|
80
|
+
...(this.entitlementDecision === undefined ? {} : { entitlement: this.entitlementDecision }),
|
|
81
|
+
pay: this.payDecision,
|
|
82
|
+
requirements: [...this.requirementDecisions],
|
|
83
|
+
jobProtection: this.jobProtectionDecision,
|
|
84
|
+
diagnostics: [],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.CompanyPolicyBuilder = CompanyPolicyBuilder;
|
|
89
|
+
//# sourceMappingURL=policy-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-builder.js","sourceRoot":"","sources":["../../src/lib/leave-programs/policy-builder.ts"],"names":[],"mappings":";;;AAoBA,MAAa,oBAAoB;IAAjC;QACmB,eAAU,GAAsB,EAAE,CAAC;QACnC,qBAAgB,GAA4C,EAAE,CAAC;QAExE,gBAAW,GAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QAC7C,yBAAoB,GAA0B,EAAE,CAAC;QAC1D,0BAAqB,GAAyC,WAAW,CAAC;IAsFpF,CAAC;IApFC,YAAY,CAAC,S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|
+
this.payDecision = { type: 'NO_COMPANY_PAY' };
|
|
6
|
+
this.requirementDecisions = [];
|
|
7
|
+
this.jobProtectionDecision = 'UNCHANGED';
|
|
8
|
+
}
|
|
9
|
+
eligibleWhen(condition) {
|
|
10
|
+
this.conditions.push(condition);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
requireKnown(_fact, options) {
|
|
14
|
+
this.requiredEvidence.push({
|
|
15
|
+
key: options.evidenceKey,
|
|
16
|
+
...(options.message === undefined ? {} : { message: options.message }),
|
|
17
|
+
});
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
grantPaidLeave(duration, options = {}) {
|
|
21
|
+
this.entitlementDecision = {
|
|
22
|
+
type: 'PAID_LEAVE',
|
|
23
|
+
duration,
|
|
24
|
+
...(options.leaveType === undefined ? {} : { leaveType: options.leaveType }),
|
|
25
|
+
};
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
noCompanyPay() {
|
|
29
|
+
this.payDecision = { type: 'NO_COMPANY_PAY' };
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
payFixedAmount(amount, options) {
|
|
33
|
+
this.payDecision = {
|
|
34
|
+
type: 'FIXED_AMOUNT',
|
|
35
|
+
amount,
|
|
36
|
+
duration: options.duration,
|
|
37
|
+
earningType: options.earningType,
|
|
38
|
+
};
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
payPercentOfPay(target, options) {
|
|
42
|
+
this.payDecision = {
|
|
43
|
+
type: 'PERCENT_OF_PAY',
|
|
44
|
+
target,
|
|
45
|
+
base: options.base,
|
|
46
|
+
duration: options.duration,
|
|
47
|
+
earningType: options.earningType,
|
|
48
|
+
};
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
topUpTo(target, options) {
|
|
52
|
+
this.payDecision = {
|
|
53
|
+
type: 'MAKE_WHOLE_TOPUP',
|
|
54
|
+
target,
|
|
55
|
+
base: options.base,
|
|
56
|
+
offsetBy: options.offsetBy,
|
|
57
|
+
earningType: options.earningType,
|
|
58
|
+
};
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
requireAdminTask(key) {
|
|
62
|
+
this.requirementDecisions.push({
|
|
63
|
+
type: 'ADMIN_TASK',
|
|
64
|
+
key,
|
|
65
|
+
blocksPayment: false,
|
|
66
|
+
});
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
doesNotProvideJobProtection() {
|
|
70
|
+
this.jobProtectionDecision = 'NONE';
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
build() {
|
|
74
|
+
return {
|
|
75
|
+
conditions: [...this.conditions],
|
|
76
|
+
requiredEvidence: [...this.requiredEvidence],
|
|
77
|
+
...(this.entitlementDecision === undefined ? {} : { entitlement: this.entitlementDecision }),
|
|
78
|
+
pay: this.payDecision,
|
|
79
|
+
requirements: [...this.requirementDecisions],
|
|
80
|
+
jobProtection: this.jobProtectionDecision,
|
|
81
|
+
diagnostics: [],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=policy-builder.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-builder.mjs","sourceRoot":"","sources":["../../src/lib/leave-programs/policy-builder.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,oBAAoB;IAAjC;QACmB,eAAU,GAAsB,EAAE,CAAC;QACnC,qBAAgB,GAA4C,EAAE,CAAC;QAExE,gBAAW,GAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QAC7C,yBAAoB,GAA0B,EAAE,CAAC;QAC1D,0BAAqB,GAAyC,WAAW,CAAC;IAsFpF,CAAC;IApFC,YAAY,CAAC,SAA0B;QACrC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAmC,EAAE,OAA4B;QAC5E,IAAI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IAAI,EAAE,kBAAkB;YACxB,MAAM;YACN,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB,CAAC,GAAuB;QACtC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,YAAY;YAClB,GAAG;YACH,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2BAA2B;QACzB,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;YAChC,gBAAgB,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAC5C,GAAG,CAAC,IAAI,CAAC,mBAAmB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC5F,GAAG,EAAE,IAAI,CAAC,WAAW;YACrB,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;YAC5C,aAAa,EAAE,IAAI,CAAC,qBAAqB;YACzC,WAAW,EAAE,EAAE;SAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AdminTask, type CompanyLeaveProgramDefinitionConfig, type ParentalRelationship } from "../types.mjs";
|
|
2
|
+
export interface ParentalTopUpPolicyOptions {
|
|
3
|
+
code: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
jurisdiction: {
|
|
7
|
+
country: string;
|
|
8
|
+
subdivisions?: string[];
|
|
9
|
+
};
|
|
10
|
+
appliesTo?: {
|
|
11
|
+
employeeCountry?: string;
|
|
12
|
+
};
|
|
13
|
+
qualifyingLeaveReasons: string[];
|
|
14
|
+
paidWeeksByParentalRelationship: Partial<Record<ParentalRelationship, number>>;
|
|
15
|
+
pay: {
|
|
16
|
+
type: 'MAKE_WHOLE_TOPUP';
|
|
17
|
+
targetPercentOfPay: number;
|
|
18
|
+
offsetByPrograms: string[];
|
|
19
|
+
earningType?: string;
|
|
20
|
+
};
|
|
21
|
+
requirements?: Array<AdminTask | string>;
|
|
22
|
+
leaveType?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function parentalTopUpPolicy(options: ParentalTopUpPolicyOptions): CompanyLeaveProgramDefinitionConfig;
|
|
25
|
+
//# sourceMappingURL=parental-top-up-policy.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parental-top-up-policy.d.mts","sourceRoot":"","sources":["../../../src/lib/leave-programs/recipes/parental-top-up-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,mCAAmC,EAAE,KAAK,oBAAoB,EAAE,qBAAiB;AAG1G,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,+BAA+B,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/E,GAAG,EAAE;QACH,IAAI,EAAE,kBAAkB,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,mCAAmC,CAuDrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AdminTask, type CompanyLeaveProgramDefinitionConfig, type ParentalRelationship } from "../types.js";
|
|
2
|
+
export interface ParentalTopUpPolicyOptions {
|
|
3
|
+
code: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
jurisdiction: {
|
|
7
|
+
country: string;
|
|
8
|
+
subdivisions?: string[];
|
|
9
|
+
};
|
|
10
|
+
appliesTo?: {
|
|
11
|
+
employeeCountry?: string;
|
|
12
|
+
};
|
|
13
|
+
qualifyingLeaveReasons: string[];
|
|
14
|
+
paidWeeksByParentalRelationship: Partial<Record<ParentalRelationship, number>>;
|
|
15
|
+
pay: {
|
|
16
|
+
type: 'MAKE_WHOLE_TOPUP';
|
|
17
|
+
targetPercentOfPay: number;
|
|
18
|
+
offsetByPrograms: string[];
|
|
19
|
+
earningType?: string;
|
|
20
|
+
};
|
|
21
|
+
requirements?: Array<AdminTask | string>;
|
|
22
|
+
leaveType?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function parentalTopUpPolicy(options: ParentalTopUpPolicyOptions): CompanyLeaveProgramDefinitionConfig;
|
|
25
|
+
//# sourceMappingURL=parental-top-up-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parental-top-up-policy.d.ts","sourceRoot":"","sources":["../../../src/lib/leave-programs/recipes/parental-top-up-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,mCAAmC,EAAE,KAAK,oBAAoB,EAAE,oBAAiB;AAG1G,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,+BAA+B,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/E,GAAG,EAAE;QACH,IAAI,EAAE,kBAAkB,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,mCAAmC,CAuDrC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parentalTopUpPolicy = parentalTopUpPolicy;
|
|
4
|
+
const pay_1 = require("../pay.js");
|
|
5
|
+
const types_1 = require("../types.js");
|
|
6
|
+
const duration_1 = require("../duration.js");
|
|
7
|
+
function parentalTopUpPolicy(options) {
|
|
8
|
+
const requirements = options.requirements ?? [
|
|
9
|
+
types_1.AdminTask.ManagerAcknowledgement,
|
|
10
|
+
types_1.AdminTask.PaymentRecordReconciliation,
|
|
11
|
+
types_1.AdminTask.SeparateFromJobProtection,
|
|
12
|
+
];
|
|
13
|
+
const earningType = options.pay.earningType ?? 'EMPLOYER_TOPUP_MAKE_WHOLE';
|
|
14
|
+
const leaveType = options.leaveType ?? 'EMPLOYER_PARENTAL_TOPUP';
|
|
15
|
+
const paidWeeksByRelationship = options.paidWeeksByParentalRelationship;
|
|
16
|
+
const employeeCountry = options.appliesTo?.employeeCountry;
|
|
17
|
+
return {
|
|
18
|
+
code: options.code,
|
|
19
|
+
displayName: options.displayName,
|
|
20
|
+
...(options.description === undefined ? {} : { description: options.description }),
|
|
21
|
+
jurisdiction: options.jurisdiction,
|
|
22
|
+
dependsOn: options.pay.offsetByPrograms,
|
|
23
|
+
...(employeeCountry === undefined ?
|
|
24
|
+
{}
|
|
25
|
+
: { appliesTo: (context) => context.employee.country.is(employeeCountry) }),
|
|
26
|
+
evaluate(context) {
|
|
27
|
+
const paidLeaveCases = Object.fromEntries(Object.entries(paidWeeksByRelationship).map(([relationship, paidWeeks]) => [
|
|
28
|
+
relationship,
|
|
29
|
+
(0, duration_1.weeks)(paidWeeks ?? 0),
|
|
30
|
+
]));
|
|
31
|
+
const builder = context
|
|
32
|
+
.policy()
|
|
33
|
+
.eligibleWhen(context.leave.reason.isOneOf(options.qualifyingLeaveReasons))
|
|
34
|
+
.requireKnown(context.pay.contractualWeeklyPay, {
|
|
35
|
+
evidenceKey: 'weekly_wage',
|
|
36
|
+
message: 'Contractual weekly pay is required to calculate company top-up.',
|
|
37
|
+
})
|
|
38
|
+
.requireKnown(context.programs.wageReplacement(options.pay.offsetByPrograms), {
|
|
39
|
+
evidenceKey: 'upstream_pay_rates',
|
|
40
|
+
message: 'Statutory or insurance wage-replacement amounts are required to calculate company top-up.',
|
|
41
|
+
})
|
|
42
|
+
.grantPaidLeave(context.leave.parentalRelationship.match(paidLeaveCases), { leaveType })
|
|
43
|
+
.topUpTo((0, pay_1.percentOfPay)(options.pay.targetPercentOfPay), {
|
|
44
|
+
base: context.pay.contractualWeeklyPay,
|
|
45
|
+
offsetBy: context.programs.wageReplacement(options.pay.offsetByPrograms),
|
|
46
|
+
earningType,
|
|
47
|
+
})
|
|
48
|
+
.doesNotProvideJobProtection();
|
|
49
|
+
for (const requirement of requirements) {
|
|
50
|
+
builder.requireAdminTask(requirement);
|
|
51
|
+
}
|
|
52
|
+
return builder.build();
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=parental-top-up-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parental-top-up-policy.js","sourceRoot":"","sources":["../../../src/lib/leave-programs/recipes/parental-top-up-policy.ts"],"names":[],"mappings":";;AA2BA,kDAyDC;AApFD,mCAAsC;AACtC,uCAA0G;AAC1G,6CAAoC;AAyBpC,SAAgB,mBAAmB,CACjC,OAAmC;IAEnC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI;QAC3C,iBAAS,CAAC,sBAAsB;QAChC,iBAAS,CAAC,2BAA2B;QACrC,iBAAS,CAAC,yBAAyB;KACpC,CAAC;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,2BAA2B,CAAC;IAC3E,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,yBAAyB,CAAC;IACjE,MAAM,uBAAuB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IACxE,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC;IAE3D,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;QAClF,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;QACvC,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC;YACjC,EAAE;YACJ,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CA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