Ensured UTC is used

This commit is contained in:
Khwezi Mngoma
2026-05-15 08:37:58 +02:00
parent 4523ef6151
commit 65687d231e
9 changed files with 24 additions and 24 deletions
@@ -2,7 +2,6 @@
using LiteCharms.Features.Models;
using LiteCharms.Features.Shop.Postgres;
using LiteCharms.Features.Shop.Quotes.Models;
using static LiteCharms.Features.Extensions.Timezones;
namespace LiteCharms.Features.Shop.Quotes;
@@ -26,6 +25,7 @@ public class QuoteService(IDbContextFactory<ShopDbContext> contextFactory)
return Result.Fail(new Error($"Quote with id {quoteId} is already assigned to order with id {orderId}"));
quote.OrderId = orderId;
quote.UpdatedAt = DateTime.UtcNow;
return await context.SaveChangesAsync(cancellationToken) > 0
? Result.Ok()
@@ -52,6 +52,7 @@ public class QuoteService(IDbContextFactory<ShopDbContext> contextFactory)
return Result.Fail(new Error($"Shopping Cart with id {shoppingCartId} not found"));
quote.ShoppingCartId = shoppingCartId;
quote.UpdatedAt = DateTime.UtcNow;
return await context.SaveChangesAsync(cancellationToken) > 0
? Result.Ok()
@@ -140,7 +141,7 @@ public class QuoteService(IDbContextFactory<ShopDbContext> contextFactory)
return Result.Fail(new Error("Quote not found."));
quote.Status = status;
quote.UpdatedAt = SouthAfricanTimeZone.UtcNow();
quote.UpdatedAt = DateTime.UtcNow;
return await context.SaveChangesAsync(cancellationToken) > 0
? Result.Ok()