wcz-layout 9.7.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/AggregatedCell-C7nAQyMO.mjs +510 -0
  2. package/dist/AggregatedCell-C7nAQyMO.mjs.map +1 -0
  3. package/dist/Approval-C-hF4jbT.mjs.map +1 -1
  4. package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
  5. package/dist/Email-BzQQkbe9.mjs.map +1 -1
  6. package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
  7. package/dist/LayoutTable-BkrjgpW_.d.mts +758 -0
  8. package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
  9. package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
  10. package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
  11. package/dist/approval-BYryxFOW.mjs +84 -0
  12. package/dist/approval-BYryxFOW.mjs.map +1 -0
  13. package/dist/auth.d.mts +21 -11
  14. package/dist/auth.mjs +43 -26
  15. package/dist/auth.mjs.map +1 -1
  16. package/dist/components.d.mts +22 -30
  17. package/dist/components.mjs +813 -140
  18. package/dist/components.mjs.map +1 -1
  19. package/dist/createApi-DGJJ4I_R.mjs +27 -0
  20. package/dist/createApi-DGJJ4I_R.mjs.map +1 -0
  21. package/dist/data/client.d.mts +690 -1176
  22. package/dist/data/client.mjs +4 -3
  23. package/dist/data/client.mjs.map +1 -1
  24. package/dist/data/server.d.mts +3 -3
  25. package/dist/data/server.mjs +4 -2
  26. package/dist/data/server.mjs.map +1 -1
  27. package/dist/{file-DimNsRly.mjs → file-C14fhUeg.mjs} +6 -7
  28. package/dist/file-C14fhUeg.mjs.map +1 -0
  29. package/dist/{file-BWcNzq55.mjs → file-C5BOj1q8.mjs} +5 -24
  30. package/dist/file-C5BOj1q8.mjs.map +1 -0
  31. package/dist/hooks.d.mts +7 -46
  32. package/dist/hooks.mjs +2587 -239
  33. package/dist/hooks.mjs.map +1 -1
  34. package/dist/index.d.mts +28 -9
  35. package/dist/index.mjs +1248 -500
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/middleware.d.mts +20 -19
  38. package/dist/middleware.mjs +47 -2
  39. package/dist/middleware.mjs.map +1 -1
  40. package/dist/models.d.mts +17 -10
  41. package/dist/models.mjs.map +1 -1
  42. package/dist/{peoplesoft-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
  43. package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-BkJMCcHb.mjs} +24 -81
  44. package/dist/peoplesoft-BkJMCcHb.mjs.map +1 -0
  45. package/dist/providers-DrairEO2.mjs +74 -0
  46. package/dist/providers-DrairEO2.mjs.map +1 -0
  47. package/dist/tokens-BLRreL1j.mjs +143 -0
  48. package/dist/tokens-BLRreL1j.mjs.map +1 -0
  49. package/dist/{utils-DjdexspV.mjs → utils-BUpDoqme.mjs} +73 -51
  50. package/dist/utils-BUpDoqme.mjs.map +1 -0
  51. package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
  52. package/dist/utils.d.mts +2 -2
  53. package/dist/utils.mjs +2 -2
  54. package/dist/vite.d.mts +1 -2
  55. package/dist/vite.mjs +3 -3
  56. package/dist/vite.mjs.map +1 -1
  57. package/package.json +130 -128
  58. package/skills/client-db/SKILL.md +104 -96
  59. package/skills/db-schema/SKILL.md +46 -33
  60. package/skills/dialogs/SKILL.md +21 -27
  61. package/skills/forms/SKILL.md +60 -39
  62. package/skills/general/SKILL.md +122 -94
  63. package/skills/general/references/exports.md +106 -0
  64. package/skills/migrations/SKILL.md +53 -2
  65. package/skills/migrations/versions/migrate-v9-to-v10.md +582 -0
  66. package/skills/routing/SKILL.md +50 -60
  67. package/skills/server-functions/SKILL.md +36 -56
  68. package/skills/services/SKILL.md +7 -4
  69. package/skills/services/docs/approval.md +2 -2
  70. package/skills/services/docs/peoplesoft.md +114 -110
  71. package/skills/start/SKILL.md +9 -5
  72. package/skills/start/steps/05-database-setup.md +52 -52
  73. package/skills/start/steps/06-entra-setup.md +1 -1
  74. package/skills/start/steps/07-vault-setup.md +5 -12
  75. package/skills/table/SKILL.md +263 -0
  76. package/skills/unslop/SKILL.md +80 -0
  77. package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
  78. package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
  79. package/dist/authMiddleware-DPly0b_T.mjs +0 -48
  80. package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
  81. package/dist/entra-CJSyeQsx.mjs +0 -109
  82. package/dist/entra-CJSyeQsx.mjs.map +0 -1
  83. package/dist/file-BWcNzq55.mjs.map +0 -1
  84. package/dist/file-DimNsRly.mjs.map +0 -1
  85. package/dist/msalServer-DLwA7_ta.mjs +0 -30
  86. package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
  87. package/dist/peoplesoft-DTPGpN2h.mjs.map +0 -1
  88. package/dist/useDialogs-BUzVrTSP.mjs +0 -248
  89. package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
  90. package/dist/user-Dzv0N9fj.d.mts +0 -16
  91. package/dist/utils-DjdexspV.mjs.map +0 -1
  92. package/skills/data-grid/SKILL.md +0 -142
  93. package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
