feat(04-03): Vendor, ExpenseCategory, Expense schema + category seeding + COA additions

- Add ExpenseStatus and ExpensePaymentMethod enums
- Add Vendor model (@@unique([tenantId, name]))
- Add ExpenseCategory model with accountCode linking to COA
- Add Expense model with approval workflow and JE reference
- Add User relations: createdExpenses, approvedExpenses
- Add COA accounts 5080 Fuel/Transportation, 5085 Rent Expense (31 total)
- Seed 9 default expense categories in createTenant transaction
- Add Vendor subject to CASL types, Expense/Vendor permissions for OFFICE_STAFF

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kevin-asprec
2026-03-05 10:38:03 +08:00
parent daf5bddf0b
commit fe4d22f440
5 changed files with 145 additions and 0 deletions

View File

@@ -62,6 +62,10 @@ export function definePermissionsFor(
can("update", "TechnicianProfile");
// Inventory management
can("manage", "Inventory");
// Expense management (record, list, view)
can("manage", "Expense");
// Vendor management (CRUD)
can("manage", "Vendor");
// Job type rates (read-only for office staff — admin configures rates)
can("read", "JobTypeRate");
// View financial reports (read-only)