Business Layer
Module-specific business logic lives here.
Use this layer for:
- React Query hooks.
- View model mapping.
- Workflow state.
- Calculations.
- Filtering and sorting.
- Validation helpers.
Do not render JSX in this layer.
Use shared business helpers for repeated cross-module patterns:
@/shared/business/queryMutationsfor mutations that invalidate React Query cache keys.@/shared/business/apiListRowsfor extracting or mappingApiListResponse.rows.@/shared/business/queryStatefor combining loading and error state from multiple queries.
Do not duplicate local useMutation + useQueryClient + invalidateQueries boilerplate in feature hooks unless the mutation needs behavior the shared helper cannot represent clearly.
Expected module shape:
business/<module>/
hooks.ts
mappers.ts
selectors.ts
validators.ts
types.ts
Only create files that the module actually needs.