Commit c0d04b3
authored
fix: resilient account type registration for deprecated state (#2103)
* 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
* fix: improve account type registration resilience for deprecated state
Improve reactive fallback for ActivateAccountType to handle both
FailedPrecondition and NotFound errors (the latter happens when
CreateDraft was a no-op and the returned ID doesn't exist in the DB).
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent f466f09 commit c0d04b3
1 file changed
Lines changed: 10 additions & 4 deletions
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | | - | |
187 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
205 | | - | |
206 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
207 | 213 | | |
208 | 214 | | |
209 | 215 | | |
| |||
0 commit comments