This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
UPDATE "orders_quotation"
|
||||
SET "notes" = '{"seed":"Demo seed quotation"}'
|
||||
WHERE "notes" = 'Demo seed quotation';
|
||||
@@ -3,6 +3,7 @@ import { prisma } from '../dist/db.js'
|
||||
|
||||
const DEMO_TEAM_UUID = process.env.DEMO_TEAM_UUID ?? '11111111-1111-4111-8111-111111111111'
|
||||
const DEMO_ORDER_COUNT = Number(process.env.DEMO_ORDER_COUNT ?? '20')
|
||||
const DEMO_QUOTATION_NOTES = JSON.stringify({ seed: 'Demo seed quotation' })
|
||||
|
||||
function requiredEnv(name: string): string {
|
||||
const value = process.env[name]?.trim()
|
||||
@@ -94,8 +95,11 @@ await prisma.order.deleteMany({
|
||||
await prisma.quotation.deleteMany({
|
||||
where: {
|
||||
teamUuid: DEMO_TEAM_UUID,
|
||||
notes: 'Demo seed quotation',
|
||||
uuid: { notIn: quotationUuids },
|
||||
OR: [
|
||||
{ notes: 'Demo seed quotation' },
|
||||
{ notes: DEMO_QUOTATION_NOTES },
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
@@ -137,7 +141,7 @@ for (let index = 0; index < DEMO_ORDER_COUNT; index += 1) {
|
||||
totalAmount,
|
||||
currency: 'USD',
|
||||
etaDays: selectedTariff.etaDays,
|
||||
notes: 'Demo seed quotation',
|
||||
notes: DEMO_QUOTATION_NOTES,
|
||||
},
|
||||
update: {
|
||||
teamUuid: DEMO_TEAM_UUID,
|
||||
@@ -146,6 +150,7 @@ for (let index = 0; index < DEMO_ORDER_COUNT; index += 1) {
|
||||
selectedTariffId: selectedTariff.id,
|
||||
totalAmount,
|
||||
currency: 'USD',
|
||||
notes: DEMO_QUOTATION_NOTES,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user