# 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/queryMutations` for mutations that invalidate React Query cache keys.
- `@/shared/business/apiListRows` for extracting or mapping `ApiListResponse.rows`.
- `@/shared/business/queryState` for 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:

```text
business/<module>/
  hooks.ts
  mappers.ts
  selectors.ts
  validators.ts
  types.ts
```

Only create files that the module actually needs.
