Paket 1: eine aktive Angebotsfassung und Bestellbezeichnung
Deploy Test / test (push) Failing after 10s
Deploy Test / deploy (push) Skipped

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-16 06:54:43 +01:00
1 parent 8cd382c357
commit 7820bececb
13 files changed
+529 -25

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
\echo '=== Aktive Angebotsfassungen (Überblick) ==='
SELECT ov.offer_id, o.name, ov.number, ov.grant_kind, ov.price_cents
FROM offer_versions ov
JOIN offers o ON o.id = ov.offer_id
WHERE ov.status = 'aktiv'
ORDER BY ov.offer_id, ov.number;
\echo '=== Heutige Registrierungslogik: alle aktiven personen-Registrierungsfassungen ==='
SELECT count(*)::int AS would_issue_count
FROM offer_versions
WHERE status = 'aktiv' AND grant_kind = 'bei_registrierung' AND holder_kind = 'person';
\echo '=== Grants je Angebot (über acquisition reference offer) ==='
SELECT a.reference_id AS offer_id, count(DISTINCT g.id)::int AS grant_count
FROM acquisitions a
JOIN grants g ON g.acquisition_id = a.id
WHERE a.reference_type = 'offer'
GROUP BY a.reference_id
ORDER BY a.reference_id;