# Café ERP coding conventions

- Application name and folder: `cafe-erp`. Stack: CodeIgniter 4, MySQL and Bootstrap 5.
- Read `docs/PROJECT-ANALYSIS.md` and `docs/IMPLEMENTATION-STATUS.md` before extending the application.
- Controllers handle validated input and responses; services own business rules and transactions; models contain focused bound SQL.
- Never use Query Builder or extend `CodeIgniter\Model` in application models. Use `$db->query($sql, $bindings)`; values never become SQL identifiers.
- No generic repository layer. Keep functions small and domain names consistent.
- Use exact decimal strings for quantities and integer minor units for money.
- Payment does not change stock. Preparation/handover changes stock once, with a unique event key and locked rows.
- Keep templates under `app/Views`, CSS under `public/assets/css`, JavaScript under `public/assets/js`. Use shared Bootstrap layouts and components.
- Do not enable placeholder actions or claim UI previews are functional business modules.
- Postman CLI is installed and may be used for API engineering work.
