Commit 45647e6
authored
feat: rename correspondent to counterparty in internal-account service (#1212)
* feat: rename correspondent terminology to counterparty in internal-account service
Renames all 'correspondent' terminology to 'counterparty' throughout the
internal-account service to use generic, asset-agnostic language:
- Proto: CorrespondentBankDetails -> CounterpartyDetails, CorrespondentType ->
CounterpartyType, field names updated (bank_id -> counterparty_id, etc.),
swift_code moved to attributes map<string,string>
- Domain: correspondent.go -> counterparty.go, CorrespondentDetails ->
CounterpartyDetails with updated accessor methods
- Errors: ErrCorrespondentRequired/NotAllowed -> ErrCounterpartyRequired/NotAllowed
- DB: Atlas migration to rename correspondent_bank_id/name/external_ref ->
counterparty_id/name/external_ref, drop swift_code column
- All service, persistence, client, test, and doc files updated accordingly
Intentional breaking change: part of the asset-agnostic accounts initiative
(GitHub Issue asset-agnostic-accounts, Task 7) to remove bank-specific terminology.
* fix: capture error return from NewCounterpartyDetails in integration test
golangci-lint checks integration-tagged files that are excluded from normal
compilation, catching that NewCounterpartyDetails returns (T, error) not T.
Also fix gofumpt formatting in mappers_test.go and repository.go.
* fix: apply gofumpt formatting to internal-account service files
Fix alignment whitespace issues flagged by golangci-lint gofmt checker
in domain/internal_account.go, e2e tests, and account_lifecycle example.
* fix: address CodeRabbit review comments on counterparty rename
- Fix VARCHAR widths in test schemas to match migration (counterparty_id
VARCHAR(50), counterparty_external_ref VARCHAR(100)) in repository_test.go
- Add counterparty_attributes mapping in starlark.go addCounterpartyDetails
so metadata (e.g. swift_code) is not silently dropped; use sentinel errors
to satisfy err113 linter
- Fix e2e test 'CLEARING account rejects counterparty details' to actually
send CounterpartyDetails and assert the error response
- Fix mismatched product type codes in counterparty_account.go example
(NOSTRO_EUR/VOSTRO_JPY instead of NOSTRO_USD/VOSTRO_USD)
* fix: guard CounterpartyDetails nil dereferences in example file
Use GetCounterpartyDetails() accessor with nil checks before accessing
fields, preventing panics on unexpected server responses. Applies to
all log sites in counterparty_account.go.
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 1bcbbc5 commit 45647e6
41 files changed
Lines changed: 1541 additions & 1588 deletions
File tree
- api/proto/meridian/internal_account/v1
- services/internal-account
- adapters/persistence
- benchmarks
- client
- docs
- domain
- e2e
- examples
- migrations
- service
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
173 | 168 | | |
174 | | - | |
175 | | - | |
| 169 | + | |
| 170 | + | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
220 | 215 | | |
221 | 216 | | |
222 | 217 | | |
223 | | - | |
| 218 | + | |
224 | 219 | | |
225 | 220 | | |
226 | | - | |
| 221 | + | |
227 | 222 | | |
228 | 223 | | |
229 | 224 | | |
| |||
323 | 318 | | |
324 | 319 | | |
325 | 320 | | |
326 | | - | |
| 321 | + | |
327 | 322 | | |
328 | | - | |
| 323 | + | |
329 | 324 | | |
330 | 325 | | |
331 | 326 | | |
| |||
394 | 389 | | |
395 | 390 | | |
396 | 391 | | |
397 | | - | |
398 | | - | |
| 392 | + | |
| 393 | + | |
399 | 394 | | |
400 | 395 | | |
401 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
200 | | - | |
| 199 | + | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
| |||
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
250 | | - | |
| 249 | + | |
251 | 250 | | |
252 | 251 | | |
253 | 252 | | |
| |||
256 | 255 | | |
257 | 256 | | |
258 | 257 | | |
259 | | - | |
260 | | - | |
| 258 | + | |
| 259 | + | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
267 | 266 | | |
268 | | - | |
| 267 | + | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
274 | 273 | | |
275 | | - | |
276 | | - | |
| 274 | + | |
| 275 | + | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
508 | | - | |
| 507 | + | |
509 | 508 | | |
510 | 509 | | |
511 | 510 | | |
| |||
526 | 525 | | |
527 | 526 | | |
528 | 527 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
537 | 533 | | |
538 | 534 | | |
539 | | - | |
| 535 | + | |
540 | 536 | | |
541 | 537 | | |
542 | 538 | | |
| |||
639 | 635 | | |
640 | 636 | | |
641 | 637 | | |
642 | | - | |
| 638 | + | |
643 | 639 | | |
644 | | - | |
| 640 | + | |
645 | 641 | | |
646 | 642 | | |
647 | 643 | | |
648 | 644 | | |
649 | 645 | | |
650 | 646 | | |
651 | 647 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
658 | 653 | | |
659 | 654 | | |
660 | 655 | | |
| |||
663 | 658 | | |
664 | 659 | | |
665 | 660 | | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
672 | 666 | | |
673 | 667 | | |
674 | 668 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments