@frigear-nu/shifts 0.0.0-stage → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/README.md +53 -2
  2. package/dist/module.d.mts +709 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +253 -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 +169 -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 +192 -0
  96. package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
  97. package/dist/runtime/app/tabs/Shifts.d.vue.ts +9 -0
  98. package/dist/runtime/app/tabs/Shifts.vue +487 -0
  99. package/dist/runtime/app/tabs/Shifts.vue.d.ts +9 -0
  100. package/dist/runtime/app/utils/admin-shifts.d.ts +42 -0
  101. package/dist/runtime/app/utils/admin-shifts.js +36 -0
  102. package/dist/runtime/dashboard.d.ts +8 -0
  103. package/dist/runtime/dashboard.js +30 -0
  104. package/dist/runtime/emails/shifts-broadcast.d.vue.ts +8 -0
  105. package/dist/runtime/emails/shifts-broadcast.vue +24 -0
  106. package/dist/runtime/emails/shifts-broadcast.vue.d.ts +8 -0
  107. package/dist/runtime/emails/shifts-reminder.d.vue.ts +12 -0
  108. package/dist/runtime/emails/shifts-reminder.vue +34 -0
  109. package/dist/runtime/emails/shifts-reminder.vue.d.ts +12 -0
  110. package/dist/runtime/emails/shifts-swap-accepted.d.vue.ts +11 -0
  111. package/dist/runtime/emails/shifts-swap-accepted.vue +32 -0
  112. package/dist/runtime/emails/shifts-swap-accepted.vue.d.ts +11 -0
  113. package/dist/runtime/emails/shifts-swap-completed.d.vue.ts +11 -0
  114. package/dist/runtime/emails/shifts-swap-completed.vue +32 -0
  115. package/dist/runtime/emails/shifts-swap-completed.vue.d.ts +11 -0
  116. package/dist/runtime/emails/shifts-swap-offered.d.vue.ts +11 -0
  117. package/dist/runtime/emails/shifts-swap-offered.vue +32 -0
  118. package/dist/runtime/emails/shifts-swap-offered.vue.d.ts +11 -0
  119. package/dist/runtime/emails/shifts-swap-pending.d.vue.ts +11 -0
  120. package/dist/runtime/emails/shifts-swap-pending.vue +32 -0
  121. package/dist/runtime/emails/shifts-swap-pending.vue.d.ts +11 -0
  122. package/dist/runtime/emails/shifts-swap-proposed.d.vue.ts +11 -0
  123. package/dist/runtime/emails/shifts-swap-proposed.vue +32 -0
  124. package/dist/runtime/emails/shifts-swap-proposed.vue.d.ts +11 -0
  125. package/dist/runtime/emails/shifts-swap-rejected.d.vue.ts +11 -0
  126. package/dist/runtime/emails/shifts-swap-rejected.vue +32 -0
  127. package/dist/runtime/emails/shifts-swap-rejected.vue.d.ts +11 -0
  128. package/dist/runtime/i18n/lang/da.json +626 -0
  129. package/dist/runtime/i18n/lang/en.json +626 -0
  130. package/dist/runtime/menus.d.ts +2 -0
  131. package/dist/runtime/menus.js +17 -0
  132. package/dist/runtime/notifications.d.ts +9 -0
  133. package/dist/runtime/notifications.js +36 -0
  134. package/dist/runtime/server/db/schema.postgresql.d.ts +2151 -0
  135. package/dist/runtime/server/db/schema.postgresql.js +228 -0
  136. package/dist/runtime/server/db/schema.sqlite.d.ts +2263 -0
  137. package/dist/runtime/server/db/schema.sqlite.js +228 -0
  138. package/dist/runtime/server/digest-email.d.ts +17 -0
  139. package/dist/runtime/server/digest-email.js +42 -0
  140. package/dist/runtime/server/plugins/station-key.d.ts +2 -0
  141. package/dist/runtime/server/plugins/station-key.js +5 -0
  142. package/dist/runtime/server/plugins/teams.d.ts +2 -0
  143. package/dist/runtime/server/plugins/teams.js +19 -0
  144. package/dist/runtime/server/policies.d.ts +2 -0
  145. package/dist/runtime/server/policies.js +41 -0
  146. package/dist/runtime/server/reminder-email.d.ts +67 -0
  147. package/dist/runtime/server/reminder-email.js +109 -0
  148. package/dist/runtime/server/routes/admin/assignment.delete.d.ts +2 -0
  149. package/dist/runtime/server/routes/admin/assignment.delete.js +10 -0
  150. package/dist/runtime/server/routes/admin/assignments.post.d.ts +2 -0
  151. package/dist/runtime/server/routes/admin/assignments.post.js +11 -0
  152. package/dist/runtime/server/routes/admin/broadcasts.get.d.ts +2 -0
  153. package/dist/runtime/server/routes/admin/broadcasts.get.js +8 -0
  154. package/dist/runtime/server/routes/admin/broadcasts.post.d.ts +2 -0
  155. package/dist/runtime/server/routes/admin/broadcasts.post.js +9 -0
  156. package/dist/runtime/server/routes/admin/candidates.get.d.ts +2 -0
  157. package/dist/runtime/server/routes/admin/candidates.get.js +10 -0
  158. package/dist/runtime/server/routes/admin/operation-teams.get.d.ts +2 -0
  159. package/dist/runtime/server/routes/admin/operation-teams.get.js +9 -0
  160. package/dist/runtime/server/routes/admin/perk.delete.d.ts +2 -0
  161. package/dist/runtime/server/routes/admin/perk.delete.js +10 -0
  162. package/dist/runtime/server/routes/admin/perk.patch.d.ts +2 -0
  163. package/dist/runtime/server/routes/admin/perk.patch.js +10 -0
  164. package/dist/runtime/server/routes/admin/perks.get.d.ts +2 -0
  165. package/dist/runtime/server/routes/admin/perks.get.js +9 -0
  166. package/dist/runtime/server/routes/admin/perks.post.d.ts +2 -0
  167. package/dist/runtime/server/routes/admin/perks.post.js +10 -0
  168. package/dist/runtime/server/routes/admin/role.delete.d.ts +2 -0
  169. package/dist/runtime/server/routes/admin/role.delete.js +11 -0
  170. package/dist/runtime/server/routes/admin/role.patch.d.ts +2 -0
  171. package/dist/runtime/server/routes/admin/role.patch.js +11 -0
  172. package/dist/runtime/server/routes/admin/roles.get.d.ts +2 -0
  173. package/dist/runtime/server/routes/admin/roles.get.js +9 -0
  174. package/dist/runtime/server/routes/admin/roles.post.d.ts +2 -0
  175. package/dist/runtime/server/routes/admin/roles.post.js +10 -0
  176. package/dist/runtime/server/routes/admin/schedule-copy.post.d.ts +2 -0
  177. package/dist/runtime/server/routes/admin/schedule-copy.post.js +12 -0
  178. package/dist/runtime/server/routes/admin/schedule-publish.post.d.ts +2 -0
  179. package/dist/runtime/server/routes/admin/schedule-publish.post.js +9 -0
  180. package/dist/runtime/server/routes/admin/schedule.delete.d.ts +2 -0
  181. package/dist/runtime/server/routes/admin/schedule.delete.js +10 -0
  182. package/dist/runtime/server/routes/admin/schedule.get.d.ts +2 -0
  183. package/dist/runtime/server/routes/admin/schedule.get.js +9 -0
  184. package/dist/runtime/server/routes/admin/schedule.patch.d.ts +2 -0
  185. package/dist/runtime/server/routes/admin/schedule.patch.js +10 -0
  186. package/dist/runtime/server/routes/admin/schedules.get.d.ts +2 -0
  187. package/dist/runtime/server/routes/admin/schedules.get.js +10 -0
  188. package/dist/runtime/server/routes/admin/schedules.post.d.ts +2 -0
  189. package/dist/runtime/server/routes/admin/schedules.post.js +9 -0
  190. package/dist/runtime/server/routes/admin/shift.delete.d.ts +2 -0
  191. package/dist/runtime/server/routes/admin/shift.delete.js +10 -0
  192. package/dist/runtime/server/routes/admin/shift.patch.d.ts +2 -0
  193. package/dist/runtime/server/routes/admin/shift.patch.js +10 -0
  194. package/dist/runtime/server/routes/admin/shifts-bulk.post.d.ts +2 -0
  195. package/dist/runtime/server/routes/admin/shifts-bulk.post.js +10 -0
  196. package/dist/runtime/server/routes/admin/shifts.get.d.ts +2 -0
  197. package/dist/runtime/server/routes/admin/shifts.get.js +10 -0
  198. package/dist/runtime/server/routes/admin/station.delete.d.ts +2 -0
  199. package/dist/runtime/server/routes/admin/station.delete.js +11 -0
  200. package/dist/runtime/server/routes/admin/station.patch.d.ts +2 -0
  201. package/dist/runtime/server/routes/admin/station.patch.js +11 -0
  202. package/dist/runtime/server/routes/admin/stations.get.d.ts +2 -0
  203. package/dist/runtime/server/routes/admin/stations.get.js +9 -0
  204. package/dist/runtime/server/routes/admin/stations.post.d.ts +2 -0
  205. package/dist/runtime/server/routes/admin/stations.post.js +10 -0
  206. package/dist/runtime/server/routes/admin/swap-cancel.post.d.ts +2 -0
  207. package/dist/runtime/server/routes/admin/swap-cancel.post.js +10 -0
  208. package/dist/runtime/server/routes/admin/swaps.get.d.ts +2 -0
  209. package/dist/runtime/server/routes/admin/swaps.get.js +10 -0
  210. package/dist/runtime/server/routes/feed/feed.get.d.ts +2 -0
  211. package/dist/runtime/server/routes/feed/feed.get.js +9 -0
  212. package/dist/runtime/server/routes/lead/attended.post.d.ts +2 -0
  213. package/dist/runtime/server/routes/lead/attended.post.js +11 -0
  214. package/dist/runtime/server/routes/lead/broadcast.post.d.ts +2 -0
  215. package/dist/runtime/server/routes/lead/broadcast.post.js +12 -0
  216. package/dist/runtime/server/routes/lead/check-in.post.d.ts +2 -0
  217. package/dist/runtime/server/routes/lead/check-in.post.js +9 -0
  218. package/dist/runtime/server/routes/lead/exceptions.get.d.ts +2 -0
  219. package/dist/runtime/server/routes/lead/exceptions.get.js +8 -0
  220. package/dist/runtime/server/routes/lead/no-show.post.d.ts +2 -0
  221. package/dist/runtime/server/routes/lead/no-show.post.js +11 -0
  222. package/dist/runtime/server/routes/lead/now.get.d.ts +2 -0
  223. package/dist/runtime/server/routes/lead/now.get.js +9 -0
  224. package/dist/runtime/server/routes/lead/on-duty.get.d.ts +2 -0
  225. package/dist/runtime/server/routes/lead/on-duty.get.js +10 -0
  226. package/dist/runtime/server/routes/lead/stations.get.d.ts +2 -0
  227. package/dist/runtime/server/routes/lead/stations.get.js +8 -0
  228. package/dist/runtime/server/routes/lead/team-shifts.get.d.ts +2 -0
  229. package/dist/runtime/server/routes/lead/team-shifts.get.js +9 -0
  230. package/dist/runtime/server/routes/lead/team-swaps.get.d.ts +2 -0
  231. package/dist/runtime/server/routes/lead/team-swaps.get.js +9 -0
  232. package/dist/runtime/server/routes/me/check-in.post.d.ts +2 -0
  233. package/dist/runtime/server/routes/me/check-in.post.js +11 -0
  234. package/dist/runtime/server/routes/me/earned-perk-claim.post.d.ts +2 -0
  235. package/dist/runtime/server/routes/me/earned-perk-claim.post.js +10 -0
  236. package/dist/runtime/server/routes/me/earned-perks.get.d.ts +2 -0
  237. package/dist/runtime/server/routes/me/earned-perks.get.js +9 -0
  238. package/dist/runtime/server/routes/me/feed-token.delete.d.ts +2 -0
  239. package/dist/runtime/server/routes/me/feed-token.delete.js +7 -0
  240. package/dist/runtime/server/routes/me/feed-token.get.d.ts +2 -0
  241. package/dist/runtime/server/routes/me/feed-token.get.js +6 -0
  242. package/dist/runtime/server/routes/me/feed-token.post.d.ts +2 -0
  243. package/dist/runtime/server/routes/me/feed-token.post.js +7 -0
  244. package/dist/runtime/server/routes/me/leads.get.d.ts +2 -0
  245. package/dist/runtime/server/routes/me/leads.get.js +5 -0
  246. package/dist/runtime/server/routes/me/now.get.d.ts +2 -0
  247. package/dist/runtime/server/routes/me/now.get.js +5 -0
  248. package/dist/runtime/server/routes/me/pass.get.d.ts +2 -0
  249. package/dist/runtime/server/routes/me/pass.get.js +11 -0
  250. package/dist/runtime/server/routes/me/settle.post.d.ts +2 -0
  251. package/dist/runtime/server/routes/me/settle.post.js +14 -0
  252. package/dist/runtime/server/routes/me/shift.get.d.ts +2 -0
  253. package/dist/runtime/server/routes/me/shift.get.js +10 -0
  254. package/dist/runtime/server/routes/me/shifts.get.d.ts +2 -0
  255. package/dist/runtime/server/routes/me/shifts.get.js +6 -0
  256. package/dist/runtime/server/routes/me/swap.delete.d.ts +2 -0
  257. package/dist/runtime/server/routes/me/swap.delete.js +11 -0
  258. package/dist/runtime/server/routes/me/swap.post.d.ts +2 -0
  259. package/dist/runtime/server/routes/me/swap.post.js +11 -0
  260. package/dist/runtime/server/routes/stations/token.get.d.ts +2 -0
  261. package/dist/runtime/server/routes/stations/token.get.js +12 -0
  262. package/dist/runtime/server/routes/swaps/approve.post.d.ts +2 -0
  263. package/dist/runtime/server/routes/swaps/approve.post.js +9 -0
  264. package/dist/runtime/server/routes/swaps/list.get.d.ts +2 -0
  265. package/dist/runtime/server/routes/swaps/list.get.js +5 -0
  266. package/dist/runtime/server/routes/swaps/offer-accept.post.d.ts +2 -0
  267. package/dist/runtime/server/routes/swaps/offer-accept.post.js +9 -0
  268. package/dist/runtime/server/routes/swaps/offer-reject.post.d.ts +2 -0
  269. package/dist/runtime/server/routes/swaps/offer-reject.post.js +9 -0
  270. package/dist/runtime/server/routes/swaps/offer.delete.d.ts +2 -0
  271. package/dist/runtime/server/routes/swaps/offer.delete.js +11 -0
  272. package/dist/runtime/server/routes/swaps/offer.post.d.ts +2 -0
  273. package/dist/runtime/server/routes/swaps/offer.post.js +11 -0
  274. package/dist/runtime/server/routes/swaps/reject.post.d.ts +2 -0
  275. package/dist/runtime/server/routes/swaps/reject.post.js +9 -0
  276. package/dist/runtime/server/swap-email.d.ts +28 -0
  277. package/dist/runtime/server/swap-email.js +49 -0
  278. package/dist/runtime/server/tasks/close-shifts.d.ts +2 -0
  279. package/dist/runtime/server/tasks/close-shifts.js +9 -0
  280. package/dist/runtime/server/tasks/send-reminders.d.ts +2 -0
  281. package/dist/runtime/server/tasks/send-reminders.js +9 -0
  282. package/dist/runtime/server/utils/shifts-admin.d.ts +67 -0
  283. package/dist/runtime/server/utils/shifts-admin.js +312 -0
  284. package/dist/runtime/server/utils/shifts-assign.d.ts +89 -0
  285. package/dist/runtime/server/utils/shifts-assign.js +264 -0
  286. package/dist/runtime/server/utils/shifts-automation.d.ts +37 -0
  287. package/dist/runtime/server/utils/shifts-automation.js +171 -0
  288. package/dist/runtime/server/utils/shifts-broadcasts.d.ts +38 -0
  289. package/dist/runtime/server/utils/shifts-broadcasts.js +113 -0
  290. package/dist/runtime/server/utils/shifts-core.d.ts +78 -0
  291. package/dist/runtime/server/utils/shifts-core.js +142 -0
  292. package/dist/runtime/server/utils/shifts-dto.d.ts +32 -0
  293. package/dist/runtime/server/utils/shifts-dto.js +127 -0
  294. package/dist/runtime/server/utils/shifts-emails.d.ts +16 -0
  295. package/dist/runtime/server/utils/shifts-emails.js +44 -0
  296. package/dist/runtime/server/utils/shifts-exceptions.d.ts +7 -0
  297. package/dist/runtime/server/utils/shifts-exceptions.js +32 -0
  298. package/dist/runtime/server/utils/shifts-feed.d.ts +16 -0
  299. package/dist/runtime/server/utils/shifts-feed.js +73 -0
  300. package/dist/runtime/server/utils/shifts-notify.d.ts +40 -0
  301. package/dist/runtime/server/utils/shifts-notify.js +22 -0
  302. package/dist/runtime/server/utils/shifts-on-duty.d.ts +12 -0
  303. package/dist/runtime/server/utils/shifts-on-duty.js +37 -0
  304. package/dist/runtime/server/utils/shifts-perks.d.ts +46 -0
  305. package/dist/runtime/server/utils/shifts-perks.js +183 -0
  306. package/dist/runtime/server/utils/shifts-reminders.d.ts +30 -0
  307. package/dist/runtime/server/utils/shifts-reminders.js +102 -0
  308. package/dist/runtime/server/utils/shifts-schemas.d.ts +318 -0
  309. package/dist/runtime/server/utils/shifts-schemas.js +177 -0
  310. package/dist/runtime/server/utils/shifts-station-key.d.ts +7 -0
  311. package/dist/runtime/server/utils/shifts-station-key.js +22 -0
  312. package/dist/runtime/server/utils/shifts-stations.d.ts +28 -0
  313. package/dist/runtime/server/utils/shifts-stations.js +109 -0
  314. package/dist/runtime/server/utils/shifts-swaps.d.ts +114 -0
  315. package/dist/runtime/server/utils/shifts-swaps.js +559 -0
  316. package/dist/runtime/server/utils/shifts-views.d.ts +62 -0
  317. package/dist/runtime/server/utils/shifts-views.js +212 -0
  318. package/dist/runtime/utils/api.d.ts +108 -0
  319. package/dist/runtime/utils/api.js +111 -0
  320. package/dist/runtime/utils/checkin.d.ts +59 -0
  321. package/dist/runtime/utils/checkin.js +57 -0
  322. package/dist/runtime/utils/guards.d.ts +21 -0
  323. package/dist/runtime/utils/guards.js +36 -0
  324. package/dist/runtime/utils/ics.d.ts +32 -0
  325. package/dist/runtime/utils/ics.js +56 -0
  326. package/dist/runtime/utils/index.d.ts +16 -0
  327. package/dist/runtime/utils/index.js +15 -0
  328. package/dist/runtime/utils/links.d.ts +30 -0
  329. package/dist/runtime/utils/links.js +18 -0
  330. package/dist/runtime/utils/reminders.d.ts +27 -0
  331. package/dist/runtime/utils/reminders.js +28 -0
  332. package/dist/runtime/utils/settings.d.ts +28 -0
  333. package/dist/runtime/utils/settings.js +18 -0
  334. package/dist/runtime/utils/station-key.d.ts +9 -0
  335. package/dist/runtime/utils/station-key.js +12 -0
  336. package/dist/runtime/utils/status.d.ts +23 -0
  337. package/dist/runtime/utils/status.js +46 -0
  338. package/dist/runtime/utils/time.d.ts +22 -0
  339. package/dist/runtime/utils/time.js +14 -0
  340. package/dist/types.d.mts +5 -0
  341. package/package.json +131 -3
