fix: correct touch point field names and enum values in demo seed
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

This commit is contained in:
fullsizemalt 2025-12-12 20:12:45 -08:00
parent f1f766a9c7
commit 981a8eded4

View file

@ -109,7 +109,8 @@ async function main() {
// ==================== TOUCH POINTS (Activity History) ==================== // ==================== TOUCH POINTS (Activity History) ====================
console.log('\n📋 Creating Touch Point History...'); console.log('\n📋 Creating Touch Point History...');
const touchPointTypes = ['WATER', 'FEED', 'INSPECT', 'DEFOLIATE', 'TOP', 'TRANSPLANT', 'IPM']; // Must match TouchType enum: WATER, FEED, PRUNE, TRAIN, INSPECT, IPM, TRANSPLANT, HARVEST, OTHER
const touchPointTypes = ['WATER', 'FEED', 'INSPECT', 'PRUNE', 'TRAIN', 'TRANSPLANT', 'IPM'];
const userList = Object.values(users); const userList = Object.values(users);
for (const batch of Object.values(batches)) { for (const batch of Object.values(batches)) {
@ -125,8 +126,8 @@ async function main() {
WATER: ['Standard feed', 'Light watering', 'Heavy watering - dry pots', 'pH 6.2'], WATER: ['Standard feed', 'Light watering', 'Heavy watering - dry pots', 'pH 6.2'],
FEED: ['Week 3 flower nutes', 'Veg formula A+B', 'Full strength', 'Half strength flush'], FEED: ['Week 3 flower nutes', 'Veg formula A+B', 'Full strength', 'Half strength flush'],
INSPECT: ['Looking healthy', 'Minor yellowing on lower leaves', 'Strong growth', 'Ready for transplant', 'Trichomes cloudy'], INSPECT: ['Looking healthy', 'Minor yellowing on lower leaves', 'Strong growth', 'Ready for transplant', 'Trichomes cloudy'],
DEFOLIATE: ['Removed lower fan leaves', 'Light lollipop', 'Heavy defoliation day 21'], PRUNE: ['Removed lower fan leaves', 'Light lollipop', 'Heavy defoliation day 21'],
TOP: ['Topped to 4 nodes', 'FIMed'], TRAIN: ['Topped to 4 nodes', 'FIMed', 'LST adjustment', 'Supercrop main stem'],
TRANSPLANT: ['1gal to 3gal', '3gal to 5gal'], TRANSPLANT: ['1gal to 3gal', '3gal to 5gal'],
IPM: ['Pyganic spray', 'Neem foliar', 'Beneficial insects released', 'Dr Zymes application'], IPM: ['Pyganic spray', 'Neem foliar', 'Beneficial insects released', 'Dr Zymes application'],
}; };
@ -134,7 +135,7 @@ async function main() {
await prisma.plantTouchPoint.create({ await prisma.plantTouchPoint.create({
data: { data: {
batchId: batch.id, batchId: batch.id,
userId: user.id, createdBy: user.id,
type, type,
notes: notes[type][Math.floor(Math.random() * notes[type].length)], notes: notes[type][Math.floor(Math.random() * notes[type].length)],
createdAt: daysAgo(daysBack) createdAt: daysAgo(daysBack)