mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 07:38:10 +00:00
fix issue
This commit is contained in:
17
e2e/freight/.live-q.cjs
Normal file
17
e2e/freight/.live-q.cjs
Normal 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})); });
|
||||
Reference in New Issue
Block a user