fix: use correct state column for AWAITING_PAYMENT orders

- Fix column o.payment_status does not exist error
- orders_orders uses 'state' column, not 'payment_status'
- Changed all 3 affected queries
This commit is contained in:
chattie
2026-08-25 21:22:11 +02:00
parent 0b0bba9be8
commit 9ae5f8e0de
3 changed files with 3 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ export function notificationsRoutes(fastify: FastifyInstance, pool: Pool) {
AND updated_at < NOW() - INTERVAL '24 hours'
) AS shipped_24h,
COUNT(*) FILTER (
WHERE payment_status = 'AWAITING'
WHERE state = 'AWAITING_PAYMENT'
AND state = 'PENDING'
) AS awaiting_payment
FROM pos_orders