fix(TaxesFee) , fix(InvoiceWaterMark) , VER 1.0.9.11

subProduct
Amir Hossein Khademi 2024-07-01 21:08:32 +03:30
parent ab0f4a683c
commit a66ee7c8a2
7 changed files with 25 additions and 12 deletions

View File

@ -1 +1 @@
1.0.7.10
1.0.9.11

View File

@ -36,12 +36,21 @@ 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)
=> 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));
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
public async Task<IResult> GetAsync(Guid id, IMediator mediator,CancellationToken cancellationToken)
=> TypedResults.Ok(await mediator.Send(new GetProductQuery(id),cancellationToken));
public async Task<IResult> GetAsync(Guid id, IMediator mediator, CancellationToken cancellationToken)
=> TypedResults.Ok(await mediator.Send(new GetProductQuery(id), cancellationToken));
// POST:Create Entity
public async Task<IResult> Post([FromBody] CreateProductCommand request, IMediator mediator,
@ -53,7 +62,7 @@ public class ProductController : ICarterModule
CancellationToken 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));
// DELETE:Delete Entity

View File

@ -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>

View File

@ -41,7 +41,6 @@ builder.Services.AddMarten(configuration,builder.Environment);
builder.Services.AddCarter();
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NjU5MUAzMTM5MmUzMTJlMzBmYlFPZXRJVThMS20zaFlBdjdKMnlKeGJRQng4b0lURDZ1Rk40akFHbnVrPQ==");
builder.Host.ConfigureContainer<ContainerBuilder>(builder =>

View File

@ -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())
{

View File

@ -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);

View File

@ -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>