fix: correct walkthrough field names in demo seed
This commit is contained in:
parent
981a8eded4
commit
f02f0dfe72
1 changed files with 8 additions and 11 deletions
|
|
@ -149,20 +149,17 @@ async function main() {
|
||||||
console.log('\n📝 Creating Walkthrough History...');
|
console.log('\n📝 Creating Walkthrough History...');
|
||||||
for (let d = 0; d < 30; d++) {
|
for (let d = 0; d < 30; d++) {
|
||||||
const user = userList[Math.floor(Math.random() * userList.length)];
|
const user = userList[Math.floor(Math.random() * userList.length)];
|
||||||
|
const startTime = daysAgo(d);
|
||||||
|
const endTime = new Date(startTime);
|
||||||
|
endTime.setMinutes(endTime.getMinutes() + 30 + Math.floor(Math.random() * 30));
|
||||||
|
|
||||||
const walkthrough = await prisma.dailyWalkthrough.create({
|
const walkthrough = await prisma.dailyWalkthrough.create({
|
||||||
data: {
|
data: {
|
||||||
userId: user.id,
|
completedBy: user.id,
|
||||||
status: 'COMPLETED',
|
status: 'COMPLETED',
|
||||||
startedAt: daysAgo(d),
|
date: daysAgo(d),
|
||||||
completedAt: daysAgo(d),
|
startTime,
|
||||||
notes: d === 0 ? null : [
|
endTime
|
||||||
'All rooms looking good',
|
|
||||||
'Found spider mites in Flower A, treated with Pyganic',
|
|
||||||
'VPD running high, adjusted humidity',
|
|
||||||
'Reservoir topped off',
|
|
||||||
'Noticed some cal-mag deficiency in veg',
|
|
||||||
null
|
|
||||||
][Math.floor(Math.random() * 6)]
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue