Expenses & Purchases
Overview
This feature tracks operational money leaving the business. It categorizes expenses into either "Direct Restocking Costs" (COGS) or "Overhead Costs" (Electricity, Rent, Employee Salaries).
Why it exists
A point-of-sale only tracks Revenue. To determine true net profitability, Bambu needs to know what it costs to keep the lights on and stock the shelves.
User flow
- User logs into
app/dashboard/expenses. - They click "Log Expense".
- They input the
Amount,Date,Category(e.g., Overhead), and an optionalNote. - The expense is added to the general ledger.
UI walkthrough


Backend logic
Expenses are often automatically generated by the system. If a user clicks Restock on a product (detailed in the Workflow), Bambu automatically provisions a silent Expense row tagged as a Restock cost. Manual expenses supplement these automated ones.
Database tables involved
Tenant Schema:
Expense: The master ledger for outgoing cash.ExpenseCategory: To group costs functionally.
API endpoints
GET /api/expenses- Retrieve date-range filtered expenses.POST /api/expenses- Insert new operational expenditure.
Permissions / roles
- Owner: Full access.
- Manager: Can log expenses (e.g., paying for water).
- Cashier: Access blocked.
Edge cases
- Deleting an expense that was auto-generated by an Inventory Restock does NOT reverse the stock injection; it only removes the financial accounting for it.
Validation rules
- Expense amounts must be positive integers
> 0.
Error handling
- Form submissions check for valid categories dynamically pulled from the backend and return standard React-Hook-Form field errors on mismatch.
Screenshots placeholders

Troubleshooting
- If profits look artificially high, check if routine fixed expenses (like Rent) were skipped by the Manager this month.