@@ -1,39 +1,62 @@
1
1
  ---
2
2
  name: routing
3
- description: "Use when: creating or modifying TanStack Router routes, navigation, permissions, loaders, etc."
3
+ description: "Use when adding or changing a page, route file, navigation entry, search params, or route-level access control. Covers createFileRoute, beforeLoad requireAuth, loader preloads, validateSearch, useSearch, src/routes/ naming and colocation, __root.tsx navigation, the auth and login routes, and the RouterLink/RouterButton link components."
4
+ metadata:
5
+ type: convention
6
+ library: wcz-layout
4
7
  ---
5
8
 
6
- > Mechanics (`createFileRoute`, `beforeLoad`, `redirect`, `loader`, preloading, `pendingComponent`) are covered by TanStack's own skills — load `@tanstack/router-core#router-core/auth-and-guards`, `#router-core/data-loading`, and `#router-core/navigation` for the API details. This skill adds only the wcz-layout conventions on top.
9
+ > Mechanics (route definitions, loaders, context, guards, navigation, search params,
10
+ > route-tree fundamentals) are covered by TanStack's own skills. List the skills shipped by
11
+ > `@tanstack/router-core` and `@tanstack/react-router` and load whichever cover the task at
12
+ > hand. This skill adds the wcz-layout conventions.
7
13
 
8
14
  ## Rules
9
15
 
10
- - Include the `requirePermission(<permissionKey>)` function in the route's `beforeLoad` to enforce access control — pass a key defined in your app's `src/lib/auth/permissions.ts`; omit it only for intentionally public routes.
11
- - Use `Route.useRouteContext()` to access the authenticated user. User can be `null` if the route doesn't include `requirePermission`.
12
- - Use the route `loader` option to preload db collections. Preload only collections with `eager` syncMode.
13
- - Create a `pendingComponent` for routes that suspend or preload meaningful data.
14
- - Route names must always be kebab-case. Entity route names must always be plural.
15
- - If a feature contains only one route, create a single file route: `src/routes/libraries.tsx`
16
- - If a feature contains multiple related routes, create a folder: `src/routes/libraries/index.tsx`
17
- - Colocate route-specific components/hooks inside `routes/<feature>/-components` or `-hooks`.
16
+ - Include `requireAuth(<permissionKey>)` in the route's `beforeLoad` to enforce access
17
+ control — pass a key defined in your app's `src/lib/auth/permissions.ts`. Use bare
18
+ `requireAuth()` when any signed-in user may enter, and omit it entirely only for
19
+ intentionally public routes.
20
+ - Route-level `requireAuth` only hides the UI. Every server function or server route that
21
+ accesses protected data still needs `authMiddleware`; see the `server-functions` skill.
22
+ - Use `Route.useRouteContext()` to access the authenticated user. `user` can be `null` if
23
+ the route doesn't include `requireAuth`.
24
+ - Preload the route's live queries in the loader and return the promise:
25
+ `loader: ({ context }) => context.dbClient.preloadLiveQuery(<x>QueryOptions)`.
26
+ - Literal URL segments and feature folders use kebab-case. Entity feature names are plural;
27
+ TanStack special route tokens retain their required syntax.
28
+ - If a feature contains only one route, create a single file route: `src/routes/<feature>s.tsx`
29
+ - If a feature contains multiple related routes, create a folder: `src/routes/<feature>s/index.tsx`
30
+ - Colocate route-specific components/hooks inside `routes/<feature>s/-components` or `-hooks`.
31
+ - When a route needs its own components/hooks that no sibling route uses, wrap it in a route
32
+ group folder named after the route and colocate them there: `routes/<feature>s/(index)/index.tsx` with `(index)/-components` and `(index)/-hooks`.
18
33
  - Root-level `components/` and `hooks/` are only for code shared across multiple routes.
