You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: deprecate Currency enum and migrate to string instrument_code (#1222)
* feat: deprecate Currency enum and migrate to string instrument_code
Replaces the Currency protobuf enum with string instrument_code fields
across all affected protos and Go service code. This supports the
Universal Asset System which handles currencies, energy (kWh), carbon
credits, GPU hours, and other instruments beyond ISO 4217 currencies.
Proto changes:
- Mark Currency enum as deprecated in common/v1/types.proto
- Replace Currency enum fields with string instrument_code in:
- events/v1/current_account_events.proto (base_currency → base_instrument_code)
- events/v1/deposit_event.proto (currency → instrument_code)
- events/v1/financial_accounting_events.proto (base_currency → base_instrument_code)
- events/v1/position_keeping_events.proto (currency → instrument_code, two messages)
- financial_accounting/v1/financial_accounting.proto (base_currency → base_instrument_code)
- Add breaking change ignores to buf.yaml for intentional field changes
Go changes:
- Remove currencyToProto() from position-keeping/domain/events.go
- Remove fromProtoCurrency()/toProtoCurrency() from financial-accounting/service/adapters.go
- Remove convertCurrencyToISO() from financial-accounting/adapters/messaging/deposit_consumer.go
- Remove Currency enum usage from payment-order service (use string codes directly)
- Remove Currency enum usage from current-account saga_handlers.go
- Mark DomainCurrencyToProto/CurrencyCodeToProto in mappers/currency.go as deprecated
- Update all tests to use string instrument codes instead of enum values
* fix: address CodeRabbit review comments on test quality
- Fix stale error message "BaseCurrency mismatch" → "BaseInstrumentCode mismatch"
in financial_accounting_events_test.go
- Replace tautological placeholder assertion in TestPostLedgerEntries_UnsupportedCurrency
with meaningful tests showing unsupported currencies are rejected at domain.NewMoney
call site (validation moved from PostLedgerEntries to Money construction)
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
0 commit comments