Restructure mediator files
This commit is contained in:
@@ -17,4 +17,10 @@
|
|||||||
<ProjectReference Include="..\Imprink.Domain\Imprink.Domain.csproj" />
|
<ProjectReference Include="..\Imprink.Domain\Imprink.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Users\Create\" />
|
||||||
|
<Folder Include="Users\Delete\" />
|
||||||
|
<Folder Include="Users\Query\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class CreateCategoryCommand : IRequest<CategoryDto>
|
|
||||||
{
|
|
||||||
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; } = true;
|
|
||||||
public Guid? ParentCategoryId { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class CreateProductCommand : IRequest<ProductDto>
|
|
||||||
{
|
|
||||||
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; } = true;
|
|
||||||
public string? ImageUrl { get; set; }
|
|
||||||
public Guid? CategoryId { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class CreateProductVariantCommand : IRequest<ProductVariantDto>
|
|
||||||
{
|
|
||||||
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; } = true;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class DeleteCategoryCommand : IRequest<bool>
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class DeleteProductCommand : IRequest<bool>
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Commands;
|
|
||||||
|
|
||||||
public class DeleteProductVariantCommand : IRequest<bool>
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,18 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Domain.Entities.Product;
|
using Imprink.Domain.Entities.Product;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Create;
|
||||||
|
|
||||||
|
public class CreateCategoryCommand : IRequest<CategoryDto>
|
||||||
|
{
|
||||||
|
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; } = true;
|
||||||
|
public Guid? ParentCategoryId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CreateCategoryHandler(IUnitOfWork unitOfWork) : IRequestHandler<CreateCategoryCommand, CategoryDto>
|
public class CreateCategoryHandler(IUnitOfWork unitOfWork) : IRequestHandler<CreateCategoryCommand, CategoryDto>
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,19 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Domain.Entities.Product;
|
using Imprink.Domain.Entities.Product;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Create;
|
||||||
|
|
||||||
|
public class CreateProductCommand : IRequest<ProductDto>
|
||||||
|
{
|
||||||
|
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; } = true;
|
||||||
|
public string? ImageUrl { get; set; }
|
||||||
|
public Guid? CategoryId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CreateProductHandler(IUnitOfWork unitOfWork) : IRequestHandler<CreateProductCommand, ProductDto>
|
public class CreateProductHandler(IUnitOfWork unitOfWork) : IRequestHandler<CreateProductCommand, ProductDto>
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,20 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Domain.Entities.Product;
|
using Imprink.Domain.Entities.Product;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Create;
|
||||||
|
|
||||||
|
public class CreateProductVariantCommand : IRequest<ProductVariantDto>
|
||||||
|
{
|
||||||
|
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; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
public class CreateProductVariantHandler(IUnitOfWork unitOfWork)
|
public class CreateProductVariantHandler(IUnitOfWork unitOfWork)
|
||||||
: IRequestHandler<CreateProductVariantCommand, ProductVariantDto>
|
: IRequestHandler<CreateProductVariantCommand, ProductVariantDto>
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Delete;
|
||||||
|
|
||||||
|
public class DeleteCategoryCommand : IRequest<bool>
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class DeleteCategoryHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteCategoryCommand, bool>
|
public class DeleteCategoryHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteCategoryCommand, bool>
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Delete;
|
||||||
|
|
||||||
|
public class DeleteProductCommand : IRequest<bool>
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class DeleteProductHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteProductCommand, bool>
|
public class DeleteProductHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteProductCommand, bool>
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Delete;
|
||||||
|
|
||||||
|
public class DeleteProductVariantCommand : IRequest<bool>
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class DeleteProductVariantHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteProductVariantCommand, bool>
|
public class DeleteProductVariantHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteProductVariantCommand, bool>
|
||||||
{
|
{
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Queries;
|
|
||||||
|
|
||||||
public class GetCategoriesQuery : IRequest<IEnumerable<CategoryDto>>
|
|
||||||
{
|
|
||||||
public bool? IsActive { get; set; }
|
|
||||||
public bool RootCategoriesOnly { get; set; } = false;
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Queries;
|
|
||||||
|
|
||||||
public class GetProductVariantsQuery : IRequest<IEnumerable<ProductVariantDto>>
|
|
||||||
{
|
|
||||||
public Guid? ProductId { get; set; }
|
|
||||||
public bool? IsActive { get; set; }
|
|
||||||
public bool InStockOnly { get; set; } = false;
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
|
||||||
using Imprink.Domain.Common.Models;
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Queries;
|
|
||||||
|
|
||||||
public class GetProductsQuery : IRequest<PagedResultDto<ProductDto>>
|
|
||||||
{
|
|
||||||
public ProductFilterParameters FilterParameters { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
|
||||||
using Imprink.Domain.Entities.Product;
|
using Imprink.Domain.Entities.Product;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Query;
|
||||||
|
|
||||||
|
public class GetCategoriesQuery : IRequest<IEnumerable<CategoryDto>>
|
||||||
|
{
|
||||||
|
public bool? IsActive { get; set; }
|
||||||
|
public bool RootCategoriesOnly { get; set; } = false;
|
||||||
|
}
|
||||||
|
|
||||||
public class GetCategoriesHandler(IUnitOfWork unitOfWork)
|
public class GetCategoriesHandler(IUnitOfWork unitOfWork)
|
||||||
: IRequestHandler<GetCategoriesQuery, IEnumerable<CategoryDto>>
|
: IRequestHandler<GetCategoriesQuery, IEnumerable<CategoryDto>>
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
|
||||||
using Imprink.Domain.Entities.Product;
|
using Imprink.Domain.Entities.Product;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Query;
|
||||||
|
|
||||||
|
public class GetProductVariantsQuery : IRequest<IEnumerable<ProductVariantDto>>
|
||||||
|
{
|
||||||
|
public Guid? ProductId { get; set; }
|
||||||
|
public bool? IsActive { get; set; }
|
||||||
|
public bool InStockOnly { get; set; } = false;
|
||||||
|
}
|
||||||
|
|
||||||
public class GetProductVariantsHandler(IUnitOfWork unitOfWork)
|
public class GetProductVariantsHandler(IUnitOfWork unitOfWork)
|
||||||
: IRequestHandler<GetProductVariantsQuery, IEnumerable<ProductVariantDto>>
|
: IRequestHandler<GetProductVariantsQuery, IEnumerable<ProductVariantDto>>
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
using Imprink.Domain.Common.Models;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
|
|
||||||
namespace Imprink.Application.Products.Handlers;
|
namespace Imprink.Application.Products.Query;
|
||||||
|
|
||||||
|
public class GetProductsQuery : IRequest<PagedResultDto<ProductDto>>
|
||||||
|
{
|
||||||
|
public ProductFilterParameters FilterParameters { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
public class GetProductsHandler(IUnitOfWork unitOfWork) : IRequestHandler<GetProductsQuery, PagedResultDto<ProductDto>>
|
public class GetProductsHandler(IUnitOfWork unitOfWork) : IRequestHandler<GetProductsQuery, PagedResultDto<ProductDto>>
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
using Imprink.Application.Products.Create;
|
||||||
|
using Imprink.Application.Products.Delete;
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
using Imprink.Application.Products.Query;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
using Imprink.Application.Products.Create;
|
||||||
|
using Imprink.Application.Products.Delete;
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
using Imprink.Application.Products.Query;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Imprink.Application.Products.Commands;
|
using Imprink.Application.Products.Create;
|
||||||
|
using Imprink.Application.Products.Delete;
|
||||||
using Imprink.Application.Products.Dtos;
|
using Imprink.Application.Products.Dtos;
|
||||||
using Imprink.Application.Products.Queries;
|
using Imprink.Application.Products.Query;
|
||||||
using Imprink.Domain.Common.Models;
|
using Imprink.Domain.Common.Models;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Imprink.Application;
|
using Imprink.Application;
|
||||||
using Imprink.Application.Products.Handlers;
|
using Imprink.Application.Products.Create;
|
||||||
using Imprink.Domain.Repositories;
|
using Imprink.Domain.Repositories;
|
||||||
using Imprink.Infrastructure;
|
using Imprink.Infrastructure;
|
||||||
using Imprink.Infrastructure.Database;
|
using Imprink.Infrastructure.Database;
|
||||||
|
|||||||
Reference in New Issue
Block a user