Initial commit
This commit is contained in:
27
Groceries.Data/Items/Item.cs
Normal file
27
Groceries.Data/Items/Item.cs
Normal file
@ -0,0 +1,27 @@
|
||||
namespace Groceries.Data;
|
||||
|
||||
public class Item
|
||||
{
|
||||
public Item(Guid id, string brand, string name)
|
||||
{
|
||||
Id = id;
|
||||
Brand = brand;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public Item(Guid id) : this(id, default!, default!)
|
||||
{
|
||||
}
|
||||
|
||||
public Item(string brand, string name) : this(default, brand, name)
|
||||
{
|
||||
}
|
||||
|
||||
public Guid Id { get; init; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public string Brand { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public ICollection<ItemBarcode> Barcodes { get; init; } = new List<ItemBarcode>();
|
||||
public IEnumerable<TransactionPromotion>? TransactionPromotions { get; init; }
|
||||
}
|
15
Groceries.Data/Items/ItemBarcode.cs
Normal file
15
Groceries.Data/Items/ItemBarcode.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace Groceries.Data;
|
||||
|
||||
public class ItemBarcode
|
||||
{
|
||||
public ItemBarcode(Guid itemId, long barcodeData, string format)
|
||||
{
|
||||
ItemId = itemId;
|
||||
BarcodeData = barcodeData;
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public Guid ItemId { get; init; }
|
||||
public long BarcodeData { get; init; }
|
||||
public string Format { get; init; }
|
||||
}
|
15
Groceries.Data/Items/ItemPurchase.cs
Normal file
15
Groceries.Data/Items/ItemPurchase.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace Groceries.Data;
|
||||
|
||||
public class ItemPurchase
|
||||
{
|
||||
public Guid ItemId { get; init; }
|
||||
public Guid TransactionId { get; init; }
|
||||
public DateTime CreatedAt { get; init; }
|
||||
public Guid StoreId { get; init; }
|
||||
public decimal Price { get; init; }
|
||||
public int Quantity { get; init; }
|
||||
|
||||
public Item? Item { get; init; }
|
||||
public Transaction? Transaction { get; init; }
|
||||
public Store? Store { get; init; }
|
||||
}
|
10
Groceries.Data/Items/ItemTagQuantity.cs
Normal file
10
Groceries.Data/Items/ItemTagQuantity.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Groceries.Data;
|
||||
|
||||
public class ItemTagQuantity
|
||||
{
|
||||
public required string Tag { get; init; }
|
||||
public required decimal Quantity { get; init; }
|
||||
public string? Unit { get; init; }
|
||||
public bool IsMetric { get; init; }
|
||||
public bool IsDivisible { get; init; }
|
||||
}
|
Reference in New Issue
Block a user