19
- - After creating a new route, add or ask for a navigation item with a unique icon from `@mui/icons-material` in `src/routes/__root.tsx`.
20
- - For navigation and redirects, always use the type-safe router components from `wcz-layout/components` (`RouterButton`, `RouterIconButton`, `RouterLink`, `RouterFab`, `RouterTab`, `RouterListItemButton`, `RouterGridActionsCellItem`) rather than raw MUI with a manual `href` — they wrap `createLink`, so `to`/`params`/`search` are type-checked.
34
+ - After creating a new route, add a navigation item with a unique icon from
35
+ `@mui/icons-material` in `src/routes/__root.tsx`.
36
+ - For user-clickable in-app navigation, use the type-safe router components from
37
+ `wcz-layout/components` (`RouterButton`, `RouterIconButton`, `RouterLink`, `RouterFab`,
38
+ `RouterTab`, `RouterListItemButton`) rather than raw MUI with a manual `href` — they wrap
39
+ `createLink`, so `to`/`params`/`search` are type-checked.
21
40
 
22
41
  ## Examples
23
42
 
24
43
  ```ts
25
44
  // imports
45
+ import AccountTree from "@mui/icons-material/AccountTree";
46
+ import Code from "@mui/icons-material/Code";
47
+ import Home from "@mui/icons-material/Home";
48
+ import Widgets from "@mui/icons-material/Widgets";
49
+ import { createFileRoute } from "@tanstack/react-router";
50
+ import { z } from "zod";
51
+ import type { Navigation } from "wcz-layout";
26
52
  import { useDialogs, useTranslation } from "wcz-layout/hooks";
27
- import { requirePermission, uuidv7 } from "wcz-layout/utils";
53
+ import { hasPermission, requireAuth } from "wcz-layout/utils";
28
54
 
29
- // src/routes/features/create.tsx
30
- export const Route = createFileRoute("/features/create")({
55
+ // src/routes/<feature>s/index.tsx
56
+ export const Route = createFileRoute("/<feature>s/")({
31
57
  component: RouteComponent,
32
- beforeLoad: requirePermission("admin"),
33
- pendingComponent: FeatureSkeleton,
34
- loader: () => {
35
- featureCollection.preload();
36
- },
58
+ beforeLoad: requireAuth("admin"),
59
+ loader: ({ context }) => context.dbClient.preloadLiveQuery(featuresQueryOptions),
37
60
  });
38
61
 
39
62
  function RouteComponent() {
@@ -43,52 +66,19 @@ function RouteComponent() {
43
66
  // route component code...
44
67
  }
45
68
 
46
- // __root.tsx
47
- import { hasPermission } from "wcz-layout/utils";
48
-
49
- const { user } = Route.useRouteContext();
50
-
69
+ // __root.tsx navigation
51
70
  const navigation: Navigation = [
52
- {
53
- kind: "item",
54
- to: "/",
55
- title: "Home",
56
- icon: <Home />,
57
- hidden: !hasPermission(user, "all"),
58
- },
59
- {
60
- kind: "header",
61
- title: "Documentation",
62
- },
71
+ { kind: "item", to: "/", title: t("Home"), icon: <Home />, hidden: !hasPermission(user, "admin") },
72
+ { kind: "header", title: t("Documentation") },
63
73
  {
64
74
  kind: "group",
65
- title: "Components",
75
+ title: t("Components"),
66
76
  icon: <Widgets />,
67
77
  children: [
68
- {
69
- kind: "item",
70
- to: "/components/navigation",
71
- title: "Navigation",
72
- icon: <AccountTree />,
73
- },
74
- {
75
- kind: "divider",
76
- },
77
- {
78
- kind: "item",
79
- to: "/components/forms",
80
- title: "Forms",
81
- icon: <Code />,
82
- },
78
+ { kind: "item", to: "/components/navigation", title: t("Navigation"), icon: <AccountTree /> },
79
+ { kind: "divider" },
80
+ { kind: "item", to: "/components/forms", title: t("Forms"), icon: <Code /> },
83
81
  ],
84
82
  },
85
83
  ];
86
-
87
- // Routes are public unless guarded. By convention, protect every route by adding
88
- // requirePermission to its beforeLoad (omit only for intentionally public routes) —
89
- // it redirects to login when signed out, then checks the permission group.
90
- export const Route = createFileRoute("/feature-name")({
91
- component: RouteComponent,
92
- beforeLoad: requirePermission("admin"),
93
- });
94
84
  ```
