Expense Types Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
2
Dependents
0
Entities
0
Integrations
Description
Data access layer responsible for reading expense type definitions and their associated business rules (mutual exclusions, receipt requirements, approval paths) from the PostgreSQL database. Supports multi-tenancy by scoping all queries to the requesting organisation, and seeds default types during organisation onboarding.
expense-types-repository
Responsibilities
- Query expense_types table scoped to a specific organisation
- Return mutual-exclusion rule sets and receipt-required flags per type
- Support CRUD operations for admin management of type catalogue
- Seed default expense types during organisation onboarding
Interfaces
findByOrganisation(String orgId) → Future<List<ExpenseType>>
findById(String typeId) → Future<ExpenseType?>
create(ExpenseType type) → Future<ExpenseType>
update(String typeId, ExpenseTypeUpdate data) → Future<ExpenseType>
delete(String typeId) → Future<void>
seedDefaults(String orgId) → Future<void>
Relationships
Dependents (2)
Components that depend on this component