events/tests
Padreug adfd4529f5
Some checks failed
lint.yml / fix(nostr): always publish tickets_available, zero is not unlimited (pull_request) Failing after 0s
fix(nostr): always publish tickets_available, zero is not unlimited
Omitting the tag used to mean "unlimited capacity". Nothing else in the
codebase agreed: `api_get_event` and `api_ticket_create` both treat
`amount_tickets < 1` as sold out. So a zero-capacity event advertised
"Unlimited tickets" on the card while the detail page and the purchase
both returned 410.

Observed on aio-demo — three approved, listed, free events in that
state. For `PKBVuusKikfJFU4PYGtBTW`:

  relay        tickets_available absent  -> webapp renders "Unlimited"
  GET  event   410 "Event is sold out."
  POST ticket  410 "Event is sold out."

The admin form was advertising it too (`min="0"`, `hint="0 = unlimited"`),
so organizers were being invited into the broken state.

Now the tag is always emitted and zero reads as sold out, which is what
every other part of the system already believed. Clients that must handle
an absent tag — a NIP-52 event from another publisher — are unaffected,
since we simply never omit it.

Scoped to removing the contradiction. Making capacity a *required* field
is the other half of #34 and is blocked on the webapp: its create dialog
uses a falsy check (`if (formValues.amount_tickets)`), so a 0 omits the
field entirely and a server-side `ge=1` would 422 it.

Refs #34
2026-09-27 23:03:54 +02:00
..
__init__.py feat: code quality (#34) 2024-08-29 12:18:49 +02:00
test_capacity_guard.py fix(tickets): amount_tickets is the remaining count, stop subtracting sold 2026-09-27 22:25:01 +02:00
test_crud_ticket_email.py feat: let a user_id ticket carry an email, accept frontend_url 2026-09-06 19:53:05 +02:00
test_frontend_root.py feat: return buyers to the calling app after Stripe, branded QR endpoint 2026-09-06 19:53:05 +02:00
test_init.py feat: code quality (#34) 2024-08-29 12:18:49 +02:00
test_nostr_publish_pending.py feat(nostr): flag events whose NIP-52 publish didn't land 2026-09-26 23:45:47 +02:00
test_nostr_timestamp.py fix: publish NIP-52 events with monotonic created_at (#26) 2026-06-18 14:13:10 +02:00
test_promo.py feat(promo): enforce active + max_uses, validate endpoint, codes hidden from public 2026-09-13 18:43:34 +02:00
test_promo_api.py feat(promo): enforce active + max_uses, validate endpoint, codes hidden from public 2026-09-13 18:43:34 +02:00
test_publish_availability.py fix(nostr): always publish tickets_available, zero is not unlimited 2026-09-27 23:03:54 +02:00
test_publish_confirmation.py feat(nostr): confirm publishes against the relay's OK 2026-09-27 22:11:21 +02:00
test_ticket_email.py feat: attach a self-describing ticket card to the email (1.6.1-aio.10) 2026-09-08 16:40:25 +02:00
test_ticket_models.py feat: let a user_id ticket carry an email, accept frontend_url 2026-09-06 19:53:05 +02:00
test_ticket_qr.py feat: attach a self-describing ticket card to the email (1.6.1-aio.10) 2026-09-08 16:40:25 +02:00