Simplify data representation

This commit is contained in:
lumijiez
2025-05-04 20:01:21 +03:00
parent 247bfba368
commit e001ea67a3
12 changed files with 54 additions and 440 deletions

View File

@@ -1,23 +0,0 @@
using Printbase.Application.ProductType;
namespace Printbase.Application.ProductGroup;
public class ProductGroupDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public List<ProductTypeDto> Types { get; set; } = [];
}
public class ProductGroupCreateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}
public class ProductGroupUpdateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}

View File

@@ -1,23 +0,0 @@
namespace Printbase.Application.ProductType;
public class ProductTypeDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public Guid GroupId { get; set; }
public string GroupName { get; set; } = string.Empty;
}
public class ProductTypeCreateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public Guid GroupId { get; set; }
}
public class ProductTypeUpdateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}

View File

@@ -1,60 +0,0 @@
namespace Printbase.Application.Products;
public class ProductDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public decimal? Discount { get; set; }
public Guid TypeId { get; set; }
public string TypeName { get; set; } = string.Empty;
public List<ProductVariantDto> Variants { get; set; } = new();
}
public class ProductVariantDto
{
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 decimal EffectivePrice { get; set; }
}
public class ProductCreateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public decimal? Discount { get; set; }
public Guid TypeId { get; set; }
public List<ProductVariantCreateDto> Variants { get; set; } = new();
}
public class ProductVariantCreateDto
{
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 class ProductUpdateDto
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public decimal? Discount { get; set; }
public Guid TypeId { get; set; }
}
public class ProductVariantUpdateDto
{
public Guid Id { 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; }
}