---
name: services
description: "Use when a feature needs a built-in wcz-layout backend service: file upload, download, thumbnails; approval requests, approvers and flows; PeopleSoft employee, manager, department lookups; or sending email."
metadata:
  type: integration
  library: wcz-layout
---

## 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** — React Query option options from `wcz-layout/data/client`.
- **Server exports** — Direct service operations from `wcz-layout/data/server`; import them only in server code.
- Client exports marked `server fn (RPC)` are TanStack Start server functions callable from the client; use them as `queryFn` in a TanStack DB collection.
- Invalidating mutation options take `{ queryClient }`.
- 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`
- In service docs, inputs are referenced by schema name (`Schema`) and return values by model type (`Model` = `z.infer<typeof Schema>`); both are defined in each doc's **Schemas/Models** section.

## 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      |
