Content: a floor on a counter that a save cannot cross, checked in the same transaction
- Dominant language
- C#
- Stars
- 6
- Forks
- 7
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 307
Description
Found by simulating a Claude Code build of Color Me Fun 2026 through the barako CLI (epic #801) on 14 September 2026; the event registration app for the Rotary Club of Koronadal is the acceptance test. Simulation page: https://claude.ai/code/artifact/05afda1a-6461-431d-aff0-50b30d3b0778
Shirt stock per size and a participant cap must never be overdrawn, including when two registrations arrive at the same instant. A workflow runs after the save commits, so it cannot refuse the save; today this is a lifecycle hook in a module.
## Change
A rule on a numeric field of a singleton or entry: a floor (usually zero) that a decrement from another entry's save may not cross, applied inside the same transaction as the save, with the refusal message configured. For example, a registration with `ShirtSize M` decrements `shirt-stock.M` and is refused when it would go below zero; rejecting the registration gives it back.
## Done when
- Two concurrent registrations for the last shirt in a size: one succeeds, one is refused with the configured message.
- A rejected registration returns its shirt to stock.
Contributor guide
Research direction
Start at the lifecycle-hook module that currently runs after save commits, then trace the barako CLI save path and its transaction boundaries. Use the Color Me Fun 2026 registration scenario as the acceptance case: concurrent registrations must allow only one final shirt, and a refused registration must restore stock while reporting the configured message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, postgresql
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100