order total: TotalInCents on both Orders, mapped into OrderDto and OrderData

yak: ordertotalincents-on-both-sides-dto-mapping-j00p
This commit is contained in:
2026-09-16 18:39:48 +01:00
parent 49f4ca395f
commit 803580786b
8 changed files with 39 additions and 9 deletions
+4
View File
@@ -29,6 +29,9 @@ public sealed class OrderData : DbBase
/// <summary>Free-text description of what this order is for.</summary>
public string Description { get; set; } = string.Empty;
/// <summary>Order total in cents of the stored order.</summary>
public int TotalInCents { get; set; }
/// <summary>
/// Foreign key to the owning client: <see cref="Guid.Empty"/> when the
/// order has no client, or when its client had no id yet at save time —
@@ -101,6 +104,7 @@ public class DbContext
{
var row = (OrderData)existing; // refresh, keep row identity
row.Description = fresh.Description;
row.TotalInCents = fresh.TotalInCents;
row.ClientId = fresh.ClientId;
return;
}