Commit c1764fc
Make the BambooHR seed script tolerate a fresh trial account's metadata
Seeding a brand-new trial (vs the previously-used account) 400'd twice on strict
Zod parses that the trial's data violates:
- GET /meta/lists returns many list fields with no `alias` (e.g. "Termination
Type") and some with no `options`; the strict `alias: string` aborted the whole
parse before the script could reach the division field (which does have an alias).
- The account's demo employees carry `division: null`; the read-back's
`division: z.string().optional()` rejected null (optional allows undefined, not
null), aborting the seed-scope scan.
Both are now nullish. We look up the division by alias and filter employees to
SEED_DIVISION, so aliasless lists and null-division employees are simply out of
scope rather than a hard parse failure. Verified: `pnpm hris:seed` now seeds the
13-person org into "LedgerLoop Demo" on the trial, and discovery returns 13.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent f9fa8cf commit c1764fc
1 file changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
108 | 113 | | |
109 | | - | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | | - | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
210 | | - | |
211 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
0 commit comments