feat: Demo polish - custom app icon, enhanced seed data
- Add custom Veridian app icon (olive green leaf + circuit design) - Add 3 demo batches: GG4 (Flower), Kush Mints (Harvested), GDP (Veg) - Add 4 demo tasks with 2 overdue for realistic demo - Add Pulse sensor mapping for device 11666 to Flower Room - Copy icon to all Android mipmap directories
|
|
@ -284,6 +284,123 @@ async function main() {
|
|||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// DEMO BATCHES
|
||||
// ============================================
|
||||
const owner = await prisma.user.findUnique({ where: { email: ownerEmail } });
|
||||
const flowerRoom = await prisma.facilityRoom.findFirst({ where: { code: 'FLO' } });
|
||||
const vegRoom = await prisma.facilityRoom.findFirst({ where: { code: 'VEG' } });
|
||||
|
||||
const demoBatches = [
|
||||
{
|
||||
name: 'B-2026-01-GG4',
|
||||
strain: 'Gorilla Glue #4',
|
||||
startDate: new Date('2026-01-01'),
|
||||
status: 'ACTIVE',
|
||||
plantCount: 48,
|
||||
source: 'CLONE',
|
||||
stage: 'FLOWER',
|
||||
roomId: flowerRoom?.id
|
||||
},
|
||||
{
|
||||
name: 'B-2025-12-KM',
|
||||
strain: 'Kush Mints',
|
||||
startDate: new Date('2025-12-15'),
|
||||
harvestDate: new Date('2026-01-08'),
|
||||
status: 'HARVESTED',
|
||||
plantCount: 36,
|
||||
source: 'CLONE',
|
||||
stage: 'DRY'
|
||||
},
|
||||
{
|
||||
name: 'B-2026-01-GDP',
|
||||
strain: 'Grand Daddy Purple',
|
||||
startDate: new Date('2026-01-05'),
|
||||
status: 'ACTIVE',
|
||||
plantCount: 24,
|
||||
source: 'SEED',
|
||||
stage: 'VEG',
|
||||
roomId: vegRoom?.id
|
||||
}
|
||||
];
|
||||
|
||||
for (const b of demoBatches) {
|
||||
const existing = await prisma.batch.findFirst({ where: { name: b.name } });
|
||||
if (!existing) {
|
||||
await prisma.batch.create({ data: b as any });
|
||||
console.log(`Created Batch: ${b.name} (${b.strain})`);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// DEMO TASKS
|
||||
// ============================================
|
||||
const demoTasks = [
|
||||
{
|
||||
title: 'IPM Treatment - Flower Room',
|
||||
description: 'Apply weekly IPM spray to all flower room plants',
|
||||
status: 'PENDING',
|
||||
priority: 'HIGH',
|
||||
dueDate: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000), // 2 days overdue
|
||||
assignedToId: owner?.id
|
||||
},
|
||||
{
|
||||
title: 'Nutrient Tank pH Calibration',
|
||||
description: 'Calibrate pH meters and check EC levels in all nutrient tanks',
|
||||
status: 'PENDING',
|
||||
priority: 'MEDIUM',
|
||||
dueDate: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000), // 1 day overdue
|
||||
assignedToId: owner?.id
|
||||
},
|
||||
{
|
||||
title: 'HVAC Filter Replacement',
|
||||
description: 'Replace HEPA filters in all grow rooms',
|
||||
status: 'PENDING',
|
||||
priority: 'LOW',
|
||||
dueDate: new Date(Date.now() + 3 * 24 * 60 * 60 * 1000), // Due in 3 days
|
||||
assignedToId: owner?.id
|
||||
},
|
||||
{
|
||||
title: 'Weekly Crop Steering Review',
|
||||
description: 'Review VPD charts and adjust environmental targets',
|
||||
status: 'IN_PROGRESS',
|
||||
priority: 'HIGH',
|
||||
dueDate: new Date(Date.now() + 1 * 24 * 60 * 60 * 1000),
|
||||
assignedToId: owner?.id
|
||||
}
|
||||
];
|
||||
|
||||
for (const t of demoTasks) {
|
||||
const existing = await prisma.task.findFirst({ where: { title: t.title } });
|
||||
if (!existing) {
|
||||
await prisma.task.create({ data: t as any });
|
||||
console.log(`Created Task: ${t.title}`);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// PULSE SENSOR MAPPING
|
||||
// ============================================
|
||||
// Map Pulse sensor device 11666 to Flower Room
|
||||
if (flowerRoom) {
|
||||
const existingSensor = await prisma.sensor.findFirst({
|
||||
where: { externalId: '11666', type: 'VPD' }
|
||||
});
|
||||
if (!existingSensor) {
|
||||
await prisma.sensor.create({
|
||||
data: {
|
||||
name: 'Veridian Demo Pulse',
|
||||
type: 'VPD',
|
||||
externalId: '11666',
|
||||
location: 'Flower Room',
|
||||
status: 'ACTIVE',
|
||||
roomId: flowerRoom.id
|
||||
} as any
|
||||
});
|
||||
console.log('Created Pulse sensor mapping for device 11666');
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Seeding complete.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 397 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 385 KiB After Width: | Height: | Size: 426 KiB |