@@ -1,79 +1,83 @@
1
1
  ---
2
2
  name: server-functions
3
- description: "Use when: creating or modifying TanStack Start server functions, API routes or middleware."
3
+ description: "Use when adding or changing server functions, REST/API routes, background-job endpoints, or server-side data access."
4
+ metadata:
5
+ type: convention
6
+ library: wcz-layout
4
7
  ---
5
8
 
6
- > Mechanics (`createServerFn`, `.validator`, `createMiddleware`, `createHandlers`) are covered by TanStack's own skills — load `@tanstack/start-client-core#start-core/server-functions`, `#start-core/middleware`, and `#start-core/server-routes` for the API details. This skill adds only the wcz-layout middleware conventions on top.
9
+ > Mechanics (`createServerFn`, `.validator`, `createMiddleware`, `createHandlers`) are covered by TanStack's own skills. List the skills shipped by `@tanstack/start-client-core` and `@tanstack/react-start` and load whichever cover the task at hand. This skill adds only the wcz-layout middleware conventions on top.
7
10
 
8
11
  ## Rules
9
12
 
10
13
  - Before generating code, clarify whether the feature should be exposed as public REST API routes or implemented as internal TanStack Start server functions (recommended), and what permission should be required for access.
11
- - Every server function MUST include `authorizationMiddleware` — server functions are callable RPC endpoints, so a route-level `requirePermission` in `beforeLoad` only hides the UI and does not protect them.
12
- - Follow the chain order for server functions: `middleware` → `validator` → `handler`.
13
- - Follow the order for middleware arrays: `authorizationMiddleware(<permissionKey>)` → `databaseMiddleware()`.
14
- - Use `validationMiddleware` only in REST API routes. Server functions use `.validator()`.
15
- - Never create a transaction in the handler because `databaseMiddleware` already owns it.
14
+ - Include `authMiddleware` in every server function by default — server functions are callable RPC endpoints, so a route-level `requireAuth` in `beforeLoad` only hides the UI and does not protect them. Omit it only for server functions backing intentionally public routes.
15
+ - Order inside a middleware **array** matters, because the array runs in order and the later entry wins the merged context type. Always `databaseMiddleware()` → `authMiddleware(<permissionKey>)` → `validationMiddleware(<schema>)`. `databaseMiddleware` declares `userMiddleware` and so contributes `user: User | null`; putting it first lets `authMiddleware` narrow `context.user` to `User` for the handler. `authMiddleware` still comes before `validationMiddleware` — otherwise an unauthenticated caller gets their body parsed and gets your validation errors back.
16
+ - The builder itself accepts its links in any order. Write them as `.validator()` → `.middleware()` → `.handler()` to match the reference app. Middleware always runs before the handler regardless of where it appears.
17
+ - `validationMiddleware` is for REST API routes only. Server functions use `.validator()`.
18
+ - `databaseMiddleware` is **app-local**, not a wcz-layout export. Every app writes it once (see below). It owns the transaction, so never open another one in a handler.
16
19
  - Reuse schemas from `src/lib/schemas/`.
17
- - Background jobs are API routes using only `authenticationMiddleware()` + `databaseMiddleware()` — cron runs in Kubernetes and authenticates via app token.
18
-
19
- ## File Placement
20
-
21
- ```
22
- src/server/actions/ — server functions
23
- src/routes/api/ — REST API routes
24
- src/server/middleware/ — databaseMiddleware
25
- wcz-layout/middleware/ — authorizationMiddleware, validationMiddleware
26
- src/server/db/schemas/ — tables, enums, relations
27
- src/lib/schemas/ — Zod schemas (shared between client and server)
28
- src/lib/auth/permissions.ts — permission keys
29
- ```
20
+ - Everything under `src/server/**` is server-only, but Start's import protection only guards `**/*.server.*` filenames. Never import from `src/server/` in a component or route file. Import the server function, not what it uses.
21
+ - Background jobs are API routes using only `databaseMiddleware()` + `authMiddleware()` — cron runs in Kubernetes and authenticates via app token.
30
22
 
