Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc3c23055a |
@@ -78,8 +78,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -91,12 +89,10 @@ jobs:
|
|||||||
- name: Build and push API image
|
- name: Build and push API image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
provenance: false
|
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
target: runner
|
target: runner
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
|
||||||
tags: |
|
tags: |
|
||||||
git.farh.net/groombook/api:${{ steps.version.outputs.tag }}
|
git.farh.net/groombook/api:${{ steps.version.outputs.tag }}
|
||||||
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/api:latest' || '' }}
|
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/api:latest' || '' }}
|
||||||
@@ -106,12 +102,10 @@ jobs:
|
|||||||
- name: Build and push Migrate image
|
- name: Build and push Migrate image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
provenance: false
|
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
target: migrate
|
target: migrate
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
|
||||||
tags: |
|
tags: |
|
||||||
git.farh.net/groombook/migrate:${{ steps.version.outputs.tag }}
|
git.farh.net/groombook/migrate:${{ steps.version.outputs.tag }}
|
||||||
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/migrate:latest' || '' }}
|
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/migrate:latest' || '' }}
|
||||||
@@ -121,12 +115,10 @@ jobs:
|
|||||||
- name: Build and push Seed image
|
- name: Build and push Seed image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
provenance: false
|
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
target: seed
|
target: seed
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
|
||||||
tags: |
|
tags: |
|
||||||
git.farh.net/groombook/seed:${{ steps.version.outputs.tag }}
|
git.farh.net/groombook/seed:${{ steps.version.outputs.tag }}
|
||||||
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/seed:latest' || '' }}
|
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/seed:latest' || '' }}
|
||||||
@@ -136,12 +128,10 @@ jobs:
|
|||||||
- name: Build and push Reset image
|
- name: Build and push Reset image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
provenance: false
|
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
target: reset
|
target: reset
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
|
||||||
tags: |
|
tags: |
|
||||||
git.farh.net/groombook/reset:${{ steps.version.outputs.tag }}
|
git.farh.net/groombook/reset:${{ steps.version.outputs.tag }}
|
||||||
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/reset:latest' || '' }}
|
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/reset:latest' || '' }}
|
||||||
|
|||||||
@@ -36,19 +36,6 @@ const DEMO_PET = {
|
|||||||
weightKg: "30.00",
|
weightKg: "30.00",
|
||||||
};
|
};
|
||||||
|
|
||||||
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, weightKg: "20.00" },
|
|
||||||
{ name: "Max", species: "Dog", breed: "Labrador Retriever", coatType: "short" as const, weightKg: "30.00" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const DEMO_SERVICES = [
|
const DEMO_SERVICES = [
|
||||||
{ id: "b0000001-0000-0000-0000-000000000001", name: "Bath & Brush", description: "Full bath, blow-dry, brush out, and ear cleaning", basePriceCents: 4500, durationMinutes: 45 },
|
{ id: "b0000001-0000-0000-0000-000000000001", name: "Bath & Brush", description: "Full bath, blow-dry, brush out, and ear cleaning", basePriceCents: 4500, durationMinutes: 45 },
|
||||||
{ id: "b0000001-0000-0000-0000-000000000002", name: "Full Groom — Small", description: "Complete grooming for dogs under 25 lbs", basePriceCents: 6500, durationMinutes: 60 },
|
{ id: "b0000001-0000-0000-0000-000000000002", name: "Full Groom — Small", description: "Complete grooming for dogs under 25 lbs", basePriceCents: 6500, durationMinutes: 60 },
|
||||||
@@ -56,7 +43,7 @@ const DEMO_SERVICES = [
|
|||||||
{ id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 },
|
{ id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 },
|
||||||
];
|
];
|
||||||
|
|
||||||
adminSeedRouter.post("/", async (c) => {
|
adminSeedRouter.post("/seed", async (c) => {
|
||||||
// Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding
|
// Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding
|
||||||
if (process.env.AUTH_DISABLED === "true") {
|
if (process.env.AUTH_DISABLED === "true") {
|
||||||
return c.json(
|
return c.json(
|
||||||
@@ -141,51 +128,6 @@ adminSeedRouter.post("/", async (c) => {
|
|||||||
results.push(`Created pet '${DEMO_PET.name}' for Demo Client (id: ${created!.id})`);
|
results.push(`Created pet '${DEMO_PET.name}' for Demo Client (id: ${created!.id})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Client: UAT Customer ──────────────────────────────────────────────────
|
|
||||||
const [existingUatClient] = await db
|
|
||||||
.select()
|
|
||||||
.from(clients)
|
|
||||||
.where(eq(clients.email, UAT_CLIENT.email));
|
|
||||||
|
|
||||||
let uatClientId: string;
|
|
||||||
if (existingUatClient) {
|
|
||||||
uatClientId = existingUatClient.id;
|
|
||||||
results.push(`Client '${UAT_CLIENT.name}' already exists (id: ${uatClientId})`);
|
|
||||||
} else {
|
|
||||||
const [created] = await db.insert(clients).values(UAT_CLIENT).returning();
|
|
||||||
uatClientId = created!.id;
|
|
||||||
results.push(`Created client '${UAT_CLIENT.name}' (id: ${uatClientId})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Pets: UAT Customer's Pets ─────────────────────────────────────────────
|
|
||||||
const existingUatPets = await db
|
|
||||||
.select()
|
|
||||||
.from(pets)
|
|
||||||
.where(eq(pets.clientId, uatClientId));
|
|
||||||
|
|
||||||
for (const uatPet of UAT_PETS) {
|
|
||||||
const existingPet = existingUatPets.find(
|
|
||||||
(p) => p.name === uatPet.name && p.species === uatPet.species
|
|
||||||
);
|
|
||||||
if (existingPet) {
|
|
||||||
results.push(`Pet '${uatPet.name}' already exists for UAT Customer (id: ${existingPet.id})`);
|
|
||||||
} else {
|
|
||||||
const [created] = await db
|
|
||||||
.insert(pets)
|
|
||||||
.values({
|
|
||||||
clientId: uatClientId,
|
|
||||||
name: uatPet.name,
|
|
||||||
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})`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.json({
|
return c.json({
|
||||||
message: "Seed complete",
|
message: "Seed complete",
|
||||||
details: results,
|
details: results,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
test
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
trigger CI v2
|
|
||||||
@@ -105,10 +105,6 @@ export function buildPet(overrides: Partial<PetRow> & { clientId: string }): Pet
|
|||||||
photoKey: null,
|
photoKey: null,
|
||||||
photoUploadedAt: null,
|
photoUploadedAt: null,
|
||||||
image: null,
|
image: null,
|
||||||
temperamentScore: null,
|
|
||||||
temperamentFlags: [],
|
|
||||||
medicalAlerts: [],
|
|
||||||
preferredCuts: [],
|
|
||||||
createdAt: new Date("2025-01-01T00:00:00Z"),
|
createdAt: new Date("2025-01-01T00:00:00Z"),
|
||||||
updatedAt: new Date("2025-01-01T00:00:00Z"),
|
updatedAt: new Date("2025-01-01T00:00:00Z"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
unique,
|
unique,
|
||||||
uuid,
|
uuid,
|
||||||
} from "drizzle-orm/pg-core";
|
} from "drizzle-orm/pg-core";
|
||||||
import type { MedicalAlert } from "@groombook/types";
|
|
||||||
|
|
||||||
// ─── Enums ────────────────────────────────────────────────────────────────────
|
// ─── Enums ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -165,10 +164,6 @@ export const pets = pgTable(
|
|||||||
specialCareNotes: text("special_care_notes"),
|
specialCareNotes: text("special_care_notes"),
|
||||||
coatType: coatTypeEnum("coat_type"),
|
coatType: coatTypeEnum("coat_type"),
|
||||||
petSizeCategory: petSizeCategoryEnum("pet_size_category"),
|
petSizeCategory: petSizeCategoryEnum("pet_size_category"),
|
||||||
temperamentScore: integer("temperament_score"),
|
|
||||||
temperamentFlags: jsonb("temperament_flags").$type<string[]>().default([]),
|
|
||||||
medicalAlerts: jsonb("medical_alerts").$type<MedicalAlert[]>().default([]),
|
|
||||||
preferredCuts: jsonb("preferred_cuts").$type<string[]>().default([]),
|
|
||||||
customFields: jsonb("custom_fields").$type<Record<string, string>>().notNull().default({}),
|
customFields: jsonb("custom_fields").$type<Record<string, string>>().notNull().default({}),
|
||||||
photoKey: text("photo_key"),
|
photoKey: text("photo_key"),
|
||||||
photoUploadedAt: timestamp("photo_uploaded_at"),
|
photoUploadedAt: timestamp("photo_uploaded_at"),
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ app.use(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Health check — no auth required, registered on app at full path before auth middleware
|
// Health check — no auth required, registered on app at full path before auth middleware
|
||||||
// /health: used by Dockerfile HEALTHCHECK and K8s readinessProbe/livenessProbe (port 3000 direct)
|
|
||||||
app.get("/health", (c) => c.json({ status: "ok" }));
|
|
||||||
// /api/health: used by Gateway HTTPRoute (/api/* → API pod)
|
|
||||||
app.get("/api/health", (c) => c.json({ status: "ok" }));
|
app.get("/api/health", (c) => c.json({ status: "ok" }));
|
||||||
|
|
||||||
// Public booking routes — no auth required, must be registered before auth middleware
|
// Public booking routes — no auth required, must be registered before auth middleware
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (process.env.AUTH_DISABLED === "true") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const authMiddleware: MiddlewareHandler = async (c, next) => {
|
export const authMiddleware: MiddlewareHandler = async (c, next) => {
|
||||||
if (c.req.path.startsWith("/api/auth/") || c.req.path === "/api/health") {
|
if (c.req.path.startsWith("/api/auth/")) {
|
||||||
await next();
|
await next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,19 +36,6 @@ const DEMO_PET = {
|
|||||||
weightKg: "30.00",
|
weightKg: "30.00",
|
||||||
};
|
};
|
||||||
|
|
||||||
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", weightKg: "20.00" },
|
|
||||||
{ name: "Max", species: "Dog", breed: "Labrador Retriever", coatType: "short", weightKg: "30.00" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const DEMO_SERVICES = [
|
const DEMO_SERVICES = [
|
||||||
{ id: "b0000001-0000-0000-0000-000000000001", name: "Bath & Brush", description: "Full bath, blow-dry, brush out, and ear cleaning", basePriceCents: 4500, durationMinutes: 45 },
|
{ id: "b0000001-0000-0000-0000-000000000001", name: "Bath & Brush", description: "Full bath, blow-dry, brush out, and ear cleaning", basePriceCents: 4500, durationMinutes: 45 },
|
||||||
{ id: "b0000001-0000-0000-0000-000000000002", name: "Full Groom — Small", description: "Complete grooming for dogs under 25 lbs", basePriceCents: 6500, durationMinutes: 60 },
|
{ id: "b0000001-0000-0000-0000-000000000002", name: "Full Groom — Small", description: "Complete grooming for dogs under 25 lbs", basePriceCents: 6500, durationMinutes: 60 },
|
||||||
@@ -56,7 +43,7 @@ const DEMO_SERVICES = [
|
|||||||
{ id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 },
|
{ id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 },
|
||||||
];
|
];
|
||||||
|
|
||||||
adminSeedRouter.post("/", async (c) => {
|
adminSeedRouter.post("/seed", async (c) => {
|
||||||
// Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding
|
// Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding
|
||||||
if (process.env.AUTH_DISABLED === "true") {
|
if (process.env.AUTH_DISABLED === "true") {
|
||||||
return c.json(
|
return c.json(
|
||||||
@@ -141,51 +128,6 @@ adminSeedRouter.post("/", async (c) => {
|
|||||||
results.push(`Created pet '${DEMO_PET.name}' for Demo Client (id: ${created!.id})`);
|
results.push(`Created pet '${DEMO_PET.name}' for Demo Client (id: ${created!.id})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Client: UAT Customer ──────────────────────────────────────────────────
|
|
||||||
const [existingUatClient] = await db
|
|
||||||
.select()
|
|
||||||
.from(clients)
|
|
||||||
.where(eq(clients.email, UAT_CLIENT.email));
|
|
||||||
|
|
||||||
let uatClientId: string;
|
|
||||||
if (existingUatClient) {
|
|
||||||
uatClientId = existingUatClient.id;
|
|
||||||
results.push(`Client '${UAT_CLIENT.name}' already exists (id: ${uatClientId})`);
|
|
||||||
} else {
|
|
||||||
const [created] = await db.insert(clients).values(UAT_CLIENT).returning();
|
|
||||||
uatClientId = created!.id;
|
|
||||||
results.push(`Created client '${UAT_CLIENT.name}' (id: ${uatClientId})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Pets: UAT Customer's Pets ─────────────────────────────────────────────
|
|
||||||
const existingUatPets = await db
|
|
||||||
.select()
|
|
||||||
.from(pets)
|
|
||||||
.where(eq(pets.clientId, uatClientId));
|
|
||||||
|
|
||||||
for (const uatPet of UAT_PETS) {
|
|
||||||
const existing = existingUatPets.find(
|
|
||||||
(p) => p.name === uatPet.name && p.species === uatPet.species
|
|
||||||
);
|
|
||||||
if (existing) {
|
|
||||||
results.push(`Pet '${uatPet.name}' already exists for UAT Customer (id: ${existing.id})`);
|
|
||||||
} else {
|
|
||||||
const [created] = await db
|
|
||||||
.insert(pets)
|
|
||||||
.values({
|
|
||||||
clientId: uatClientId,
|
|
||||||
name: uatPet.name,
|
|
||||||
species: uatPet.species,
|
|
||||||
breed: uatPet.breed,
|
|
||||||
coatType: uatPet.coatType as any,
|
|
||||||
weightKg: uatPet.weightKg,
|
|
||||||
dateOfBirth: new Date("2019-01-01T00:00:00Z"),
|
|
||||||
})
|
|
||||||
.returning();
|
|
||||||
results.push(`Created pet '${uatPet.name}' for UAT Customer (id: ${created!.id})`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.json({
|
return c.json({
|
||||||
message: "Seed complete",
|
message: "Seed complete",
|
||||||
details: results,
|
details: results,
|
||||||
|
|||||||
Reference in New Issue
Block a user