Fix notification email showing wrong order amount ($149.99 displayed as $1.50)#14
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
Root cause: NotificationRenderer.FormatCurrency() incorrectly divided the TotalAmount by 100, assuming it was in cents. The OrderPlacedEvent contract (Shared.Contracts) uses decimal TotalAmount in dollars. A $149.99 order was displayed as $1.50 (149.99 / 100 = 1.4999, rounded to $1.50). Fix: Remove the erroneous division by 100 and format the dollar amount directly.
Contributor
Author
🤖 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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Order confirmation notification emails were displaying incorrect amounts — a $149.99 order appeared as $1.50 in the email preview.
Root cause:
NotificationRenderer.FormatCurrency()divided theTotalAmountby 100, assuming the value was transmitted in cents. However, theOrderPlacedEventshared contract definesTotalAmountas adecimalin dollars, not cents. The division produced149.99 / 100 = 1.4999, which rounded to$1.50.Fix: Removed the erroneous
/100mdivision so the dollar amount is formatted directly.Review & Testing Checklist for Human
TotalAmountcontract: Confirm that all current and planned producers ofOrderPlacedEventsendTotalAmountin dollars (not cents). The Order service is currently scaffolded, so check with the team that the intended contract is dollars. If any producer sends cents, this fix would be wrong and the contract needs to be clarified.{"orderId": "11111111-1111-1111-1111-111111111111", "customerId": "22222222-2222-2222-2222-222222222222", "totalAmount": 149.99, "placedAt": "2026-03-17T12:00:00Z"}to/api/notification/events/order-placed, then open the preview URL and confirm the total shows $149.99.0.01(one cent),1000.00, and0.10to verify formatting across different magnitudes.Notes
Shared.Contractsproject reference path in the.csproj(relative path../../Shared/...doesn't resolve when building the project standalone). This is unrelated to this change.FormatCurrency; consider adding them to prevent regressions.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/4b31c83c48bb4bbe84d3dba130d00fe7