fix(TaxesFee) , fix(InvoiceWaterMark) , VER 1.0.9.11
parent
ab0f4a683c
commit
a66ee7c8a2
|
@ -36,12 +36,21 @@ public class ProductController : ICarterModule
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET:Get All Entity
|
// GET:Get All Entity
|
||||||
public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery]string? productName, [FromQuery] QuerySortBy? sortBy, [FromQuery] Guid? categoryId, [FromQuery] bool? specialOffer, [FromQuery] Guid[]? brandIds , [FromQuery]double? minPrice , [FromQuery] double? maxPrice, [FromQuery]bool? isActive, IMediator mediator, CancellationToken cancellationToken)
|
public async Task<IResult> GetAllAsync([FromQuery] int page,
|
||||||
=> TypedResults.Ok(await mediator.Send(new GetProductsQuery(Page: page, SpecialOffer: specialOffer, SortBy: sortBy ?? 0 ,ProductName: productName, CategoryId: categoryId ?? default , BrandIds: brandIds , MinPrice: minPrice ?? -1 , MaxPrice:maxPrice ?? 0,IsActive:isActive),cancellationToken));
|
[FromQuery] string? productName,
|
||||||
|
[FromQuery] QuerySortBy? sortBy,
|
||||||
|
[FromQuery] Guid? categoryId,
|
||||||
|
[FromQuery] bool? specialOffer,
|
||||||
|
[FromQuery] Guid[]? brandIds,
|
||||||
|
[FromQuery] double? minPrice,
|
||||||
|
[FromQuery] double? maxPrice,
|
||||||
|
[FromQuery] bool? isActive,
|
||||||
|
IMediator mediator, CancellationToken cancellationToken)
|
||||||
|
=> TypedResults.Ok(await mediator.Send(new GetProductsQuery(Page: page, SpecialOffer: specialOffer, SortBy: sortBy ?? 0, ProductName: productName, CategoryId: categoryId ?? default, BrandIds: brandIds, MinPrice: minPrice ?? -1, MaxPrice: maxPrice ?? 0, IsActive: isActive), cancellationToken));
|
||||||
|
|
||||||
// GET:Get An Entity By Id
|
// GET:Get An Entity By Id
|
||||||
public async Task<IResult> GetAsync(Guid id, IMediator mediator,CancellationToken cancellationToken)
|
public async Task<IResult> GetAsync(Guid id, IMediator mediator, CancellationToken cancellationToken)
|
||||||
=> TypedResults.Ok(await mediator.Send(new GetProductQuery(id),cancellationToken));
|
=> TypedResults.Ok(await mediator.Send(new GetProductQuery(id), cancellationToken));
|
||||||
|
|
||||||
// POST:Create Entity
|
// POST:Create Entity
|
||||||
public async Task<IResult> Post([FromBody] CreateProductCommand request, IMediator mediator,
|
public async Task<IResult> Post([FromBody] CreateProductCommand request, IMediator mediator,
|
||||||
|
@ -53,7 +62,7 @@ public class ProductController : ICarterModule
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
=> TypedResults.Ok(await mediator.Send(request, cancellationToken));
|
=> TypedResults.Ok(await mediator.Send(request, cancellationToken));
|
||||||
|
|
||||||
public async Task<IResult> ChangeDisplayedAsync(Guid productId, [FromQuery]bool beDisplayed, [FromServices] IMediator mediator, CancellationToken cancellationToken)
|
public async Task<IResult> ChangeDisplayedAsync(Guid productId, [FromQuery] bool beDisplayed, [FromServices] IMediator mediator, CancellationToken cancellationToken)
|
||||||
=> TypedResults.Ok(await mediator.Send(new ChangeProductDisplayedCommand(productId, beDisplayed), cancellationToken));
|
=> TypedResults.Ok(await mediator.Send(new ChangeProductDisplayedCommand(productId, beDisplayed), cancellationToken));
|
||||||
|
|
||||||
// DELETE:Delete Entity
|
// DELETE:Delete Entity
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<AssemblyVersion>1.0.7.10</AssemblyVersion>
|
<AssemblyVersion>1.0.9.11</AssemblyVersion>
|
||||||
<FileVersion>1.0.7.10</FileVersion>
|
<FileVersion>1.0.9.11</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -41,7 +41,6 @@ builder.Services.AddMarten(configuration,builder.Environment);
|
||||||
builder.Services.AddCarter();
|
builder.Services.AddCarter();
|
||||||
|
|
||||||
|
|
||||||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NjU5MUAzMTM5MmUzMTJlMzBmYlFPZXRJVThMS20zaFlBdjdKMnlKeGJRQng4b0lURDZ1Rk40akFHbnVrPQ==");
|
|
||||||
|
|
||||||
|
|
||||||
builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
|
builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
|
||||||
|
|
|
@ -8,6 +8,7 @@ public static class CoreConfig
|
||||||
|
|
||||||
public static async Task CoreInit(this IApplicationBuilder app)
|
public static async Task CoreInit(this IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
|
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NjA1NkAzMjM2MkUzMTJFMzliSzVTQlJKN0NLVzNVOFVKSlErcVEzYW9PSkZ2dUhicHliVjkrMncxdHpRPQ==");
|
||||||
var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
|
var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
|
||||||
using (var scope = scopeFactory.CreateScope())
|
using (var scope = scopeFactory.CreateScope())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
namespace Netina.Core.EntityServices.OrderHandlers;
|
namespace Netina.Core.EntityServices.OrderHandlers;
|
||||||
|
|
||||||
public class CalculateOrderCommandHandler(IRepositoryWrapper repositoryWrapper, IMediator mediator) : IRequestHandler<CalculateOrderCommand,Order>
|
public class CalculateOrderCommandHandler(IRepositoryWrapper repositoryWrapper, IMediator mediator,ISettingService settingService) : IRequestHandler<CalculateOrderCommand,Order>
|
||||||
{
|
{
|
||||||
|
|
||||||
public async Task<Order> Handle(CalculateOrderCommand request, CancellationToken cancellationToken)
|
public async Task<Order> Handle(CalculateOrderCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
var setting = await settingService.GetSettingAsync("ShopSetting", cancellationToken);
|
||||||
|
double taxesFee = 9;
|
||||||
|
if (setting is ShopSetting shopSetting)
|
||||||
|
taxesFee = shopSetting.TaxesFee;
|
||||||
var order = await mediator.Send(new GetOrderQuery(request.OrderId), cancellationToken);
|
var order = await mediator.Send(new GetOrderQuery(request.OrderId), cancellationToken);
|
||||||
if (order.OrderStatus != OrderStatus.OrderBag)
|
if (order.OrderStatus != OrderStatus.OrderBag)
|
||||||
throw new AppException("Order is not in bag status and cant be calculate", ApiResultStatusCode.BadRequest);
|
throw new AppException("Order is not in bag status and cant be calculate", ApiResultStatusCode.BadRequest);
|
||||||
|
@ -22,7 +26,7 @@ public class CalculateOrderCommandHandler(IRepositoryWrapper repositoryWrapper,
|
||||||
if (!order.DiscountCode.IsNullOrEmpty())
|
if (!order.DiscountCode.IsNullOrEmpty())
|
||||||
discountCodePrice += await mediator.Send(new CalculateOrderDiscountCommand(order.DiscountCode, order),cancellationToken);
|
discountCodePrice += await mediator.Send(new CalculateOrderDiscountCommand(order.DiscountCode, order),cancellationToken);
|
||||||
|
|
||||||
var taxesPrice = (((totalProductPrice - (discountCodePrice + productDiscountPrice)) + totalPackingPrice + servicePrice) / 100) * 10;
|
var taxesPrice = (((totalProductPrice - (discountCodePrice + productDiscountPrice)) + totalPackingPrice + servicePrice) / 100) * taxesFee;
|
||||||
|
|
||||||
|
|
||||||
order.SetTotalPrice(totalProductPrice, totalPackingPrice, servicePrice, deliveryPrice, productDiscountPrice, discountCodePrice, taxesPrice);
|
order.SetTotalPrice(totalProductPrice, totalPackingPrice, servicePrice, deliveryPrice, productDiscountPrice, discountCodePrice, taxesPrice);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||||
<PackageReference Include="Quartz" Version="3.8.1" />
|
<PackageReference Include="Quartz" Version="3.8.1" />
|
||||||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="24.1.41" />
|
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="26.1.35" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue