Commit ca1b334
authored
feat: Wire Starlark handler registry in services (#717)
* feat: Wire Starlark handler registry in current-account and payment-order services
Add HandlerRegistry initialization with service client handlers in both
current-account and payment-order services, enabling saga scripts to call
real gRPC services instead of mocks.
Current-account service:
- Creates HandlerRegistry populated with position-keeping, financial-accounting,
and current-account handlers via RegisterStarlarkHandlers
- Handlers adapt Starlark params (map[string]any) to gRPC calls with
saga metadata propagation (idempotency, correlation, etc.)
- Registry is stored in serviceClients for future SagaExecutor integration
Payment-order service:
- Creates HandlerRegistry with position-keeping, financial-accounting,
and current-account handlers
- Uses type assertions for clients stored as interfaces
- Registry available for when payment execution sagas migrate to Starlark
This completes the handler wiring per starlark-service-bindings.md PRD.
The Go orchestrators (DepositOrchestrator, PaymentOrchestrator) remain
functional - Starlark migration is a future task.
saga-script-versioning.13
* fix: Downgrade handler registration failures to warnings in payment-order
Handler registration failures are now warnings instead of errors since
the Starlark runner isn't wired yet. This prevents startup failures when
position-keeping is unavailable during the migration period.
Changes:
- Position-keeping client creation failure is now a warning
- Handler registration errors are now warnings (not startup failures)
- Nil check for posKeepingClient before calling RegisterStarlarkHandlers
- Proper defer cleanup only when client is successfully created
The service can now start and operate without Starlark handlers until
the full Starlark migration is complete.
saga-script-versioning.13
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent f6df7b3 commit ca1b334
2 files changed
Lines changed: 120 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
| |||
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
444 | 497 | | |
445 | 498 | | |
446 | 499 | | |
| |||
451 | 504 | | |
452 | 505 | | |
453 | 506 | | |
| 507 | + | |
454 | 508 | | |
455 | 509 | | |
456 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
158 | 224 | | |
159 | 225 | | |
160 | 226 | | |
| |||
0 commit comments