@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.
Files changed (345) hide show
  1. package/README.md +53 -2
  2. package/dist/module.d.mts +716 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +272 -0
  5. package/dist/runtime/access.d.ts +2 -0
  6. package/dist/runtime/access.js +84 -0
  7. package/dist/runtime/app/components/ShiftBroadcastSlideover.d.vue.ts +19 -0
  8. package/dist/runtime/app/components/ShiftBroadcastSlideover.vue +142 -0
  9. package/dist/runtime/app/components/ShiftBroadcastSlideover.vue.d.ts +19 -0
  10. package/dist/runtime/app/components/ShiftBroadcastsCard.d.vue.ts +9 -0
  11. package/dist/runtime/app/components/ShiftBroadcastsCard.vue +74 -0
  12. package/dist/runtime/app/components/ShiftBroadcastsCard.vue.d.ts +9 -0
  13. package/dist/runtime/app/components/ShiftBulkSlideover.d.vue.ts +15 -0
  14. package/dist/runtime/app/components/ShiftBulkSlideover.vue +185 -0
  15. package/dist/runtime/app/components/ShiftBulkSlideover.vue.d.ts +15 -0
  16. package/dist/runtime/app/components/ShiftCheckInCard.d.vue.ts +13 -0
  17. package/dist/runtime/app/components/ShiftCheckInCard.vue +238 -0
  18. package/dist/runtime/app/components/ShiftCheckInCard.vue.d.ts +13 -0
  19. package/dist/runtime/app/components/ShiftCopySlideover.d.vue.ts +11 -0
  20. package/dist/runtime/app/components/ShiftCopySlideover.vue +71 -0
  21. package/dist/runtime/app/components/ShiftCopySlideover.vue.d.ts +11 -0
  22. package/dist/runtime/app/components/ShiftDayView.d.vue.ts +16 -0
  23. package/dist/runtime/app/components/ShiftDayView.vue +124 -0
  24. package/dist/runtime/app/components/ShiftDayView.vue.d.ts +16 -0
  25. package/dist/runtime/app/components/ShiftFeedSlideover.d.vue.ts +7 -0
  26. package/dist/runtime/app/components/ShiftFeedSlideover.vue +172 -0
  27. package/dist/runtime/app/components/ShiftFeedSlideover.vue.d.ts +7 -0
  28. package/dist/runtime/app/components/ShiftNowCard.d.vue.ts +6 -0
  29. package/dist/runtime/app/components/ShiftNowCard.vue +83 -0
  30. package/dist/runtime/app/components/ShiftNowCard.vue.d.ts +6 -0
  31. package/dist/runtime/app/components/ShiftPassFullscreen.d.vue.ts +13 -0
  32. package/dist/runtime/app/components/ShiftPassFullscreen.vue +79 -0
  33. package/dist/runtime/app/components/ShiftPassFullscreen.vue.d.ts +13 -0
  34. package/dist/runtime/app/components/ShiftPerkSlideover.d.vue.ts +14 -0
  35. package/dist/runtime/app/components/ShiftPerkSlideover.vue +103 -0
  36. package/dist/runtime/app/components/ShiftPerkSlideover.vue.d.ts +14 -0
  37. package/dist/runtime/app/components/ShiftPerksCard.d.vue.ts +8 -0
  38. package/dist/runtime/app/components/ShiftPerksCard.vue +66 -0
  39. package/dist/runtime/app/components/ShiftPerksCard.vue.d.ts +8 -0
  40. package/dist/runtime/app/components/ShiftQrScanner.d.vue.ts +10 -0
  41. package/dist/runtime/app/components/ShiftQrScanner.vue +44 -0
  42. package/dist/runtime/app/components/ShiftQrScanner.vue.d.ts +10 -0
  43. package/dist/runtime/app/components/ShiftRoleSlideover.d.vue.ts +15 -0
  44. package/dist/runtime/app/components/ShiftRoleSlideover.vue +88 -0
  45. package/dist/runtime/app/components/ShiftRoleSlideover.vue.d.ts +15 -0
  46. package/dist/runtime/app/components/ShiftScheduleSettingsFields.d.vue.ts +11 -0
  47. package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue +61 -0
  48. package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue.d.ts +11 -0
  49. package/dist/runtime/app/components/ShiftScheduleSlideover.d.vue.ts +12 -0
  50. package/dist/runtime/app/components/ShiftScheduleSlideover.vue +129 -0
  51. package/dist/runtime/app/components/ShiftScheduleSlideover.vue.d.ts +12 -0
  52. package/dist/runtime/app/components/ShiftSlideover.d.vue.ts +13 -0
  53. package/dist/runtime/app/components/ShiftSlideover.vue +353 -0
  54. package/dist/runtime/app/components/ShiftSlideover.vue.d.ts +13 -0
  55. package/dist/runtime/app/components/ShiftStationSlideover.d.vue.ts +15 -0
  56. package/dist/runtime/app/components/ShiftStationSlideover.vue +92 -0
  57. package/dist/runtime/app/components/ShiftStationSlideover.vue.d.ts +15 -0
  58. package/dist/runtime/app/composables/index.d.ts +6 -0
  59. package/dist/runtime/app/composables/index.js +5 -0
  60. package/dist/runtime/app/composables/useShiftsActions.d.ts +61 -0
  61. package/dist/runtime/app/composables/useShiftsActions.js +224 -0
  62. package/dist/runtime/app/composables/useShiftsFormat.d.ts +12 -0
  63. package/dist/runtime/app/composables/useShiftsFormat.js +14 -0
  64. package/dist/runtime/app/composables/useShiftsLinks.d.ts +12 -0
  65. package/dist/runtime/app/composables/useShiftsLinks.js +6 -0
  66. package/dist/runtime/app/composables/useShiftsTranslate.d.ts +5 -0
  67. package/dist/runtime/app/composables/useShiftsTranslate.js +12 -0
  68. package/dist/runtime/app/composables/useShiftsVenueFeatures.d.ts +17 -0
  69. package/dist/runtime/app/composables/useShiftsVenueFeatures.js +18 -0
  70. package/dist/runtime/app/dashboard/NextShift.d.vue.ts +3 -0
  71. package/dist/runtime/app/dashboard/NextShift.vue +69 -0
  72. package/dist/runtime/app/dashboard/NextShift.vue.d.ts +3 -0
  73. package/dist/runtime/app/dashboard/OpenSwaps.d.vue.ts +3 -0
  74. package/dist/runtime/app/dashboard/OpenSwaps.vue +69 -0
  75. package/dist/runtime/app/dashboard/OpenSwaps.vue.d.ts +3 -0
  76. package/dist/runtime/app/dashboard/TeamOnNow.d.vue.ts +3 -0
  77. package/dist/runtime/app/dashboard/TeamOnNow.vue +72 -0
  78. package/dist/runtime/app/dashboard/TeamOnNow.vue.d.ts +3 -0
  79. package/dist/runtime/app/pages/check-in.d.vue.ts +3 -0
  80. package/dist/runtime/app/pages/check-in.vue +93 -0
  81. package/dist/runtime/app/pages/check-in.vue.d.ts +3 -0
  82. package/dist/runtime/app/pages/lead.d.vue.ts +3 -0
  83. package/dist/runtime/app/pages/lead.vue +300 -0
  84. package/dist/runtime/app/pages/lead.vue.d.ts +3 -0
  85. package/dist/runtime/app/pages/shift.d.vue.ts +3 -0
  86. package/dist/runtime/app/pages/shift.vue +482 -0
  87. package/dist/runtime/app/pages/shift.vue.d.ts +3 -0
  88. package/dist/runtime/app/pages/shifts.d.vue.ts +3 -0
  89. package/dist/runtime/app/pages/shifts.vue +21 -0
  90. package/dist/runtime/app/pages/shifts.vue.d.ts +3 -0
  91. package/dist/runtime/app/pages/station.d.vue.ts +3 -0
  92. package/dist/runtime/app/pages/station.vue +104 -0
  93. package/dist/runtime/app/pages/station.vue.d.ts +3 -0
  94. package/dist/runtime/app/pages/swaps.d.vue.ts +3 -0
  95. package/dist/runtime/app/pages/swaps.vue +32 -0
  96. package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
  97. package/dist/runtime/app/tabs/HomeShifts.d.vue.ts +6 -0
  98. package/dist/runtime/app/tabs/HomeShifts.vue +194 -0
  99. package/dist/runtime/app/tabs/HomeShifts.vue.d.ts +6 -0
  100. package/dist/runtime/app/tabs/HomeSwaps.d.vue.ts +3 -0
  101. package/dist/runtime/app/tabs/HomeSwaps.vue +188 -0
  102. package/dist/runtime/app/tabs/HomeSwaps.vue.d.ts +3 -0
  103. package/dist/runtime/app/tabs/Shifts.d.vue.ts +9 -0
  104. package/dist/runtime/app/tabs/Shifts.vue +487 -0
  105. package/dist/runtime/app/tabs/Shifts.vue.d.ts +9 -0
  106. package/dist/runtime/app/utils/admin-shifts.d.ts +42 -0
  107. package/dist/runtime/app/utils/admin-shifts.js +36 -0
  108. package/dist/runtime/dashboard.d.ts +8 -0
  109. package/dist/runtime/dashboard.js +30 -0
  110. package/dist/runtime/emails/shifts-broadcast.d.vue.ts +8 -0
  111. package/dist/runtime/emails/shifts-broadcast.vue +24 -0
  112. package/dist/runtime/emails/shifts-broadcast.vue.d.ts +8 -0
  113. package/dist/runtime/emails/shifts-reminder.d.vue.ts +12 -0
  114. package/dist/runtime/emails/shifts-reminder.vue +34 -0
  115. package/dist/runtime/emails/shifts-reminder.vue.d.ts +12 -0
  116. package/dist/runtime/emails/shifts-swap-accepted.d.vue.ts +11 -0
  117. package/dist/runtime/emails/shifts-swap-accepted.vue +32 -0
  118. package/dist/runtime/emails/shifts-swap-accepted.vue.d.ts +11 -0
  119. package/dist/runtime/emails/shifts-swap-completed.d.vue.ts +11 -0
  120. package/dist/runtime/emails/shifts-swap-completed.vue +32 -0
  121. package/dist/runtime/emails/shifts-swap-completed.vue.d.ts +11 -0
  122. package/dist/runtime/emails/shifts-swap-offered.d.vue.ts +11 -0
  123. package/dist/runtime/emails/shifts-swap-offered.vue +32 -0
  124. package/dist/runtime/emails/shifts-swap-offered.vue.d.ts +11 -0
  125. package/dist/runtime/emails/shifts-swap-pending.d.vue.ts +11 -0
  126. package/dist/runtime/emails/shifts-swap-pending.vue +32 -0
  127. package/dist/runtime/emails/shifts-swap-pending.vue.d.ts +11 -0
  128. package/dist/runtime/emails/shifts-swap-proposed.d.vue.ts +11 -0
  129. package/dist/runtime/emails/shifts-swap-proposed.vue +32 -0
  130. package/dist/runtime/emails/shifts-swap-proposed.vue.d.ts +11 -0
  131. package/dist/runtime/emails/shifts-swap-rejected.d.vue.ts +11 -0
  132. package/dist/runtime/emails/shifts-swap-rejected.vue +32 -0
  133. package/dist/runtime/emails/shifts-swap-rejected.vue.d.ts +11 -0
  134. package/dist/runtime/i18n/lang/da.json +627 -0
  135. package/dist/runtime/i18n/lang/en.json +627 -0
  136. package/dist/runtime/notifications.d.ts +9 -0
  137. package/dist/runtime/notifications.js +36 -0
  138. package/dist/runtime/server/db/schema.postgresql.d.ts +2151 -0
  139. package/dist/runtime/server/db/schema.postgresql.js +228 -0
  140. package/dist/runtime/server/db/schema.sqlite.d.ts +2263 -0
  141. package/dist/runtime/server/db/schema.sqlite.js +228 -0
  142. package/dist/runtime/server/digest-email.d.ts +17 -0
  143. package/dist/runtime/server/digest-email.js +42 -0
  144. package/dist/runtime/server/plugins/station-key.d.ts +2 -0
  145. package/dist/runtime/server/plugins/station-key.js +5 -0
  146. package/dist/runtime/server/plugins/teams.d.ts +2 -0
  147. package/dist/runtime/server/plugins/teams.js +19 -0
  148. package/dist/runtime/server/policies.d.ts +2 -0
  149. package/dist/runtime/server/policies.js +41 -0
  150. package/dist/runtime/server/reminder-email.d.ts +67 -0
  151. package/dist/runtime/server/reminder-email.js +109 -0
  152. package/dist/runtime/server/routes/admin/assignment.delete.d.ts +2 -0
  153. package/dist/runtime/server/routes/admin/assignment.delete.js +10 -0
  154. package/dist/runtime/server/routes/admin/assignments.post.d.ts +2 -0
  155. package/dist/runtime/server/routes/admin/assignments.post.js +11 -0
  156. package/dist/runtime/server/routes/admin/broadcasts.get.d.ts +2 -0
  157. package/dist/runtime/server/routes/admin/broadcasts.get.js +8 -0
  158. package/dist/runtime/server/routes/admin/broadcasts.post.d.ts +2 -0
  159. package/dist/runtime/server/routes/admin/broadcasts.post.js +9 -0
  160. package/dist/runtime/server/routes/admin/candidates.get.d.ts +2 -0
  161. package/dist/runtime/server/routes/admin/candidates.get.js +10 -0
  162. package/dist/runtime/server/routes/admin/operation-teams.get.d.ts +2 -0
  163. package/dist/runtime/server/routes/admin/operation-teams.get.js +9 -0
  164. package/dist/runtime/server/routes/admin/perk.delete.d.ts +2 -0
  165. package/dist/runtime/server/routes/admin/perk.delete.js +10 -0
  166. package/dist/runtime/server/routes/admin/perk.patch.d.ts +2 -0
  167. package/dist/runtime/server/routes/admin/perk.patch.js +10 -0
  168. package/dist/runtime/server/routes/admin/perks.get.d.ts +2 -0
  169. package/dist/runtime/server/routes/admin/perks.get.js +9 -0
  170. package/dist/runtime/server/routes/admin/perks.post.d.ts +2 -0
  171. package/dist/runtime/server/routes/admin/perks.post.js +10 -0
  172. package/dist/runtime/server/routes/admin/role.delete.d.ts +2 -0
  173. package/dist/runtime/server/routes/admin/role.delete.js +11 -0
  174. package/dist/runtime/server/routes/admin/role.patch.d.ts +2 -0
  175. package/dist/runtime/server/routes/admin/role.patch.js +11 -0
  176. package/dist/runtime/server/routes/admin/roles.get.d.ts +2 -0
  177. package/dist/runtime/server/routes/admin/roles.get.js +9 -0
  178. package/dist/runtime/server/routes/admin/roles.post.d.ts +2 -0
  179. package/dist/runtime/server/routes/admin/roles.post.js +10 -0
  180. package/dist/runtime/server/routes/admin/schedule-copy.post.d.ts +2 -0
  181. package/dist/runtime/server/routes/admin/schedule-copy.post.js +12 -0
  182. package/dist/runtime/server/routes/admin/schedule-publish.post.d.ts +2 -0
  183. package/dist/runtime/server/routes/admin/schedule-publish.post.js +9 -0
  184. package/dist/runtime/server/routes/admin/schedule.delete.d.ts +2 -0
  185. package/dist/runtime/server/routes/admin/schedule.delete.js +10 -0
  186. package/dist/runtime/server/routes/admin/schedule.get.d.ts +2 -0
  187. package/dist/runtime/server/routes/admin/schedule.get.js +9 -0
  188. package/dist/runtime/server/routes/admin/schedule.patch.d.ts +2 -0
  189. package/dist/runtime/server/routes/admin/schedule.patch.js +10 -0
  190. package/dist/runtime/server/routes/admin/schedules.get.d.ts +2 -0
  191. package/dist/runtime/server/routes/admin/schedules.get.js +10 -0
  192. package/dist/runtime/server/routes/admin/schedules.post.d.ts +2 -0
  193. package/dist/runtime/server/routes/admin/schedules.post.js +9 -0
  194. package/dist/runtime/server/routes/admin/shift.delete.d.ts +2 -0
  195. package/dist/runtime/server/routes/admin/shift.delete.js +10 -0
  196. package/dist/runtime/server/routes/admin/shift.patch.d.ts +2 -0
  197. package/dist/runtime/server/routes/admin/shift.patch.js +10 -0
  198. package/dist/runtime/server/routes/admin/shifts-bulk.post.d.ts +2 -0
  199. package/dist/runtime/server/routes/admin/shifts-bulk.post.js +10 -0
  200. package/dist/runtime/server/routes/admin/shifts.get.d.ts +2 -0
  201. package/dist/runtime/server/routes/admin/shifts.get.js +10 -0
  202. package/dist/runtime/server/routes/admin/station.delete.d.ts +2 -0
  203. package/dist/runtime/server/routes/admin/station.delete.js +11 -0
  204. package/dist/runtime/server/routes/admin/station.patch.d.ts +2 -0
  205. package/dist/runtime/server/routes/admin/station.patch.js +11 -0
  206. package/dist/runtime/server/routes/admin/stations.get.d.ts +2 -0
  207. package/dist/runtime/server/routes/admin/stations.get.js +9 -0
  208. package/dist/runtime/server/routes/admin/stations.post.d.ts +2 -0
  209. package/dist/runtime/server/routes/admin/stations.post.js +10 -0
  210. package/dist/runtime/server/routes/admin/swap-cancel.post.d.ts +2 -0
  211. package/dist/runtime/server/routes/admin/swap-cancel.post.js +10 -0
  212. package/dist/runtime/server/routes/admin/swaps.get.d.ts +2 -0
  213. package/dist/runtime/server/routes/admin/swaps.get.js +10 -0
  214. package/dist/runtime/server/routes/feed/feed.get.d.ts +2 -0
  215. package/dist/runtime/server/routes/feed/feed.get.js +9 -0
  216. package/dist/runtime/server/routes/lead/attended.post.d.ts +2 -0
  217. package/dist/runtime/server/routes/lead/attended.post.js +11 -0
  218. package/dist/runtime/server/routes/lead/broadcast.post.d.ts +2 -0
  219. package/dist/runtime/server/routes/lead/broadcast.post.js +12 -0
  220. package/dist/runtime/server/routes/lead/check-in.post.d.ts +2 -0
  221. package/dist/runtime/server/routes/lead/check-in.post.js +9 -0
  222. package/dist/runtime/server/routes/lead/exceptions.get.d.ts +2 -0
  223. package/dist/runtime/server/routes/lead/exceptions.get.js +8 -0
  224. package/dist/runtime/server/routes/lead/no-show.post.d.ts +2 -0
  225. package/dist/runtime/server/routes/lead/no-show.post.js +11 -0
  226. package/dist/runtime/server/routes/lead/now.get.d.ts +2 -0
  227. package/dist/runtime/server/routes/lead/now.get.js +9 -0
  228. package/dist/runtime/server/routes/lead/on-duty.get.d.ts +2 -0
  229. package/dist/runtime/server/routes/lead/on-duty.get.js +10 -0
  230. package/dist/runtime/server/routes/lead/stations.get.d.ts +2 -0
  231. package/dist/runtime/server/routes/lead/stations.get.js +8 -0
  232. package/dist/runtime/server/routes/lead/team-shifts.get.d.ts +2 -0
  233. package/dist/runtime/server/routes/lead/team-shifts.get.js +9 -0
  234. package/dist/runtime/server/routes/lead/team-swaps.get.d.ts +2 -0
  235. package/dist/runtime/server/routes/lead/team-swaps.get.js +9 -0
  236. package/dist/runtime/server/routes/me/check-in.post.d.ts +2 -0
  237. package/dist/runtime/server/routes/me/check-in.post.js +11 -0
  238. package/dist/runtime/server/routes/me/earned-perk-claim.post.d.ts +2 -0
  239. package/dist/runtime/server/routes/me/earned-perk-claim.post.js +10 -0
  240. package/dist/runtime/server/routes/me/earned-perks.get.d.ts +2 -0
  241. package/dist/runtime/server/routes/me/earned-perks.get.js +9 -0
  242. package/dist/runtime/server/routes/me/feed-token.delete.d.ts +2 -0
  243. package/dist/runtime/server/routes/me/feed-token.delete.js +7 -0
  244. package/dist/runtime/server/routes/me/feed-token.get.d.ts +2 -0
  245. package/dist/runtime/server/routes/me/feed-token.get.js +6 -0
  246. package/dist/runtime/server/routes/me/feed-token.post.d.ts +2 -0
  247. package/dist/runtime/server/routes/me/feed-token.post.js +7 -0
  248. package/dist/runtime/server/routes/me/leads.get.d.ts +2 -0
  249. package/dist/runtime/server/routes/me/leads.get.js +5 -0
  250. package/dist/runtime/server/routes/me/now.get.d.ts +2 -0
  251. package/dist/runtime/server/routes/me/now.get.js +5 -0
  252. package/dist/runtime/server/routes/me/pass.get.d.ts +2 -0
  253. package/dist/runtime/server/routes/me/pass.get.js +11 -0
  254. package/dist/runtime/server/routes/me/settle.post.d.ts +2 -0
  255. package/dist/runtime/server/routes/me/settle.post.js +14 -0
  256. package/dist/runtime/server/routes/me/shift.get.d.ts +2 -0
  257. package/dist/runtime/server/routes/me/shift.get.js +10 -0
  258. package/dist/runtime/server/routes/me/shifts.get.d.ts +2 -0
  259. package/dist/runtime/server/routes/me/shifts.get.js +6 -0
  260. package/dist/runtime/server/routes/me/swap.delete.d.ts +2 -0
  261. package/dist/runtime/server/routes/me/swap.delete.js +11 -0
  262. package/dist/runtime/server/routes/me/swap.post.d.ts +2 -0
  263. package/dist/runtime/server/routes/me/swap.post.js +11 -0
  264. package/dist/runtime/server/routes/stations/token.get.d.ts +2 -0
  265. package/dist/runtime/server/routes/stations/token.get.js +12 -0
  266. package/dist/runtime/server/routes/swaps/approve.post.d.ts +2 -0
  267. package/dist/runtime/server/routes/swaps/approve.post.js +9 -0
  268. package/dist/runtime/server/routes/swaps/list.get.d.ts +2 -0
  269. package/dist/runtime/server/routes/swaps/list.get.js +5 -0
  270. package/dist/runtime/server/routes/swaps/offer-accept.post.d.ts +2 -0
  271. package/dist/runtime/server/routes/swaps/offer-accept.post.js +9 -0
  272. package/dist/runtime/server/routes/swaps/offer-reject.post.d.ts +2 -0
  273. package/dist/runtime/server/routes/swaps/offer-reject.post.js +9 -0
  274. package/dist/runtime/server/routes/swaps/offer.delete.d.ts +2 -0
  275. package/dist/runtime/server/routes/swaps/offer.delete.js +11 -0
  276. package/dist/runtime/server/routes/swaps/offer.post.d.ts +2 -0
  277. package/dist/runtime/server/routes/swaps/offer.post.js +11 -0
  278. package/dist/runtime/server/routes/swaps/reject.post.d.ts +2 -0
  279. package/dist/runtime/server/routes/swaps/reject.post.js +9 -0
  280. package/dist/runtime/server/swap-email.d.ts +28 -0
  281. package/dist/runtime/server/swap-email.js +49 -0
  282. package/dist/runtime/server/tasks/close-shifts.d.ts +2 -0
  283. package/dist/runtime/server/tasks/close-shifts.js +9 -0
  284. package/dist/runtime/server/tasks/send-reminders.d.ts +2 -0
  285. package/dist/runtime/server/tasks/send-reminders.js +9 -0
  286. package/dist/runtime/server/utils/shifts-admin.d.ts +67 -0
  287. package/dist/runtime/server/utils/shifts-admin.js +312 -0
  288. package/dist/runtime/server/utils/shifts-assign.d.ts +89 -0
  289. package/dist/runtime/server/utils/shifts-assign.js +264 -0
  290. package/dist/runtime/server/utils/shifts-automation.d.ts +37 -0
  291. package/dist/runtime/server/utils/shifts-automation.js +171 -0
  292. package/dist/runtime/server/utils/shifts-broadcasts.d.ts +38 -0
  293. package/dist/runtime/server/utils/shifts-broadcasts.js +113 -0
  294. package/dist/runtime/server/utils/shifts-core.d.ts +78 -0
  295. package/dist/runtime/server/utils/shifts-core.js +142 -0
  296. package/dist/runtime/server/utils/shifts-dto.d.ts +32 -0
  297. package/dist/runtime/server/utils/shifts-dto.js +127 -0
  298. package/dist/runtime/server/utils/shifts-emails.d.ts +16 -0
  299. package/dist/runtime/server/utils/shifts-emails.js +44 -0
  300. package/dist/runtime/server/utils/shifts-exceptions.d.ts +7 -0
  301. package/dist/runtime/server/utils/shifts-exceptions.js +32 -0
  302. package/dist/runtime/server/utils/shifts-feed.d.ts +16 -0
  303. package/dist/runtime/server/utils/shifts-feed.js +73 -0
  304. package/dist/runtime/server/utils/shifts-notify.d.ts +40 -0
  305. package/dist/runtime/server/utils/shifts-notify.js +22 -0
  306. package/dist/runtime/server/utils/shifts-on-duty.d.ts +12 -0
  307. package/dist/runtime/server/utils/shifts-on-duty.js +37 -0
  308. package/dist/runtime/server/utils/shifts-perks.d.ts +46 -0
  309. package/dist/runtime/server/utils/shifts-perks.js +183 -0
  310. package/dist/runtime/server/utils/shifts-reminders.d.ts +30 -0
  311. package/dist/runtime/server/utils/shifts-reminders.js +102 -0
  312. package/dist/runtime/server/utils/shifts-schemas.d.ts +318 -0
  313. package/dist/runtime/server/utils/shifts-schemas.js +177 -0
  314. package/dist/runtime/server/utils/shifts-station-key.d.ts +7 -0
  315. package/dist/runtime/server/utils/shifts-station-key.js +22 -0
  316. package/dist/runtime/server/utils/shifts-stations.d.ts +28 -0
  317. package/dist/runtime/server/utils/shifts-stations.js +109 -0
  318. package/dist/runtime/server/utils/shifts-swaps.d.ts +114 -0
  319. package/dist/runtime/server/utils/shifts-swaps.js +559 -0
  320. package/dist/runtime/server/utils/shifts-views.d.ts +62 -0
  321. package/dist/runtime/server/utils/shifts-views.js +212 -0
  322. package/dist/runtime/utils/api.d.ts +108 -0
  323. package/dist/runtime/utils/api.js +111 -0
  324. package/dist/runtime/utils/checkin.d.ts +59 -0
  325. package/dist/runtime/utils/checkin.js +57 -0
  326. package/dist/runtime/utils/guards.d.ts +21 -0
  327. package/dist/runtime/utils/guards.js +36 -0
  328. package/dist/runtime/utils/ics.d.ts +32 -0
  329. package/dist/runtime/utils/ics.js +56 -0
  330. package/dist/runtime/utils/index.d.ts +16 -0
  331. package/dist/runtime/utils/index.js +15 -0
  332. package/dist/runtime/utils/links.d.ts +44 -0
  333. package/dist/runtime/utils/links.js +21 -0
  334. package/dist/runtime/utils/reminders.d.ts +27 -0
  335. package/dist/runtime/utils/reminders.js +28 -0
  336. package/dist/runtime/utils/settings.d.ts +28 -0
  337. package/dist/runtime/utils/settings.js +18 -0
  338. package/dist/runtime/utils/station-key.d.ts +9 -0
  339. package/dist/runtime/utils/station-key.js +12 -0
  340. package/dist/runtime/utils/status.d.ts +23 -0
  341. package/dist/runtime/utils/status.js +46 -0
  342. package/dist/runtime/utils/time.d.ts +22 -0
  343. package/dist/runtime/utils/time.js +14 -0
  344. package/dist/types.d.mts +5 -0
  345. package/package.json +131 -3
