Cleanup folder structure again
This commit is contained in:
14
src/Imprink.Application/Dtos/CategoryDto.cs
Normal file
14
src/Imprink.Application/Dtos/CategoryDto.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class CategoryDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string Description { get; set; } = null!;
|
||||
public string? ImageUrl { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public Guid? ParentCategoryId { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public DateTime? ModifiedAt { get; set; }
|
||||
}
|
||||
12
src/Imprink.Application/Dtos/PagedResultDto.cs
Normal file
12
src/Imprink.Application/Dtos/PagedResultDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class PagedResultDto<T>
|
||||
{
|
||||
public IEnumerable<T> Items { get; set; } = new List<T>();
|
||||
public int TotalCount { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
public bool HasPreviousPage => PageNumber > 1;
|
||||
public bool HasNextPage => PageNumber < TotalPages;
|
||||
}
|
||||
16
src/Imprink.Application/Dtos/ProductDto.cs
Normal file
16
src/Imprink.Application/Dtos/ProductDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class ProductDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public decimal BasePrice { get; set; }
|
||||
public bool IsCustomizable { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
public Guid? CategoryId { get; set; }
|
||||
public CategoryDto? Category { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public DateTime? ModifiedAt { get; set; }
|
||||
}
|
||||
17
src/Imprink.Application/Dtos/ProductVariantDto.cs
Normal file
17
src/Imprink.Application/Dtos/ProductVariantDto.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class ProductVariantDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public string Size { get; set; } = null!;
|
||||
public string? Color { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
public string Sku { get; set; } = null!;
|
||||
public int StockQuantity { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public ProductDto? Product { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public DateTime? ModifiedAt { get; set; }
|
||||
}
|
||||
7
src/Imprink.Application/Dtos/RoleDto.cs
Normal file
7
src/Imprink.Application/Dtos/RoleDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class RoleDto
|
||||
{
|
||||
public required Guid RoleId { get; set; }
|
||||
public required string RoleName { get; set; }
|
||||
}
|
||||
23
src/Imprink.Application/Dtos/UserDto.cs
Normal file
23
src/Imprink.Application/Dtos/UserDto.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Imprink.Domain.Entities;
|
||||
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public required string Name { get; set; }
|
||||
public required string Nickname { get; set; }
|
||||
public required string Email { get; set; }
|
||||
public bool EmailVerified { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
public required bool IsActive { get; set; }
|
||||
|
||||
public virtual ICollection<Address> Addresses { get; set; } = new List<Address>();
|
||||
public virtual ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
|
||||
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
|
||||
public Address? DefaultAddress => Addresses.FirstOrDefault(a => a is { IsDefault: true, IsActive: true });
|
||||
public IEnumerable<Role> Roles => UserRoles.Select(ur => ur.Role);
|
||||
}
|
||||
7
src/Imprink.Application/Dtos/UserRoleDto.cs
Normal file
7
src/Imprink.Application/Dtos/UserRoleDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Imprink.Application.Dtos;
|
||||
|
||||
public class UserRoleDto
|
||||
{
|
||||
public required string UserId { get; set; }
|
||||
public required Guid RoleId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user