fix(gro-1749): sync UAT seed data to root src and fix route path (#71)

Co-authored-by: Flea Flicker <flea@groombook.dev>
Co-committed-by: Flea Flicker <flea@groombook.dev>
This commit was merged in pull request #71.
This commit is contained in:
2026-05-25 17:45:56 +00:00
committed by Flea Flicker
parent 040ff4a253
commit a03771f7e7
3 changed files with 71 additions and 6 deletions
+8 -5
View File
@@ -40,12 +40,13 @@ const UAT_CLIENT = {
name: "UAT Customer",
email: "uat-customer@groombook.dev",
phone: "555-0100",
address: "1 UAT Lane, Test City, CA 90210",
status: "active" as const,
};
const UAT_PETS = [
{ name: "Bella", species: "Dog", breed: "Poodle", coatType: "curly" as const },
{ name: "Max", species: "Dog", breed: "Labrador Retriever", coatType: "short" as const },
{ name: "Bella", species: "Dog", breed: "Poodle", coatType: "curly" as const, weightKg: "20.00" },
{ name: "Max", species: "Dog", breed: "Labrador Retriever", coatType: "short" as const, weightKg: "30.00" },
];
const DEMO_SERVICES = [
@@ -55,7 +56,7 @@ const DEMO_SERVICES = [
{ id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 },
];
adminSeedRouter.post("/seed", async (c) => {
adminSeedRouter.post("/", async (c) => {
// Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding
if (process.env.AUTH_DISABLED === "true") {
return c.json(
@@ -156,7 +157,7 @@ adminSeedRouter.post("/seed", async (c) => {
results.push(`Created client '${UAT_CLIENT.name}' (id: ${uatClientId})`);
}
// ── Pets: UAT Customer Pets ───────────────────────────────────────────────
// ── Pets: UAT Customer's Pets ─────────────────────────────────────────────
const existingUatPets = await db
.select()
.from(pets)
@@ -177,6 +178,8 @@ adminSeedRouter.post("/seed", async (c) => {
species: uatPet.species,
breed: uatPet.breed,
coatType: uatPet.coatType,
weightKg: uatPet.weightKg,
dateOfBirth: new Date("2019-01-01T00:00:00Z"),
})
.returning();
results.push(`Created pet '${uatPet.name}' for UAT Customer (id: ${created!.id})`);
@@ -191,4 +194,4 @@ adminSeedRouter.post("/seed", async (c) => {
staffOidcSub: KNOWN_STAFF.oidcSub,
},
});
});
});