Commit f466f09
authored
fix: handle DEPRECATED account types and sagas in convergent apply (#2102)
* fix: allow DEPRECATED -> ACTIVE transition for convergent manifest apply
When a manifest is re-applied to a tenant that previously had different
manifests, instruments and account types from the prior manifest get
deprecated. When the new manifest re-declares them, the activate step
fails because DEPRECATED was terminal.
Allow DEPRECATED -> ACTIVE transition for both instruments and account
types, enabling convergent re-application of manifests.
* test: update tests for DEPRECATED -> ACTIVE reactivation
Update tests that asserted DEPRECATED was terminal to reflect the new
convergent-apply behavior where DEPRECATED instruments and account types
can be reactivated.
* test: fix remaining deprecated-terminal assertions in instrument registry
* fix: handle DEPRECATED account types and sagas in convergent apply
Account type ActivateAccountType had a hardcoded != StatusDraft check
that rejected DEPRECATED status even though the transition table now
allows it. Use CanTransitionTo instead.
Also add idempotent ACTIVE check to saga ActivateSaga, and reactive
fallback for account type activation in the applier client.
* fix: correct GetActiveDefinition method name in reactive fallback
* test: update tests for DEPRECATED reactivation and saga idempotency
- Account type: DEPRECATED activation now succeeds (not ErrNotDraft)
- Saga: ACTIVE to ACTIVE is now idempotent (not ErrNotDraft)
- Bump function size baseline to 186
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 9f8e53c commit f466f09
6 files changed
Lines changed: 21 additions & 9 deletions
File tree
- services
- control-plane/internal/applier
- reference-data
- accounttype
- saga
- tests/architecture
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments