wcz-layout
Version:
32 lines (23 loc) • 2.03 kB
Markdown
name: services
description: "Use when: working with file, approval, employee or email services into your workflow."
## Info
You can read about each service in the links below. Services are categorized as either client or server exports, depending on their intended usage.
- **Client exports** — Contains `queryOptions` and `mutationOptions`; use for data fetching/mutations on the client with React Query.
- **Server exports** — Server functions; prefer calling mutations inside other server functions or database transactions.
- Invalidating mutation options take `{ queryClient }` so they can invalidate related queries; read-only ones (e.g. `downloadFileMutationOptions()`, `openFileMutationOptions()`) don't require it.
- Access `queryClient` with `Route.useRouteContext()` in a route file, or `useRouteContext({ from: "path" })` in a component.
- To read about a service, open the linked file in the **File** column directly.
## Import Paths
- Client exports: `wcz-layout/data/client`
- Server exports: `wcz-layout/data/server`
- Schemas & Models: `wcz-layout/models`
## Services
| Service | File | Summary |
| ---------- | ----------------------------------- | ----------------------------------------------------------------------- |
| file | [file.md](docs/file.md) | File metadata, thumbnails, binary download/open, upload, update, delete |
| approval | [approval.md](docs/approval.md) | Approval request lifecycle, approvers, flows, statuses, step results |
| peoplesoft | [peoplesoft.md](docs/peoplesoft.md) | Employee, manager, department, and company general manager lookups |
| email | [email.md](docs/email.md) | Server-only email sending with optional file attachment references |
> The attendance service is not available yet — do not generate code against it; tell the user it is coming in a future release.