Ticket waves follow the event's fiat setting #179
No reviewers
Labels
No labels
app:activities
app:chat
app:chatelet
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!179
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/wave-fiat-inheritance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported from aio-demo: event with card enabled, Card offered at checkout, purchase refused with "Fiat payments are not enabled for this ticket wave."
Two causes, both introduced with wave support in #176.
1. Waves never carried the fiat flag
newWaveRowset id, title, dates, currency, capacity and price — notallow_fiat. Fiat is a per-wave opt-in in the extension, so every wave the webapp created silently refused card payments however the event-level toggle was set.Confirmed against the live instance — the reported event:
The primary wave was right because
applyFormToPrimaryWavewrites the form values into it; the three added waves were not.GBPis the backend'sTicketWavedefault, since the webapp never sent a currency for them either.The Card checkbox now governs every wave on save — ticking it enables fiat on all of them, unticking disables it on all of them, and each settles in the event's fiat currency rather than whatever it happened to hold. The webapp offers exactly one control for fiat, so one control decides it.
An earlier revision of this branch added a per-wave switch instead. That was wrong and has been removed: with the event-level setting applied on save it would be silently overwritten, and a control that disagrees with what gets stored is worse than none.
The trade-off, stated plainly: a per-wave fiat setting made in the LNbits admin (which does have that control) is overwritten next time the event is saved from the webapp. Acceptable while the webapp has no way to represent one — and now deliberate rather than accidental, which the previous behaviour was not.
2. The rail list ignored the wave
effectivePaymentMethodsreturned the organiser's explicitpayment_methodsbefore consulting anything else, so the Card button appeared regardless of what the wave could take. That list is event-level while fiat is per-wave, and the webapp always sets it — so the explicit path is the normal one, not the exception.The wave is a separate argument rather than folded into
allowFiat: that one is the event's legacy flag and means something different. Conflating them broke two existing tests, correctly — which is how the design fault surfaced. Mirrors the backend'seffective_payment_methods(event, wave)(aiolabs/events#67).Tests
11 new, including that an unset wave flag reads as no-fiat (how the backend reads it), that the event-level question stays unfiltered, that the event's fiat currency overwrites a stale per-wave one, and that nothing else about a wave is disturbed. 83 pass; vue-tsc, prettier and the production build clean.
Existing events
Waves already saved with
allow_fiatunset stay wrong until the event is saved again from the webapp — the data is genuinely wrong, not just displayed wrong. Re-saving now fixes every wave at once. Pairs with aiolabs/events#67.Ticket waves inherit the event's fiat settingto Ticket waves follow the event's fiat setting