@@ -0,0 +1,9 @@
1
+ import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ type __VLS_Props = {
3
+ operationId: string;
4
+ teams: ShiftsTeamOption[];
5
+ ladders: ShiftsLadder[];
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;
@@ -0,0 +1,15 @@
1
+ import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ import type { ShiftDto, ShiftRoleDto } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ scheduleId: string;
5
+ operationId?: string;
6
+ teams: ShiftsTeamOption[];
7
+ roles: ShiftRoleDto[];
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (saved: false | ShiftDto[]) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onClose?: ((saved: false | ShiftDto[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,185 @@
1
+ <script setup>
2
+ import { z } from "zod";
3
+ import { daysBetween } from "../utils/admin-shifts";
4
+ import { shiftsApi } from "../../utils/api";
5
+ import { $fetch, computed, reactive, SHIFTS_NO_FEATURE, useAction, useModuleT, useShiftsFormat, useShiftsTranslate, useShiftsVenueFeatures } from "#imports";
6
+ defineOptions({ name: "ShiftBulkSlideover" });
7
+ const props = defineProps({
8
+ scheduleId: { type: String, required: true },
9
+ operationId: { type: String, required: false },
10
+ teams: { type: Array, required: true },
11
+ roles: { type: Array, required: true }
12
+ });
13
+ const emit = defineEmits(["close"]);
14
+ const t = useModuleT("shifts");
15
+ const tr = useShiftsTranslate();
16
+ const { busy, run } = useAction();
17
+ const timeZone = useShiftsFormat().timeZone;
18
+ const NONE = "__none__";
19
+ const clock = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, t("admin.clockInvalid", "Use HH:mm."));
20
+ const schema = z.object({
21
+ teamId: z.string().min(1, t("admin.teamRequired", "Choose a team.")),
22
+ from: z.string().min(1, t("admin.fromRequired", "Pick the first day.")),
23
+ to: z.string().min(1, t("admin.toRequired", "Pick the last day.")),
24
+ slots: z.array(z.object({ start: clock, end: clock })).min(1),
25
+ capacity: z.number().int().min(0).nullable(),
26
+ shiftRoleId: z.string(),
27
+ featureId: z.string()
28
+ }).refine((value) => value.to >= value.from, { message: t("admin.rangeInvalid", "The last day must be on or after the first."), path: ["to"] });
29
+ const state = reactive({ teamId: props.teams[0]?.id ?? "", from: "", to: "", slots: [{ start: "10:00", end: "16:00" }], capacity: null, shiftRoleId: NONE, featureId: SHIFTS_NO_FEATURE });
30
+ const venue = useShiftsVenueFeatures(() => props.operationId ?? "");
31
+ const teamOptions = computed(() => props.teams.map((team) => ({ label: tr(team.name), value: team.id })));
32
+ const roleOptions = computed(() => [
33
+ { label: t("admin.noRole", "No role"), value: NONE },
34
+ ...props.roles.filter((role) => role.teamId === state.teamId).map((role) => ({ label: tr(role.name), value: role.id }))
35
+ ]);
36
+ const days = computed(() => state.from && state.to ? daysBetween(state.from, state.to) : []);
37
+ const total = computed(() => days.value.length * state.slots.length);
38
+ function addSlot() {
39
+ const last = state.slots.at(-1);
40
+ state.slots.push({ start: last?.end ?? "16:00", end: last?.end && last.end < "18:00" ? "22:00" : "02:00" });
41
+ }
42
+ async function save(event) {
43
+ const { teamId, slots, capacity, shiftRoleId, featureId } = event.data;
44
+ const saved = await run(
45
+ () => $fetch(shiftsApi.admin.bulk(props.scheduleId), {
46
+ method: "POST",
47
+ body: { teamId, days: days.value, slots, capacity, shiftRoleId: shiftRoleId === NONE ? null : shiftRoleId, location: featureId === SHIFTS_NO_FEATURE ? null : { featureId } }
48
+ }),
49
+ { success: t("admin.bulkCreated", "Created {count} shifts", { count: total.value }) }
50
+ );
51
+ if (saved) emit("close", saved);
52
+ }
53
+ </script>
54
+
55
+ <template>
56
+ <FormSlideover
57
+ form-id="shift-bulk-form"
58
+ :title="t('admin.bulkTitle', 'Create shifts')"
59
+ :description="t('admin.bulkDescription', 'Every time slot on every day, for one team. Times are local times in {zone}; a slot that ends before it starts ends the next day.', { zone: timeZone })"
60
+ :submit-label="t('admin.bulkSubmit', 'Create {count} shifts', { count: total })"
61
+ :loading="busy"
62
+ :disabled="!total"
63
+ @close="emit('close', false)"
64
+ >
65
+ <UForm
66
+ id="shift-bulk-form"
67
+ :schema="schema"
68
+ :state="state"
69
+ class="flex flex-col gap-4"
70
+ @submit="save"
71
+ >
72
+ <UFormField
73
+ name="teamId"
74
+ :label="t('admin.team', 'Team')"
75
+ required
76
+ >
77
+ <USelect
78
+ v-model="state.teamId"
79
+ :items="teamOptions"
80
+ class="w-full"
81
+ />
82
+ </UFormField>
83
+ <div class="grid grid-cols-2 gap-4">
84
+ <UFormField
85
+ name="from"
86
+ :label="t('admin.firstDay', 'First day')"
87
+ required
88
+ >
89
+ <UInput
90
+ v-model="state.from"
91
+ type="date"
92
+ class="w-full"
93
+ />
94
+ </UFormField>
95
+ <UFormField
96
+ name="to"
97
+ :label="t('admin.lastDay', 'Last day')"
98
+ required
99
+ >
100
+ <UInput
101
+ v-model="state.to"
102
+ type="date"
103
+ class="w-full"
104
+ />
105
+ </UFormField>
106
+ </div>
107
+ <UFormField
108
+ name="slots"
109
+ :label="t('admin.slots', 'Time slots')"
110
+ >
111
+ <div class="flex flex-col gap-2">
112
+ <div
113
+ v-for="(slot, index) in state.slots"
114
+ :key="index"
115
+ class="flex items-center gap-2"
116
+ >
117
+ <UInput
118
+ v-model="slot.start"
119
+ type="time"
120
+ :aria-label="t('admin.slotStart', 'Starts')"
121
+ />
122
+ <span class="text-muted">–</span>
123
+ <UInput
124
+ v-model="slot.end"
125
+ type="time"
126
+ :aria-label="t('admin.slotEnd', 'Ends')"
127
+ />
128
+ <UButton
129
+ v-if="state.slots.length > 1"
130
+ icon="i-lucide-x"
131
+ color="neutral"
132
+ variant="ghost"
133
+ :aria-label="t('admin.removeSlot', 'Remove time slot')"
134
+ @click="state.slots.splice(index, 1)"
135
+ />
136
+ </div>
137
+ <UButton
138
+ icon="i-lucide-plus"
139
+ color="neutral"
140
+ variant="outline"
141
+ class="self-start"
142
+ :label="t('admin.addSlot', 'Add time slot')"
143
+ @click="addSlot"
144
+ />
145
+ </div>
146
+ </UFormField>
147
+ <div class="grid grid-cols-2 gap-4">
148
+ <UFormField
149
+ name="capacity"
150
+ :label="t('admin.capacity', 'Capacity')"
151
+ :description="t('admin.capacityHelp', 'Empty uses the schedule\'s maximum.')"
152
+ >
153
+ <UInputNumber
154
+ v-model="state.capacity"
155
+ :min="0"
156
+ class="w-full"
157
+ />
158
+ </UFormField>
159
+ <UFormField
160
+ name="shiftRoleId"
161
+ :label="t('admin.shiftRole', 'Shift role')"
162
+ >
163
+ <USelect
164
+ v-model="state.shiftRoleId"
165
+ :items="roleOptions"
166
+ class="w-full"
167
+ />
168
+ </UFormField>
169
+ </div>
170
+ <UFormField
171
+ v-if="operationId"
172
+ name="featureId"
173
+ :label="t('admin.venueFeature', 'Place on the venue layout')"
174
+ :description="t('admin.venueFeatureHelp', 'Where the shift is worked: the on-duty map draws it there.')"
175
+ >
176
+ <USelect
177
+ v-model="state.featureId"
178
+ :items="venue.items.value"
179
+ :loading="venue.status.value === 'pending'"
180
+ class="w-full"
181
+ />
182
+ </UFormField>
183
+ </UForm>
184
+ </FormSlideover>
185
+ </template>
@@ -0,0 +1,15 @@
1
+ import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ import type { ShiftDto, ShiftRoleDto } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ scheduleId: string;
5
+ operationId?: string;
6
+ teams: ShiftsTeamOption[];
7
+ roles: ShiftRoleDto[];
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (saved: false | ShiftDto[]) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onClose?: ((saved: false | ShiftDto[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ import type { ShiftScheduleDto } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ schedule: ShiftScheduleDto;
5
+ teams: ShiftsTeamOption[];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ changed: () => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChanged?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,238 @@
1
+ <script setup>
2
+ import { shiftsApi } from "../../utils/api";
3
+ import { DEFAULT_CHECK_IN_RADIUS } from "../../utils/checkin";
4
+ import { $fetch, computed, h, ref, resolveComponent, tableUi, useAction, useFetch, useModuleT, useShiftsActions, useShiftsTranslate, watch } from "#imports";
5
+ defineOptions({ name: "ShiftCheckInCard" });
6
+ const props = defineProps({
7
+ schedule: { type: Object, required: true },
8
+ teams: { type: Array, required: true }
9
+ });
10
+ const emit = defineEmits(["changed"]);
11
+ const t = useModuleT("shifts");
12
+ const tr = useShiftsTranslate();
13
+ const actions = useShiftsActions();
14
+ const { busy, run } = useAction();
15
+ const selfModes = (modes2) => (modes2 ?? []).filter((mode) => mode !== "lead");
16
+ const modes = ref([]);
17
+ const location = ref(null);
18
+ const autoNoShow = ref(false);
19
+ const autoNoShowMinutes = ref(30);
20
+ const overrides = ref([]);
21
+ function reset() {
22
+ const checkIn = props.schedule.checkIn;
23
+ modes.value = selfModes(checkIn.modes);
24
+ location.value = checkIn.location ?? null;
25
+ autoNoShow.value = props.schedule.autoNoShow;
26
+ autoNoShowMinutes.value = props.schedule.autoNoShowMinutes;
27
+ overrides.value = Object.entries(checkIn.teams ?? {}).map(([teamId, team]) => ({ teamId, modes: selfModes(team.modes ?? checkIn.modes), location: team.location ?? null }));
28
+ }
29
+ watch(() => props.schedule, reset, { immediate: true });
30
+ const stationReady = computed(() => props.schedule.stationKeyConfigured);
31
+ const stationInUse = computed(() => modes.value.includes("station") || overrides.value.some((item) => item.modes.includes("station")));
32
+ const modeItemsFor = (selected) => [
33
+ {
34
+ label: t("checkIn.modes.station", "Station"),
35
+ description: stationReady.value ? t("checkIn.modes.stationHelp", "Volunteers scan the rotating QR code of a station of their team.") : t("checkIn.modes.stationNeedsKey", "Needs a station key on the server (NUXT_SHIFTS_STATION_KEY)."),
36
+ value: "station",
37
+ disabled: !stationReady.value && !selected.includes("station")
38
+ },
39
+ { label: t("checkIn.modes.location", "Location"), description: t("checkIn.modes.locationHelp", `Volunteers tap "I'm here" and the app sends their position. A determined person can fake it.`), value: "location" },
40
+ { label: t("checkIn.modes.daily", "Once a day"), description: t("checkIn.modes.dailyHelp", "The first check-in of the day also checks in the person's other shifts that day whose check-in is open."), value: "daily" }
41
+ ];
42
+ const modeItems = computed(() => modeItemsFor(modes.value));
43
+ const teamName = (id) => {
44
+ const team = props.teams.find((item) => item.id === id);
45
+ return team ? tr(team.name) : id;
46
+ };
47
+ const addableTeams = computed(() => props.teams.filter((team) => !overrides.value.some((item) => item.teamId === team.id)).map((team) => ({ label: tr(team.name), value: team.id })));
48
+ const teamToAdd = ref(void 0);
49
+ function addOverride(teamId) {
50
+ if (!teamId) return;
51
+ overrides.value.push({ teamId, modes: [...modes.value], location: location.value });
52
+ teamToAdd.value = void 0;
53
+ }
54
+ async function save() {
55
+ const teams = Object.fromEntries(overrides.value.map((item) => [item.teamId, { modes: [...item.modes, "lead"], ...item.location ? { location: item.location } : {} }]));
56
+ const body = {
57
+ checkIn: { modes: [...modes.value, "lead"], location: location.value, ...overrides.value.length ? { teams } : {} },
58
+ autoNoShow: autoNoShow.value,
59
+ autoNoShowMinutes: autoNoShowMinutes.value
60
+ };
61
+ const saved = await run(
62
+ () => $fetch(shiftsApi.admin.schedule(props.schedule.id), { method: "PATCH", body }),
63
+ { success: t("checkIn.saved", "Saved the check-in of {name}", { name: tr(props.schedule.name) }), error: t("checkIn.saveFailed", "Could not save the check-in settings") }
64
+ );
65
+ if (saved) emit("changed");
66
+ }
67
+ const { data: stations, status, refresh } = await useFetch(() => shiftsApi.admin.stations(props.schedule.id), {
68
+ key: computed(() => `shifts:stations:${props.schedule.id}`),
69
+ default: () => []
70
+ });
71
+ async function addStation() {
72
+ if (await actions.createStation(props.schedule, props.teams)) await refresh();
73
+ }
74
+ const RowMenu = resolveComponent("RowMenu");
75
+ const columns = computed(() => [
76
+ { accessorKey: "name", header: t("admin.name", "Name"), cell: ({ row }) => h("span", { class: "text-highlighted font-medium" }, tr(row.original.name)) },
77
+ { accessorKey: "teamId", header: t("admin.team", "Team"), cell: ({ row }) => teamName(row.original.teamId) },
78
+ { accessorKey: "featureId", header: t("stations.feature", "Station on the venue layout"), cell: ({ row }) => row.original.featureId ?? "" },
79
+ {
80
+ id: "actions",
81
+ meta: { class: { th: "w-0", td: "w-0" } },
82
+ cell: ({ row }) => h(RowMenu, { items: actions.stationMenu(row.original, { schedule: props.schedule, teams: props.teams, changed: refresh }), subject: tr(row.original.name) })
83
+ }
84
+ ]);
85
+ </script>
86
+
87
+ <template>
88
+ <div class="flex flex-col gap-4">
89
+ <UAlert
90
+ v-if="!stationReady"
91
+ icon="i-lucide-key-round"
92
+ :color="stationInUse ? 'warning' : 'neutral'"
93
+ variant="subtle"
94
+ :title="t('checkIn.stationKeyMissing', 'Station check-in needs a station key')"
95
+ :description="stationInUse ? t('checkIn.stationKeyMissingInUse', 'Station check-in is on, but the server has no NUXT_SHIFTS_STATION_KEY: volunteers cannot check in by station and station screens do not open. Set the key, or turn the mode off. The other modes work.') : t('checkIn.stationKeyMissingHint', 'Set NUXT_SHIFTS_STATION_KEY on the server to use station check-in and station screens. The other modes work without it.')"
96
+ />
97
+ <SectionCard
98
+ :title="t('checkIn.title', 'How volunteers check in')"
99
+ :description="t('checkIn.description', 'Any mode that is on is enough. A lead can always scan a volunteer\'s pass.')"
100
+ >
101
+ <div class="divide-default divide-y">
102
+ <FormRow
103
+ name="modes"
104
+ :label="t('checkIn.modesLabel', 'Check-in modes')"
105
+ :description="t('checkIn.modesHint', 'Besides a lead scanning the pass.')"
106
+ >
107
+ <UCheckboxGroup
108
+ v-model="modes"
109
+ :items="modeItems"
110
+ />
111
+ </FormRow>
112
+ <FormRow
113
+ v-if="modes.includes('location')"
114
+ name="location"
115
+ :label="t('checkIn.location', 'Check-in place')"
116
+ :description="t('checkIn.locationHint', 'A point and radius ({radius} m unless you set one), or an area. The phone\'s accuracy must be within the radius.', { radius: DEFAULT_CHECK_IN_RADIUS })"
117
+ >
118
+ <MapLocationField
119
+ v-model="location"
120
+ :modes="['radius', 'area']"
121
+ :default-radius="DEFAULT_CHECK_IN_RADIUS"
122
+ height="16rem"
123
+ />
124
+ </FormRow>
125
+ <FormRow
126
+ name="autoNoShow"
127
+ :label="t('checkIn.autoNoShow', 'Automatic no-shows')"
128
+ :description="t('checkIn.autoNoShowHint', 'Mark people who have not checked in this long after the start as no-shows. Their leads get it in a digest.')"
129
+ >
130
+ <div class="flex flex-wrap items-center gap-3">
131
+ <USwitch
132
+ v-model="autoNoShow"
133
+ :label="t('checkIn.autoNoShowOn', 'On')"
134
+ />
135
+ <UInputNumber
136
+ v-model="autoNoShowMinutes"
137
+ :min="0"
138
+ :max="1440"
139
+ :disabled="!autoNoShow"
140
+ class="w-32"
141
+ :aria-label="t('checkIn.autoNoShowMinutes', 'Minutes after the start')"
142
+ />
143
+ <span class="text-muted text-sm">{{ t("checkIn.minutesAfterStart", "minutes after the start") }}</span>
144
+ </div>
145
+ </FormRow>
146
+ <FormRow
147
+ name="teams"
148
+ :label="t('checkIn.overrides', 'Per team')"
149
+ :description="t('checkIn.overridesHint', 'A team can check in differently, e.g. at its own bar.')"
150
+ >
151
+ <div class="flex flex-col gap-4">
152
+ <div
153
+ v-for="(item, index) in overrides"
154
+ :key="item.teamId"
155
+ class="border-default flex flex-col gap-2 rounded-md border p-3"
156
+ >
157
+ <div class="flex items-center justify-between gap-2">
158
+ <span class="text-highlighted text-sm font-semibold">{{ teamName(item.teamId) }}</span>
159
+ <UButton
160
+ icon="i-lucide-x"
161
+ color="neutral"
162
+ variant="ghost"
163
+ size="sm"
164
+ :aria-label="t('checkIn.removeOverride', 'Remove the override of {team}', { team: teamName(item.teamId) })"
165
+ @click="overrides.splice(index, 1)"
166
+ />
167
+ </div>
168
+ <UCheckboxGroup
169
+ v-model="item.modes"
170
+ :items="modeItemsFor(item.modes)"
171
+ orientation="horizontal"
172
+ />
173
+ <MapLocationField
174
+ v-if="item.modes.includes('location')"
175
+ v-model="item.location"
176
+ :modes="['radius', 'area']"
177
+ :default-radius="DEFAULT_CHECK_IN_RADIUS"
178
+ height="12rem"
179
+ />
180
+ </div>
181
+ <USelect
182
+ v-if="addableTeams.length"
183
+ v-model="teamToAdd"
184
+ :items="addableTeams"
185
+ :placeholder="t('checkIn.addOverride', 'Add a team override')"
186
+ class="w-60"
187
+ @update:model-value="addOverride"
188
+ />
189
+ </div>
190
+ </FormRow>
191
+ </div>
192
+ <template #footer>
193
+ <div class="flex justify-end gap-2">
194
+ <UButton
195
+ color="neutral"
196
+ variant="outline"
197
+ :label="t('checkIn.reset', 'Discard changes')"
198
+ @click="reset"
199
+ />
200
+ <UButton
201
+ :loading="busy"
202
+ :label="t('checkIn.save', 'Save check-in settings')"
203
+ @click="save"
204
+ />
205
+ </div>
206
+ </template>
207
+ </SectionCard>
208
+
209
+ <TableCard
210
+ :title="t('stations.title', 'Check-in stations')"
211
+ :description="t('stations.cardDescription', 'Screens with a QR code that changes every 30 seconds. Open one on a tablet at the bar; leads of the team can open it too.')"
212
+ :loading="status === 'pending' && !stations.length"
213
+ >
214
+ <template #actions>
215
+ <UButton
216
+ icon="i-lucide-plus"
217
+ :label="t('stations.create', 'Add station')"
218
+ :disabled="!teams.length"
219
+ @click="addStation"
220
+ />
221
+ </template>
222
+ <UTable
223
+ :data="stations"
224
+ :columns="columns"
225
+ :ui="tableUi()"
226
+ >
227
+ <template #empty>
228
+ <UEmpty
229
+ icon="i-lucide-qr-code"
230
+ :title="t('stations.empty', 'No stations yet')"
231
+ :description="t('stations.emptyDescription', 'Add one per bar or gate when volunteers check in by station.')"
232
+ :actions="[{ label: t('stations.create', 'Add station'), icon: 'i-lucide-plus', onClick: addStation }]"
233
+ />
234
+ </template>
235
+ </UTable>
236
+ </TableCard>
237
+ </div>
238
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ import type { ShiftScheduleDto } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ schedule: ShiftScheduleDto;
5
+ teams: ShiftsTeamOption[];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ changed: () => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChanged?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { ShiftCopyResultDto, ShiftScheduleDto } from '../../../types.js';
2
+ type __VLS_Props = {
3
+ schedule: ShiftScheduleDto;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (saved: false | ShiftCopyResultDto) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onClose?: ((saved: false | ShiftCopyResultDto) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,71 @@
1
+ <script setup>
2
+ import { z } from "zod";
3
+ import { shiftsApi } from "../../utils/api";
4
+ import { $fetch, computed, reactive, useAction, useFetch, useModuleT, useShiftsTranslate } from "#imports";
5
+ defineOptions({ name: "ShiftCopySlideover" });
6
+ const props = defineProps({
7
+ schedule: { type: Object, required: true }
8
+ });
9
+ const emit = defineEmits(["close"]);
10
+ const t = useModuleT("shifts");
11
+ const tr = useShiftsTranslate();
12
+ const { busy, run } = useAction();
13
+ const { data: schedules } = await useFetch(shiftsApi.admin.schedules, { key: "shifts:all-schedules", default: () => [] });
14
+ const options = computed(() => schedules.value.filter((item) => item.id !== props.schedule.id).map((item) => ({
15
+ label: `${tr(item.name)} (${t("admin.shiftCount", "{count} shifts", { count: item.shiftCount ?? 0 })})`,
16
+ value: item.id
17
+ })));
18
+ const schema = z.object({
19
+ scheduleId: z.string().min(1, t("admin.sourceRequired", "Choose a schedule to copy.")),
20
+ offsetDays: z.number().int().min(-3660).max(3660)
21
+ });
22
+ const state = reactive({ scheduleId: "", offsetDays: 0 });
23
+ async function save(event) {
24
+ const result = await run(
25
+ () => $fetch(shiftsApi.admin.copyFrom(props.schedule.id), { method: "POST", body: event.data }),
26
+ { success: t("admin.copied", "Copied the shifts into {name}", { name: tr(props.schedule.name) }) }
27
+ );
28
+ if (result) emit("close", result);
29
+ }
30
+ </script>
31
+
32
+ <template>
33
+ <FormSlideover
34
+ form-id="shift-copy-form"
35
+ :title="t('admin.copyTitle', 'Copy from another schedule')"
36
+ :description="t('admin.copyDescription', 'Copies the shift roles and shifts, not who works them, and the coverage, handover and approval, which replace this schedule\'s. Teams of another operation are matched by name.')"
37
+ :submit-label="t('admin.copySubmit', 'Copy shifts')"
38
+ :loading="busy"
39
+ @close="emit('close', false)"
40
+ >
41
+ <UForm
42
+ id="shift-copy-form"
43
+ :schema="schema"
44
+ :state="state"
45
+ class="flex flex-col gap-4"
46
+ @submit="save"
47
+ >
48
+ <UFormField
49
+ name="scheduleId"
50
+ :label="t('admin.sourceSchedule', 'Schedule')"
51
+ required
52
+ >
53
+ <USelect
54
+ v-model="state.scheduleId"
55
+ :items="options"
56
+ class="w-full"
57
+ />
58
+ </UFormField>
59
+ <UFormField
60
+ name="offsetDays"
61
+ :label="t('admin.offsetDays', 'Move by days')"
62
+ :description="t('admin.offsetDaysHelp', 'The shifts keep their local times. 364 keeps the weekday a year on.')"
63
+ >
64
+ <UInputNumber
65
+ v-model="state.offsetDays"
66
+ class="w-full"
67
+ />
68
+ </UFormField>
69
+ </UForm>
70
+ </FormSlideover>
71
+ </template>
@@ -0,0 +1,11 @@
1
+ import type { ShiftCopyResultDto, ShiftScheduleDto } from '../../../types.js';
2
+ type __VLS_Props = {
3
+ schedule: ShiftScheduleDto;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (saved: false | ShiftCopyResultDto) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onClose?: ((saved: false | ShiftCopyResultDto) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import type { ShiftsTeamOption } from '../utils/admin-shifts.js';
2
+ import type { ShiftWithAssigneesDto } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ shifts: ShiftWithAssigneesDto[];
5
+ day: string;
6
+ teams: ShiftsTeamOption[];
7
+ timeZone: string;
8
+ minPerShift?: number | null;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ open: (shift: ShiftWithAssigneesDto) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onOpen?: ((shift: ShiftWithAssigneesDto) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;