.
This commit is contained in:
@@ -7,18 +7,18 @@ using Vizhvizh.Shop.Domain.Shops.ValuesObjects;
|
||||
|
||||
namespace Vizhvizh.Shop.Application.CommandHandlers.Shops;
|
||||
|
||||
public class CreateShopCommandHandler(IShopRepository shopRepository) : ICommandHandler<CreateShopCommand, ShopId>
|
||||
public class CreateShopCommandHandler(IShopRepository shopRepository) : ICommandHandler<CreateShopCommand>
|
||||
{
|
||||
public async Task<ShopId> Handle(CreateShopCommand request, CancellationToken cancellationToken)
|
||||
public async Task Handle(CreateShopCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var location = ShopLocation.CreateNew(request.ShopLocation.Latitude, request.ShopLocation.Longitude,
|
||||
request.ShopLocation.ProvinceId, request.ShopLocation.CityId, request.ShopLocation.Address, request.ShopLocation.PostalCode);
|
||||
|
||||
var businessLicense = ShopBusinessLicense.CreateNew(request.ShopBusinessLicenseImage, request.ShopBusinessLicenseCode);
|
||||
|
||||
var shop = Domain.Shops.Entities.Shop.CreateNew(request.OwnerId, request.Title,
|
||||
location,TelephoneVO.CreateNew(request.Telephone), request.Description);
|
||||
location, TelephoneVO.CreateNew(request.Telephone), businessLicense, request.Description);
|
||||
|
||||
await shopRepository.AddAsync(shop, cancellationToken);
|
||||
|
||||
return shop.Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,8 @@
|
||||
<ProjectReference Include="..\Vichvich.Shop.ApplicationContract\Vizhvizh.Shop.ApplicationContract.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="CommandHandlers\Products\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user