31
23
  ## Examples
32
24
 
33
25
  ```ts
34
- // src/server/actions/<feature>.ts
26
+ // src/server/actions/<table>.ts
27
+ import { createFileRoute } from "@tanstack/react-router";
28
+ import { createServerFn } from "@tanstack/react-start";
29
+ import { eq } from "drizzle-orm";
30
+ import { authMiddleware, validationMiddleware } from "wcz-layout/middleware";
31
+ import z from "zod";
32
+ import { FeatureSchema } from "~/lib/schemas/feature";
33
+ import { featureTable } from "../db/schemas/feature";
34
+ import { databaseMiddleware } from "../middleware/databaseMiddleware";
35
+
35
36
  export const selectFeatures = createServerFn()
36
- .middleware([authorizationMiddleware("all"), databaseMiddleware()])
37
- .handler(async ({ context }) => {
38
- return await context.db.select().from(featureTable);
37
+ .middleware([databaseMiddleware(), authMiddleware()])
38
+ .handler(({ context }) => {
39
+ return context.db.select().from(featureTable);
39
40
  });
40
41
 
41
42
  export const insertFeature = createServerFn({ method: "POST" })
42
- .middleware([authorizationMiddleware("admin"), databaseMiddleware()])
43
43
  .validator(FeatureSchema)
44
+ .middleware([databaseMiddleware(), authMiddleware("admin")])
44
45
  .handler(async ({ data, context }) => {
45
46
  await context.db.insert(featureTable).values(data);
46
47
  });
47
48
 
48
49
  export const updateFeature = createServerFn({ method: "POST" })
49
- .middleware([authorizationMiddleware("admin"), databaseMiddleware()])
50
50
  .validator(FeatureSchema)
51
+ .middleware([databaseMiddleware(), authMiddleware("admin")])
51
52
  .handler(async ({ data, context }) => {
52
53
  await context.db.update(featureTable).set(data).where(eq(featureTable.id, data.id));
53
54
  });
54
55
 
55
56
  export const deleteFeature = createServerFn({ method: "POST" })
56
- .middleware([authorizationMiddleware("admin"), databaseMiddleware()])
57
- .validator(FeatureSchema.pick({ id: true }))
57
+ .validator(z.uuid())
58
+ .middleware([databaseMiddleware(), authMiddleware("admin")])
58
59
  .handler(async ({ data, context }) => {
59
- await context.db.delete(featureTable).where(eq(featureTable.id, data.id));
60
+ await context.db.delete(featureTable).where(eq(featureTable.id, data));
60
61
  });
61
62
 
62
63
  // src/routes/api/<feature>s/index.ts
63
64
  export const Route = createFileRoute("/api/features/")({
64
65
  server: {
65
- middleware: [databaseMiddleware()],
66
66
  handlers: ({ createHandlers }) =>
67
67
  createHandlers({
68
68
  GET: {
69
- middleware: [authorizationMiddleware("all")],
69
+ middleware: [databaseMiddleware(), authMiddleware()],
70
70
  handler: async ({ context }) => {
71
71
  const items = await context.db.select().from(featureTable);
72
72
  return Response.json(items);
73
73
  },
74
74
  },
75
75
  POST: {
76
- middleware: [validationMiddleware(FeatureSchema), authorizationMiddleware("admin")],
76
+ middleware: [
77
+ databaseMiddleware(),
78
+ authMiddleware("admin"),
79
+ validationMiddleware(FeatureSchema),
80
+ ],
77
81
  handler: async ({ context }) => {
78
82
  const [response] = await context.db
79
83
  .insert(featureTable)
@@ -85,28 +89,4 @@ export const Route = createFileRoute("/api/features/")({
85
89
  }),
86
90
  },
87
91
  });
88
-
89
- // src/routes/api/<feature>s/$id.ts
90
- export const Route = createFileRoute("/api/features/$id")({
91
- server: {
92
- middleware: [authorizationMiddleware("admin"), databaseMiddleware()],
93
- handlers: ({ createHandlers }) =>
94
- createHandlers({
95
- PUT: {
96
- middleware: [validationMiddleware(FeatureSchema)],
97
- handler: async ({ params, context }) => {
98
- await context.db
99
- .update(featureTable)
100
- .set(context.data)
101
- .where(eq(featureTable.id, params.id));
102
- return new Response(null, { status: 204 });
103
- },
104
- },
105
- DELETE: async ({ params, context }) => {
106
- await context.db.delete(featureTable).where(eq(featureTable.id, params.id));
107
- return new Response(null, { status: 204 });
108
- },
109
- }),
110
- },
111
- });
112
92
  ```
