Normalize demo quotation notes
Build and deploy Docker image / build (push) Successful in 3m7s

This commit is contained in:
Ruslan Bakiev
2026-06-07 13:16:53 +07:00
parent 7b5c44876c
commit c198b6c566
2 changed files with 10 additions and 2 deletions
@@ -0,0 +1,3 @@
UPDATE "orders_quotation"
SET "notes" = '{"seed":"Demo seed quotation"}'
WHERE "notes" = 'Demo seed quotation';
+7 -2
View File
@@ -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,
},
})