Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Notification.Domain\Notification.Domain.csproj" />
<ProjectReference Include="..\Notification.Infrastructure\Notification.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ namespace Notification.API.Services;
public class NotificationRenderer
{
/// <summary>
/// Formats a monetary amount for display in notification emails.
/// Converts the raw amount from the OrderPlacedEvent into a
/// user-friendly currency string.
/// Formats a monetary amount for display. The amount is expected in the
/// base currency unit (e.g. dollars), matching the OrderPlacedEvent contract.
/// </summary>
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)
Expand Down