Remove almost everything :(
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
namespace Printbase.Domain.Entities.Products;
|
||||
|
||||
public class Product
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public Guid TypeId { get; set; }
|
||||
public ProductType Type { get; set; } = null!;
|
||||
public ICollection<ProductVariant> Variants { get; set; } = new List<ProductVariant>();
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace Printbase.Domain.Entities.Products;
|
||||
|
||||
public class ProductGroup
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public ICollection<ProductType> Types { get; set; } = new List<ProductType>();
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Printbase.Domain.Entities.Products;
|
||||
|
||||
public class ProductType
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public Guid GroupId { get; set; }
|
||||
public ProductGroup Group { get; set; } = null!;
|
||||
public ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
namespace Printbase.Domain.Entities.Products;
|
||||
|
||||
public class ProductVariant
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public string? Color { get; set; }
|
||||
public string? Size { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal? Discount { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public string? SKU { get; set; }
|
||||
public Product Product { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public decimal GetDiscountedPrice()
|
||||
{
|
||||
if (Discount is > 0)
|
||||
{
|
||||
return Price - Price * Discount.Value / 100m;
|
||||
}
|
||||
|
||||
return Price;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user