@feedmepos/mf-hrm-portal 2.2.5-dev → 2.2.5-dev.10
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/dist/{ApprovalCodeList-DgcWZ3SZ.js → ApprovalCodeList-BsDMMSIz.js} +4 -4
- package/dist/{AuditLogList-vWKMMGvd.js → AuditLogList-CGNZdtmn.js} +18 -17
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DuhXogXK.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C6MoToqi.js} +2 -2
- package/dist/EmployeeList-B_OuDWWQ.js +787 -0
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js → FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js} +1 -1
- package/dist/{GrantUserList-BAW0C1bA.js → GrantUserList-Bd0lXmFo.js} +5 -5
- package/dist/{Main-NzpdRNB3.js → Main-B66lSeOv.js} +5 -5
- package/dist/{Main-Wr6cTqfM.js → Main-CzHSNHsH.js} +2 -2
- package/dist/{Main-B7Nn8CLQ.js → Main-njRQ1tFk.js} +9 -9
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
- package/dist/{PermissionSetList-D6AFOleD.js → PermissionSetList-GTI6Cwj5.js} +18 -18
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bzq2_BMn.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C-QEQ-js.js} +1052 -1052
- package/dist/{RoleList-BuqpmXn_.js → RoleList-CmHgtM0m.js} +7 -7
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-SFqxftRx.js +426 -0
- package/dist/ScheduleButton.vue_vue_type_script_setup_true_lang-CrWfo-zF.js +690 -0
- package/dist/ScheduleGeneralPage-DxFxJN5j.js +320 -0
- package/dist/SchedulePage-cJDI3-E7.js +14647 -0
- package/dist/SchedulePositionPage-n1wUShIM.js +293 -0
- package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-B8W4sTsA.js +242 -0
- package/dist/SelectFilter-CG13h83-.js +264 -0
- package/dist/TeamMemberList-ByZt3VqN.js +1154 -0
- package/dist/{TimesheetList-B5FyVyCz.js → TimesheetList-Dv0-W--W.js} +54 -53
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C99Jr6Ax.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DIo6h5-a.js} +2 -2
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/{app-8samJY5z.js → app-SCXGJ95F.js} +3146 -2553
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-Ba4X_9nY.js → dayjs.min-DqMLPYv-.js} +1 -1
- package/dist/{employee-BcFgm8Rt.js → employee-DT_xYQkz.js} +3 -3
- package/dist/{iteration-Dhdew1jW.js → iteration-B5dB9ecy.js} +1 -1
- package/dist/{lodash-CJ3mHku0.js → lodash-CRHFapxI.js} +1 -1
- package/dist/{role-BViYS7RK.js → role-CJm8pXaw.js} +1 -1
- package/dist/{rule-Dxt1ZSQS.js → rule-AJm-eVzJ.js} +276 -272
- package/dist/src/api/schedule/index.d.ts +41 -0
- package/dist/src/components/form/OutletRoleAssignment.vue.d.ts +16 -0
- package/dist/src/components/layout/AppSidebar.vue.d.ts +2 -0
- package/dist/src/components/layout/PortalShell.vue.d.ts +12 -0
- package/dist/src/components/layout/withShell.d.ts +14 -0
- package/dist/src/helpers/outlet-role-assignment.d.ts +40 -0
- package/dist/src/helpers/rule.d.ts +15 -0
- package/dist/src/router/shared.d.ts +4 -1
- package/dist/src/types/schedule.d.ts +232 -0
- package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/SchedulePage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +3 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeIdentitySection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeModeStep.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePosAccessSection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleAddEmployeeSchedulingSection.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddPickPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAddPositionModal.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +22 -0
- package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +34 -0
- package/dist/src/views/scheduling/components/ScheduleAssignEmployeePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleButton.vue.d.ts +23 -0
- package/dist/src/views/scheduling/components/ScheduleChangeEmployeeModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +24 -0
- package/dist/src/views/scheduling/components/ScheduleCostRail.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleDateRangePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleDayNotePopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleDemandRow.vue.d.ts +23 -0
- package/dist/src/views/scheduling/components/ScheduleDemandSheet.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleDotsIcon.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeDetailPanel.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeIdentity.vue.d.ts +17 -0
- package/dist/src/views/scheduling/components/ScheduleEmployeeMenu.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleFilterBar.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleGapPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleGridHeader.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleGridSkeleton.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleLegendBar.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleOnboardingWelcome.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +9 -0
- package/dist/src/views/scheduling/components/ScheduleOpenShiftCardMenu.vue.d.ts +14 -0
- package/dist/src/views/scheduling/components/SchedulePdfPreview.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/SchedulePublishModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleReviewBar.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +54 -0
- package/dist/src/views/scheduling/components/ScheduleSelectExistingEmployeeModal.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftCardMenu.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +35 -0
- package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleShiftImpact.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftMoreOptions.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +16 -0
- package/dist/src/views/scheduling/components/ScheduleShiftRepeatDaysRow.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleShiftSegmentsEditor.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleShiftWhoPicker.vue.d.ts +25 -0
- package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +14 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +18 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +60 -0
- package/dist/src/views/scheduling/components/ScheduleStatsRow.vue.d.ts +12 -0
- package/dist/src/views/scheduling/components/ScheduleSwapShiftsModal.vue.d.ts +8 -0
- package/dist/src/views/scheduling/components/ScheduleTimePickerPopover.vue.d.ts +6 -0
- package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +20 -0
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +72 -0
- package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +38 -0
- package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +29 -0
- package/dist/src/views/scheduling/composables/schedule-employee-profile.d.ts +7 -0
- package/dist/src/views/scheduling/composables/schedule-popover-position.d.ts +16 -0
- package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +14 -0
- package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +10 -0
- package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +21 -0
- package/dist/src/views/scheduling/composables/useCollapsedList.d.ts +9 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +98 -0
- package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +73 -0
- package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +77 -0
- package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +50 -0
- package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +122 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +143 -0
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +426 -0
- package/dist/src/views/scheduling/composables/useScheduleCellState.d.ts +27 -0
- package/dist/src/views/scheduling/composables/useScheduleClashDetection.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +19 -0
- package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +43 -0
- package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +48 -0
- package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +77 -0
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +76 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandRow.d.ts +45 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +145 -0
- package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +22 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +41 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeMenu.d.ts +35 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeProfile.d.ts +16 -0
- package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +26 -0
- package/dist/src/views/scheduling/composables/useScheduleFilterBar.d.ts +14 -0
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +82 -0
- package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +70 -0
- package/dist/src/views/scheduling/composables/useScheduleLegend.d.ts +15 -0
- package/dist/src/views/scheduling/composables/useScheduleLegendBar.d.ts +35 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1316 -0
- package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +23 -0
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +20 -0
- package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +50 -0
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +32 -0
- package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +93 -0
- package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +27 -0
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +189 -0
- package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +54 -0
- package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +18 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +163 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +181 -0
- package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +23 -0
- package/dist/src/views/scheduling/composables/useScheduleStatsRow.d.ts +25 -0
- package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +49 -0
- package/dist/src/views/scheduling/composables/useScheduleTopbar.d.ts +10 -0
- package/dist/src/views/scheduling/composables/useScheduleViewportFit.d.ts +9 -0
- package/dist/src/views/scheduling/data.d.ts +110 -0
- package/dist/src/views/scheduling/locales/index.d.ts +496 -0
- package/dist/src/views/scheduling/schedule-store.d.ts +151 -0
- package/dist/src/views/scheduling/types.d.ts +324 -0
- package/dist/src/views/team/components/PortalConditionForm.vue.d.ts +2 -2
- package/dist/src/views/team/condition-builders/ConditionBuilderForm.vue.d.ts +2 -2
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +12 -3
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-BiyAfGvZ.js → useReportPermissions-Cg3lV70m.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-Cu4RxVQX.js +0 -889
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-BUI0Xsgc.js +0 -85
- package/dist/SelectFilter-ATOm0hdn.js +0 -269
- package/dist/TeamMemberList-M6HA9BWu.js +0 -1248
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { EmployeeAvailHours } from '../types';
|
|
2
|
+
import type { FdtoScheduleUpdateEmployeeProfileReq } from '@/types/schedule';
|
|
3
|
+
export type ScheduleAddEmployeeStep = 'mode' | 'details';
|
|
4
|
+
export type ScheduleAddEmployeeMode = 'new' | 'existing';
|
|
5
|
+
export interface ScheduleAddEmployeeForm {
|
|
6
|
+
name: string;
|
|
7
|
+
mobile: string;
|
|
8
|
+
dial: string;
|
|
9
|
+
employment: 'full' | 'part';
|
|
10
|
+
locations: string[];
|
|
11
|
+
payBasis: 'hourly' | 'monthly';
|
|
12
|
+
payAmount: string;
|
|
13
|
+
maxHours: string;
|
|
14
|
+
minHours: string;
|
|
15
|
+
otAfterDaily: string;
|
|
16
|
+
maxOtHours: string;
|
|
17
|
+
/** For a part-timer: days they CAN work. For a full-timer: days they're OFF — the
|
|
18
|
+
* mockup inverts the same array's meaning by employment type. */
|
|
19
|
+
availDays: boolean[];
|
|
20
|
+
availHours: EmployeeAvailHours[];
|
|
21
|
+
preferences: string;
|
|
22
|
+
primaryPosition: string;
|
|
23
|
+
secondaryPositions: string[];
|
|
24
|
+
seniority: '' | 'senior' | 'junior';
|
|
25
|
+
passcode: string[];
|
|
26
|
+
masterUser: boolean;
|
|
27
|
+
/** POS role for a brand-new user (applied at every outlet in `locations`). */
|
|
28
|
+
roleId: string;
|
|
29
|
+
/** Required by the POS for a master user. */
|
|
30
|
+
masterCode: string;
|
|
31
|
+
}
|
|
32
|
+
/** A salaried month, for converting a monthly figure into the hourly one the cost rail
|
|
33
|
+
* actually reads. Ported verbatim from the mockup's MONTH_HOURS. */
|
|
34
|
+
export declare const MONTH_HOURS = 173;
|
|
35
|
+
/** A freshly-ticked worked day defaults to the whole day rather than the outlet's current
|
|
36
|
+
* trading hours — trading hours can change, and narrowing a person's stated availability to
|
|
37
|
+
* whatever the outlet happens to trade today isn't something this form should assume for them.
|
|
38
|
+
* `23:59`, not `24:00`: a part-timer's per-day fields are native `<input type="time">`s, which
|
|
39
|
+
* only accept `00:00`–`23:59` — `24:00` would render as blank there despite being a valid
|
|
40
|
+
* `FdtoScheduleTime` on the wire. */
|
|
41
|
+
export declare function defaultAvailHours(): EmployeeAvailHours;
|
|
42
|
+
export declare function blankForm(): ScheduleAddEmployeeForm;
|
|
43
|
+
/** Coverage and Auto-Schedule are still authored per role, so a role is derived from the
|
|
44
|
+
* primary position rather than asked for twice. Unlike position, Employee.role is one of a
|
|
45
|
+
* fixed small set the grid groups by, so an unrecognised (or unset) position falls back to
|
|
46
|
+
* the first known role instead of leaving the record without one. */
|
|
47
|
+
export declare function roleFromPosition(position: string): string;
|
|
48
|
+
export declare function generateCode(): string;
|
|
49
|
+
/** `raw` is typed `string` because that's the form field's declared type, but Vue 3 casts
|
|
50
|
+
* `v-model` on an `<input type="number">` to an actual `number` regardless — the DOM does this
|
|
51
|
+
* itself, independent of the `.number` modifier, so the runtime value disagrees with the type
|
|
52
|
+
* the moment someone types a digit. `String()` first is what makes `.trim()` safe either way. */
|
|
53
|
+
export declare function parsePositiveInt(raw: string, min: number, max: number): number | undefined;
|
|
54
|
+
export declare function parseNonNegativeInt(raw: string, max: number): number | undefined;
|
|
55
|
+
export declare function initials(name: string): string;
|
|
56
|
+
export declare function isPartTimeForm(form: ScheduleAddEmployeeForm): boolean;
|
|
57
|
+
/** `availDays[i]` always means "is this a working day" — the same convention the board model
|
|
58
|
+
* and `ScheduleEmployeeDetailPanel` read (a day off is one marked NOT worked), regardless of
|
|
59
|
+
* employment type. Only the full-time TOGGLE BUTTON is framed as "mark a day off" rather than
|
|
60
|
+
* "mark a work day" — see `useScheduleAddEmployee`'s `dayLit`, which flips this value for
|
|
61
|
+
* that button's pressed state without touching what's actually stored. */
|
|
62
|
+
export declare function dayIsWorkedInForm(form: ScheduleAddEmployeeForm, i: number): boolean;
|
|
63
|
+
/** Days this form currently marks as worked, converted to Mongo's weekday convention. */
|
|
64
|
+
export declare function availabilityPayload(form: ScheduleAddEmployeeForm): Array<{
|
|
65
|
+
dayOfWeek: number;
|
|
66
|
+
start: string;
|
|
67
|
+
end: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** The EmployeeProfile fields `createExisting` and `updateExisting` both send — everything but
|
|
70
|
+
* `employeeId`, which only the create path has (an update targets one already known from the
|
|
71
|
+
* URL). Shared here so the two payloads cannot silently drift apart. */
|
|
72
|
+
export declare function toEmployeeProfileFields(form: ScheduleAddEmployeeForm, name: string, payAmountNumber: number): FdtoScheduleUpdateEmployeeProfileReq;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DaySlot, Employee, LeaveSlot, WorkSlot } from '../types';
|
|
2
|
+
import type { FdtoScheduleSaveAssignmentReq } from '@/types/schedule';
|
|
3
|
+
/** dayjs-free local-date key — matches on the browser's local Y/M/D, not UTC, so this stays
|
|
4
|
+
* correct regardless of timezone. */
|
|
5
|
+
export declare function isoDateKey(d: Date): string;
|
|
6
|
+
export declare function isWorkSlot(slot: DaySlot): slot is WorkSlot;
|
|
7
|
+
export declare function isLeaveSlot(slot: DaySlot): slot is LeaveSlot;
|
|
8
|
+
export declare function workSlotsOf(day: DaySlot): WorkSlot[];
|
|
9
|
+
/** A WorkSlot, in the shape ShiftAssignments actually stores. `pending` is the only status
|
|
10
|
+
* this board's own writers ever set on a fresh slot (see commitShift's callers) — `ot` is
|
|
11
|
+
* derived at cost-rail time, never authored, so it has nowhere sensible to map but PUBLISHED. */
|
|
12
|
+
export declare function toAssignmentReq(employeeId: string, date: string, slot: WorkSlot): FdtoScheduleSaveAssignmentReq;
|
|
13
|
+
/** Which coverage-position (a RULES.coverage.full key, e.g. 'grill', 'customer service') a
|
|
14
|
+
* work slot's `role` counts toward for area-view grouping and cost-by-position breakdowns.
|
|
15
|
+
* The shift popover's "Position needed" field writes a coverage-position key directly into
|
|
16
|
+
* `role` for anything authored through it — so a role that's already a coverage key is
|
|
17
|
+
* used as-is. Seed data instead recorded a station label ('FOH', 'Kitchen', ...), which
|
|
18
|
+
* ROLE_POSITIONS translates to that station's first/primary position. This can't tell a
|
|
19
|
+
* Kitchen employee's grill shifts apart from their prep shifts when the seed data only
|
|
20
|
+
* ever recorded the station — that distinction only exists once a shift is authored (or
|
|
21
|
+
* re-saved) through the popover, which does record the specific position. */
|
|
22
|
+
export declare function positionKeyOf(role: string): string;
|
|
23
|
+
/** The hours this employee is contracted to in a week — what "18h / 44h" measures against.
|
|
24
|
+
* Stated per person on their own profile now that ScheduleSettings carries pay rates alone, so
|
|
25
|
+
* there is no venue-wide full/part pair to fall back to: somebody nobody has agreed hours with
|
|
26
|
+
* reads 0, which is the truth rather than a default they never signed. */
|
|
27
|
+
export declare function contractCapFor(emp: Employee): number;
|
|
28
|
+
/** Whether `hours` runs past what this person is contracted to.
|
|
29
|
+
*
|
|
30
|
+
* A cap of 0 means no hours were ever agreed, which is NOT a contract of zero hours: read
|
|
31
|
+
* naively, `hours > 0` makes every rostered minute overtime, flags everybody on the cost rail's
|
|
32
|
+
* over-contract list and makes copy-week refuse every shift. An unknown limit cannot be
|
|
33
|
+
* exceeded, so it is treated as no limit and the question is answered false. */
|
|
34
|
+
export declare function overContract(emp: Employee, hours: number): boolean;
|
|
35
|
+
export declare function isPartTime(emp: Employee): boolean;
|
|
36
|
+
/** Which weekday (0 = Mon) is today, relative to no particular week — used to seed
|
|
37
|
+
* focusDayIdx whenever "today" needs a weekday index rather than a date. */
|
|
38
|
+
export declare function todayWeekdayIdx(): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { Employee, ScheduleDayNote } from '../types';
|
|
3
|
+
/** Everything a manager authors about a DATE rather than about a shift — the note on its
|
|
4
|
+
* card, whether the venue opens, whether it bills at the holiday rate. Keyed by ISO date
|
|
5
|
+
* (via the board's `dateKey`), not by weekday index: the mockup's flat single-week horizon
|
|
6
|
+
* could use the weekday index directly, but the board pages through weeks, and a note put on
|
|
7
|
+
* this Monday must not reappear on every other Monday. */
|
|
8
|
+
export declare function useScheduleDayMeta(employees: Ref<Employee[]>, dateKey: (dayIdx: number) => string | null, handlers?: {
|
|
9
|
+
onPersistError?: (message: string) => void;
|
|
10
|
+
}): {
|
|
11
|
+
dayNote: (dayIdx: number) => ScheduleDayNote | null;
|
|
12
|
+
setDayNote: (dayIdx: number, title: string, desc: string) => void;
|
|
13
|
+
clearDayNote: (dayIdx: number) => void;
|
|
14
|
+
toggleClosed: (dayIdx: number) => {
|
|
15
|
+
closed: boolean;
|
|
16
|
+
rostered: number;
|
|
17
|
+
};
|
|
18
|
+
isManuallyClosed: (dayIdx: number) => boolean;
|
|
19
|
+
isStandingClosedWeekday: (dayIdx: number) => boolean;
|
|
20
|
+
holidayName: (dayIdx: number) => string | null;
|
|
21
|
+
holidayIsAuto: (dayIdx: number) => boolean;
|
|
22
|
+
isPublicHoliday: (dayIdx: number) => boolean;
|
|
23
|
+
holidayRateApplies: (dayIdx: number) => boolean;
|
|
24
|
+
setHolidayNormal: (dayIdx: number, toNormal: boolean) => void;
|
|
25
|
+
setPublicHoliday: (dayIdx: number, on: boolean) => void;
|
|
26
|
+
otRateOn: (dayIdx: number) => number;
|
|
27
|
+
regularRateOn: (dayIdx: number) => number;
|
|
28
|
+
isHoliday: (dayIdx: number) => boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Employee } from '../types';
|
|
2
|
+
/** Adds `positionName` to the employee's own profile — the backend write path a real
|
|
3
|
+
* "existing employee" record has (see `useScheduleAddEmployee.ts`'s `toEmployeeProfileFields`
|
|
4
|
+
* for the same shape, built from the add-employee form instead of a live `Employee`).
|
|
5
|
+
* Fire-and-forget: the local roster already shows the grant, and a failed profile write isn't
|
|
6
|
+
* worth a second error dialog on top of whatever caller-side save this followed. */
|
|
7
|
+
export declare function grantSkillToEmployee(emp: Employee, positionName: string): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ScheduleAnchorRect {
|
|
2
|
+
left: number;
|
|
3
|
+
right: number;
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
}
|
|
7
|
+
/** Measures the element a popover was opened from. Takes the rect while the anchor is still on
|
|
8
|
+
* screen; a hidden or detached element measures 0×0 and counts as "no anchor". */
|
|
9
|
+
export declare function anchorRectOf(el: Element | null | undefined): ScheduleAnchorRect | null;
|
|
10
|
+
/** Port of HRM V6.2 placePopover(): below the anchor by preference (6px gap), flipped above when
|
|
11
|
+
* there is no room, clamped to the viewport on both edges. Uses the popover's rendered size, so
|
|
12
|
+
* call it once the element is in the DOM. */
|
|
13
|
+
export declare function placePopover(el: HTMLElement, anchor: ScheduleAnchorRect | null): {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ScheduleBreakChoice = 0 | 30 | 60 | 90 | 120 | 'custom';
|
|
2
|
+
export interface ScheduleShiftSegment {
|
|
3
|
+
start: string;
|
|
4
|
+
end: string;
|
|
5
|
+
}
|
|
6
|
+
/** A break length that doesn't match one of the presets becomes 'custom', carrying its own
|
|
7
|
+
* minutes/unit back out for the caller to seed its custom-break fields from. */
|
|
8
|
+
export declare function normalizeBreak(mins: number | undefined): {
|
|
9
|
+
choice: ScheduleBreakChoice;
|
|
10
|
+
customMins?: number;
|
|
11
|
+
customUnit?: 'mins' | 'hrs';
|
|
12
|
+
};
|
|
13
|
+
export declare function resolvedBreakMins(choice: ScheduleBreakChoice, customMins: number, customUnit: 'mins' | 'hrs'): number | undefined;
|
|
14
|
+
export declare function segmentHours(seg: ScheduleShiftSegment, breakMins: number): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Employee, OpenShift } from '../types';
|
|
2
|
+
export declare const RANGE_LEN = 7;
|
|
3
|
+
export declare function mostRecentMonday(from: Date): Date;
|
|
4
|
+
export declare function weekDates(offset: number): Date[];
|
|
5
|
+
export declare function weeksBetween(a: Date, b: Date): number;
|
|
6
|
+
export interface WeekBucket {
|
|
7
|
+
employees: Employee[];
|
|
8
|
+
openShifts: OpenShift[];
|
|
9
|
+
}
|
|
10
|
+
export declare function weekData(offset: number): WeekBucket;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FdtoScheduleAutoScheduleObjective } from '@/types/schedule';
|
|
2
|
+
import type { CoverageSegment, Employee, Proposal } from '../types';
|
|
3
|
+
export interface SolverInput {
|
|
4
|
+
dayCount: number;
|
|
5
|
+
employees: Employee[];
|
|
6
|
+
/** Coverage of a day against an explicit set of employees (the working copy). */
|
|
7
|
+
segmentsWith: (dayIdx: number, employees: Employee[]) => CoverageSegment[];
|
|
8
|
+
/** Days the board will not take shifts on (locked week). */
|
|
9
|
+
skipDay: (dayIdx: number) => boolean;
|
|
10
|
+
objective: FdtoScheduleAutoScheduleObjective;
|
|
11
|
+
allowOvertime: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SolverOutput {
|
|
14
|
+
proposals: Proposal[];
|
|
15
|
+
unfilled: number;
|
|
16
|
+
totalHours: number;
|
|
17
|
+
overtimeHours: number;
|
|
18
|
+
cost: number;
|
|
19
|
+
explanations: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function solveAutoSchedule(input: SolverInput): SolverOutput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A long list shown as its first few entries plus "+N more", expandable in place. For chip rows
|
|
2
|
+
* that can run to a hundred items (a person rostered at every outlet), which would otherwise
|
|
3
|
+
* push the rest of the form off screen. */
|
|
4
|
+
export declare function useCollapsedList<T>(items: () => T[], limit?: number): {
|
|
5
|
+
expanded: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
shown: import("vue").ComputedRef<T[]>;
|
|
7
|
+
hiddenCount: import("vue").ComputedRef<number>;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Employee } from '../types';
|
|
2
|
+
import type { ScheduleBoardApi } from './useScheduleBoard';
|
|
3
|
+
import { type ScheduleAddEmployeeMode, type ScheduleAddEmployeeStep } from './schedule-add-employee-form';
|
|
4
|
+
export type { ScheduleAddEmployeeForm, ScheduleAddEmployeeMode, ScheduleAddEmployeeStep, } from './schedule-add-employee-form';
|
|
5
|
+
/** Add-employee wizard: a "how do you want to add them" step, then one detail form covering
|
|
6
|
+
* identity, locations, pay, scheduling caps, availability, positions and POS access — plus
|
|
7
|
+
* the "select existing POS staff" side dialog the first step can hand off to. */
|
|
8
|
+
export declare function useScheduleAddEmployee(board: ScheduleBoardApi): {
|
|
9
|
+
open: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
selectExistingOpen: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
step: import("vue").Ref<ScheduleAddEmployeeStep, ScheduleAddEmployeeStep>;
|
|
12
|
+
mode: import("vue").Ref<ScheduleAddEmployeeMode, ScheduleAddEmployeeMode>;
|
|
13
|
+
form: {
|
|
14
|
+
name: string;
|
|
15
|
+
mobile: string;
|
|
16
|
+
dial: string;
|
|
17
|
+
employment: "full" | "part";
|
|
18
|
+
locations: string[];
|
|
19
|
+
payBasis: "hourly" | "monthly";
|
|
20
|
+
payAmount: string;
|
|
21
|
+
maxHours: string;
|
|
22
|
+
minHours: string;
|
|
23
|
+
otAfterDaily: string;
|
|
24
|
+
maxOtHours: string;
|
|
25
|
+
availDays: boolean[];
|
|
26
|
+
availHours: {
|
|
27
|
+
from: string;
|
|
28
|
+
to: string;
|
|
29
|
+
}[];
|
|
30
|
+
preferences: string;
|
|
31
|
+
primaryPosition: string;
|
|
32
|
+
secondaryPositions: string[];
|
|
33
|
+
seniority: "" | "senior" | "junior";
|
|
34
|
+
passcode: string[];
|
|
35
|
+
masterUser: boolean;
|
|
36
|
+
roleId: string;
|
|
37
|
+
masterCode: string;
|
|
38
|
+
};
|
|
39
|
+
sectionId: import("vue").Ref<string, string>;
|
|
40
|
+
isEditing: import("vue").ComputedRef<boolean>;
|
|
41
|
+
locOpen: import("vue").Ref<boolean, boolean>;
|
|
42
|
+
secOpen: import("vue").Ref<boolean, boolean>;
|
|
43
|
+
secondaryOptions: import("vue").ComputedRef<string[]>;
|
|
44
|
+
isPart: import("vue").ComputedRef<boolean>;
|
|
45
|
+
dayLit: (i: number) => boolean;
|
|
46
|
+
avLabel: import("vue").ComputedRef<"Weekly availability" | "Time off days">;
|
|
47
|
+
avAllLabel: import("vue").ComputedRef<"Clear all" | "Select all" | "No days off" | "Every day off">;
|
|
48
|
+
maxHoursPlaceholder: import("vue").ComputedRef<"Hours per week" | "No cap">;
|
|
49
|
+
otAfterDailyPlaceholder: import("vue").ComputedRef<string>;
|
|
50
|
+
payUnit: import("vue").ComputedRef<"/month" | "/hour">;
|
|
51
|
+
effectiveRate: import("vue").ComputedRef<number>;
|
|
52
|
+
passcodeValue: import("vue").ComputedRef<string>;
|
|
53
|
+
passcodeOk: import("vue").ComputedRef<boolean>;
|
|
54
|
+
currentLocationLabel: import("vue").ComputedRef<string>;
|
|
55
|
+
roleOptions: import("vue").ComputedRef<{
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}[]>;
|
|
59
|
+
roleError: import("vue").ComputedRef<boolean>;
|
|
60
|
+
masterCodeError: import("vue").ComputedRef<boolean>;
|
|
61
|
+
isNewUser: import("vue").ComputedRef<boolean>;
|
|
62
|
+
needsRole: import("vue").ComputedRef<boolean>;
|
|
63
|
+
footerHint: import("vue").ComputedRef<"Pick who — this outlet's own pay, position and hours are still set here." | "One short form. Rest days are set on their profile afterwards.">;
|
|
64
|
+
primaryRoleLabel: import("vue").ComputedRef<string>;
|
|
65
|
+
locationsSummary: import("vue").ComputedRef<string>;
|
|
66
|
+
payLine: import("vue").ComputedRef<string>;
|
|
67
|
+
nameError: import("vue").ComputedRef<boolean>;
|
|
68
|
+
passError: import("vue").ComputedRef<boolean>;
|
|
69
|
+
availabilityError: import("vue").ComputedRef<boolean>;
|
|
70
|
+
saving: import("vue").Ref<boolean, boolean>;
|
|
71
|
+
saveError: import("vue").Ref<string | null, string | null>;
|
|
72
|
+
candidatesLoading: import("vue").Ref<boolean, boolean>;
|
|
73
|
+
candidatesError: import("vue").Ref<string | null, string | null>;
|
|
74
|
+
openWizard: (section: string) => void;
|
|
75
|
+
openEditFor: (emp: Employee) => void;
|
|
76
|
+
close: () => void;
|
|
77
|
+
setMode: (m: ScheduleAddEmployeeMode) => void;
|
|
78
|
+
openSelectExisting: () => void;
|
|
79
|
+
closeSelectExisting: () => void;
|
|
80
|
+
pickExisting: (employeeId: string) => void;
|
|
81
|
+
next: () => void;
|
|
82
|
+
back: () => void;
|
|
83
|
+
toggleMulti: (which: "loc" | "sec") => void;
|
|
84
|
+
toggleLocation: (loc: string) => void;
|
|
85
|
+
removeLocation: (loc: string) => void;
|
|
86
|
+
toggleSecondary: (pos: string) => void;
|
|
87
|
+
removeSecondary: (pos: string) => void;
|
|
88
|
+
setPrimaryPosition: (pos: string) => void;
|
|
89
|
+
setPayBasis: (basis: "hourly" | "monthly") => void;
|
|
90
|
+
toggleAvailDay: (i: number) => void;
|
|
91
|
+
availAll: () => void;
|
|
92
|
+
setAvailHour: (i: number, field: "from" | "to", value: string) => void;
|
|
93
|
+
copyAvailHourDown: (i: number) => void;
|
|
94
|
+
setPasscodeDigit: (i: number, value: string) => void;
|
|
95
|
+
generatePasscode: () => void;
|
|
96
|
+
create: () => Promise<boolean>;
|
|
97
|
+
};
|
|
98
|
+
export type ScheduleAddEmployeeApi = ReturnType<typeof useScheduleAddEmployee>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ScheduleBoardApi } from './useScheduleBoard';
|
|
2
|
+
import type { ScheduleDemandApi } from './useScheduleDemand';
|
|
3
|
+
import { type ScheduleAnchorRect } from './schedule-popover-position';
|
|
4
|
+
export interface ScheduleAddPickState {
|
|
5
|
+
open: boolean;
|
|
6
|
+
empId: number | null;
|
|
7
|
+
dayIdx: number | null;
|
|
8
|
+
/** Measured rect of the cell the popup opened from; the popup component places itself from it
|
|
9
|
+
* once rendered (V6.2 placePopover), writing the result to `left`/`top`. */
|
|
10
|
+
anchor: ScheduleAnchorRect | null;
|
|
11
|
+
left: number;
|
|
12
|
+
top: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ScheduleAddPickLeaveOption {
|
|
15
|
+
reason: string;
|
|
16
|
+
swatch: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ScheduleAddPickSuggestion {
|
|
19
|
+
start: string;
|
|
20
|
+
end: string;
|
|
21
|
+
short: number;
|
|
22
|
+
label: string;
|
|
23
|
+
/** "Covers 16:00–22:00 demand" — the demand this offer answers, shown under the label. */
|
|
24
|
+
covers: string;
|
|
25
|
+
title: string;
|
|
26
|
+
}
|
|
27
|
+
/** The "+ Add" quick-pick popover on an employee's empty cell — ported from the mockup's
|
|
28
|
+
* openAddShiftPicker()/renderAddPickList(), scoped to what this board actually has: our one
|
|
29
|
+
* active shift pattern, a fixed leave-reason list, and a demand-gap suggestion, all committed
|
|
30
|
+
* directly (no clash confirmation dialogs — this board has no such infrastructure yet, and none
|
|
31
|
+
* of its existing write paths gate on one either). Leave picks write a full-day approved leave
|
|
32
|
+
* immediately rather than opening a creation form — there's no "book a leave" authoring flow
|
|
33
|
+
* anywhere in this port yet, only the existing pending-request review modal, which assumes the
|
|
34
|
+
* leave already exists. The mockup's "On this day" (join an existing open-shift group) section is
|
|
35
|
+
* left out — it needs split-shift/group-joining machinery this board doesn't model. */
|
|
36
|
+
export declare function useScheduleAddPick(board: ScheduleBoardApi, demand: ScheduleDemandApi, handlers: {
|
|
37
|
+
onCommitted: (message: string) => void;
|
|
38
|
+
onOpenFullEditor: (empId: number, dayIdx: number) => void;
|
|
39
|
+
/** The leave editor, on this cell. `reason` is the row's own type, or null for the plain "Leave" row. */
|
|
40
|
+
onOpenLeave: (empId: number, dayIdx: number, reason: string | null) => void;
|
|
41
|
+
}): {
|
|
42
|
+
state: {
|
|
43
|
+
open: boolean;
|
|
44
|
+
empId: number | null;
|
|
45
|
+
dayIdx: number | null;
|
|
46
|
+
anchor: {
|
|
47
|
+
left: number;
|
|
48
|
+
right: number;
|
|
49
|
+
top: number;
|
|
50
|
+
bottom: number;
|
|
51
|
+
} | null;
|
|
52
|
+
left: number;
|
|
53
|
+
top: number;
|
|
54
|
+
};
|
|
55
|
+
query: import("vue").Ref<string, string>;
|
|
56
|
+
parsedRange: import("vue").ComputedRef<{
|
|
57
|
+
start: string;
|
|
58
|
+
end: string;
|
|
59
|
+
} | null>;
|
|
60
|
+
suggested: import("vue").ComputedRef<ScheduleAddPickSuggestion | null>;
|
|
61
|
+
filteredPatterns: import("vue").ComputedRef<import("../types").ShiftTemplate[]>;
|
|
62
|
+
filteredLeaves: import("vue").ComputedRef<ScheduleAddPickLeaveOption[]>;
|
|
63
|
+
hasResults: import("vue").ComputedRef<boolean>;
|
|
64
|
+
openFor: (empId: number, dayIdx: number, anchor: HTMLElement) => void;
|
|
65
|
+
close: () => void;
|
|
66
|
+
pickSuggested: () => void;
|
|
67
|
+
pickPattern: (key: string) => void;
|
|
68
|
+
pickTypedRange: (start: string, end: string) => void;
|
|
69
|
+
pickLeave: (reason: string) => void;
|
|
70
|
+
submitQuery: () => void;
|
|
71
|
+
openBlank: () => void;
|
|
72
|
+
};
|
|
73
|
+
export type ScheduleAddPickApi = ReturnType<typeof useScheduleAddPick>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Employee, OpenShift } from '../types';
|
|
2
|
+
import type { ScheduleBoardApi } from './useScheduleBoard';
|
|
3
|
+
export interface ScheduleShiftPart {
|
|
4
|
+
start: string;
|
|
5
|
+
end: string;
|
|
6
|
+
}
|
|
7
|
+
/** One shift on the All-shifts row, whichever way it was authored. A split shift is ONE
|
|
8
|
+
* entry carrying both of its periods — two periods one person works is one shift, and
|
|
9
|
+
* counting it twice made a day of three split shifts report as six. */
|
|
10
|
+
export interface ScheduleRowEntry {
|
|
11
|
+
/** Stable across redraws, so the row can be keyed on it. */
|
|
12
|
+
key: string;
|
|
13
|
+
kind: 'open' | 'emp';
|
|
14
|
+
/** The demand record this came from, when it came from one. */
|
|
15
|
+
open?: OpenShift;
|
|
16
|
+
/** Whoever holds it, or null while it is still asking for somebody. */
|
|
17
|
+
who: Employee | null;
|
|
18
|
+
parts: ScheduleShiftPart[];
|
|
19
|
+
position: string;
|
|
20
|
+
/** A shift with a name of its own ("Weekend cover"), distinct from its position. */
|
|
21
|
+
label?: string;
|
|
22
|
+
filled: boolean;
|
|
23
|
+
hours: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ScheduleStackState {
|
|
26
|
+
open: boolean;
|
|
27
|
+
dayIdx: number | null;
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
}
|
|
31
|
+
/** The "Open shifts" row: a pseudo-row above the people holding the shifts nobody is on yet.
|
|
32
|
+
*
|
|
33
|
+
* It used to be the "All shifts" row and it used to LEAD this view, carrying every shift on
|
|
34
|
+
* the day whichever way it was authored. The coverage band has both of those now — and the
|
|
35
|
+
* band measures something this row could not, because a shift with nobody on it contributes
|
|
36
|
+
* zero to coverage, so counting untaken records was never an answer to "is this week staffed".
|
|
37
|
+
*
|
|
38
|
+
* What is left is the job only this row can do. An unassigned shift has no person, so the
|
|
39
|
+
* employee rows have nowhere to draw it; the old row would have shown it alongside every
|
|
40
|
+
* other shift, which is the same cards twice — once here and once on the row of whoever is on
|
|
41
|
+
* them. So the subject narrows to the shifts still waiting for somebody, and the row renders
|
|
42
|
+
* only while at least one exists. That makes it a to-do list rather than furniture: it appears
|
|
43
|
+
* when you author open demand and disappears the moment the last of it is staffed, which is
|
|
44
|
+
* the completion signal the old row had to paint itself green to fake. */
|
|
45
|
+
export declare function useScheduleAllShiftsRow(board: ScheduleBoardApi): {
|
|
46
|
+
dayEntries: (dayIdx: number) => ScheduleRowEntry[];
|
|
47
|
+
dayStack: (dayIdx: number) => {
|
|
48
|
+
entries: ScheduleRowEntry[];
|
|
49
|
+
done: number;
|
|
50
|
+
total: number;
|
|
51
|
+
hours: number;
|
|
52
|
+
allOpen: boolean;
|
|
53
|
+
mixShown: {
|
|
54
|
+
name: string;
|
|
55
|
+
n: number;
|
|
56
|
+
}[];
|
|
57
|
+
mixRest: number;
|
|
58
|
+
title: string;
|
|
59
|
+
};
|
|
60
|
+
summary: import("vue").ComputedRef<{
|
|
61
|
+
count: number;
|
|
62
|
+
meta: string;
|
|
63
|
+
tip: string;
|
|
64
|
+
}>;
|
|
65
|
+
hasPending: import("vue").ComputedRef<boolean>;
|
|
66
|
+
stack: {
|
|
67
|
+
open: boolean;
|
|
68
|
+
dayIdx: number | null;
|
|
69
|
+
left: number;
|
|
70
|
+
top: number;
|
|
71
|
+
};
|
|
72
|
+
stackEntries: import("vue").ComputedRef<ScheduleRowEntry[]>;
|
|
73
|
+
openStack: (dayIdx: number, anchor: HTMLElement) => void;
|
|
74
|
+
closeStack: () => void;
|
|
75
|
+
whenOf: (e: ScheduleRowEntry) => string;
|
|
76
|
+
};
|
|
77
|
+
export type ScheduleAllShiftsRowApi = ReturnType<typeof useScheduleAllShiftsRow>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ScheduleBoardApi } from './useScheduleBoard';
|
|
2
|
+
import type { Employee, WorkSlot } from '../types';
|
|
3
|
+
export interface ScheduleAssignedSlot {
|
|
4
|
+
emp: Employee;
|
|
5
|
+
slot: WorkSlot;
|
|
6
|
+
}
|
|
7
|
+
export interface SchedulePositionCellMeta {
|
|
8
|
+
required: number;
|
|
9
|
+
filled: number;
|
|
10
|
+
open: number;
|
|
11
|
+
short: number;
|
|
12
|
+
}
|
|
13
|
+
/** Shared by the week and day area views, so a position's colour never disagrees between them. */
|
|
14
|
+
export declare function positionSwatchClass(position: string): string;
|
|
15
|
+
/** Whether this employee can be put on `position` — ported from the mockup's qualifiedFor().
|
|
16
|
+
* Nobody having a named position yet reads as "any station", the same way an unspecialised
|
|
17
|
+
* new-account roster does in the reference: rostering shouldn't be blocked on the Positions
|
|
18
|
+
* page being filled in first. */
|
|
19
|
+
export declare function qualifiedFor(emp: Employee, position: string): boolean;
|
|
20
|
+
/** Week-by-area grouping: rows are positions (a RULES.coverage.full key), not employees.
|
|
21
|
+
* Ported from the mockup's positionRows()/renderPositionBlock() — scoped to this board's single
|
|
22
|
+
* "Unassigned" section and its existing WorkSlot/OpenShift model, so no split shifts and
|
|
23
|
+
* no locked/closed-day states (neither exists anywhere in this port yet). */
|
|
24
|
+
export declare function useScheduleAreaBoard(board: ScheduleBoardApi): {
|
|
25
|
+
positionRows: import("vue").ComputedRef<string[]>;
|
|
26
|
+
assignedOn: (dayIdx: number, position: string) => ScheduleAssignedSlot[];
|
|
27
|
+
unfilledOpenShiftsOn: (dayIdx: number, position: string) => {
|
|
28
|
+
id: number;
|
|
29
|
+
dayIdx: number;
|
|
30
|
+
position: string;
|
|
31
|
+
required: number;
|
|
32
|
+
filledBy: number | null;
|
|
33
|
+
sen?: "junior" | "senior" | undefined;
|
|
34
|
+
empType?: "full" | "part" | undefined;
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
38
|
+
breakMins?: number | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
poolFor: (position: string) => Employee[];
|
|
41
|
+
cellMeta: (dayIdx: number, position: string) => SchedulePositionCellMeta;
|
|
42
|
+
positionWeekMeta: (position: string) => {
|
|
43
|
+
required: number;
|
|
44
|
+
filled: number;
|
|
45
|
+
open: number;
|
|
46
|
+
short: number;
|
|
47
|
+
pool: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export type ScheduleAreaBoardApi = ReturnType<typeof useScheduleAreaBoard>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ScheduleBoardApi } from './useScheduleBoard';
|
|
2
|
+
import type { ScheduleAreaBoardApi } from './useScheduleAreaBoard';
|
|
3
|
+
/** Dragging a person from the staff rail onto a position/day cell — ported from the mockup's
|
|
4
|
+
* dropStaffOnCell(), scoped to this board's model (no "unspecialised, so ask what they can
|
|
5
|
+
* do" grant flow, no split shifts): dropping fills an existing open shift for that position/day
|
|
6
|
+
* if there is one, otherwise opens the shift editor pre-filled with this person, day and
|
|
7
|
+
* position so the manager sets the hours. */
|
|
8
|
+
export declare function useScheduleAreaDragDrop(board: ScheduleBoardApi, areaBoard: ScheduleAreaBoardApi, handlers: {
|
|
9
|
+
onFillOpenShift: (openId: number, empId: number) => void;
|
|
10
|
+
onCreateShift: (empId: number, dayIdx: number, position: string) => void;
|
|
11
|
+
onNotQualified: (empName: string, position: string) => void;
|
|
12
|
+
}): {
|
|
13
|
+
draggingEmpId: import("vue").Ref<number | null, number | null>;
|
|
14
|
+
startRailDrag: (empId: number) => void;
|
|
15
|
+
endRailDrag: () => void;
|
|
16
|
+
dropOnCell: (dayIdx: number, position: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export type ScheduleAreaDragDropApi = ReturnType<typeof useScheduleAreaDragDrop>;
|