fix issue

This commit is contained in:
Marshal
2026-08-02 10:26:36 +00:00
parent 53d8655dc3
commit ff772fddef
63 changed files with 10927 additions and 14 deletions

17
e2e/freight/.live-q.cjs Normal file
View File

@@ -0,0 +1,17 @@
const { Client } = require('pg');
(async () => {
const c = new Client({ connectionString: 'postgres://edr_e2e:edr_e2e@localhost:5533/edr_freight_e2e' });
await c.connect();
const r = await c.query(`
SELECT ct.reference AS contract, b.reference AS bk, b.status,
COALESCE(b.payment_status,'-') AS pay,
(SELECT count(*) FROM freight.wagon_booking_allocations a
WHERE a.booking_id=b.id AND a.deleted_at IS NULL) AS wagons
FROM freight.bookings b JOIN freight.contracts ct ON ct.id=b.contract_id
WHERE ct.reference LIKE 'CTR-IMP-%' AND b.deleted_at IS NULL
AND b.created_at > now() - interval '30 minutes'
ORDER BY b.created_at DESC LIMIT 15`);
console.log(JSON.stringify(r.rows));
await c.end();
})().catch(e => { console.log(JSON.stringify({error: e.message})); });