@@ -1,15 +1,18 @@
1
1
  ---
2
2
  name: services
3
- description: "Use when: working with file, approval, employee or email services into your workflow."
3
+ 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."
4
+ metadata:
5
+ type: integration
6
+ library: wcz-layout
4
7
  ---
5
8
 
6
9
  ## Info
7
10
 
8
11
  You can read about each service in the links below. Services are categorized as either client or server exports, depending on their intended usage.
9
12
 
10
- - **Client exports** — Contains `queryOptions` and `mutationOptions`; use for data fetching/mutations on the client with React Query.
11
- - **Server exports** — Server functions; prefer calling mutations inside other server functions or database transactions.
12
- - Invalidating mutation options take `{ queryClient }` so they can invalidate related queries; read-only ones (e.g. `downloadFileMutationOptions()`, `openFileMutationOptions()`) don't require it.
13
+ - **Client exports** — React Query option factories from `wcz-layout/data/client`.
14
+ - **Server exports** — Direct service operations from `wcz-layout/data/server`; import themonly in server code.
15
+ - Invalidating mutation factories take `{ queryClient }`.
13
16
  - Access `queryClient` with `Route.useRouteContext()` in a route file, or `useRouteContext({ from: "path" })` in a component.
14
17
  - To read about a service, open the linked file in the **File** column directly.
15
18
 
