fix: remove incorrect cents-to-dollars conversion in notification currency display#22
Conversation
…rency display The FormatCurrency method in NotificationRenderer divided the amount by 100, assuming the OrderPlacedEvent.TotalAmount was in cents. However, the shared contract defines TotalAmount as a decimal in dollars. This caused a 49.99 order to display as .50 in email previews. Also fixes project reference paths in Notification.API.csproj (Shared.* projects were unreachable due to incorrect relative paths).
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| "version": "10.0.100-rc.2.25502.107", | ||
| "rollForward": "latestMajor" |
There was a problem hiding this comment.
🟡 rollForward: latestMajor allows building with unintended SDK major versions
The rollForward policy was changed from latestFeature to latestMajor, and the version was pinned to a specific pre-release SDK (10.0.100-rc.2.25502.107). The latestMajor policy is the most permissive roll-forward option — it means the .NET SDK resolver will use any installed SDK version at or above the specified one, including future major versions (e.g., .NET 11, 12). Combined with targeting net10.0 in all .csproj files, this could lead to non-reproducible builds across developer machines and CI. The original latestFeature policy was more appropriate as it constrained resolution to the 10.0.1xx feature band. This appears to be a local workaround for having an RC SDK installed that shouldn't have been committed.
| "version": "10.0.100-rc.2.25502.107", | |
| "rollForward": "latestMajor" | |
| "version": "10.0.100", | |
| "rollForward": "latestFeature" |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Order confirmation notification emails were displaying amounts off by a factor of 100 — a $149.99 order showed as $1.50. The
FormatCurrencymethod inNotificationRendererdivided the amount by100m, assuming theOrderPlacedEvent.TotalAmountwas in cents. It is not — the shared contract, HTTP DTO, and domain entity all pass the value as a dollar-denominateddecimal. Removed the erroneous division.Additionally fixes broken project reference paths in
Notification.API.csproj(..\..\Shared\→..\..\..\Shared\) and updatesglobal.jsonto match the available .NET 10 RC SDK.Before → After:
Review & Testing Checklist for Human
TotalAmountin cents. The HTTP endpoint (OrderPlacedEventDto) clearly uses dollars, but if there are RabbitMQ producers elsewhere that actually send cents, this fix would break those. Search for all usages ofOrderPlacedEventandTotalAmountacross services.global.jsonchange: SDK version was pinned to10.0.100-rc.2.25502.107withrollForward: latestMajorto get the project building. Confirm this is acceptable for your team/CI — you may want to revert to10.0.100withlatestFeatureif your CI has the stable SDK.Shared.*project references went from..\..\Shared\to..\..\..\Shared\. Verify this resolves correctly in both local builds and Docker builds (Dockerfiles may use a different build context)./api/notification/events/order-placedwith{"orderId": "11111111-1111-1111-1111-111111111111", "customerId": "22222222-2222-2222-2222-222222222222", "totalAmount": 149.99, "placedAt": "2026-03-17T12:00:00Z"}, then open the returned preview URL and confirm the total shows $149.99.Notes
ROOT_CAUSE_ANALYSIS.mdadded at repo root documenting the bug, root cause, and fix.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/fa6c5963390b469695ed46642614a462