fix(TaxesFee) , fix(InvoiceWaterMark) , VER 1.0.9.11
parent
ab0f4a683c
commit
a66ee7c8a2
|
@ -36,7 +36,16 @@ public class ProductController : ICarterModule
|
|||
}
|
||||
|
||||
// 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,
|
||||
[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
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<AssemblyVersion>1.0.7.10</AssemblyVersion>
|
||||
<FileVersion>1.0.7.10</FileVersion>
|
||||
<AssemblyVersion>1.0.9.11</AssemblyVersion>
|
||||
<FileVersion>1.0.9.11</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -41,7 +41,6 @@ builder.Services.AddMarten(configuration,builder.Environment);
|
|||
builder.Services.AddCarter();
|
||||
|
||||
|
||||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NjU5MUAzMTM5MmUzMTJlMzBmYlFPZXRJVThMS20zaFlBdjdKMnlKeGJRQng4b0lURDZ1Rk40akFHbnVrPQ==");
|
||||
|
||||
|
||||
builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
|
||||
|
|
|
@ -8,6 +8,7 @@ public static class CoreConfig
|
|||
|
||||
public static async Task CoreInit(this IApplicationBuilder app)
|
||||
{
|
||||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NjA1NkAzMjM2MkUzMTJFMzliSzVTQlJKN0NLVzNVOFVKSlErcVEzYW9PSkZ2dUhicHliVjkrMncxdHpRPQ==");
|
||||
var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
|
||||
using (var scope = scopeFactory.CreateScope())
|
||||
{
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
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)
|
||||
{
|
||||
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);
|
||||
if (order.OrderStatus != OrderStatus.OrderBag)
|
||||
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())
|
||||
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);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||
<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>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue