theming, date, time localisation, additional features, seeding initial cleanup
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import { db } from '../lib/db';
|
||||
import { timeSlots } from '../lib/db/schema';
|
||||
|
||||
async function seedTimeSlots() {
|
||||
console.log('🌱 Seeding time slots...');
|
||||
|
||||
// Example time slots for different days
|
||||
const timeSlotData = [
|
||||
// Sunday: 12:00 - 17:00
|
||||
{ dayOfWeek: 0, startTime: '12:00', endTime: '17:00' },
|
||||
|
||||
// Monday: 19:00 - 23:00
|
||||
{ dayOfWeek: 1, startTime: '19:00', endTime: '23:00' },
|
||||
|
||||
// Tuesday: 19:00 - 23:00
|
||||
{ dayOfWeek: 2, startTime: '19:00', endTime: '23:00' },
|
||||
|
||||
// Wednesday: NO SLOTS (facility closed)
|
||||
// { dayOfWeek: 3, startTime: '18:00', endTime: '22:00' },
|
||||
|
||||
// Thursday: NO SLOTS (facility closed)
|
||||
// { dayOfWeek: 4, startTime: '19:00', endTime: '23:00' },
|
||||
|
||||
// Friday: 18:00 - 22:00
|
||||
{ dayOfWeek: 5, startTime: '18:00', endTime: '22:00' },
|
||||
|
||||
// Saturday: 10:00 - 18:00
|
||||
{ dayOfWeek: 6, startTime: '10:00', endTime: '18:00' },
|
||||
];
|
||||
|
||||
for (const slot of timeSlotData) {
|
||||
await db.insert(timeSlots).values({
|
||||
id: crypto.randomUUID(),
|
||||
dayOfWeek: slot.dayOfWeek,
|
||||
startTime: slot.startTime,
|
||||
endTime: slot.endTime,
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
}
|
||||
|
||||
console.log('✅ Time slots seeding completed');
|
||||
}
|
||||
|
||||
// Run the seeding function
|
||||
seedTimeSlots()
|
||||
.then(() => {
|
||||
console.log('Time slots seeding process completed');
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error during time slots seeding:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user