2023-07-23 20:00:53 +01:00

27 lines
660 B
C#

namespace Groceries.Data;
using System.Text.Json.Serialization;
public class TransactionItem
{
[JsonConstructor]
public TransactionItem(Guid transactionId, Guid itemId, decimal price, int quantity)
{
TransactionId = transactionId;
ItemId = itemId;
Price = price;
Quantity = quantity;
}
public TransactionItem(Guid itemId, decimal price, int quantity) : this(default, itemId, price, quantity)
{
}
public Guid TransactionId { get; init; }
public Guid ItemId { get; init; }
public decimal Price { get; set; }
public int Quantity { get; set; }
public Item? Item { get; init; }
}