Commit 0e4febf
feat(runtime): resolve tenant default currency onto ExecutionContext
ADR-0053 follow-up. The `localization.currency` setting (tenant-scoped, default
USD, documented as "applied when a currency field omits its own") was declared
but had ZERO runtime consumers — resolveExecutionContext read only timezone +
locale, so no code path could reach the tenant default.
This carries it onto the context, mirroring timezone/locale exactly:
- spec: `ExecutionContext.currency` (ISO 4217, optional).
- runtime: `resolveLocalization` reads `localization.currency` (canonical
settings path + the direct sys_setting fallback), coerced to a 3-letter code;
assigned to `ctx.currency`.
- rest: the REST context mirror reads + carries it too.
Foundation for the unified currency-resolution chain (field currencyConfig →
tenant localization.currency); analytics/template/renderer consumers land in
follow-ups. Undefined when unconfigured → consumers render a plain number.
Tests: resolve-execution-context 17 passed (+2: canonical + fallback currency,
ISO-code coercion/junk rejection).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent f4b102d commit 0e4febf
5 files changed
Lines changed: 60 additions & 4 deletions
File tree
- .changeset
- packages
- rest/src
- runtime/src/security
- spec/src/kernel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| 1047 | + | |
1047 | 1048 | | |
1048 | 1049 | | |
1049 | 1050 | | |
1050 | 1051 | | |
1051 | 1052 | | |
1052 | 1053 | | |
1053 | | - | |
| 1054 | + | |
1054 | 1055 | | |
1055 | 1056 | | |
| 1057 | + | |
1056 | 1058 | | |
1057 | 1059 | | |
1058 | 1060 | | |
| 1061 | + | |
1059 | 1062 | | |
1060 | 1063 | | |
| 1064 | + | |
1061 | 1065 | | |
1062 | 1066 | | |
1063 | 1067 | | |
| |||
1071 | 1075 | | |
1072 | 1076 | | |
1073 | 1077 | | |
| 1078 | + | |
1074 | 1079 | | |
1075 | 1080 | | |
1076 | 1081 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
206 | 219 | | |
207 | 220 | | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
| 226 | + | |
213 | 227 | | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| 231 | + | |
217 | 232 | | |
218 | 233 | | |
219 | 234 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | | - | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
| 125 | + | |
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | | - | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| 142 | + | |
134 | 143 | | |
135 | 144 | | |
136 | 145 | | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
363 | 373 | | |
364 | 374 | | |
365 | 375 | | |
| 376 | + | |
366 | 377 | | |
367 | 378 | | |
368 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
| |||
0 commit comments