@@ -0,0 +1,93 @@
1
+ <script setup>
2
+ import { shiftsApi } from "../../utils/api";
3
+ import { $fetch, computed, errorMessage, navigateTo, ref, useAuthPages, useHead, useModuleT, useRoute, useShiftsFormat } from "#imports";
4
+ defineOptions({ name: "ShiftsCheckInPage" });
5
+ const t = useModuleT("shifts");
6
+ const format = useShiftsFormat();
7
+ const route = useRoute();
8
+ const teamId = computed(() => String(route.params.teamId ?? ""));
9
+ const result = ref(null);
10
+ const code = ref("");
11
+ const busy = ref(false);
12
+ const failureTitle = (status, errorCode) => {
13
+ if (status === 404) return t("scanner.unknown", "Unknown code for this team");
14
+ if (status === 403) return t("scanner.forbidden", "You do not lead this team");
15
+ if (errorCode === "outside_window") return t("scanner.outsideWindow", "Check-in for this shift is not open now");
16
+ if (errorCode === "assignment_cancelled") return t("scanner.cancelled", "This person was taken off the shift");
17
+ return t("scanner.failed", "Could not check in");
18
+ };
19
+ const REPEAT_MS = 3e3;
20
+ let last = null;
21
+ async function scan(value) {
22
+ const trimmed = value.trim();
23
+ if (!trimmed || busy.value) return;
24
+ if (last && last.code === trimmed && Date.now() - last.at < REPEAT_MS) return;
25
+ last = { code: trimmed, at: Date.now() };
26
+ busy.value = true;
27
+ try {
28
+ const answer = await $fetch(shiftsApi.teams.checkIn(teamId.value), { method: "POST", body: { code: trimmed } });
29
+ const name = answer.assignment.person.name ?? `#${answer.assignment.userId}`;
30
+ const when = `${format.time(answer.shift.startsAt)}\u2013${format.time(answer.shift.endsAt)}`;
31
+ result.value = answer.alreadyCheckedIn ? { tone: "warning", title: t("scanner.already", "{name} was checked in already", { name }), description: t("scanner.alreadyAt", "At {time}, shift {when}", { time: format.time(answer.checkedInAt), when }) } : {
32
+ tone: "success",
33
+ title: t("scanner.checkedIn", "Checked in {name}", { name }),
34
+ description: answer.alsoCheckedIn.length ? t("scanner.shiftAndDaily", "Shift {when}, and {count} more today", { when, count: answer.alsoCheckedIn.length }) : t("scanner.shift", "Shift {when}", { when })
35
+ };
36
+ code.value = "";
37
+ } catch (error) {
38
+ const status = error.statusCode;
39
+ if (status === 401) return navigateTo({ path: useAuthPages().login, query: { redirect: route.path } });
40
+ const errorCode = error.data?.data?.code;
41
+ result.value = {
42
+ tone: "error",
43
+ title: failureTitle(status, errorCode),
44
+ description: status === 404 || status === 403 ? void 0 : errorMessage(error, "")
45
+ };
46
+ } finally {
47
+ busy.value = false;
48
+ }
49
+ }
50
+ useHead({ title: () => t("scanner.title", "Check in") });
51
+ </script>
52
+
53
+ <template>
54
+ <UContainer>
55
+ <UPage>
56
+ <UPageHeader
57
+ :title="t('scanner.title', 'Check in')"
58
+ :description="t('scanner.description', 'Scan the QR pass of a person on your team, or type the code under it.')"
59
+ />
60
+ <UPageBody class="mx-auto flex w-full max-w-md flex-col gap-4">
61
+ <UAlert
62
+ v-if="result"
63
+ :color="result.tone"
64
+ variant="subtle"
65
+ :icon="result.tone === 'success' ? 'i-lucide-check-circle' : result.tone === 'warning' ? 'i-lucide-info' : 'i-lucide-circle-alert'"
66
+ :title="result.title"
67
+ :description="result.description"
68
+ />
69
+ <ShiftQrScanner
70
+ :paused="busy"
71
+ @detect="scan"
72
+ />
73
+ <form
74
+ class="flex gap-2"
75
+ @submit.prevent="scan(code)"
76
+ >
77
+ <UInput
78
+ v-model="code"
79
+ :placeholder="t('scanner.codePlaceholder', 'Code')"
80
+ :aria-label="t('scanner.code', 'Check-in code')"
81
+ autocomplete="off"
82
+ class="flex-1"
83
+ />
84
+ <UButton
85
+ type="submit"
86
+ :loading="busy"
87
+ :label="t('scanner.checkInAction', 'Check in person')"
88
+ />
89
+ </form>
90
+ </UPageBody>
91
+ </UPage>
92
+ </UContainer>
93
+ </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,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,300 @@
1
+ <script setup>
2
+ import { shiftsApi } from "../../utils/api";
3
+ import { SHIFT_ASSIGNMENT_STATUS_LABELS } from "../../utils/status";
4
+ import { dayKey } from "@frigear-nu/module-kit/time";
5
+ import { $fetch, computed, errorMessage, navigateTo, ref, useAction, useAuthPages, useFetch, useHead, useModuleT, useRoute, useShiftsActions, useShiftsFormat, useShiftsLinks, useShiftsTranslate } from "#imports";
6
+ defineOptions({ name: "ShiftsLeadPage" });
7
+ const t = useModuleT("shifts");
8
+ const tr = useShiftsTranslate();
9
+ const format = useShiftsFormat();
10
+ const links = useShiftsLinks();
11
+ const actions = useShiftsActions();
12
+ const { run } = useAction();
13
+ const route = useRoute();
14
+ const teamId = computed(() => String(route.params.teamId ?? ""));
15
+ const from = `${dayKey(/* @__PURE__ */ new Date(), format.timeZone)}T00:00:00.000Z`;
16
+ const { data: shifts, error, refresh } = await useFetch(() => shiftsApi.teams.shifts(teamId.value), {
17
+ query: { from },
18
+ key: computed(() => `shifts:lead:${teamId.value}`),
19
+ default: () => []
20
+ });
21
+ if (error.value?.statusCode === 401) {
22
+ await navigateTo({ path: useAuthPages().login, query: { redirect: route.path } });
23
+ }
24
+ const { data: swaps, refresh: refreshSwaps } = await useFetch(() => shiftsApi.teams.swaps(teamId.value), {
25
+ query: { status: "pending_approval" },
26
+ key: computed(() => `shifts:lead-swaps:${teamId.value}`),
27
+ default: () => []
28
+ });
29
+ const { data: exceptions, refresh: refreshExceptions } = await useFetch(() => shiftsApi.teams.exceptions(teamId.value), {
30
+ key: computed(() => `shifts:lead-exceptions:${teamId.value}`),
31
+ default: () => []
32
+ });
33
+ const { data: stations } = await useFetch(() => shiftsApi.teams.stations(teamId.value), {
34
+ key: computed(() => `shifts:lead-stations:${teamId.value}`),
35
+ default: () => []
36
+ });
37
+ const view = ref("exceptions");
38
+ const viewItems = computed(() => [
39
+ { label: t("lead.viewExceptions", "Exceptions ({count})", { count: exceptions.value.length }), value: "exceptions", icon: "i-lucide-triangle-alert" },
40
+ { label: t("lead.viewShifts", "All shifts"), value: "shifts", icon: "i-lucide-list" }
41
+ ]);
42
+ const exceptionLabel = (item) => ({
43
+ no_show: t("exceptions.no_show", "No-show"),
44
+ late: t("exceptions.late", "Late by {minutes} min", { minutes: item.lateMinutes ?? 0 }),
45
+ not_checked_in: t("exceptions.not_checked_in", "Not checked in"),
46
+ claimed_no_show: t("exceptions.claimed_no_show", "No-show, perk claimed")
47
+ })[item.kind];
48
+ const exceptionColor = (kind) => kind === "late" ? "warning" : kind === "not_checked_in" ? "info" : "error";
49
+ const { data: led } = await useFetch(shiftsApi.me.leads, { key: "shifts:leads", default: () => [] });
50
+ const team = computed(() => led.value.find((item) => item.teamId === teamId.value));
51
+ const days = computed(() => {
52
+ const byDay = /* @__PURE__ */ new Map();
53
+ for (const shift of shifts.value) {
54
+ const key = dayKey(shift.startsAt, format.timeZone);
55
+ byDay.set(key, [...byDay.get(key) ?? [], shift]);
56
+ }
57
+ return [...byDay.entries()].map(([day, items]) => ({ day, items }));
58
+ });
59
+ const nameOf = (person) => person.name ?? `#${person.userId}`;
60
+ const statusLabel = (status) => t(`statuses.${status}`, SHIFT_ASSIGNMENT_STATUS_LABELS[status]);
61
+ async function mark(assignee, to) {
62
+ const done = await run(
63
+ () => $fetch(to === "attended" ? shiftsApi.attended(assignee.id) : shiftsApi.noShow(assignee.id), { method: "POST" }).then(() => true),
64
+ { success: t("admin.marked", "Marked {name} {status}", { name: nameOf(assignee.person), status: statusLabel(to).toLowerCase() }), error: t("lead.markFailed", "Could not mark attendance") }
65
+ );
66
+ if (done) await Promise.all([refresh(), refreshExceptions()]);
67
+ }
68
+ async function approve(swap) {
69
+ if (await actions.approveSwap(swap)) await Promise.all([refresh(), refreshSwaps()]);
70
+ }
71
+ async function reject(swap) {
72
+ if (await actions.rejectSwap(swap)) await Promise.all([refresh(), refreshSwaps()]);
73
+ }
74
+ useHead({ title: () => t("lead.title", "Lead {team}", { team: team.value ? tr(team.value.teamName) : "" }) });
75
+ </script>
76
+
77
+ <template>
78
+ <UContainer>
79
+ <UPage>
80
+ <UPageHeader
81
+ :title="team ? tr(team.teamName) : t('lead.titleFallback', 'Your team')"
82
+ :description="team ? tr(team.operationName) : t('lead.description', 'Your team\'s shifts, attendance and swaps.')"
83
+ >
84
+ <template #links>
85
+ <UButton
86
+ icon="i-lucide-megaphone"
87
+ color="neutral"
88
+ variant="outline"
89
+ :label="t('broadcast.leadAction', 'Message team')"
90
+ @click="actions.broadcastToTeam(teamId, team ? tr(team.teamName) : '')"
91
+ />
92
+ <UButton
93
+ :to="links.checkIn(teamId)"
94
+ icon="i-lucide-scan-line"
95
+ :label="t('lead.scanner', 'Open the check-in scanner')"
96
+ />
97
+ </template>
98
+ </UPageHeader>
99
+ <UPageBody class="max-w-3xl">
100
+ <UEmpty
101
+ v-if="error && error.statusCode !== 401"
102
+ icon="i-lucide-circle-alert"
103
+ :title="error.statusCode === 403 ? t('lead.forbidden', 'You do not lead this team') : t('lead.loadFailed', 'The team could not be loaded')"
104
+ :description="error.statusCode === 403 ? void 0 : errorMessage(error, '')"
105
+ :actions="[{ label: t('shift.back', 'My shifts'), to: links.shifts(), color: 'neutral', variant: 'outline' }]"
106
+ />
107
+ <div
108
+ v-else
109
+ class="flex flex-col gap-4"
110
+ >
111
+ <SectionCard
112
+ v-if="swaps.length"
113
+ :title="t('admin.viewSwapsTitle', 'Swaps to approve')"
114
+ icon="i-lucide-arrow-left-right"
115
+ >
116
+ <ul class="divide-default divide-y">
117
+ <li
118
+ v-for="swap in swaps"
119
+ :key="swap.id"
120
+ class="flex flex-wrap items-center justify-between gap-2 py-2"
121
+ >
122
+ <div class="flex flex-col text-sm">
123
+ <span class="text-highlighted font-medium">{{ tr(swap.shift.teamName) }} · {{ format.range(swap.shift.startsAt, swap.shift.endsAt) }}</span>
124
+ <span class="text-muted">
125
+ {{ actions.swapSummary(swap) }}
126
+ </span>
127
+ </div>
128
+ <div class="flex items-center gap-2">
129
+ <span
130
+ v-if="!actions.swapAllowed(swap)"
131
+ class="text-muted text-sm"
132
+ >
133
+ {{ t("swaps.noLongerAllowed", "No longer allowed by the schedule's settings: reject it.") }}
134
+ </span>
135
+ <UButton
136
+ color="neutral"
137
+ variant="outline"
138
+ :label="t('swaps.rejectAction', 'Reject swap')"
139
+ @click="reject(swap)"
140
+ />
141
+ <UButton
142
+ v-if="actions.swapAllowed(swap)"
143
+ :label="t('swaps.approveAction', 'Approve swap')"
144
+ @click="approve(swap)"
145
+ />
146
+ </div>
147
+ </li>
148
+ </ul>
149
+ </SectionCard>
150
+
151
+ <SectionCard
152
+ v-if="stations.length"
153
+ :title="t('lead.stations', 'Check-in stations')"
154
+ icon="i-lucide-qr-code"
155
+ >
156
+ <div class="flex flex-wrap gap-2">
157
+ <UButton
158
+ v-for="station in stations"
159
+ :key="station.id"
160
+ :to="links.station(station.id)"
161
+ icon="i-lucide-monitor"
162
+ color="neutral"
163
+ variant="outline"
164
+ :label="t('lead.openStation', 'Open {name}', { name: tr(station.name) })"
165
+ />
166
+ </div>
167
+ </SectionCard>
168
+
169
+ <UTabs
170
+ v-model="view"
171
+ :items="viewItems"
172
+ :content="false"
173
+ variant="link"
174
+ />
175
+
176
+ <template v-if="view === 'exceptions'">
177
+ <UEmpty
178
+ v-if="!exceptions.length"
179
+ icon="i-lucide-check-circle"
180
+ :title="t('lead.noExceptions', 'Nothing to look at')"
181
+ :description="t('lead.noExceptionsDescription', 'Everybody on the team\'s shifts of the last day checked in on time.')"
182
+ />
183
+ <SectionCard
184
+ v-else
185
+ :title="t('lead.exceptionsTitle', 'Exceptions')"
186
+ :description="t('lead.exceptionsDescription', 'No-shows, late check-ins and people not checked in on the shifts of the last day.')"
187
+ >
188
+ <ul class="divide-default divide-y">
189
+ <li
190
+ v-for="item in exceptions"
191
+ :key="`${item.kind}:${item.assignment.id}`"
192
+ class="flex flex-wrap items-center justify-between gap-2 py-1.5"
193
+ >
194
+ <div class="flex flex-col gap-0.5">
195
+ <TableIdentity
196
+ :title="nameOf(item.assignment.person)"
197
+ :description="`${format.day(dayKey(item.shift.startsAt, format.timeZone))} \xB7 ${format.time(item.shift.startsAt)}\u2013${format.time(item.shift.endsAt)}`"
198
+ :avatar="{ src: item.assignment.person.avatar ?? void 0, alt: nameOf(item.assignment.person) }"
199
+ />
200
+ </div>
201
+ <div class="flex items-center gap-2">
202
+ <UBadge
203
+ :color="exceptionColor(item.kind)"
204
+ variant="subtle"
205
+ :label="exceptionLabel(item)"
206
+ />
207
+ <UButton
208
+ v-if="item.assignment.status !== 'attended'"
209
+ size="xs"
210
+ color="neutral"
211
+ variant="outline"
212
+ :label="t('admin.markAttended', 'Mark attended')"
213
+ @click="mark(item.assignment, 'attended')"
214
+ />
215
+ <UButton
216
+ v-if="item.assignment.status === 'assigned'"
217
+ size="xs"
218
+ color="neutral"
219
+ variant="ghost"
220
+ :label="t('admin.markNoShow', 'Mark no-show')"
221
+ @click="mark(item.assignment, 'no_show')"
222
+ />
223
+ </div>
224
+ </li>
225
+ </ul>
226
+ </SectionCard>
227
+ </template>
228
+
229
+ <UEmpty
230
+ v-if="view === 'shifts' && !days.length"
231
+ icon="i-lucide-calendar-clock"
232
+ :title="t('lead.empty', 'No upcoming shifts for the team')"
233
+ />
234
+ <SectionCard
235
+ v-for="group in view === 'shifts' ? days : []"
236
+ :key="group.day"
237
+ :title="format.day(group.day)"
238
+ >
239
+ <div class="flex flex-col gap-4">
240
+ <div
241
+ v-for="shift in group.items"
242
+ :key="shift.id"
243
+ class="flex flex-col gap-1"
244
+ >
245
+ <span class="text-highlighted text-sm font-semibold tabular-nums">
246
+ {{ format.time(shift.startsAt) }}–{{ format.time(shift.endsAt) }}
247
+ <span class="text-muted font-normal">· {{ shift.effectiveCapacity === null ? shift.filled : `${shift.filled}/${shift.effectiveCapacity}` }}</span>
248
+ </span>
249
+ <p
250
+ v-if="!shift.assignees.length"
251
+ class="text-muted text-sm"
252
+ >
253
+ {{ t("admin.nobodyYet", "Nobody yet.") }}
254
+ </p>
255
+ <ul
256
+ v-else
257
+ class="divide-default divide-y"
258
+ >
259
+ <li
260
+ v-for="assignee in shift.assignees"
261
+ :key="assignee.id"
262
+ class="flex flex-wrap items-center justify-between gap-2 py-1.5"
263
+ >
264
+ <TableIdentity
265
+ :title="nameOf(assignee.person)"
266
+ :avatar="{ src: assignee.person.avatar ?? void 0, alt: nameOf(assignee.person) }"
267
+ />
268
+ <div class="flex items-center gap-2">
269
+ <StatusBadge
270
+ :status="assignee.status"
271
+ :label="statusLabel(assignee.status)"
272
+ :colors="{ assigned: 'info', attended: 'success', no_show: 'error' }"
273
+ />
274
+ <UButton
275
+ v-if="assignee.status !== 'attended'"
276
+ size="xs"
277
+ color="neutral"
278
+ variant="outline"
279
+ :label="t('admin.markAttended', 'Mark attended')"
280
+ @click="mark(assignee, 'attended')"
281
+ />
282
+ <UButton
283
+ v-if="assignee.status !== 'no_show'"
284
+ size="xs"
285
+ color="neutral"
286
+ variant="ghost"
287
+ :label="t('admin.markNoShow', 'Mark no-show')"
288
+ @click="mark(assignee, 'no_show')"
289
+ />
290
+ </div>
291
+ </li>
292
+ </ul>
293
+ </div>
294
+ </div>
295
+ </SectionCard>
296
+ </div>
297
+ </UPageBody>
298
+ </UPage>
299
+ </UContainer>
300
+ </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,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;