Commit 1d31c8e
committed
docs(admin users create): use primaryTenantId in help description and examples
サーバ実装 (`geolonia/geonicdb` の `src/api/admin/schemas/user.schemas.ts:48` `CreateUserInputSchema`) は `.strict()` で `primaryTenantId` のみを受理するが、CLI ヘルプの description と examples が旧フィールド名 `tenantId` のままだった。ヘルプ通りに書くと `400 Unrecognized key: "tenantId"` で必ず失敗する状態。
修正:
- `src/commands/admin/users.ts`:
- L86, L89 (description): `tenantId` → `primaryTenantId`
- L107, L111 (`addExamples` payload): `"tenantId":"<tenant-id>"` → `"primaryTenantId":"<tenant-id>"`
回帰防止としてユニットテストを追加 (`tests/admin-users.test.ts`):
- `users create` の description が `primaryTenantId` を含み、旧文言 `"tenantId":` / `tenantId is required` を含まないこと
- `addExamples` に渡される example payload が role 別 (`tenant_admin` / `user`) で `primaryTenantId` を使い、旧 `"tenantId":` を含まないこと
実装側を変える前にテストを追加して red を確認 → 修正で green、というオーソドックスな TDD で進めた。lint / typecheck / 全 35 spec / 735 tests いずれも pass。
Closes #1181 parent f80dbd4 commit 1d31c8e
3 files changed
Lines changed: 43 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
110 | 146 | | |
111 | 147 | | |
112 | 148 | | |
| |||
0 commit comments