From 89e43ea10f5859ccb13c1fd5bbe67345f6366bd2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 06:42:28 +0000 Subject: [PATCH] fix: remove incorrect cents-to-dollars conversion in notification email amounts FormatCurrency() divided the amount by 100 based on a wrong assumption that OrderPlacedEvent.TotalAmount was in cents. The contract sends dollars (decimal), so a $149.99 order displayed as $1.50 in confirmation emails. Also fixes Notification.API.csproj Shared project reference paths (../../Shared -> ../../../Shared) to match the actual directory structure. --- .../Notification.API/Notification.API.csproj | 4 ++-- .../Notification.API/Services/NotificationRenderer.cs | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Services/Notification/Notification.API/Notification.API.csproj b/src/Services/Notification/Notification.API/Notification.API.csproj index 25b5fb0..1518ca2 100644 --- a/src/Services/Notification/Notification.API/Notification.API.csproj +++ b/src/Services/Notification/Notification.API/Notification.API.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs b/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs index ac8d79e..535a35b 100644 --- a/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs +++ b/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs @@ -9,18 +9,9 @@ namespace Notification.API.Services; /// public class NotificationRenderer { - /// - /// Formats a monetary amount for display in notification emails. - /// Converts the raw amount from the OrderPlacedEvent into a - /// user-friendly currency string. - /// private static string FormatCurrency(decimal amount) { - // The OrderPlacedEvent.TotalAmount is transmitted in cents (integer - // representation) to avoid floating-point precision issues across - // service boundaries. Convert back to dollars for display. - var dollars = amount / 100m; - return dollars.ToString("C2"); + return amount.ToString("C2"); } public string RenderOrderConfirmation(OrderNotification notification)