Add a screen to set prices per branch #3
Reference in New Issue
Block a user
Delete Branch "feat/branch-prices"
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?
Branch price overrides were already applied at the till, in cash sales and in M-Pesa, but nothing could set them. This adds the screen and API.
What changes
/admin/prices): the owner picks a branch and sets its price for any product next to the default. Setting it back to the default removes the override; "Use default" resets it. A counter shows how many products are priced differently at that branch. Branch managers see their own branch's prices read-only./api/branch-prices: GET (owner: any branch; manager: own branch), PUT and DELETE (owner only). The branch and product must belong to the business, prices must be above zero, and who changed a price is recorded (updatedBy).branchPricing: truefor Starter insrc/lib/tiers.ts.Testing
npm test: 56 tests pass, 6 new: price applies only at its branch and through to the recorded sale; reset to default; manager read-only and pinned to their branch; plan rules (trial, Growth, paid Starter); zero price refused; another tenant's branch or product refused.No migration or deploy step needed.
🤖 Generated with Claude Code