Commit 7c41c9bb authored by Michal Bilanin's avatar Michal Bilanin 🙄
Browse files

Merge branch 'refactor/view-models' into 'master'

Refactor/view models

See merge request !39
parents f7d8fe4d 2a91b663
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -25,6 +25,5 @@ public class CreateOrderDto : BaseEntityDto


    public int UserId { get; set; }
    public int UserId { get; set; }
    public int AddressId { get; set; }
    public int AddressId { get; set; }
    public IEnumerable<CartItemDetailDto> CartItems { get; set; } = [];
    public string? CouponCodeString { get; set; }
    public string? CouponCodeString { get; set; }
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -20,6 +20,5 @@ public class OrderDetailDto
    public int UserId { get; set; }
    public int UserId { get; set; }


    public CouponCode? CouponCode { get; set; }
    public CouponCode? CouponCode { get; set; }
    public int AddressId { get; set; }
    public List<OrderProductDetailDto> OrderProducts { get; set; } = [];
    public List<OrderProductDetailDto> OrderProducts { get; set; } = [];
}
}
+6 −6
Original line number Original line Diff line number Diff line
@@ -27,19 +27,19 @@ public class ProductFacade(IProductService productService, IImageService imageSe
        return await productService.CreateProductAsync(mapper.Map<ProductDto>(productImageDto));
        return await productService.CreateProductAsync(mapper.Map<ProductDto>(productImageDto));
    }
    }


    public async Task<IEnumerable<ProductDto>> GetAllProductsAsync()
    public Task<IEnumerable<ProductDto>> GetAllProductsAsync()
    {
    {
        return await productService.GetAllProductsAsync();
        return productService.GetAllProductsAsync();
    }
    }


    public async Task<FilteredResult<ProductDto>> GetProductsFilteredAsync(ProductFilterDto productFilter)
    public Task<FilteredResult<ProductDto>> GetProductsFilteredAsync(ProductFilterDto productFilter)
    {
    {
        return await productService.GetProductsFilteredAsync(productFilter);
        return productService.GetProductsFilteredAsync(productFilter);
    }
    }


    public async Task<ProductDto?> GetProductByIdAsync(int id)
    public Task<ProductDto?> GetProductByIdAsync(int id)
    {
    {
        return await productService.GetProductByIdAsync(id);
        return productService.GetProductByIdAsync(id);
    }
    }


    public async Task<ProductDetailDto?> GetProductDetailByIdAsync(int id)
    public async Task<ProductDetailDto?> GetProductDetailByIdAsync(int id)
+3 −3
Original line number Original line Diff line number Diff line
@@ -89,9 +89,9 @@ public class GiftCardService(
        return ret is null ? null : mapper.Map<CouponCodeDto>(ret);
        return ret is null ? null : mapper.Map<CouponCodeDto>(ret);
    }
    }


    public async Task<IEnumerable<CouponCodeDto>> GetCouponCodesAsync()
    public Task<List<CouponCodeDto>> GetCouponCodesAsync()
    {
    {
        return await couponCodeRepository.GetAllAsync()
        return couponCodeRepository.GetAllAsync()
            .ContinueWith(task => mapper.Map<List<CouponCodeDto>>(task.Result));
            .ContinueWith(task => mapper.Map<List<CouponCodeDto>>(task.Result));
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,7 @@ public interface IGiftCardService
    Task<bool> DeleteGiftCardByIdAsync(int id);
    Task<bool> DeleteGiftCardByIdAsync(int id);
    Task<CouponCodeDto?> RedeemCouponAsync(string CouponCode);
    Task<CouponCodeDto?> RedeemCouponAsync(string CouponCode);


    Task<IEnumerable<CouponCodeDto>> GetCouponCodesAsync();
    Task<List<CouponCodeDto>> GetCouponCodesAsync();


    Task<CouponCodeDto?> GetCouponCodeByIdAsync(int id);
    Task<CouponCodeDto?> GetCouponCodeByIdAsync(int id);


Loading