The ticket-vouchers lookup previously returned the tier entitlement every time, so a donor could keep claiming free tickets by re- submitting the form. It now subtracts vouchers already consumed: remaining = entitled - used where `used` is the sum of the Vouchers column across that donor's prior ticket orders (each checkout stores what it applied). Response gains entitled/used/remaining; `vouchers` is now the remaining count the form should grant. Consumption is implicit — no counter to keep in sync — and resets by zeroing/deleting the Vouchers value on the order row in NocoDB. - nocodb: findByEmail + vouchersUsedByEmail (case-insensitive). - 8 new tests (36 total). Doc updated with the new response + reset. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||