Fix GitHub/Google OAuth redirect URI configuration (GRO-546) #257
+13
-3
@@ -184,7 +184,7 @@ const dogBreeds = [
|
|||||||
"Brittany", "English Springer Spaniel", "Maltese", "Bichon Frise",
|
"Brittany", "English Springer Spaniel", "Maltese", "Bichon Frise",
|
||||||
"West Highland White Terrier", "Vizsla", "Chihuahua", "Collie",
|
"West Highland White Terrier", "Vizsla", "Chihuahua", "Collie",
|
||||||
"Basset Hound", "Newfoundland", "Samoyed", "Australian Shepherd",
|
"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",
|
"Mixed Breed", "Mixed Breed", "Mixed Breed",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -312,6 +312,14 @@ const demoPetImages = [
|
|||||||
"/demo-pets/dog-sheepdog-merle-running.png",
|
"/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 ──────────────────────────────────────────────────────
|
// ── Service definitions ──────────────────────────────────────────────────────
|
||||||
// Deterministic service IDs + UNIQUE(name) constraint make seed fully idempotent:
|
// Deterministic service IDs + UNIQUE(name) constraint make seed fully idempotent:
|
||||||
// first run inserts, subsequent runs update existing rows via ON CONFLICT (name).
|
// first run inserts, subsequent runs update existing rows via ON CONFLICT (name).
|
||||||
@@ -652,6 +660,7 @@ async function seed() {
|
|||||||
const clientRecords: ClientRecord[] = [];
|
const clientRecords: ClientRecord[] = [];
|
||||||
const petRecords: PetRecord[] = [];
|
const petRecords: PetRecord[] = [];
|
||||||
|
|
||||||
|
let petIndex = 0; // Track pet count to assign Puggle images to first 250 pets
|
||||||
const clientBatchSize = 50;
|
const clientBatchSize = 50;
|
||||||
for (let batch = 0; batch < Math.ceil(cfg.clientCount / clientBatchSize); batch++) {
|
for (let batch = 0; batch < Math.ceil(cfg.clientCount / clientBatchSize); batch++) {
|
||||||
const clientBatch: (typeof schema.clients.$inferInsert)[] = [];
|
const clientBatch: (typeof schema.clients.$inferInsert)[] = [];
|
||||||
@@ -683,7 +692,7 @@ async function seed() {
|
|||||||
const petCount = rand() < 0.5 ? 1 : rand() < 0.7 ? 2 : 3;
|
const petCount = rand() < 0.5 ? 1 : rand() < 0.7 ? 2 : 3;
|
||||||
for (let p = 0; p < petCount; p++) {
|
for (let p = 0; p < petCount; p++) {
|
||||||
const petId = uuid();
|
const petId = uuid();
|
||||||
const breed = pick(dogBreeds);
|
const breed = petIndex < 250 ? "Puggle" : pick(dogBreeds);
|
||||||
const dob = new Date(now);
|
const dob = new Date(now);
|
||||||
dob.setFullYear(dob.getFullYear() - randInt(1, 14));
|
dob.setFullYear(dob.getFullYear() - randInt(1, 14));
|
||||||
dob.setMonth(randInt(0, 11));
|
dob.setMonth(randInt(0, 11));
|
||||||
@@ -702,10 +711,11 @@ async function seed() {
|
|||||||
shampooPreference: pick(shampoos),
|
shampooPreference: pick(shampoos),
|
||||||
specialCareNotes: rand() < 0.1 ? "Vet clearance required before grooming" : null,
|
specialCareNotes: rand() < 0.1 ? "Vet clearance required before grooming" : null,
|
||||||
customFields: {},
|
customFields: {},
|
||||||
image: pick(demoPetImages),
|
image: petIndex < 250 ? pick(puggleImages) : pick(demoPetImages),
|
||||||
});
|
});
|
||||||
|
|
||||||
petRecords.push({ id: petId, clientId });
|
petRecords.push({ id: petId, clientId });
|
||||||
|
petIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user