Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 2x 2x 2x 2x 8x 116x 2x 2x 2x 2x 2x 2x 2x 2x 2x 111x 111x 111x 204x 17x 17x 17x 9x 17x | export const officesForProviderHourSnap = [
{ officeId: 1, appointments: [1750165200] }, // 15:00
{
officeId: 2,
appointments: [1750154400, 1750158000, 1750161600], // 12, 13, 14
},
];
export const officesForProviderHourSnapEqualDistance = [
{ officeId: 1, appointments: [1750158000] }, // 13:00
{ officeId: 2, appointments: [1750154400, 1750161600] }, // 12, 14
];
const JULY_2_2025_BASE_TIMESTAMP = 1751450400;
const generateAppointmentTimestamps = (
count: number,
startTimestamp = JULY_2_2025_BASE_TIMESTAMP,
intervalSeconds = 300
): number[] =>
Array.from(
{ length: count },
(_, index) => startTimestamp + index * intervalSeconds
);
export const officesForHourlyViewTest = [
{
officeId: 1,
appointments: generateAppointmentTimestamps(20),
},
{
officeId: 2,
appointments: generateAppointmentTimestamps(
20,
JULY_2_2025_BASE_TIMESTAMP + 3600
),
},
];
export const officesForDayPartViewTest = [
{
officeId: 1,
appointments: generateAppointmentTimestamps(9),
},
{
officeId: 2,
appointments: generateAppointmentTimestamps(
9,
JULY_2_2025_BASE_TIMESTAMP + 3 * 60 * 60
),
},
];
export const listViewHourNavigationSlots = [
{ officeId: 1, appointments: [1749560400, 1749564000] }, // 15:00, 16:00
];
export const listViewDayPartNavigationSlots = [
{ officeId: 1, appointments: [1749535200, 1749560400] }, // 08:00 am, 15:00 pm
];
export const offices10351880And10470 = [
{ officeId: 10351880, appointments: [1750118400] },
{ officeId: 10470, appointments: [1750118400] },
];
export const defaultMultiProviderOffices = [
{
officeId: 102522,
appointments: [
1747202400, 1747223100, 1747223400, 1747223700, 1747224000, 1747224300,
],
},
{
officeId: 54261,
appointments: [1747223100, 1747223400, 1747223700, 1747224000, 1747224300],
},
{
officeId: 10489,
appointments: [1747223100, 1747223400, 1747223700, 1747224000, 1747224300],
},
];
export const officeOneMorningSlots = [
{ officeId: 1, appointments: [1747224600, 1747224900, 1747225200] },
];
export const officeOneAndTwoSlots = [
{ officeId: 1, appointments: [1747224600, 1747224900, 1747225200] },
{ officeId: 2, appointments: [1747223100, 1747223400, 1747223700] },
];
export const officeTwoAndThreeSlots = [
{
officeId: 2,
appointments: [1747223100, 1747223400, 1747223700, 1747224000, 1747224300],
},
{
officeId: 3,
appointments: [1747223100, 1747223400, 1747223700, 1747224000, 1747224300],
},
];
export type CalendarDayMock = {
date: string;
providerIDs: string;
offices?: Array<{ officeId: number | string; appointments: number[] }>;
};
export function calendarResponse(
days: CalendarDayMock[],
defaultOffices = defaultMultiProviderOffices,
markers: {
prevBookableDate?: string | null;
nextBookableDate?: string | null;
} = {}
) {
const startDate = days[0]?.date ?? "2025-01-01";
const endDate = days[days.length - 1]?.date ?? "2025-12-31";
return {
startDate,
endDate,
slotsStartDate: startDate,
slotsEndDate: endDate,
prevBookableDate: markers.prevBookableDate ?? null,
nextBookableDate: markers.nextBookableDate ?? null,
availableDays: days.map((day) => ({
date: day.date,
providerIDs: day.providerIDs,
offices: day.offices ?? defaultOffices,
})),
};
}
export function setAvailableDays(
wrapper: { vm: any },
days: Array<{ date: string; providerIDs: string }>,
offices: Array<{
officeId: number | string;
appointments: number[];
}> = defaultMultiProviderOffices
) {
wrapper.vm.availableDays = days;
const map = new Map<
string,
Array<{ officeId: number | string; appointments: number[] }>
>();
for (const day of days) {
map.set(day.date.slice(0, 10), offices);
}
wrapper.vm.appointmentsByDay = map;
}
export function setAppointmentsByDay(
wrapper: { vm: any },
entries: Array<
[string, Array<{ officeId: number | string; appointments: number[] }>]
>
) {
wrapper.vm.appointmentsByDay = new Map(entries);
}
|