@frigear-nu/shifts 0.0.0-stage → 0.0.0
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/README.md +53 -2
- package/dist/module.d.mts +709 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +253 -0
- package/dist/runtime/access.d.ts +2 -0
- package/dist/runtime/access.js +84 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.d.vue.ts +19 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.vue +142 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.vue.d.ts +19 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.d.vue.ts +9 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.vue +74 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.vue.d.ts +9 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.vue +185 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/components/ShiftCheckInCard.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftCheckInCard.vue +238 -0
- package/dist/runtime/app/components/ShiftCheckInCard.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftCopySlideover.d.vue.ts +11 -0
- package/dist/runtime/app/components/ShiftCopySlideover.vue +71 -0
- package/dist/runtime/app/components/ShiftCopySlideover.vue.d.ts +11 -0
- package/dist/runtime/app/components/ShiftDayView.d.vue.ts +16 -0
- package/dist/runtime/app/components/ShiftDayView.vue +124 -0
- package/dist/runtime/app/components/ShiftDayView.vue.d.ts +16 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.d.vue.ts +7 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.vue +172 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.vue.d.ts +7 -0
- package/dist/runtime/app/components/ShiftNowCard.d.vue.ts +6 -0
- package/dist/runtime/app/components/ShiftNowCard.vue +83 -0
- package/dist/runtime/app/components/ShiftNowCard.vue.d.ts +6 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.vue +79 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.d.vue.ts +14 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.vue +103 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.vue.d.ts +14 -0
- package/dist/runtime/app/components/ShiftPerksCard.d.vue.ts +8 -0
- package/dist/runtime/app/components/ShiftPerksCard.vue +66 -0
- package/dist/runtime/app/components/ShiftPerksCard.vue.d.ts +8 -0
- package/dist/runtime/app/components/ShiftQrScanner.d.vue.ts +10 -0
- package/dist/runtime/app/components/ShiftQrScanner.vue +44 -0
- package/dist/runtime/app/components/ShiftQrScanner.vue.d.ts +10 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.vue +88 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.d.vue.ts +11 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue +61 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue.d.ts +11 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.d.vue.ts +12 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.vue +129 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.vue.d.ts +12 -0
- package/dist/runtime/app/components/ShiftSlideover.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftSlideover.vue +353 -0
- package/dist/runtime/app/components/ShiftSlideover.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftStationSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftStationSlideover.vue +92 -0
- package/dist/runtime/app/components/ShiftStationSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/composables/index.d.ts +6 -0
- package/dist/runtime/app/composables/index.js +5 -0
- package/dist/runtime/app/composables/useShiftsActions.d.ts +61 -0
- package/dist/runtime/app/composables/useShiftsActions.js +224 -0
- package/dist/runtime/app/composables/useShiftsFormat.d.ts +12 -0
- package/dist/runtime/app/composables/useShiftsFormat.js +14 -0
- package/dist/runtime/app/composables/useShiftsLinks.d.ts +12 -0
- package/dist/runtime/app/composables/useShiftsLinks.js +6 -0
- package/dist/runtime/app/composables/useShiftsTranslate.d.ts +5 -0
- package/dist/runtime/app/composables/useShiftsTranslate.js +12 -0
- package/dist/runtime/app/composables/useShiftsVenueFeatures.d.ts +17 -0
- package/dist/runtime/app/composables/useShiftsVenueFeatures.js +18 -0
- package/dist/runtime/app/dashboard/NextShift.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/NextShift.vue +69 -0
- package/dist/runtime/app/dashboard/NextShift.vue.d.ts +3 -0
- package/dist/runtime/app/dashboard/OpenSwaps.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/OpenSwaps.vue +69 -0
- package/dist/runtime/app/dashboard/OpenSwaps.vue.d.ts +3 -0
- package/dist/runtime/app/dashboard/TeamOnNow.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/TeamOnNow.vue +72 -0
- package/dist/runtime/app/dashboard/TeamOnNow.vue.d.ts +3 -0
- package/dist/runtime/app/pages/check-in.d.vue.ts +3 -0
- package/dist/runtime/app/pages/check-in.vue +93 -0
- package/dist/runtime/app/pages/check-in.vue.d.ts +3 -0
- package/dist/runtime/app/pages/lead.d.vue.ts +3 -0
- package/dist/runtime/app/pages/lead.vue +300 -0
- package/dist/runtime/app/pages/lead.vue.d.ts +3 -0
- package/dist/runtime/app/pages/shift.d.vue.ts +3 -0
- package/dist/runtime/app/pages/shift.vue +482 -0
- package/dist/runtime/app/pages/shift.vue.d.ts +3 -0
- package/dist/runtime/app/pages/shifts.d.vue.ts +3 -0
- package/dist/runtime/app/pages/shifts.vue +169 -0
- package/dist/runtime/app/pages/shifts.vue.d.ts +3 -0
- package/dist/runtime/app/pages/station.d.vue.ts +3 -0
- package/dist/runtime/app/pages/station.vue +104 -0
- package/dist/runtime/app/pages/station.vue.d.ts +3 -0
- package/dist/runtime/app/pages/swaps.d.vue.ts +3 -0
- package/dist/runtime/app/pages/swaps.vue +192 -0
- package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
- package/dist/runtime/app/tabs/Shifts.d.vue.ts +9 -0
- package/dist/runtime/app/tabs/Shifts.vue +487 -0
- package/dist/runtime/app/tabs/Shifts.vue.d.ts +9 -0
- package/dist/runtime/app/utils/admin-shifts.d.ts +42 -0
- package/dist/runtime/app/utils/admin-shifts.js +36 -0
- package/dist/runtime/dashboard.d.ts +8 -0
- package/dist/runtime/dashboard.js +30 -0
- package/dist/runtime/emails/shifts-broadcast.d.vue.ts +8 -0
- package/dist/runtime/emails/shifts-broadcast.vue +24 -0
- package/dist/runtime/emails/shifts-broadcast.vue.d.ts +8 -0
- package/dist/runtime/emails/shifts-reminder.d.vue.ts +12 -0
- package/dist/runtime/emails/shifts-reminder.vue +34 -0
- package/dist/runtime/emails/shifts-reminder.vue.d.ts +12 -0
- package/dist/runtime/emails/shifts-swap-accepted.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-accepted.vue +32 -0
- package/dist/runtime/emails/shifts-swap-accepted.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-completed.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-completed.vue +32 -0
- package/dist/runtime/emails/shifts-swap-completed.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-offered.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-offered.vue +32 -0
- package/dist/runtime/emails/shifts-swap-offered.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-pending.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-pending.vue +32 -0
- package/dist/runtime/emails/shifts-swap-pending.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-proposed.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-proposed.vue +32 -0
- package/dist/runtime/emails/shifts-swap-proposed.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-rejected.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-rejected.vue +32 -0
- package/dist/runtime/emails/shifts-swap-rejected.vue.d.ts +11 -0
- package/dist/runtime/i18n/lang/da.json +626 -0
- package/dist/runtime/i18n/lang/en.json +626 -0
- package/dist/runtime/menus.d.ts +2 -0
- package/dist/runtime/menus.js +17 -0
- package/dist/runtime/notifications.d.ts +9 -0
- package/dist/runtime/notifications.js +36 -0
- package/dist/runtime/server/db/schema.postgresql.d.ts +2151 -0
- package/dist/runtime/server/db/schema.postgresql.js +228 -0
- package/dist/runtime/server/db/schema.sqlite.d.ts +2263 -0
- package/dist/runtime/server/db/schema.sqlite.js +228 -0
- package/dist/runtime/server/digest-email.d.ts +17 -0
- package/dist/runtime/server/digest-email.js +42 -0
- package/dist/runtime/server/plugins/station-key.d.ts +2 -0
- package/dist/runtime/server/plugins/station-key.js +5 -0
- package/dist/runtime/server/plugins/teams.d.ts +2 -0
- package/dist/runtime/server/plugins/teams.js +19 -0
- package/dist/runtime/server/policies.d.ts +2 -0
- package/dist/runtime/server/policies.js +41 -0
- package/dist/runtime/server/reminder-email.d.ts +67 -0
- package/dist/runtime/server/reminder-email.js +109 -0
- package/dist/runtime/server/routes/admin/assignment.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/assignment.delete.js +10 -0
- package/dist/runtime/server/routes/admin/assignments.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/assignments.post.js +11 -0
- package/dist/runtime/server/routes/admin/broadcasts.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/broadcasts.get.js +8 -0
- package/dist/runtime/server/routes/admin/broadcasts.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/broadcasts.post.js +9 -0
- package/dist/runtime/server/routes/admin/candidates.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/candidates.get.js +10 -0
- package/dist/runtime/server/routes/admin/operation-teams.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/operation-teams.get.js +9 -0
- package/dist/runtime/server/routes/admin/perk.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perk.delete.js +10 -0
- package/dist/runtime/server/routes/admin/perk.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perk.patch.js +10 -0
- package/dist/runtime/server/routes/admin/perks.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perks.get.js +9 -0
- package/dist/runtime/server/routes/admin/perks.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perks.post.js +10 -0
- package/dist/runtime/server/routes/admin/role.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/role.delete.js +11 -0
- package/dist/runtime/server/routes/admin/role.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/role.patch.js +11 -0
- package/dist/runtime/server/routes/admin/roles.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/roles.get.js +9 -0
- package/dist/runtime/server/routes/admin/roles.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/roles.post.js +10 -0
- package/dist/runtime/server/routes/admin/schedule-copy.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule-copy.post.js +12 -0
- package/dist/runtime/server/routes/admin/schedule-publish.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule-publish.post.js +9 -0
- package/dist/runtime/server/routes/admin/schedule.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.delete.js +10 -0
- package/dist/runtime/server/routes/admin/schedule.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.get.js +9 -0
- package/dist/runtime/server/routes/admin/schedule.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.patch.js +10 -0
- package/dist/runtime/server/routes/admin/schedules.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedules.get.js +10 -0
- package/dist/runtime/server/routes/admin/schedules.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedules.post.js +9 -0
- package/dist/runtime/server/routes/admin/shift.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shift.delete.js +10 -0
- package/dist/runtime/server/routes/admin/shift.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shift.patch.js +10 -0
- package/dist/runtime/server/routes/admin/shifts-bulk.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shifts-bulk.post.js +10 -0
- package/dist/runtime/server/routes/admin/shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shifts.get.js +10 -0
- package/dist/runtime/server/routes/admin/station.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/station.delete.js +11 -0
- package/dist/runtime/server/routes/admin/station.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/station.patch.js +11 -0
- package/dist/runtime/server/routes/admin/stations.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/stations.get.js +9 -0
- package/dist/runtime/server/routes/admin/stations.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/stations.post.js +10 -0
- package/dist/runtime/server/routes/admin/swap-cancel.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/swap-cancel.post.js +10 -0
- package/dist/runtime/server/routes/admin/swaps.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/swaps.get.js +10 -0
- package/dist/runtime/server/routes/feed/feed.get.d.ts +2 -0
- package/dist/runtime/server/routes/feed/feed.get.js +9 -0
- package/dist/runtime/server/routes/lead/attended.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/attended.post.js +11 -0
- package/dist/runtime/server/routes/lead/broadcast.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/broadcast.post.js +12 -0
- package/dist/runtime/server/routes/lead/check-in.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/check-in.post.js +9 -0
- package/dist/runtime/server/routes/lead/exceptions.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/exceptions.get.js +8 -0
- package/dist/runtime/server/routes/lead/no-show.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/no-show.post.js +11 -0
- package/dist/runtime/server/routes/lead/now.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/now.get.js +9 -0
- package/dist/runtime/server/routes/lead/on-duty.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/on-duty.get.js +10 -0
- package/dist/runtime/server/routes/lead/stations.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/stations.get.js +8 -0
- package/dist/runtime/server/routes/lead/team-shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/team-shifts.get.js +9 -0
- package/dist/runtime/server/routes/lead/team-swaps.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/team-swaps.get.js +9 -0
- package/dist/runtime/server/routes/me/check-in.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/check-in.post.js +11 -0
- package/dist/runtime/server/routes/me/earned-perk-claim.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/earned-perk-claim.post.js +10 -0
- package/dist/runtime/server/routes/me/earned-perks.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/earned-perks.get.js +9 -0
- package/dist/runtime/server/routes/me/feed-token.delete.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.delete.js +7 -0
- package/dist/runtime/server/routes/me/feed-token.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.get.js +6 -0
- package/dist/runtime/server/routes/me/feed-token.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.post.js +7 -0
- package/dist/runtime/server/routes/me/leads.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/leads.get.js +5 -0
- package/dist/runtime/server/routes/me/now.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/now.get.js +5 -0
- package/dist/runtime/server/routes/me/pass.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/pass.get.js +11 -0
- package/dist/runtime/server/routes/me/settle.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/settle.post.js +14 -0
- package/dist/runtime/server/routes/me/shift.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/shift.get.js +10 -0
- package/dist/runtime/server/routes/me/shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/shifts.get.js +6 -0
- package/dist/runtime/server/routes/me/swap.delete.d.ts +2 -0
- package/dist/runtime/server/routes/me/swap.delete.js +11 -0
- package/dist/runtime/server/routes/me/swap.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/swap.post.js +11 -0
- package/dist/runtime/server/routes/stations/token.get.d.ts +2 -0
- package/dist/runtime/server/routes/stations/token.get.js +12 -0
- package/dist/runtime/server/routes/swaps/approve.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/approve.post.js +9 -0
- package/dist/runtime/server/routes/swaps/list.get.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/list.get.js +5 -0
- package/dist/runtime/server/routes/swaps/offer-accept.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer-accept.post.js +9 -0
- package/dist/runtime/server/routes/swaps/offer-reject.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer-reject.post.js +9 -0
- package/dist/runtime/server/routes/swaps/offer.delete.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer.delete.js +11 -0
- package/dist/runtime/server/routes/swaps/offer.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer.post.js +11 -0
- package/dist/runtime/server/routes/swaps/reject.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/reject.post.js +9 -0
- package/dist/runtime/server/swap-email.d.ts +28 -0
- package/dist/runtime/server/swap-email.js +49 -0
- package/dist/runtime/server/tasks/close-shifts.d.ts +2 -0
- package/dist/runtime/server/tasks/close-shifts.js +9 -0
- package/dist/runtime/server/tasks/send-reminders.d.ts +2 -0
- package/dist/runtime/server/tasks/send-reminders.js +9 -0
- package/dist/runtime/server/utils/shifts-admin.d.ts +67 -0
- package/dist/runtime/server/utils/shifts-admin.js +312 -0
- package/dist/runtime/server/utils/shifts-assign.d.ts +89 -0
- package/dist/runtime/server/utils/shifts-assign.js +264 -0
- package/dist/runtime/server/utils/shifts-automation.d.ts +37 -0
- package/dist/runtime/server/utils/shifts-automation.js +171 -0
- package/dist/runtime/server/utils/shifts-broadcasts.d.ts +38 -0
- package/dist/runtime/server/utils/shifts-broadcasts.js +113 -0
- package/dist/runtime/server/utils/shifts-core.d.ts +78 -0
- package/dist/runtime/server/utils/shifts-core.js +142 -0
- package/dist/runtime/server/utils/shifts-dto.d.ts +32 -0
- package/dist/runtime/server/utils/shifts-dto.js +127 -0
- package/dist/runtime/server/utils/shifts-emails.d.ts +16 -0
- package/dist/runtime/server/utils/shifts-emails.js +44 -0
- package/dist/runtime/server/utils/shifts-exceptions.d.ts +7 -0
- package/dist/runtime/server/utils/shifts-exceptions.js +32 -0
- package/dist/runtime/server/utils/shifts-feed.d.ts +16 -0
- package/dist/runtime/server/utils/shifts-feed.js +73 -0
- package/dist/runtime/server/utils/shifts-notify.d.ts +40 -0
- package/dist/runtime/server/utils/shifts-notify.js +22 -0
- package/dist/runtime/server/utils/shifts-on-duty.d.ts +12 -0
- package/dist/runtime/server/utils/shifts-on-duty.js +37 -0
- package/dist/runtime/server/utils/shifts-perks.d.ts +46 -0
- package/dist/runtime/server/utils/shifts-perks.js +183 -0
- package/dist/runtime/server/utils/shifts-reminders.d.ts +30 -0
- package/dist/runtime/server/utils/shifts-reminders.js +102 -0
- package/dist/runtime/server/utils/shifts-schemas.d.ts +318 -0
- package/dist/runtime/server/utils/shifts-schemas.js +177 -0
- package/dist/runtime/server/utils/shifts-station-key.d.ts +7 -0
- package/dist/runtime/server/utils/shifts-station-key.js +22 -0
- package/dist/runtime/server/utils/shifts-stations.d.ts +28 -0
- package/dist/runtime/server/utils/shifts-stations.js +109 -0
- package/dist/runtime/server/utils/shifts-swaps.d.ts +114 -0
- package/dist/runtime/server/utils/shifts-swaps.js +559 -0
- package/dist/runtime/server/utils/shifts-views.d.ts +62 -0
- package/dist/runtime/server/utils/shifts-views.js +212 -0
- package/dist/runtime/utils/api.d.ts +108 -0
- package/dist/runtime/utils/api.js +111 -0
- package/dist/runtime/utils/checkin.d.ts +59 -0
- package/dist/runtime/utils/checkin.js +57 -0
- package/dist/runtime/utils/guards.d.ts +21 -0
- package/dist/runtime/utils/guards.js +36 -0
- package/dist/runtime/utils/ics.d.ts +32 -0
- package/dist/runtime/utils/ics.js +56 -0
- package/dist/runtime/utils/index.d.ts +16 -0
- package/dist/runtime/utils/index.js +15 -0
- package/dist/runtime/utils/links.d.ts +30 -0
- package/dist/runtime/utils/links.js +18 -0
- package/dist/runtime/utils/reminders.d.ts +27 -0
- package/dist/runtime/utils/reminders.js +28 -0
- package/dist/runtime/utils/settings.d.ts +28 -0
- package/dist/runtime/utils/settings.js +18 -0
- package/dist/runtime/utils/station-key.d.ts +9 -0
- package/dist/runtime/utils/station-key.js +12 -0
- package/dist/runtime/utils/status.d.ts +23 -0
- package/dist/runtime/utils/status.js +46 -0
- package/dist/runtime/utils/time.d.ts +22 -0
- package/dist/runtime/utils/time.js +14 -0
- package/dist/types.d.mts +5 -0
- package/package.json +131 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
import type { ShiftPerkDto } from '../../../types.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
operationId: string;
|
|
5
|
+
teams: ShiftsTeamOption[];
|
|
6
|
+
perk?: ShiftPerkDto;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
close: (saved: false | ShiftPerkDto) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onClose?: ((saved: false | ShiftPerkDto) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
operationId: string;
|
|
4
|
+
teams: ShiftsTeamOption[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shiftsApi } from "../../utils/api";
|
|
3
|
+
import { computed, h, resolveComponent, tableUi, useFetch, useModuleT, useShiftsActions, useShiftsTranslate } from "#imports";
|
|
4
|
+
defineOptions({ name: "ShiftPerksCard" });
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
operationId: { type: String, required: true },
|
|
7
|
+
teams: { type: Array, required: true }
|
|
8
|
+
});
|
|
9
|
+
const t = useModuleT("shifts");
|
|
10
|
+
const tr = useShiftsTranslate();
|
|
11
|
+
const actions = useShiftsActions();
|
|
12
|
+
const { data: perks, status, refresh } = await useFetch(() => shiftsApi.admin.perks(props.operationId), {
|
|
13
|
+
key: computed(() => `shifts:perks:${props.operationId}`),
|
|
14
|
+
default: () => []
|
|
15
|
+
});
|
|
16
|
+
async function add() {
|
|
17
|
+
if (await actions.createPerk(props.operationId, props.teams)) await refresh();
|
|
18
|
+
}
|
|
19
|
+
const RowMenu = resolveComponent("RowMenu");
|
|
20
|
+
const teamName = (id) => {
|
|
21
|
+
const team = id ? props.teams.find((item) => item.id === id) : void 0;
|
|
22
|
+
return team ? tr(team.name) : t("admin.allTeams", "All teams");
|
|
23
|
+
};
|
|
24
|
+
const columns = computed(() => [
|
|
25
|
+
{ accessorKey: "name", header: t("admin.name", "Name"), cell: ({ row }) => h("span", { class: "text-highlighted font-medium" }, tr(row.original.name)) },
|
|
26
|
+
{ accessorKey: "voucherType", header: t("perks.voucherType", "Voucher type"), cell: ({ row }) => row.original.voucherType },
|
|
27
|
+
{ accessorKey: "teamId", header: t("admin.team", "Team"), cell: ({ row }) => teamName(row.original.teamId) },
|
|
28
|
+
{ accessorKey: "quantity", header: t("perks.quantity", "Per shift"), cell: ({ row }) => String(row.original.quantity) },
|
|
29
|
+
{ accessorKey: "earned", header: t("perks.earned", "Earned"), cell: ({ row }) => String(row.original.earned ?? 0) },
|
|
30
|
+
{
|
|
31
|
+
id: "actions",
|
|
32
|
+
meta: { class: { th: "w-0", td: "w-0" } },
|
|
33
|
+
cell: ({ row }) => h(RowMenu, { items: actions.perkMenu(row.original, { teams: props.teams, changed: refresh }), subject: tr(row.original.name) })
|
|
34
|
+
}
|
|
35
|
+
]);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<TableCard
|
|
40
|
+
:title="t('perks.title', 'Perks')"
|
|
41
|
+
:description="t('perks.cardDescription', 'What volunteers earn for every shift they attend, given at the end of the shift. The vouchers app hands it out.')"
|
|
42
|
+
:loading="status === 'pending' && !perks.length"
|
|
43
|
+
>
|
|
44
|
+
<template #actions>
|
|
45
|
+
<UButton
|
|
46
|
+
icon="i-lucide-plus"
|
|
47
|
+
:label="t('perks.create', 'Add perk')"
|
|
48
|
+
@click="add"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
<UTable
|
|
52
|
+
:data="perks"
|
|
53
|
+
:columns="columns"
|
|
54
|
+
:ui="tableUi()"
|
|
55
|
+
>
|
|
56
|
+
<template #empty>
|
|
57
|
+
<UEmpty
|
|
58
|
+
icon="i-lucide-utensils"
|
|
59
|
+
:title="t('perks.empty', 'No perks yet')"
|
|
60
|
+
:description="t('perks.emptyDescription', 'Add a perk, for example two beers per shift.')"
|
|
61
|
+
:actions="[{ label: t('perks.create', 'Add perk'), icon: 'i-lucide-plus', onClick: add }]"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
</UTable>
|
|
65
|
+
</TableCard>
|
|
66
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
operationId: string;
|
|
4
|
+
teams: ShiftsTeamOption[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
paused?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
detect: (code: string) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onDetect?: ((code: string) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { defineAsyncComponent, ref, useModuleT } from "#imports";
|
|
3
|
+
defineOptions({ name: "ShiftQrScanner" });
|
|
4
|
+
defineProps({
|
|
5
|
+
paused: { type: Boolean, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["detect"]);
|
|
8
|
+
const t = useModuleT("shifts");
|
|
9
|
+
const QrcodeStream = defineAsyncComponent(() => import("vue-qrcode-reader").then((module) => module.QrcodeStream));
|
|
10
|
+
const failure = ref(null);
|
|
11
|
+
function onDetect(codes) {
|
|
12
|
+
const code = codes[0]?.rawValue?.trim();
|
|
13
|
+
if (code) emit("detect", code);
|
|
14
|
+
}
|
|
15
|
+
function onError(error) {
|
|
16
|
+
failure.value = error.name === "NotAllowedError" ? t("scanner.noPermission", "The camera is not allowed. Allow it in the browser, or type the code.") : error.name === "NotFoundError" || error.name === "OverconstrainedError" ? t("scanner.noCamera", "No camera found. Type the code instead.") : t("scanner.cameraFailed", "The camera could not start. Type the code instead.");
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<ClientOnly>
|
|
22
|
+
<UAlert
|
|
23
|
+
v-if="failure"
|
|
24
|
+
color="warning"
|
|
25
|
+
variant="subtle"
|
|
26
|
+
icon="i-lucide-camera-off"
|
|
27
|
+
:title="failure"
|
|
28
|
+
/>
|
|
29
|
+
<div
|
|
30
|
+
v-else
|
|
31
|
+
class="border-default aspect-square w-full overflow-hidden rounded-lg border"
|
|
32
|
+
>
|
|
33
|
+
<QrcodeStream
|
|
34
|
+
:paused="paused"
|
|
35
|
+
:formats="['qr_code']"
|
|
36
|
+
@detect="onDetect"
|
|
37
|
+
@error="onError"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
<template #fallback>
|
|
41
|
+
<USkeleton class="aspect-square w-full" />
|
|
42
|
+
</template>
|
|
43
|
+
</ClientOnly>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
paused?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
detect: (code: string) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onDetect?: ((code: string) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
import type { ShiftRoleDto } from '../../../types.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
scheduleId: string;
|
|
5
|
+
teams: ShiftsTeamOption[];
|
|
6
|
+
ladders: ShiftsLadder[];
|
|
7
|
+
role?: ShiftRoleDto;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
close: (saved: false | ShiftRoleDto) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClose?: ((saved: false | ShiftRoleDto) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { shiftsRoleOptions } from "../utils/admin-shifts";
|
|
4
|
+
import { shiftsApi } from "../../utils/api";
|
|
5
|
+
import { $fetch, computed, reactive, useAction, useModuleT, useShiftsTranslate } from "#imports";
|
|
6
|
+
defineOptions({ name: "ShiftRoleSlideover" });
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
scheduleId: { type: String, required: true },
|
|
9
|
+
teams: { type: Array, required: true },
|
|
10
|
+
ladders: { type: Array, required: true },
|
|
11
|
+
role: { type: Object, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["close"]);
|
|
14
|
+
const t = useModuleT("shifts");
|
|
15
|
+
const tr = useShiftsTranslate();
|
|
16
|
+
const { busy, run } = useAction();
|
|
17
|
+
const ANY = "__any__";
|
|
18
|
+
const schema = z.object({
|
|
19
|
+
name: z.custom((value) => !!value && (typeof value === "string" ? !!value.trim() : Object.values(value).some((text) => text?.trim())), t("admin.roleNameRequired", "Give the role a name.")),
|
|
20
|
+
teamId: z.string().min(1, t("admin.teamRequired", "Choose a team.")),
|
|
21
|
+
teamRole: z.string()
|
|
22
|
+
});
|
|
23
|
+
const state = reactive({ name: props.role?.name ?? "", teamId: props.role?.teamId ?? props.teams[0]?.id ?? "", teamRole: props.role?.teamRole ?? ANY });
|
|
24
|
+
const teamOptions = computed(() => props.teams.map((team) => ({ label: tr(team.name), value: team.id })));
|
|
25
|
+
const kind = computed(() => props.teams.find((team) => team.id === state.teamId)?.kind);
|
|
26
|
+
const roleOptions = computed(() => [{ label: t("admin.anyRole", "Anybody on the team"), value: ANY }, ...shiftsRoleOptions(props.ladders, kind.value, tr)]);
|
|
27
|
+
async function save(event) {
|
|
28
|
+
const teamRole = event.data.teamRole === ANY ? null : event.data.teamRole;
|
|
29
|
+
const saved = await run(
|
|
30
|
+
() => props.role ? $fetch(shiftsApi.admin.role(props.role.id), { method: "PATCH", body: { name: event.data.name, teamRole } }) : $fetch(shiftsApi.admin.roles(props.scheduleId), { method: "POST", body: { name: event.data.name, teamId: event.data.teamId, teamRole } }),
|
|
31
|
+
{ success: t("admin.roleSaved", "Saved {name}", { name: tr(event.data.name) }) }
|
|
32
|
+
);
|
|
33
|
+
if (saved) emit("close", saved);
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<FormSlideover
|
|
39
|
+
form-id="shift-role-form"
|
|
40
|
+
:title="role ? t('admin.editRole', 'Edit shift role') : t('admin.newRole', 'New shift role')"
|
|
41
|
+
:description="t('admin.roleDescription', 'A role people hold on a shift, such as team lead or bartender, with the lowest team role that may hold it.')"
|
|
42
|
+
:submit-label="role ? t('admin.saveRole', 'Save shift role') : t('admin.createRole', 'Add shift role')"
|
|
43
|
+
:loading="busy"
|
|
44
|
+
@close="emit('close', false)"
|
|
45
|
+
>
|
|
46
|
+
<UForm
|
|
47
|
+
id="shift-role-form"
|
|
48
|
+
:schema="schema"
|
|
49
|
+
:state="state"
|
|
50
|
+
class="flex flex-col gap-4"
|
|
51
|
+
@submit="save"
|
|
52
|
+
>
|
|
53
|
+
<UFormField
|
|
54
|
+
name="name"
|
|
55
|
+
:label="t('admin.name', 'Name')"
|
|
56
|
+
required
|
|
57
|
+
>
|
|
58
|
+
<TranslatedInput
|
|
59
|
+
v-model="state.name"
|
|
60
|
+
class="w-full"
|
|
61
|
+
/>
|
|
62
|
+
</UFormField>
|
|
63
|
+
<UFormField
|
|
64
|
+
name="teamId"
|
|
65
|
+
:label="t('admin.team', 'Team')"
|
|
66
|
+
required
|
|
67
|
+
>
|
|
68
|
+
<USelect
|
|
69
|
+
v-model="state.teamId"
|
|
70
|
+
:items="teamOptions"
|
|
71
|
+
:disabled="!!role"
|
|
72
|
+
class="w-full"
|
|
73
|
+
/>
|
|
74
|
+
</UFormField>
|
|
75
|
+
<UFormField
|
|
76
|
+
name="teamRole"
|
|
77
|
+
:label="t('admin.teamRole', 'Lowest team role')"
|
|
78
|
+
:description="t('admin.teamRoleHelp', 'People below it on the team\'s ladder cannot hold this role.')"
|
|
79
|
+
>
|
|
80
|
+
<USelect
|
|
81
|
+
v-model="state.teamRole"
|
|
82
|
+
:items="roleOptions"
|
|
83
|
+
class="w-full"
|
|
84
|
+
/>
|
|
85
|
+
</UFormField>
|
|
86
|
+
</UForm>
|
|
87
|
+
</FormSlideover>
|
|
88
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
import type { ShiftRoleDto } from '../../../types.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
scheduleId: string;
|
|
5
|
+
teams: ShiftsTeamOption[];
|
|
6
|
+
ladders: ShiftsLadder[];
|
|
7
|
+
role?: ShiftRoleDto;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
close: (saved: false | ShiftRoleDto) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClose?: ((saved: false | ShiftRoleDto) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ShiftScheduleSettings } from '../../../types.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: ShiftScheduleSettings;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: ShiftScheduleSettings) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: ShiftScheduleSettings) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useModuleT, watch } from "#imports";
|
|
3
|
+
defineOptions({ name: "ShiftScheduleSettingsFields" });
|
|
4
|
+
const settings = defineModel({ type: Object, ...{ required: true } });
|
|
5
|
+
const t = useModuleT("shifts");
|
|
6
|
+
watch(() => settings.value.coverage, (coverage) => {
|
|
7
|
+
if (coverage === "all" && settings.value.handover !== "trade") settings.value = { ...settings.value, handover: "trade" };
|
|
8
|
+
});
|
|
9
|
+
const coverages = computed(() => [
|
|
10
|
+
{ label: t("admin.coverages.flexible", "Flexible"), value: "flexible", description: t("admin.coverages.flexibleHelp", "Volunteers may give shifts away and take others over.") },
|
|
11
|
+
{ label: t("admin.coverages.all", "Every shift"), value: "all", description: t("admin.coverages.allHelp", "Volunteers must work every shift they hold. They can only trade one shift for another.") }
|
|
12
|
+
]);
|
|
13
|
+
const handovers = computed(() => [
|
|
14
|
+
{ label: t("admin.handovers.trade", "Trade"), value: "trade", description: t("admin.handovers.tradeHelp", "Shift for shift: both change hands together, so nobody works fewer shifts.") },
|
|
15
|
+
{ label: t("admin.handovers.release", "Give away"), value: "release", description: t("admin.handovers.releaseHelp", "A volunteer gives a shift away and somebody else takes it over."), disabled: settings.value.coverage === "all" },
|
|
16
|
+
{ label: t("admin.handovers.both", "Both"), value: "both", description: t("admin.handovers.bothHelp", "Volunteers choose: trade a shift, or give it away."), disabled: settings.value.coverage === "all" }
|
|
17
|
+
]);
|
|
18
|
+
const approvals = computed(() => [
|
|
19
|
+
{ label: t("admin.approvals.peer", "Between volunteers"), value: "peer", description: t("admin.approvals.peerHelp", "A swap is done as soon as the owner accepts an offer.") },
|
|
20
|
+
{ label: t("admin.approvals.lead", "A lead approves"), value: "lead", description: t("admin.approvals.leadHelp", "A lead of the team or staff approves each swap the owner accepted.") }
|
|
21
|
+
]);
|
|
22
|
+
const update = (key, value) => {
|
|
23
|
+
settings.value = { ...settings.value, [key]: value };
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<FormRow
|
|
29
|
+
name="coverage"
|
|
30
|
+
:label="t('admin.coverage', 'Coverage')"
|
|
31
|
+
:description="t('admin.coverageHelp', 'Whether volunteers must work every shift they are given.')"
|
|
32
|
+
>
|
|
33
|
+
<URadioGroup
|
|
34
|
+
:model-value="settings.coverage"
|
|
35
|
+
:items="coverages"
|
|
36
|
+
@update:model-value="update('coverage', $event)"
|
|
37
|
+
/>
|
|
38
|
+
</FormRow>
|
|
39
|
+
<FormRow
|
|
40
|
+
name="handover"
|
|
41
|
+
:label="t('admin.handover', 'Handover')"
|
|
42
|
+
:description="settings.coverage === 'all' ? t('admin.handoverAllHelp', 'With every shift covered, volunteers can only trade.') : t('admin.handoverHelp', 'How a shift changes hands between volunteers.')"
|
|
43
|
+
>
|
|
44
|
+
<URadioGroup
|
|
45
|
+
:model-value="settings.handover"
|
|
46
|
+
:items="handovers"
|
|
47
|
+
@update:model-value="update('handover', $event)"
|
|
48
|
+
/>
|
|
49
|
+
</FormRow>
|
|
50
|
+
<FormRow
|
|
51
|
+
name="approval"
|
|
52
|
+
:label="t('admin.approval', 'Approval')"
|
|
53
|
+
:description="t('admin.approvalHelp', 'Whether a swap the two volunteers agree on needs a lead too.')"
|
|
54
|
+
>
|
|
55
|
+
<URadioGroup
|
|
56
|
+
:model-value="settings.approval"
|
|
57
|
+
:items="approvals"
|
|
58
|
+
@update:model-value="update('approval', $event)"
|
|
59
|
+
/>
|
|
60
|
+
</FormRow>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ShiftScheduleSettings } from '../../../types.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: ShiftScheduleSettings;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: ShiftScheduleSettings) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: ShiftScheduleSettings) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ShiftScheduleDto } from '../../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
operationId: string;
|
|
4
|
+
schedule?: ShiftScheduleDto;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
close: (saved: false | ShiftScheduleDto) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onClose?: ((saved: false | ShiftScheduleDto) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { shiftsApi } from "../../utils/api";
|
|
4
|
+
import { DEFAULT_SCHEDULE_SETTINGS, SHIFT_APPROVALS, SHIFT_COVERAGES, SHIFT_HANDOVERS, validScheduleSettings } from "../../utils/settings";
|
|
5
|
+
import { $fetch, computed, reactive, useAction, useModuleT, useShiftsTranslate } from "#imports";
|
|
6
|
+
defineOptions({ name: "ShiftScheduleSlideover" });
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
operationId: { type: String, required: true },
|
|
9
|
+
schedule: { type: Object, required: false }
|
|
10
|
+
});
|
|
11
|
+
const emit = defineEmits(["close"]);
|
|
12
|
+
const t = useModuleT("shifts");
|
|
13
|
+
const tr = useShiftsTranslate();
|
|
14
|
+
const { busy, run } = useAction();
|
|
15
|
+
const optionalCount = z.number().int().min(0).nullable();
|
|
16
|
+
const schema = z.object({
|
|
17
|
+
name: z.custom((value) => !!value && (typeof value === "string" ? !!value.trim() : Object.values(value).some((text) => text?.trim())), t("admin.nameRequired", "Give the schedule a name.")),
|
|
18
|
+
coverage: z.enum(SHIFT_COVERAGES),
|
|
19
|
+
handover: z.enum(SHIFT_HANDOVERS),
|
|
20
|
+
approval: z.enum(SHIFT_APPROVALS),
|
|
21
|
+
minPerShift: optionalCount,
|
|
22
|
+
maxPerShift: optionalCount,
|
|
23
|
+
maxShiftsPerDay: z.number().int().min(1).max(24).nullable(),
|
|
24
|
+
minRestHours: z.number().min(0).max(72).nullable()
|
|
25
|
+
}).refine(validScheduleSettings, { message: t("admin.handoverAllHelp", "With every shift covered, volunteers can only trade."), path: ["handover"] });
|
|
26
|
+
const state = reactive({
|
|
27
|
+
name: props.schedule?.name ?? "",
|
|
28
|
+
coverage: props.schedule?.coverage ?? DEFAULT_SCHEDULE_SETTINGS.coverage,
|
|
29
|
+
handover: props.schedule?.handover ?? DEFAULT_SCHEDULE_SETTINGS.handover,
|
|
30
|
+
approval: props.schedule?.approval ?? DEFAULT_SCHEDULE_SETTINGS.approval,
|
|
31
|
+
minPerShift: props.schedule?.minPerShift ?? null,
|
|
32
|
+
maxPerShift: props.schedule?.maxPerShift ?? null,
|
|
33
|
+
maxShiftsPerDay: props.schedule?.guards.maxShiftsPerDay ?? null,
|
|
34
|
+
minRestHours: props.schedule?.guards.minRestHours ?? null
|
|
35
|
+
});
|
|
36
|
+
const settings = computed({
|
|
37
|
+
get: () => ({ coverage: state.coverage, handover: state.handover, approval: state.approval }),
|
|
38
|
+
set: (value) => Object.assign(state, value)
|
|
39
|
+
});
|
|
40
|
+
async function save(event) {
|
|
41
|
+
const { name, coverage, handover, approval, minPerShift, maxPerShift, maxShiftsPerDay, minRestHours } = event.data;
|
|
42
|
+
const body = { name, coverage, handover, approval, minPerShift, maxPerShift, guards: { maxShiftsPerDay, minRestHours } };
|
|
43
|
+
const saved = await run(
|
|
44
|
+
() => props.schedule ? $fetch(shiftsApi.admin.schedule(props.schedule.id), { method: "PATCH", body }) : $fetch(shiftsApi.admin.schedules, { method: "POST", body: { operationId: props.operationId, ...body } }),
|
|
45
|
+
{ success: t("admin.scheduleSaved", "Saved {name}", { name: tr(name) }) }
|
|
46
|
+
);
|
|
47
|
+
if (saved) emit("close", saved);
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<FormSlideover
|
|
53
|
+
form-id="shift-schedule-form"
|
|
54
|
+
:title="schedule ? t('admin.editSchedule', 'Edit schedule') : t('admin.newSchedule', 'New schedule')"
|
|
55
|
+
:description="t('admin.scheduleDescription', 'A schedule holds the shifts of an operation. It stays a draft until you publish it.')"
|
|
56
|
+
:submit-label="schedule ? t('admin.saveSchedule', 'Save schedule') : t('admin.createSchedule', 'Create schedule')"
|
|
57
|
+
:loading="busy"
|
|
58
|
+
@close="emit('close', false)"
|
|
59
|
+
>
|
|
60
|
+
<UForm
|
|
61
|
+
id="shift-schedule-form"
|
|
62
|
+
:schema="schema"
|
|
63
|
+
:state="state"
|
|
64
|
+
class="flex flex-col gap-4"
|
|
65
|
+
@submit="save"
|
|
66
|
+
>
|
|
67
|
+
<UFormField
|
|
68
|
+
name="name"
|
|
69
|
+
:label="t('admin.name', 'Name')"
|
|
70
|
+
required
|
|
71
|
+
>
|
|
72
|
+
<TranslatedInput
|
|
73
|
+
v-model="state.name"
|
|
74
|
+
class="w-full"
|
|
75
|
+
/>
|
|
76
|
+
</UFormField>
|
|
77
|
+
<div class="divide-default border-default divide-y border-y py-4">
|
|
78
|
+
<ShiftScheduleSettingsFields v-model="settings" />
|
|
79
|
+
</div>
|
|
80
|
+
<div class="grid grid-cols-2 gap-4">
|
|
81
|
+
<UFormField
|
|
82
|
+
name="minPerShift"
|
|
83
|
+
:label="t('admin.minPerShift', 'Minimum per shift')"
|
|
84
|
+
:description="t('admin.minPerShiftHelp', 'Fewer shows the shift as short.')"
|
|
85
|
+
>
|
|
86
|
+
<UInputNumber
|
|
87
|
+
v-model="state.minPerShift"
|
|
88
|
+
:min="0"
|
|
89
|
+
class="w-full"
|
|
90
|
+
/>
|
|
91
|
+
</UFormField>
|
|
92
|
+
<UFormField
|
|
93
|
+
name="maxPerShift"
|
|
94
|
+
:label="t('admin.maxPerShift', 'Maximum per shift')"
|
|
95
|
+
:description="t('admin.maxPerShiftHelp', 'Used when a shift sets no capacity. Empty is no limit.')"
|
|
96
|
+
>
|
|
97
|
+
<UInputNumber
|
|
98
|
+
v-model="state.maxPerShift"
|
|
99
|
+
:min="0"
|
|
100
|
+
class="w-full"
|
|
101
|
+
/>
|
|
102
|
+
</UFormField>
|
|
103
|
+
<UFormField
|
|
104
|
+
name="maxShiftsPerDay"
|
|
105
|
+
:label="t('admin.maxShiftsPerDay', 'Shifts per person per day')"
|
|
106
|
+
:description="t('admin.maxShiftsPerDayHelp', 'More shows a warning; volunteers cannot swap past it.')"
|
|
107
|
+
>
|
|
108
|
+
<UInputNumber
|
|
109
|
+
v-model="state.maxShiftsPerDay"
|
|
110
|
+
:min="1"
|
|
111
|
+
class="w-full"
|
|
112
|
+
/>
|
|
113
|
+
</UFormField>
|
|
114
|
+
<UFormField
|
|
115
|
+
name="minRestHours"
|
|
116
|
+
:label="t('admin.minRestHours', 'Rest between shifts (hours)')"
|
|
117
|
+
:description="t('admin.minRestHoursHelp', 'Less shows a warning; volunteers cannot swap past it.')"
|
|
118
|
+
>
|
|
119
|
+
<UInputNumber
|
|
120
|
+
v-model="state.minRestHours"
|
|
121
|
+
:min="0"
|
|
122
|
+
:step="0.5"
|
|
123
|
+
class="w-full"
|
|
124
|
+
/>
|
|
125
|
+
</UFormField>
|
|
126
|
+
</div>
|
|
127
|
+
</UForm>
|
|
128
|
+
</FormSlideover>
|
|
129
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ShiftScheduleDto } from '../../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
operationId: string;
|
|
4
|
+
schedule?: ShiftScheduleDto;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
close: (saved: false | ShiftScheduleDto) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onClose?: ((saved: false | ShiftScheduleDto) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ShiftRoleDto, ShiftWithAssigneesDto } from '../../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
shift: ShiftWithAssigneesDto;
|
|
4
|
+
roles: ShiftRoleDto[];
|
|
5
|
+
minPerShift?: number | null;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
close: (changed: boolean) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onClose?: ((changed: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|