2026-06-22 19:03:37 +02:00
..
2026-06-22 19:03:37 +02:00
2026-06-22 19:03:37 +02:00
2026-06-17 21:45:57 +02:00
2026-06-19 16:43:41 +02:00
2026-06-22 19:03:37 +02:00
2026-06-22 19:03:37 +02:00
2026-06-22 19:03:37 +02:00

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:

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

Only create files that the module actually needs.