Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d191743e2 |
+1
-1
@@ -79,7 +79,7 @@ GroomBook is an open-source, self-hostable pet grooming business management & CR
|
||||
| TC-APP-4.5.5 | Appointment groups | 1. Create multiple appointments for same time slot<br>2. View in calendar | Appointments are grouped/linked appropriately |
|
||||
| TC-APP-4.5.6 | Appointment availability check | 1. Attempt to book appointment during unavailable slot | System shows conflict or prevents double-booking |
|
||||
| TC-APP-4.5.7 | Booking wizard — size/coat selection | 1. Start new appointment booking wizard<br>2. Select a pet with sizeCategory and coatType set<br>3. Observe the service/slot selection step | Size and coat type dropdowns are displayed and persist the pet's existing values |
|
||||
| TC-APP-4.5.8 | Large/X-Large pet slot duration reflects buffer | 1. Add a pet with sizeCategory = "large" or "x-large" to an appointment<br>2. Note the service duration<br>3. Complete booking and inspect the appointment | Appointment slot includes the service duration plus the configured buffer for the pet's size category |
|
||||
| TC-APP-4.5.8 | Large/Xlarge pet slot duration reflects buffer | 1. Add a pet with sizeCategory = "large" or "xlarge" to an appointment<br>2. Note the service duration<br>3. Complete booking and inspect the appointment | Appointment slot includes the service duration plus the configured buffer for the pet's size category |
|
||||
| TC-APP-4.5.9 | Appointment overrun cascades downstream | 1. Book three consecutive same-groomer appointments (A → B → C)<br>2. Manually extend appointment A's endTime so it overlaps B's startTime by ≥15 min<br>3. Observe appointment B | Appointment B (and C if still overlapping) is automatically shifted forward by the overrun delta + buffer; no error thrown |
|
||||
| TC-APP-4.5.10 | Cascaded appointments appear at new times | 1. Complete TC-APP-4.5.9<br>2. Check the calendar/list view | Appointments B and C are now shown at their shifted start/end times |
|
||||
| TC-APP-4.5.11 | Client receives reschedule notification email | 1. Complete TC-APP-4.5.9<br>2. Check the client's email (or notification log) | Client receives an email with subject/lines indicating their appointment was rescheduled from original time to new time |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { eq, and, gt, gte, lt, ne, or, asc } from "@groombook/db";
|
||||
import { eq, and, gt, or, asc } from "@groombook/db";
|
||||
import { appointments, clients, pets, services, staff, type Db } from "@groombook/db";
|
||||
import { resolveBufferMinutes } from "./buffer.js";
|
||||
import { sendEmail, buildRescheduleNotificationEmail } from "../services/email.js";
|
||||
@@ -53,12 +53,12 @@ export async function detectAndCascadeOverrun({
|
||||
db,
|
||||
overrunningAppointmentId,
|
||||
newEndTime,
|
||||
originalEndTime,
|
||||
_originalEndTime,
|
||||
}: {
|
||||
db: Db;
|
||||
overrunningAppointmentId: string;
|
||||
newEndTime: Date;
|
||||
originalEndTime: Date;
|
||||
_originalEndTime: Date;
|
||||
}): Promise<CascadeResult> {
|
||||
const result: CascadeResult = { shifted: [], flaggedForReview: [] };
|
||||
|
||||
@@ -178,16 +178,16 @@ export async function detectAndCascadeOverrun({
|
||||
export function isOverrun({
|
||||
originalEndTime,
|
||||
newEndTime,
|
||||
originalStartTime,
|
||||
newStartTime,
|
||||
_originalStartTime,
|
||||
_newStartTime,
|
||||
status,
|
||||
currentTime,
|
||||
bufferMinutes,
|
||||
}: {
|
||||
originalEndTime: Date;
|
||||
newEndTime: Date;
|
||||
originalStartTime: Date;
|
||||
newStartTime?: Date;
|
||||
_originalStartTime: Date;
|
||||
_newStartTime?: Date;
|
||||
status: string;
|
||||
currentTime: Date;
|
||||
bufferMinutes: number;
|
||||
|
||||
@@ -700,7 +700,7 @@ appointmentsRouter.patch(
|
||||
isOverrun({
|
||||
originalEndTime,
|
||||
newEndTime: new Date(updateFields.endTime),
|
||||
originalStartTime: row.startTime,
|
||||
_originalStartTime: row.startTime,
|
||||
status: row.status,
|
||||
currentTime: new Date(),
|
||||
bufferMinutes: row.bufferMinutes ?? 0,
|
||||
@@ -710,7 +710,7 @@ appointmentsRouter.patch(
|
||||
db,
|
||||
overrunningAppointmentId: id,
|
||||
newEndTime: new Date(updateFields.endTime),
|
||||
originalEndTime,
|
||||
_originalEndTime: originalEndTime,
|
||||
});
|
||||
return c.json({ ...row, cascade: cascadeResult });
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ bookRouter.get("/availability", async (c) => {
|
||||
const serviceId = c.req.query("serviceId");
|
||||
const dateStr = c.req.query("date");
|
||||
const petSizeCategory = c.req.query("petSizeCategory") ?? undefined;
|
||||
const petCoatType = c.req.query("petCoatType") ?? undefined;
|
||||
|
||||
if (!serviceId || !dateStr) {
|
||||
return c.json({ error: "serviceId and date are required" }, 400);
|
||||
|
||||
@@ -19,7 +19,7 @@ export default defineConfig({
|
||||
reporter: process.env.CI ? "github" : "list",
|
||||
|
||||
use: {
|
||||
baseURL: "http://localhost:8080",
|
||||
baseURL: process.env.PLAYWRIGHT_BASE_URL ?? "http://localhost:8080",
|
||||
trace: "on-first-retry",
|
||||
screenshot: "only-on-failure",
|
||||
serviceWorkers: "block",
|
||||
|
||||
@@ -515,7 +515,7 @@ export function BookPage() {
|
||||
<option value="small">Small (under 15 lbs)</option>
|
||||
<option value="medium">Medium (15–40 lbs)</option>
|
||||
<option value="large">Large (40–80 lbs)</option>
|
||||
<option value="x-large">X-Large (over 80 lbs)</option>
|
||||
<option value="xlarge">X-Large (over 80 lbs)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@@ -568,7 +568,7 @@ export function BookPage() {
|
||||
<div>
|
||||
<div style={{ color: "#9ca3af", fontSize: 12, fontWeight: 600, textTransform: "uppercase" }}>Service</div>
|
||||
<div style={{ fontWeight: 600 }}>{selectedService.name}</div>
|
||||
<div style={{ color: "#6b7280" }}>{fmtPrice(selectedService.basePriceCents)} · {fmtDuration(selectedService.durationMinutes + ((form.petSizeCategory === "large" || form.petSizeCategory === "x-large") ? (selectedService.defaultBufferMinutes ?? 0) : 0))}</div>
|
||||
<div style={{ color: "#6b7280" }}>{fmtPrice(selectedService.basePriceCents)} · {fmtDuration(selectedService.durationMinutes + ((form.petSizeCategory === "large" || form.petSizeCategory === "xlarge") ? (selectedService.defaultBufferMinutes ?? 0) : 0))}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ color: "#9ca3af", fontSize: 12, fontWeight: 600, textTransform: "uppercase" }}>Date & Time</div>
|
||||
|
||||
Reference in New Issue
Block a user