@@ -80,13 +80,13 @@ const ApprovalFlowSchema = z.object({
80
80
 
81
81
  const ApprovalCoRequestorGroupSchema = z.object({
82
82
  role: z.string().trim().min(1),
83
- email: z.email().optional(),
83
+ email: z.email(),
84
84
  });
85
85
 
86
86
  const ApprovalCoRequestorEmployeeSchema = z.object({
87
87
  employeeId: z.string().trim().min(1),
88
88
  name: z.string().trim().min(1),
89
- email: z.email().optional(),
89
+ email: z.email(),
90
90
  });
91
91
 
92
92
  const ApprovalCoRequestorPrincipalSchema = z.union([
@@ -1,110 +1,114 @@
1
- # peoplesoft
2
-
3
- ## Client
4
-
5
- - Employee:
6
- `searchEmployeesQueryOptions`
7
- `employeesQueryOptions`
8
- `activeEmployeesQueryOptions`
9
- `employeeByEmployeeIdQueryOptions`
10
- `previousEmployeeIdsQueryOptions`
11
- `employeeSupervisorQueryOptions`
12
- `employeeSubordinatesQueryOptions`
13
- `employeeManagerQueryOptions`
14
- `employeeGeneralManagerQueryOptions`
15
- `companyGeneralManagerQueryOptions`
16
- - Department:
17
- `departmentsQueryOptions`
18
- `departmentByIdQueryOptions`
19
- `departmentManagerQueryOptions`
20
- `departmentEmployeesQueryOptions`
21
-
22
- ## Server
23
-
24
- - Employee:
25
- `searchEmployees`
26
- `getEmployees`
27
- `getActiveEmployees`
28
- `getEmployeeByEmployeeId`
29
- `getPreviousEmployeeIds`
30
- `getEmployeeSupervisor`
31
- `getEmployeeSubordinates`
32
- `getEmployeeManager`
33
- `getEmployeeGeneralManager`
34
- `getCompanyGeneralManager`
35
- - Department:
36
- `getDepartments`
37
- `getDepartmentById`
38
- `getDepartmentManager`
39
- `getDepartmentEmployees`
40
-
41
- ## Schemas/Models
42
-
43
- ```ts
44
- const EmployeeSchema = z.object({
45
- badgeId: z.string().trim(),
46
- category: z.string().trim(),
47
- categoryGroup: EmployeeCategoryGroup,
48
- companyCode: z.string().trim(),
49
- contactPhone: z.string().trim(),
50
- departmentId: z.string().trim(),
51
- departmentDescription: z.string().trim(),
52
- emailString: z.string().trim(),
53
- employeeId: z.string().trim(),
54
- extensionNumber: z.string().trim(),
55
- firstName: z.string().trim(),
56
- gender: z.string().trim(),
57
- hiredDate: z.date(),
58
- lastName: z.string().trim(),
59
- managerId: z.string().trim(),
60
- middleName: z.string().trim(),
61
- name: z.string().trim(),
62
- nameTitleCase: z.string().trim(),
63
- nfcSn: z.string().trim(),
64
- plantId: z.string().trim(),
65
- position: z.string().trim(),
66
- previousEmployeeIds: z.string().trim().nullable(),
67
- reHiredDate: z.date().nullable(),
68
- recordNumber: z.number(),
69
- status: EmployeeStatus,
70
- supervisorId: z.string().trim(),
71
- terminationDate: z.date().nullable(),
72
- terminationFutureDate: z.date().nullable(),
73
- type: z.string().trim(),
74
- upperDepartmentId: z.string().trim(),
75
- jobCode: z.string().trim(),
76
- jobDescription: z.string().trim(),
77
- terminationReason: z.string().trim().nullable(),
78
- supervisorRecordNumber: z.number(),
79
- });
80
-
81
- const DepartmentSchema = z.object({
82
- departmentId: z.string().trim(),
83
- description: z.string().trim(),
84
- managerId: z.string().trim(),
85
- managerRecordNumber: z.string().trim(),
86
- treeLevel: z.number(),
87
- upperDepartmentId: z.string().trim(),
88
- companyCode: z.string().trim(),
89
- location: z.string().trim(),
90
- salLocation: z.string().trim(),
91
- plantId: z.string().trim(),
92
- manager: EmployeeSchema,
93
- });
94
-
95
- const EmployeeCategoryGroup = z.enum(["IDL", "FD", "FI"]);
96
- const EmployeeStatus = z.enum(["Active", "Terminated", "Leave of Absence"]);
97
- ```
98
-
99
- ## Examples
100
-
101
- ```ts
102
- import { activeEmployeesQueryOptions } from "wcz-layout/data/client";
103
- import { getEmployeeManager } from "wcz-layout/data/server";
104
-
105
- // client
106
- const { data: employees = [] } = useQuery(activeEmployeesQueryOptions());
107
-
108
- // server
109
- const manager = await getEmployeeManager({ data: { employeeId } });
110
- ```
1
+ # peoplesoft
2
+
3
+ ## Client
4
+
5
+ - Employee:
6
+ `searchEmployeesQueryOptions`
7
+ `employeesQueryOptions`
8
+ `activeEmployeesQueryOptions`
9
+ `employeeByEmployeeIdQueryOptions`
10
+ `previousEmployeeIdsQueryOptions`
11
+ `employeeSupervisorQueryOptions`
12
+ `employeeSubordinatesQueryOptions`
13
+ `employeeManagerQueryOptions`
14
+ `employeeGeneralManagerQueryOptions`
15
+ `companyGeneralManagerQueryOptions`
16
+ `searchEmployees`
17
+ `getEmployees`
18
+ `getActiveEmployees`
19
+ - Department:
20
+ `departmentsQueryOptions`
21
+ `departmentByIdQueryOptions`
22
+ `departmentManagerQueryOptions`
23
+ `departmentEmployeesQueryOptions`
24
+ `getDepartments`
25
+
26
+ ## Server
27
+
28
+ - Employee:
29
+ `searchEmployees`
30
+ `getEmployees`
31
+ `getActiveEmployees`
32
+ `getEmployeeByEmployeeId`
33
+ `getPreviousEmployeeIds`
34
+ `getEmployeeSupervisor`
35
+ `getEmployeeSubordinates`
36
+ `getEmployeeManager`
37
+ `getEmployeeGeneralManager`
38
+ `getCompanyGeneralManager`
39
+ - Department:
40
+ `getDepartments`
41
+ `getDepartmentById`
42
+ `getDepartmentManager`
43
+ `getDepartmentEmployees`
44
+
45
+ ## Schemas/Models
46
+
47
+ ```ts
48
+ const EmployeeSchema = z.object({
49
+ badgeId: z.string().trim(),
50
+ category: z.string().trim(),
51
+ categoryGroup: EmployeeCategoryGroup,
52
+ companyCode: z.string().trim(),
53
+ contactPhone: z.string().trim(),
54
+ departmentId: z.string().trim(),
55
+ departmentDescription: z.string().trim(),
56
+ emailString: z.string().trim().nullable(),
57
+ employeeId: z.string().trim(),
58
+ extensionNumber: z.string().trim(),
59
+ firstName: z.string().trim(),
60
+ gender: z.string().trim(),
61
+ hiredDate: z.date(),
62
+ lastName: z.string().trim(),
63
+ managerId: z.string().trim(),
64
+ middleName: z.string().trim(),
65
+ name: z.string().trim(),
66
+ nameTitleCase: z.string().trim(),
67
+ nfcSn: z.string().trim(),
68
+ plantId: z.string().trim(),
69
+ position: z.string().trim(),
70
+ previousEmployeeIds: z.string().trim().nullable(),
71
+ reHiredDate: z.date().nullable(),
72
+ recordNumber: z.number(),
73
+ status: EmployeeStatus,
74
+ supervisorId: z.string().trim(),
75
+ terminationDate: z.date().nullable(),
76
+ terminationFutureDate: z.date().nullable(),
77
+ type: z.string().trim(),
78
+ upperDepartmentId: z.string().trim(),
79
+ jobCode: z.string().trim(),
80
+ jobDescription: z.string().trim(),
81
+ terminationReason: z.string().trim().nullable(),
82
+ supervisorRecordNumber: z.number(),
83
+ });
84
+
85
+ const DepartmentSchema = z.object({
86
+ departmentId: z.string().trim(),
87
+ description: z.string().trim(),
88
+ managerId: z.string().trim(),
89
+ managerRecordNumber: z.string().trim(),
90
+ treeLevel: z.number(),
91
+ upperDepartmentId: z.string().trim(),
92
+ companyCode: z.string().trim(),
93
+ location: z.string().trim(),
94
+ salLocation: z.string().trim(),
95
+ plantId: z.string().trim(),
96
+ manager: EmployeeSchema,
97
+ });
98
+
99
+ const EmployeeCategoryGroup = z.enum(["IDL", "FD", "FI"]);
100
+ const EmployeeStatus = z.enum(["Active", "Terminated", "Leave of Absence"]);
101
+ ```
102
+
103
+ ## Examples
104
+
105
+ ```ts
106
+ import { activeEmployeesQueryOptions } from "wcz-layout/data/client";
107
+ import { getEmployeeManager } from "wcz-layout/data/server";
108
+
109
+ // client
110
+ const { data: employees = [] } = useQuery(activeEmployeesQueryOptions());
111
+
112
+ // server
113
+ const manager = await getEmployeeManager({ data: { employeeId } });
114
+ ```
@@ -1,9 +1,13 @@
1
1
  ---
2
2
  name: start
3
- description: "Use when: bootstrapping a freshly downloaded template into a real project."
3
+ description: "Use when bootstrapping a cloned template: git remote, project rename, APM and WiCOP registration, Postgres, Entra ID, Vault, favicon, GitLab CI, and first push."
4
+ metadata:
5
+ type: workflow
6
+ library: wcz-layout
7
+ disable-model-invocation: "true"
4
8
  ---
5
9
 
6
- # Project Initialization Orchestrator
10
+ # Project initialization
7
11
 
8
12
  ## Role
9
13
 
@@ -23,8 +27,8 @@ Begin every conversation with:
23
27
 
24
28
  > To make initialization flexible, you can choose:
25
29
  >
26
- > - ✅ **Full initialization** (recommended for new projects)
27
- > - ✅ **Partial / custom steps** (select specific steps below)
30
+ > - **Full initialization** for a new project
31
+ > - **Selected steps** from the list below
28
32
 
29
33
  Then list all steps by name so the user can pick.
30
34
 
@@ -37,7 +41,7 @@ Then list all steps by name so the user can pick.
37
41
  | 3 | [03-apm-setup.md](steps/03-apm-setup.md) | Register the app internally |
38
42
  | 4 | [04-wicop-setup.md](steps/04-wicop-setup.md) | Request release management (CD) |
39
43
  | 5 | [05-database-setup.md](steps/05-database-setup.md) | Postgres via Docker or existing |
40
- | 6 | [06-entra-setup.md](steps/06-entra-setup.md) | Azure AD app registration |
44
+ | 6 | [06-entra-setup.md](steps/06-entra-setup.md) | Entra ID app registration |
41
45
  | 7 | [07-vault-setup.md](steps/07-vault-setup.md) | Vault secrets configuration |
42
46
  | 8 | [08-generate-favicon.md](steps/08-generate-favicon.md) | Generate and replace favicon |
43
47
  | 9 | [09-commit.md](steps/09-commit.md) | Commit and push to origin |