feat(GRO-395): ensure at least 250 seeded pets are Puggles with photos

Add Puggle breed to dogBreeds array and modify seed logic to guarantee first 250 pets are assigned Puggle breed. This ensures demo data includes a significant population of Puggle dogs (Pug-Beagle mix) with images for testing grooming workflows with diverse pet breeds.

- Add Puggle to available dog breeds list
- Track pet creation index across all clients
- Assign Puggle breed to first 250 pets regardless of randomization
- Assign Puggle-specific images to first 250 pets
- Remaining pets use general demo image pool

This satisfies requirement: "at least 250 of the 2500 pets are first or second generation puggles with photos"

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit was merged in pull request #255.
This commit is contained in:
Paperclip
2026-04-10 21:45:16 +00:00
parent 39f603589b
commit 522e5dbf63
+13 -3
View File
@@ -184,7 +184,7 @@ const dogBreeds = [
"Brittany", "English Springer Spaniel", "Maltese", "Bichon Frise",
"West Highland White Terrier", "Vizsla", "Chihuahua", "Collie",
"Basset Hound", "Newfoundland", "Samoyed", "Australian Shepherd",
"Pembroke Welsh Corgi", "French Bulldog", "Weimaraner",
"Pembroke Welsh Corgi", "French Bulldog", "Weimaraner", "Puggle",
"Mixed Breed", "Mixed Breed", "Mixed Breed",
];
@@ -312,6 +312,14 @@ const demoPetImages = [
"/demo-pets/dog-sheepdog-merle-running.png",
];
const puggleImages = [
"/demo-pets/dog-puggle-fawn-playful.png",
"/demo-pets/dog-puggle-black-sitting.png",
"/demo-pets/dog-puggle-cream-groomed.png",
"/demo-pets/dog-puggle-tricolor-outdoor.png",
"/demo-pets/dog-puggle-fawn-grooming.png",
];
// ── Service definitions ──────────────────────────────────────────────────────
// Deterministic service IDs + UNIQUE(name) constraint make seed fully idempotent:
// first run inserts, subsequent runs update existing rows via ON CONFLICT (name).
@@ -652,6 +660,7 @@ async function seed() {
const clientRecords: ClientRecord[] = [];
const petRecords: PetRecord[] = [];
let petIndex = 0; // Track pet count to assign Puggle images to first 250 pets
const clientBatchSize = 50;
for (let batch = 0; batch < Math.ceil(cfg.clientCount / clientBatchSize); batch++) {
const clientBatch: (typeof schema.clients.$inferInsert)[] = [];
@@ -683,7 +692,7 @@ async function seed() {
const petCount = rand() < 0.5 ? 1 : rand() < 0.7 ? 2 : 3;
for (let p = 0; p < petCount; p++) {
const petId = uuid();
const breed = pick(dogBreeds);
const breed = petIndex < 250 ? "Puggle" : pick(dogBreeds);
const dob = new Date(now);
dob.setFullYear(dob.getFullYear() - randInt(1, 14));
dob.setMonth(randInt(0, 11));
@@ -702,10 +711,11 @@ async function seed() {
shampooPreference: pick(shampoos),
specialCareNotes: rand() < 0.1 ? "Vet clearance required before grooming" : null,
customFields: {},
image: pick(demoPetImages),
image: petIndex < 250 ? pick(puggleImages) : pick(demoPetImages),
});
petRecords.push({ id: petId, clientId });
petIndex++;
}
}