@frigear-nu/shifts 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -2
- package/dist/module.d.mts +716 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +272 -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 +21 -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 +32 -0
- package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
- package/dist/runtime/app/tabs/HomeShifts.d.vue.ts +6 -0
- package/dist/runtime/app/tabs/HomeShifts.vue +194 -0
- package/dist/runtime/app/tabs/HomeShifts.vue.d.ts +6 -0
- package/dist/runtime/app/tabs/HomeSwaps.d.vue.ts +3 -0
- package/dist/runtime/app/tabs/HomeSwaps.vue +188 -0
- package/dist/runtime/app/tabs/HomeSwaps.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 +627 -0
- package/dist/runtime/i18n/lang/en.json +627 -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 +44 -0
- package/dist/runtime/utils/links.js +21 -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,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import HomeSwaps from "../tabs/HomeSwaps.vue";
|
|
3
|
+
import { useHead, useModuleT, useShiftsLinks } from "#imports";
|
|
4
|
+
defineOptions({ name: "ShiftsSwapsPage" });
|
|
5
|
+
const t = useModuleT("shifts");
|
|
6
|
+
const links = useShiftsLinks();
|
|
7
|
+
useHead({ title: () => t("swaps.title", "Open swaps") });
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<UContainer>
|
|
12
|
+
<UPage>
|
|
13
|
+
<UPageHeader
|
|
14
|
+
:title="t('swaps.title', 'Open swaps')"
|
|
15
|
+
:description="t('swaps.description', 'Shifts others want to trade or give away that you can take. A trade asks for one of your own shifts in return.')"
|
|
16
|
+
>
|
|
17
|
+
<template #links>
|
|
18
|
+
<UButton
|
|
19
|
+
:to="links.shifts()"
|
|
20
|
+
icon="i-lucide-arrow-left"
|
|
21
|
+
color="neutral"
|
|
22
|
+
variant="ghost"
|
|
23
|
+
:label="t('shift.back', 'My shifts')"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
</UPageHeader>
|
|
27
|
+
<UPageBody class="max-w-3xl">
|
|
28
|
+
<HomeSwaps />
|
|
29
|
+
</UPageBody>
|
|
30
|
+
</UPage>
|
|
31
|
+
</UContainer>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
standalone?: boolean;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shiftsApi } from "../../utils/api";
|
|
3
|
+
import { SHIFT_ASSIGNMENT_STATUS_LABELS, SHIFT_SWAP_STATUS_LABELS } from "../../utils/status";
|
|
4
|
+
import { dayKey } from "@frigear-nu/module-kit/time";
|
|
5
|
+
import { computed, errorMessage, navigateTo, ref, shallowRef, useAuthPages, useLazyFetch, useModuleT, useRoute, useShiftsActions, useShiftsFormat, useShiftsLinks, useShiftsTranslate, watch } from "#imports";
|
|
6
|
+
defineOptions({ name: "ShiftsHomeShiftsTab" });
|
|
7
|
+
defineProps({
|
|
8
|
+
standalone: { type: Boolean, required: false }
|
|
9
|
+
});
|
|
10
|
+
const t = useModuleT("shifts");
|
|
11
|
+
const tr = useShiftsTranslate();
|
|
12
|
+
const format = useShiftsFormat();
|
|
13
|
+
const links = useShiftsLinks();
|
|
14
|
+
const actions = useShiftsActions();
|
|
15
|
+
const route = useRoute();
|
|
16
|
+
const { data, status, error, refresh } = useLazyFetch(shiftsApi.me.shifts, { key: "shifts:me", default: () => [] });
|
|
17
|
+
const { data: led } = useLazyFetch(shiftsApi.me.leads, { key: "shifts:leads", default: () => [] });
|
|
18
|
+
const loading = computed(() => status.value === "pending" && !data.value.length);
|
|
19
|
+
watch(() => error.value?.statusCode, async (code) => {
|
|
20
|
+
if (code === 401) await navigateTo({ path: useAuthPages().login, query: { redirect: route.fullPath } });
|
|
21
|
+
}, { immediate: true });
|
|
22
|
+
const today = dayKey(/* @__PURE__ */ new Date(), format.timeZone);
|
|
23
|
+
const showPast = ref(false);
|
|
24
|
+
const picked = shallowRef();
|
|
25
|
+
const keyOf = (value) => `${value.year}-${String(value.month).padStart(2, "0")}-${String(value.day).padStart(2, "0")}`;
|
|
26
|
+
const workDays = computed(() => new Set(data.value.map((item) => dayKey(item.shift.startsAt, format.timeZone))));
|
|
27
|
+
const groups = computed(() => {
|
|
28
|
+
const pickedKey = picked.value ? keyOf(picked.value) : null;
|
|
29
|
+
const byDay = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const item of data.value) {
|
|
31
|
+
const key = dayKey(item.shift.startsAt, format.timeZone);
|
|
32
|
+
if (pickedKey ? key !== pickedKey : !showPast.value && item.shift.endsAt < (/* @__PURE__ */ new Date()).toISOString()) continue;
|
|
33
|
+
byDay.set(key, [...byDay.get(key) ?? [], item]);
|
|
34
|
+
}
|
|
35
|
+
return [...byDay.entries()].map(([day, items]) => ({ day, items }));
|
|
36
|
+
});
|
|
37
|
+
const pastCount = computed(() => data.value.filter((item) => item.shift.endsAt < (/* @__PURE__ */ new Date()).toISOString()).length);
|
|
38
|
+
const statusLabel = (item) => item.swap ? t(`swapStatuses.${item.swap.status}`, SHIFT_SWAP_STATUS_LABELS[item.swap.status]) : t(`statuses.${item.assignment.status}`, SHIFT_ASSIGNMENT_STATUS_LABELS[item.assignment.status]);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="flex flex-col gap-4">
|
|
43
|
+
<div class="flex flex-wrap justify-end gap-2">
|
|
44
|
+
<UButton
|
|
45
|
+
v-for="team in led"
|
|
46
|
+
:key="team.teamId"
|
|
47
|
+
:to="links.lead(team.teamId)"
|
|
48
|
+
icon="i-lucide-shield-check"
|
|
49
|
+
color="neutral"
|
|
50
|
+
variant="outline"
|
|
51
|
+
:label="t('mine.lead', 'Lead {team}', { team: tr(team.teamName) })"
|
|
52
|
+
/>
|
|
53
|
+
<UButton
|
|
54
|
+
icon="i-lucide-calendar-plus"
|
|
55
|
+
color="neutral"
|
|
56
|
+
variant="outline"
|
|
57
|
+
:label="t('feed.title', 'Subscribe in calendar')"
|
|
58
|
+
@click="actions.subscribe()"
|
|
59
|
+
/>
|
|
60
|
+
<UButton
|
|
61
|
+
v-if="standalone"
|
|
62
|
+
:to="links.swaps()"
|
|
63
|
+
icon="i-lucide-arrow-left-right"
|
|
64
|
+
color="neutral"
|
|
65
|
+
variant="outline"
|
|
66
|
+
:label="t('mine.openSwaps', 'Open swaps')"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
v-if="loading"
|
|
72
|
+
class="grid gap-4 lg:grid-cols-[20rem_1fr]"
|
|
73
|
+
aria-busy="true"
|
|
74
|
+
>
|
|
75
|
+
<SectionCard loading />
|
|
76
|
+
<SectionCard loading />
|
|
77
|
+
</div>
|
|
78
|
+
<UEmpty
|
|
79
|
+
v-else-if="error && !data.length"
|
|
80
|
+
icon="i-lucide-circle-alert"
|
|
81
|
+
:title="t('mine.loadFailed', 'Your shifts could not be loaded')"
|
|
82
|
+
:description="errorMessage(error, '')"
|
|
83
|
+
:actions="[{ label: t('tryAgain', 'Try again'), icon: 'i-lucide-rotate-ccw', color: 'neutral', variant: 'outline', onClick: () => refresh() }]"
|
|
84
|
+
/>
|
|
85
|
+
<UEmpty
|
|
86
|
+
v-else-if="!data.length"
|
|
87
|
+
icon="i-lucide-calendar-clock"
|
|
88
|
+
:title="t('mine.empty', 'No shifts yet')"
|
|
89
|
+
:description="t('mine.emptyDescription', 'When a coordinator puts you on a shift, it shows up here.')"
|
|
90
|
+
:actions="[{ label: t('mine.openSwaps', 'Open swaps'), to: links.swaps(), icon: 'i-lucide-arrow-left-right', color: 'neutral', variant: 'outline' }]"
|
|
91
|
+
/>
|
|
92
|
+
<div
|
|
93
|
+
v-else
|
|
94
|
+
class="grid items-start gap-4 lg:grid-cols-[20rem_1fr]"
|
|
95
|
+
data-shifts-mine
|
|
96
|
+
>
|
|
97
|
+
<SectionCard
|
|
98
|
+
:title="t('mine.calendar', 'Calendar')"
|
|
99
|
+
icon="i-lucide-calendar"
|
|
100
|
+
>
|
|
101
|
+
<template
|
|
102
|
+
v-if="picked"
|
|
103
|
+
#actions
|
|
104
|
+
>
|
|
105
|
+
<UButton
|
|
106
|
+
color="neutral"
|
|
107
|
+
variant="ghost"
|
|
108
|
+
size="xs"
|
|
109
|
+
icon="i-lucide-x"
|
|
110
|
+
:label="t('mine.showAll', 'Show all days')"
|
|
111
|
+
@click="picked = void 0"
|
|
112
|
+
/>
|
|
113
|
+
</template>
|
|
114
|
+
<UCalendar
|
|
115
|
+
v-model="picked"
|
|
116
|
+
:week-starts-on="1"
|
|
117
|
+
class="w-full"
|
|
118
|
+
>
|
|
119
|
+
<template #day="{ day }">
|
|
120
|
+
<UChip
|
|
121
|
+
:show="workDays.has(keyOf(day))"
|
|
122
|
+
size="2xs"
|
|
123
|
+
position="bottom-right"
|
|
124
|
+
>
|
|
125
|
+
{{ day.day }}
|
|
126
|
+
</UChip>
|
|
127
|
+
</template>
|
|
128
|
+
</UCalendar>
|
|
129
|
+
</SectionCard>
|
|
130
|
+
|
|
131
|
+
<div class="flex flex-col gap-4">
|
|
132
|
+
<SectionCard v-if="!groups.length">
|
|
133
|
+
<p class="text-muted text-sm">
|
|
134
|
+
{{ picked ? t("mine.noneThatDay", "No shifts on that day.") : t("mine.noneUpcoming", "No upcoming shifts.") }}
|
|
135
|
+
</p>
|
|
136
|
+
</SectionCard>
|
|
137
|
+
<SectionCard
|
|
138
|
+
v-for="group in groups"
|
|
139
|
+
:key="group.day"
|
|
140
|
+
:title="format.day(group.day)"
|
|
141
|
+
flush
|
|
142
|
+
>
|
|
143
|
+
<template
|
|
144
|
+
v-if="group.day === today"
|
|
145
|
+
#actions
|
|
146
|
+
>
|
|
147
|
+
<UBadge
|
|
148
|
+
size="sm"
|
|
149
|
+
variant="subtle"
|
|
150
|
+
:label="t('mine.today', 'Today')"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
<ul class="divide-default divide-y">
|
|
154
|
+
<li
|
|
155
|
+
v-for="item in group.items"
|
|
156
|
+
:key="item.assignment.id"
|
|
157
|
+
>
|
|
158
|
+
<ULink
|
|
159
|
+
:to="links.shift(item.assignment.id)"
|
|
160
|
+
class="hover:bg-elevated/50 flex items-center justify-between gap-3 px-4 py-3 transition"
|
|
161
|
+
>
|
|
162
|
+
<div class="flex min-w-0 flex-col">
|
|
163
|
+
<span class="text-highlighted font-medium tabular-nums">{{ format.time(item.shift.startsAt) }}–{{ format.time(item.shift.endsAt) }}</span>
|
|
164
|
+
<span class="text-muted truncate text-sm">
|
|
165
|
+
{{ tr(item.teamName) }}<template v-if="item.roleName"> · {{ tr(item.roleName) }}</template> · {{ tr(item.operationName) }}
|
|
166
|
+
</span>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="flex shrink-0 items-center gap-2">
|
|
169
|
+
<StatusBadge
|
|
170
|
+
:status="item.swap ? item.swap.status : item.assignment.status"
|
|
171
|
+
:label="statusLabel(item)"
|
|
172
|
+
:colors="{ assigned: 'info', attended: 'success', no_show: 'error', open: 'warning', offered: 'warning', pending_approval: 'warning' }"
|
|
173
|
+
/>
|
|
174
|
+
<UIcon
|
|
175
|
+
name="i-lucide-chevron-right"
|
|
176
|
+
class="text-dimmed size-4"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
</ULink>
|
|
180
|
+
</li>
|
|
181
|
+
</ul>
|
|
182
|
+
</SectionCard>
|
|
183
|
+
<UButton
|
|
184
|
+
v-if="!picked && pastCount"
|
|
185
|
+
color="neutral"
|
|
186
|
+
variant="ghost"
|
|
187
|
+
class="self-start"
|
|
188
|
+
:label="showPast ? t('mine.hidePast', 'Hide past shifts') : t('mine.showPast', 'Show {count} past shifts', { count: pastCount })"
|
|
189
|
+
@click="showPast = !showPast"
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
standalone?: boolean;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shiftsApi } from "../../utils/api";
|
|
3
|
+
import { SHIFT_SWAP_OFFER_STATUS_LABELS } from "../../utils/status";
|
|
4
|
+
import { allowsSwapKind } from "../../utils/settings";
|
|
5
|
+
import { $fetch, computed, errorMessage, navigateTo, onMounted, reactive, ref, useAction, useAuthPages, useLazyFetch, useModuleT, useRoute, useShiftsFormat, useShiftsLinks, useShiftsTranslate, watch } from "#imports";
|
|
6
|
+
defineOptions({ name: "ShiftsHomeSwapsTab" });
|
|
7
|
+
const t = useModuleT("shifts");
|
|
8
|
+
const tr = useShiftsTranslate();
|
|
9
|
+
const format = useShiftsFormat();
|
|
10
|
+
const links = useShiftsLinks();
|
|
11
|
+
const { busy, run } = useAction();
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
const { data: swaps, status, error, refresh } = useLazyFetch(shiftsApi.swaps, { key: "shifts:swaps", default: () => [] });
|
|
14
|
+
const { data: mine, refresh: refreshMine } = useLazyFetch(shiftsApi.me.shifts, { key: "shifts:me", default: () => [] });
|
|
15
|
+
const loading = computed(() => status.value === "pending" && !swaps.value.length);
|
|
16
|
+
watch(() => error.value?.statusCode, async (code) => {
|
|
17
|
+
if (code === 401) await navigateTo({ path: useAuthPages().login, query: { redirect: route.fullPath } });
|
|
18
|
+
}, { immediate: true });
|
|
19
|
+
const now = ref(0);
|
|
20
|
+
onMounted(() => now.value = Date.now());
|
|
21
|
+
const upcomingMine = computed(() => mine.value.filter((item) => item.assignment.status === "assigned" && Date.parse(item.shift.startsAt) > now.value));
|
|
22
|
+
const myOpen = computed(() => upcomingMine.value.filter((item) => item.swap));
|
|
23
|
+
const giving = reactive({});
|
|
24
|
+
const givingOptions = (swap) => upcomingMine.value.filter((item) => !swap.wantedAssignmentId || item.assignment.id === swap.wantedAssignmentId).filter((item) => allowsSwapKind(item.settings, "trade")).filter((item) => item.shift.scheduleId === swap.shift.scheduleId || swap.settings.coverage !== "all" && item.settings.coverage !== "all").map((item) => ({ label: `${tr(item.teamName)} \xB7 ${format.range(item.shift.startsAt, item.shift.endsAt)}`, value: item.assignment.id }));
|
|
25
|
+
async function offer(swap) {
|
|
26
|
+
const back = swap.kind === "trade" ? giving[swap.id] ?? swap.wantedAssignmentId ?? null : null;
|
|
27
|
+
if (swap.kind === "trade" && !back) return;
|
|
28
|
+
const done = await run(
|
|
29
|
+
() => $fetch(shiftsApi.offers(swap.id), { method: "POST", body: { assignmentId: back } }).then(() => true),
|
|
30
|
+
swap.kind === "trade" ? { success: t("swaps.tradeOffered", "Offered {name} a trade", { name: swap.owner.name ?? "" }), error: t("swaps.offerFailed", "Could not make the offer") } : { success: t("swaps.offered", "Offered to take the shift of {name}", { name: swap.owner.name ?? "" }), error: t("swaps.offerFailed", "Could not make the offer") }
|
|
31
|
+
);
|
|
32
|
+
if (done) await Promise.all([refresh(), refreshMine()]);
|
|
33
|
+
}
|
|
34
|
+
async function withdraw(swap) {
|
|
35
|
+
if (!swap.myOffer) return;
|
|
36
|
+
const done = await run(
|
|
37
|
+
() => $fetch(shiftsApi.offer(swap.id, swap.myOffer.id), { method: "DELETE" }).then(() => true),
|
|
38
|
+
{ success: t("swaps.offerWithdrawn", "Withdrew your offer"), error: t("swaps.offerWithdrawFailed", "Could not withdraw the offer") }
|
|
39
|
+
);
|
|
40
|
+
if (done) await refresh();
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div class="flex flex-col gap-4">
|
|
46
|
+
<SectionCard
|
|
47
|
+
v-if="myOpen.length"
|
|
48
|
+
:title="t('swaps.mine', 'Your shifts on offer')"
|
|
49
|
+
icon="i-lucide-megaphone"
|
|
50
|
+
flush
|
|
51
|
+
>
|
|
52
|
+
<ul class="divide-default divide-y">
|
|
53
|
+
<li
|
|
54
|
+
v-for="item in myOpen"
|
|
55
|
+
:key="item.assignment.id"
|
|
56
|
+
class="flex items-center justify-between gap-2 px-4 py-2.5"
|
|
57
|
+
>
|
|
58
|
+
<span class="text-sm">{{ tr(item.teamName) }} · {{ format.range(item.shift.startsAt, item.shift.endsAt) }}</span>
|
|
59
|
+
<UButton
|
|
60
|
+
:to="links.shift(item.assignment.id)"
|
|
61
|
+
size="sm"
|
|
62
|
+
color="neutral"
|
|
63
|
+
variant="outline"
|
|
64
|
+
:label="t('swaps.seeOffers', 'See offers')"
|
|
65
|
+
/>
|
|
66
|
+
</li>
|
|
67
|
+
</ul>
|
|
68
|
+
</SectionCard>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
v-if="loading"
|
|
72
|
+
class="flex flex-col gap-3"
|
|
73
|
+
aria-busy="true"
|
|
74
|
+
>
|
|
75
|
+
<SectionCard
|
|
76
|
+
v-for="index in 2"
|
|
77
|
+
:key="index"
|
|
78
|
+
loading
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
<UEmpty
|
|
82
|
+
v-else-if="error && error.statusCode !== 401"
|
|
83
|
+
icon="i-lucide-circle-alert"
|
|
84
|
+
:title="t('swaps.loadFailed', 'The swaps could not be loaded')"
|
|
85
|
+
:description="errorMessage(error, '')"
|
|
86
|
+
:actions="[{ label: t('tryAgain', 'Try again'), icon: 'i-lucide-rotate-ccw', color: 'neutral', variant: 'outline', onClick: () => refresh() }]"
|
|
87
|
+
/>
|
|
88
|
+
<UEmpty
|
|
89
|
+
v-else-if="!swaps.length"
|
|
90
|
+
icon="i-lucide-arrow-left-right"
|
|
91
|
+
:title="t('swaps.empty', 'No open swaps for you')"
|
|
92
|
+
:description="t('swaps.emptyDescription', 'When somebody on your team offers a shift you can take, it shows up here.')"
|
|
93
|
+
/>
|
|
94
|
+
<div
|
|
95
|
+
v-else
|
|
96
|
+
class="flex flex-col gap-3"
|
|
97
|
+
data-shifts-swaps
|
|
98
|
+
>
|
|
99
|
+
<SectionCard
|
|
100
|
+
v-for="swap in swaps"
|
|
101
|
+
:key="swap.id"
|
|
102
|
+
:title="`${tr(swap.shift.teamName)} \xB7 ${format.range(swap.shift.startsAt, swap.shift.endsAt)}`"
|
|
103
|
+
:description="t('swaps.from', 'From {name} \xB7 {schedule}', { name: swap.owner.name ?? '', schedule: tr(swap.shift.scheduleName) })"
|
|
104
|
+
>
|
|
105
|
+
<template #actions>
|
|
106
|
+
<div class="flex items-center gap-2">
|
|
107
|
+
<UBadge
|
|
108
|
+
color="neutral"
|
|
109
|
+
variant="subtle"
|
|
110
|
+
:label="swap.kind === 'trade' ? t('swapKinds.trade', 'Trade') : t('swapKinds.release', 'Give away')"
|
|
111
|
+
/>
|
|
112
|
+
<UBadge
|
|
113
|
+
v-if="swap.myOffer"
|
|
114
|
+
color="primary"
|
|
115
|
+
variant="subtle"
|
|
116
|
+
:label="t(`offerStatuses.${swap.myOffer.status}`, SHIFT_SWAP_OFFER_STATUS_LABELS[swap.myOffer.status])"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
<UAlert
|
|
121
|
+
v-if="swap.settings.coverage === 'all'"
|
|
122
|
+
class="mb-3"
|
|
123
|
+
color="info"
|
|
124
|
+
variant="subtle"
|
|
125
|
+
icon="i-lucide-info"
|
|
126
|
+
:title="t('shift.tradeOnly', 'Trade only: you must work all your shifts.')"
|
|
127
|
+
/>
|
|
128
|
+
<p
|
|
129
|
+
v-if="swap.wantedShift && !swap.myOffer"
|
|
130
|
+
class="text-muted mb-3 text-sm"
|
|
131
|
+
>
|
|
132
|
+
{{ t("swaps.wants", "Wants your shift on {team}, {when}", { team: tr(swap.wantedShift.teamName), when: format.range(swap.wantedShift.startsAt, swap.wantedShift.endsAt) }) }}
|
|
133
|
+
</p>
|
|
134
|
+
<div
|
|
135
|
+
v-if="!swap.myOffer && swap.kind === 'trade'"
|
|
136
|
+
class="flex flex-wrap items-end gap-2"
|
|
137
|
+
>
|
|
138
|
+
<UFormField
|
|
139
|
+
:label="t('swaps.giveBack', 'You give in return')"
|
|
140
|
+
:description="givingOptions(swap).length ? void 0 : t('swaps.nothingToTrade', 'You have no upcoming shift to trade.')"
|
|
141
|
+
required
|
|
142
|
+
class="min-w-64 flex-1"
|
|
143
|
+
>
|
|
144
|
+
<USelect
|
|
145
|
+
v-model="giving[swap.id]"
|
|
146
|
+
:items="givingOptions(swap)"
|
|
147
|
+
:placeholder="t('swaps.pickShift', 'Choose one of your shifts')"
|
|
148
|
+
:disabled="!givingOptions(swap).length"
|
|
149
|
+
class="w-full"
|
|
150
|
+
/>
|
|
151
|
+
</UFormField>
|
|
152
|
+
<UButton
|
|
153
|
+
:loading="busy"
|
|
154
|
+
:disabled="!giving[swap.id] && !swap.wantedAssignmentId"
|
|
155
|
+
:label="t('swaps.tradeAction', 'Offer a trade')"
|
|
156
|
+
@click="offer(swap)"
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
<div
|
|
160
|
+
v-else-if="!swap.myOffer"
|
|
161
|
+
class="flex justify-end"
|
|
162
|
+
>
|
|
163
|
+
<UButton
|
|
164
|
+
:loading="busy"
|
|
165
|
+
:label="t('swaps.offerAction', 'Take the shift over')"
|
|
166
|
+
@click="offer(swap)"
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
<div
|
|
170
|
+
v-else
|
|
171
|
+
class="flex items-center justify-between gap-2"
|
|
172
|
+
>
|
|
173
|
+
<span class="text-muted text-sm">
|
|
174
|
+
{{ swap.myOffer.offeredShift ? t("swaps.youGive", "You give {team}, {when}", { team: tr(swap.myOffer.offeredShift.teamName), when: format.range(swap.myOffer.offeredShift.startsAt, swap.myOffer.offeredShift.endsAt) }) : t("swaps.youTake", "You take the shift over") }}
|
|
175
|
+
</span>
|
|
176
|
+
<UButton
|
|
177
|
+
color="neutral"
|
|
178
|
+
variant="outline"
|
|
179
|
+
size="sm"
|
|
180
|
+
:loading="busy"
|
|
181
|
+
:label="t('swaps.withdrawOffer', 'Withdraw offer')"
|
|
182
|
+
@click="withdraw(swap)"
|
|
183
|
+
/>
|
|
184
|
+
</div>
|
|
185
|
+
</SectionCard>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
operation?: {
|
|
3
|
+
id: string;
|
|
4
|
+
slug?: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|