This commit is contained in:
2026-04-22 21:26:23 +04:30
parent 64ee78e320
commit 15d11122b8
9 changed files with 149 additions and 229 deletions
@@ -2,17 +2,18 @@
using Vizhvizh.GoldGallery.ApplicationContract.Commands;
using Vizhvizh.GoldGallery.Domain.Products.Entities;
using Vizhvizh.GoldGallery.Domain.Products.Repositories;
using Vizhvizh.GoldGallery.Domain.Products.ValuesObjects;
namespace Vizhvizh.GoldGallery.Application.CommandHandlers.Categories;
public class CreateCategoryCommandHandler(ICategoryRepository categoryRepository) : ICommandHandler<CreateCategoryCommand>
{
public Task Handle(CreateCategoryCommand request, CancellationToken cancellationToken)
public async Task Handle(CreateCategoryCommand request, CancellationToken cancellationToken)
{
//var category = Category.CreateNew(request.Title,
// request.Description,
// request.Image)
var category = Category.CreateNew(request.Title,
request.Description,
request.Image, CategoryPath.CreateNew("/1/"));
throw new Exception();
await categoryRepository.AddAsync(category, cancellationToken);
}
}