feat: Add demo Room records for Dashboard display
Adds 6 cultivation zones to seed.ts: - Flower Room A/B (78°F, 55% RH) - Veg Room 1/2 (76°F, 65% RH) - Drying Room (62°F, 60% RH) - Cure Vault (65°F, 58% RH) These rooms are now returned by /api/rooms for Dashboard display.
This commit is contained in:
parent
eca58ecbc2
commit
5fe22f03fb
1 changed files with 18 additions and 0 deletions
|
|
@ -78,6 +78,24 @@ async function main() {
|
|||
console.log('Updated Owner password hash');
|
||||
}
|
||||
|
||||
// Create Demo Rooms for Dashboard
|
||||
const demoRooms = [
|
||||
{ name: 'Flower Room A', type: RoomType.FLOWER, sqft: 500, targetTemp: 78, targetHumidity: 55, capacity: 100 },
|
||||
{ name: 'Flower Room B', type: RoomType.FLOWER, sqft: 500, targetTemp: 78, targetHumidity: 55, capacity: 100 },
|
||||
{ name: 'Veg Room 1', type: RoomType.VEG, sqft: 300, targetTemp: 76, targetHumidity: 65, capacity: 200 },
|
||||
{ name: 'Veg Room 2', type: RoomType.VEG, sqft: 300, targetTemp: 76, targetHumidity: 65, capacity: 200 },
|
||||
{ name: 'Drying Room', type: RoomType.DRY, sqft: 150, targetTemp: 62, targetHumidity: 60, capacity: 50 },
|
||||
{ name: 'Cure Vault', type: RoomType.CURE, sqft: 200, targetTemp: 65, targetHumidity: 58, capacity: 100 }
|
||||
];
|
||||
|
||||
for (const r of demoRooms) {
|
||||
const existingRoom = await prisma.room.findFirst({ where: { name: r.name } });
|
||||
if (!existingRoom) {
|
||||
await prisma.room.create({ data: r });
|
||||
console.log(`Created Room: ${r.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Create Default Supplies
|
||||
const supplies = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue