Compare commits

..

No commits in common. "9b0afb2d2ccc16105a4ffb5d52feda5e5688bcee" and "b9cb52927f9dda8760f57fd38e90f24b6ae0f522" have entirely different histories.

18 changed files with 96 additions and 384 deletions

View File

@ -4,13 +4,11 @@ using FruitBank.Common.Dtos;
using FruitBank.Common.Entities;
using FruitBank.Common.Interfaces;
using FruitBank.Common.Server.Interfaces;
using FruitBank.Common.Server.Services.SignalRs;
using FruitBank.Common.SignalRs;
using Mango.Nop.Core.Extensions;
using Mango.Nop.Core.Loggers;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Newtonsoft.Json;
using Nop.Core;
using Nop.Core.Domain.Customers;
@ -45,9 +43,6 @@ using System.Text;
using System.Text.Json.Serialization;
using System.Xml;
using System.Xml.Serialization;
using AyCode.Services.Server.SignalRs;
using AyCode.Core.Extensions;
using MessagePack.Resolvers;
namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
{
@ -56,7 +51,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
public class CustomOrderController : BaseAdminController, ICustomOrderSignalREndpointServer
{
private readonly FruitBankDbContext _dbContext;
private readonly SignalRSendToClientService _sendToClient;
private readonly IOrderService _orderService;
private readonly CustomOrderModelFactory _orderModelFactory;
@ -71,7 +65,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
private readonly IPriceCalculationService _priceCalculationService;
protected readonly IEventPublisher _eventPublisher;
protected readonly ILocalizationService _localizationService;
protected readonly ICustomerActivityService _customerActivityService;
protected readonly ICustomerActivityService _customerActivityService;
protected readonly IExportManager _exportManager;
protected readonly IGiftCardService _giftCardService;
protected readonly IImportManager _importManager;
@ -102,7 +96,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
return hasVendorProducts;
}
public CustomOrderController(FruitBankDbContext fruitBankDbContext, SignalRSendToClientService sendToClient,
public CustomOrderController(FruitBankDbContext fruitBankDbContext,
IOrderService orderService,
IPriceCalculationService priceCalculationService,
IOrderModelFactory orderModelFactory,
@ -126,8 +120,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
_logger = new Logger<CustomOrderController>(logWriters.ToArray());
_dbContext = fruitBankDbContext;
_sendToClient = sendToClient;
_orderService = orderService;
_orderModelFactory = orderModelFactory as CustomOrderModelFactory;
_customOrderSignalREndpoint = customOrderSignalREndpoint;
@ -152,26 +144,14 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
}
#region CustomOrderSignalREndpoint
[NonAction] public Task<List<OrderDto>> GetAllOrderDtos() => _customOrderSignalREndpoint.GetAllOrderDtos();
[NonAction] public Task<OrderDto> GetOrderDtoById(int orderId) => _customOrderSignalREndpoint.GetOrderDtoById(orderId);
[NonAction] public Task<List<OrderDto>> GetPendingOrderDtos() => _customOrderSignalREndpoint.GetPendingOrderDtos();
[NonAction] public Task<List<OrderDto>> GetPendingOrderDtosForMeasuring() => _customOrderSignalREndpoint.GetPendingOrderDtosForMeasuring();
[NonAction]public Task<OrderDto> GetOrderDtoById(int orderId) => _customOrderSignalREndpoint.GetOrderDtoById(orderId);
[NonAction]public Task<List<OrderDto>> GetPendingOrderDtos() => _customOrderSignalREndpoint.GetPendingOrderDtos();
[NonAction]public Task<List<OrderDto>> GetPendingOrderDtosForMeasuring() => _customOrderSignalREndpoint.GetPendingOrderDtosForMeasuring();
[NonAction] public Task<OrderDto> StartMeasuring(int orderId, int userId) => _customOrderSignalREndpoint.StartMeasuring(orderId, userId);
[NonAction] public Task<OrderDto> SetOrderStatusToComplete(int orderId, int revisorId) => _customOrderSignalREndpoint.SetOrderStatusToComplete(orderId, revisorId);
[NonAction]public Task<OrderDto> SetOrderStatusToComplete(int orderId, int revisorId) => _customOrderSignalREndpoint.SetOrderStatusToComplete(orderId, revisorId);
[NonAction] public Task<List<OrderDto>> GetAllOrderDtoByIds(int[] orderIds) => _customOrderSignalREndpoint.GetAllOrderDtoByIds(orderIds);
[NonAction] public Task<List<OrderItemDto>> GetAllOrderItemDtos() => _customOrderSignalREndpoint.GetAllOrderItemDtos();
[NonAction]public Task<List<OrderDto>> GetAllOrderDtoByProductId(int productId) => _customOrderSignalREndpoint.GetAllOrderDtoByProductId(productId);
[NonAction]public Task<OrderItemDto> GetOrderItemDtoById(int orderItemId) => _customOrderSignalREndpoint.GetOrderItemDtoById(orderItemId);
[NonAction]public Task<List<OrderItemDto>> GetAllOrderItemDtoByOrderId(int orderId) => _customOrderSignalREndpoint.GetAllOrderItemDtoByOrderId(orderId);
[NonAction]public Task<List<OrderItemDto>> GetAllOrderItemDtoByProductId(int productId) => _customOrderSignalREndpoint.GetAllOrderItemDtoByProductId(productId);
[NonAction] public Task<List<OrderItemPallet>> GetAllOrderItemPallets() => _customOrderSignalREndpoint.GetAllOrderItemPallets();
[NonAction] public Task<OrderItemPallet> GetOrderItemPalletById(int orderItemPalletId) => _customOrderSignalREndpoint.GetOrderItemPalletById(orderItemPalletId);
[NonAction] public Task<List<OrderItemPallet>> GetAllOrderItemPalletByOrderItemId(int orderItemId) => _customOrderSignalREndpoint.GetAllOrderItemPalletByOrderItemId(orderItemId);
[NonAction] public Task<List<OrderItemPallet>> GetAllOrderItemPalletByOrderId(int orderId) => _customOrderSignalREndpoint.GetAllOrderItemPalletByOrderId(orderId);
[NonAction] public Task<List<OrderItemPallet>> GetAllOrderItemPalletByProductId(int productId) => _customOrderSignalREndpoint.GetAllOrderItemPalletByProductId(productId);
[NonAction]public Task<OrderItemPallet> AddOrUpdateMeasuredOrderItemPallet(OrderItemPallet orderItemPallet) => _customOrderSignalREndpoint.AddOrUpdateMeasuredOrderItemPallet(orderItemPallet);
[NonAction] public Task<OrderItemPallet> AddOrUpdateMeasuredOrderItemPallet(OrderItemPallet orderItemPallet) => _customOrderSignalREndpoint.AddOrUpdateMeasuredOrderItemPallet(orderItemPallet);
#endregion CustomOrderSignalREndpoint
[CheckPermission(StandardPermission.Orders.ORDERS_VIEW)]
@ -349,16 +329,12 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
if (order == null)
return RedirectToAction("List", "Order");
//TODO: A FruitBankAttributeService-t használjuk és akkor az OrderDto lehet lekérni és beadni a SaveAttribute-ba! - J.
// store attributes in GenericAttribute table
//await _genericAttributeService.SaveAttributeAsync(order, nameof(IMeasurable.IsMeasurable), model.IsMeasurable, _storeContext.GetCurrentStore().Id);
await _genericAttributeService.SaveAttributeAsync(order, nameof(IOrderDto.DateOfReceipt), model.DateOfReceipt, _storeContext.GetCurrentStore().Id);
var orderDto = await _dbContext.OrderDtos.GetByIdAsync(model.OrderId, true);
await _sendToClient.SendOrderChanged(orderDto);
_notificationService.SuccessNotification("Custom attributes saved successfully.");
return RedirectToAction("Edit", "Order", new { id = model.OrderId });
}
@ -374,11 +350,11 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
if (customer == null) return RedirectToAction("List");
var billingAddress = await _customerService.GetCustomerBillingAddressAsync(customer);
if (billingAddress == null)
if(billingAddress == null)
{
//let's see if he has any address at all
var addresses = await _customerService.GetAddressesByCustomerIdAsync(customer.Id);
if (addresses != null && addresses.Count > 0)
if(addresses != null && addresses.Count > 0)
{
//set the first one as billing
billingAddress = addresses[0];
@ -483,9 +459,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
await _orderService.UpdateOrderAsync(order);
var orderDto = await _dbContext.OrderDtos.GetByIdAsync(order.Id, true);
await _sendToClient.SendMeasuringNotification("Módosult a rendelés, mérjétek újra!", orderDto);
return true;
});
@ -583,7 +556,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
}
[HttpGet] // Change from [HttpPost] to [HttpGet]
[HttpGet] // Change from [HttpPost] to [HttpGet]
[CheckPermission(StandardPermission.Customers.CUSTOMERS_VIEW)]
public virtual async Task<IActionResult> CustomerSearchAutoComplete(string term)
{
@ -632,7 +605,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
if (string.IsNullOrEmpty(fullName))
fullName = "[No name]";
if (string.IsNullOrEmpty(company))
if(string.IsNullOrEmpty(company))
company = "[No company]";
string fullText = $"{company} ({fullName}), {customer.Email}";
@ -836,12 +809,10 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
[CheckPermission(StandardPermission.Orders.ORDERS_IMPORT_EXPORT)]
public virtual async Task<IActionResult> ExportXmlAll(OrderSearchModelExtended model)
{
var startDateValue = model.StartDate == null
? null
var startDateValue = model.StartDate == null ? null
: (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, await _dateTimeHelper.GetCurrentTimeZoneAsync());
var endDateValue = model.EndDate == null
? null
var endDateValue = model.EndDate == null ? null
: (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, await _dateTimeHelper.GetCurrentTimeZoneAsync()).AddDays(1);
//a vendor should have access only to his products
@ -934,12 +905,10 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
[CheckPermission(StandardPermission.Orders.ORDERS_IMPORT_EXPORT)]
public virtual async Task<IActionResult> ExportExcelAll(OrderSearchModelExtended model)
{
var startDateValue = model.StartDate == null
? null
var startDateValue = model.StartDate == null ? null
: (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, await _dateTimeHelper.GetCurrentTimeZoneAsync());
var endDateValue = model.EndDate == null
? null
var endDateValue = model.EndDate == null ? null
: (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, await _dateTimeHelper.GetCurrentTimeZoneAsync()).AddDays(1);
//a vendor should have access only to his products
@ -1056,7 +1025,9 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
return RedirectToAction("List");
}
}
#endregion
#endregion
}
}

View File

@ -4,7 +4,6 @@ using FruitBank.Common.Dtos;
using FruitBank.Common.Entities;
using FruitBank.Common.Interfaces;
using FruitBank.Common.Server.Interfaces;
using FruitBank.Common.Server.Services.SignalRs;
using FruitBank.Common.SignalRs;
using Mango.Nop.Core.Loggers;
using Nop.Core;
@ -14,11 +13,11 @@ using Nop.Plugin.Misc.FruitBankPlugin.Controllers;
using Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;
using Nop.Plugin.Misc.FruitBankPlugin.Services;
using Nop.Services.Catalog;
using static Nop.Services.Security.StandardPermission;
namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers;
public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, SignalRSendToClientService sendToClient, IPriceCalculationService customPriceCalculationService,IEventPublisher eventPublisher, IWorkContext workContext, IEnumerable<IAcLogWriterBase> logWriters)
: ICustomOrderSignalREndpointServer
public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, IPriceCalculationService customPriceCalculationService,IEventPublisher eventPublisher, IWorkContext workContext, IEnumerable<IAcLogWriterBase> logWriters) : ICustomOrderSignalREndpointServer
{
private readonly ILogger _logger = new Logger<CustomOrderSignalREndpoint>(logWriters.ToArray());
@ -52,67 +51,7 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, SignalRSendToCli
return await ctx.OrderDtos.GetAllByIds(orderIds).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderDtoByProductId)]
public async Task<List<OrderDto>> GetAllOrderDtoByProductId(int productId)
{
return await ctx.OrderDtos.GetAllByProductId(productId, true).ToListAsync();
}
[SignalR(SignalRTags.GetOrderItemDtoById)]
public async Task<OrderItemDto> GetOrderItemDtoById(int orderItemId)
{
return await ctx.OrderItemDtos.GetByIdAsync(orderItemId, true);
}
[SignalR(SignalRTags.GetAllOrderItemDtos)]
public async Task<List<OrderItemDto>> GetAllOrderItemDtos()
{
return await ctx.OrderItemDtos.GetAll(true).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderItemDtoByOrderId)]
public async Task<List<OrderItemDto>> GetAllOrderItemDtoByOrderId(int orderId)
{
return await ctx.OrderItemDtos.GetAllByOrderId(orderId, true).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderItemDtoByProductId)]
public async Task<List<OrderItemDto>> GetAllOrderItemDtoByProductId(int productId)
{
return await ctx.OrderItemDtos.GetAllByProductId(productId, true).ToListAsync();
}
[SignalR(SignalRTags.GetOrderItemPalletById)]
public async Task<OrderItemPallet> GetOrderItemPalletById(int orderItemPalletId)
{
return await ctx.OrderItemPallets.GetByIdAsync(orderItemPalletId, true);
}
[SignalR(SignalRTags.GetAllOrderItemPallets)]
public async Task<List<OrderItemPallet>> GetAllOrderItemPallets()
{
return await ctx.OrderItemPallets.GetAll(true).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderItemPalletByOrderItemId)]
public async Task<List<OrderItemPallet>> GetAllOrderItemPalletByOrderItemId(int orderItemId)
{
return await ctx.OrderItemPallets.GetAllByOrderItemId(orderItemId, true).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderItemPalletByOrderId)]
public async Task<List<OrderItemPallet>> GetAllOrderItemPalletByOrderId(int orderId)
{
return await ctx.OrderItemPallets.GetAllByOrderId(orderId).ToListAsync();
}
[SignalR(SignalRTags.GetAllOrderItemPalletByProductId)]
public async Task<List<OrderItemPallet>> GetAllOrderItemPalletByProductId(int productId)
{
return await ctx.OrderItemPallets.GetAllByProductId(productId).ToListAsync();
}
[SignalR(SignalRTags.StartMeasuring, SignalRTags.SendOrderChanged, SendToClientType.Others)]
[SignalR(SignalRTags.StartMeasuring)]
public async Task<OrderDto> StartMeasuring(int orderId, int userId)
{
_logger.Detail($"StartMeasuring invoked; orderId: {orderId}; userId: {userId}");
@ -121,7 +60,7 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, SignalRSendToCli
return await ctx.OrderDtos.GetByIdAsync(orderId, true);
}
[SignalR(SignalRTags.SetOrderStatusToComplete, SignalRTags.SendOrderChanged, SendToClientType.Others)]
[SignalR(SignalRTags.SetOrderStatusToComplete)]
public async Task<OrderDto> SetOrderStatusToComplete(int orderId, int revisorId)
{
_logger.Detail($"SetOrderStatusToComplete invoked; orderId: {orderId}; revisorId: {revisorId}");
@ -140,7 +79,7 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, SignalRSendToCli
return await ctx.OrderDtos.GetByIdAsync(orderId, true);
}
[SignalR(SignalRTags.AddOrUpdateMeasuredOrderItemPallet, SignalRTags.SendOrderItemPalletChanged, SendToClientType.Others)]
[SignalR(SignalRTags.AddOrUpdateMeasuredOrderItemPallet)]
public async Task<OrderItemPallet> AddOrUpdateMeasuredOrderItemPallet(OrderItemPallet orderItemPallet)
{
ArgumentNullException.ThrowIfNull(orderItemPallet);
@ -148,21 +87,6 @@ public class CustomOrderSignalREndpoint(FruitBankDbContext ctx, SignalRSendToCli
_logger.Detail($"AddOrUpdateMeasuredOrderItemPallet invoked; {orderItemPallet}");
if (!await ctx.AddOrUpdateOrderItemPalletSafeAsync(orderItemPallet)) return null;
var isMeasurable = orderItemPallet.GrossWeight > 0;
if (isMeasurable)
{
var orderItemDto = await ctx.OrderItemDtos.GetByIdAsync(orderItemPallet.OrderItemId, true);
if (orderItemDto.IsAudited && orderItemDto.IsMeasurable)
{
var orderItem = ctx.OrderItems.GetById(orderItemDto.Id);
await ((CustomPriceCalculationService)customPriceCalculationService).CheckAndUpdateOrderItemFinalPricesAsync
(orderItem, orderItemDto.IsMeasurable, orderItemDto.NetWeight);
}
}
return await ctx.OrderItemPallets.GetByIdAsync(orderItemPallet.Id, false);
}

View File

@ -405,22 +405,14 @@
ClassName = NopColumnClassDefaults.CenterAll
});
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.MeasuringStatusString))
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasured))
{
Title = "Mérés állapota", //T($"FruitBank.{nameof(OrderModelExtended.MeasuringStatus)}").Text,
Width = "100",
Render = new RenderCustom("renderColumnMeasuringStatus"),
Title = T($"FruitBank.{nameof(OrderModelExtended.IsMeasured)}").Text,
Width = "80",
Render = new RenderCustom("renderColumnIsMeasurable"),
ClassName = NopColumnClassDefaults.CenterAll
});
// gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModelExtended.IsMeasured))
// {
// Title = T($"FruitBank.{nameof(OrderModelExtended.IsMeasured)}").Text,
// Width = "80",
// Render = new RenderCustom("renderColumnIsMeasurable"),
// ClassName = NopColumnClassDefaults.CenterAll
// });
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(IOrderDto.DateOfReceipt))
{
Title = T($"FruitBank.{nameof(IOrderDto.DateOfReceipt)}").Text,
@ -436,15 +428,13 @@
{
Title = T("Admin.Orders.Fields.OrderStatus").Text,
Width = "100",
Render = new RenderCustom("renderColumnOrderStatus"),
ClassName = NopColumnClassDefaults.CenterAll
Render = new RenderCustom("renderColumnOrderStatus")
});
}
gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.PaymentStatus))
{
Title = T("Admin.Orders.Fields.PaymentStatus").Text,
Width = "130",
ClassName = NopColumnClassDefaults.CenterAll
Width = "130"
});
//a vendor does not have access to this functionality
if (!Model.IsLoggedInAsVendor)
@ -512,18 +502,6 @@
}
}
function renderColumnMeasuringStatus(data, type, row, meta) {
var color;
switch (row.MeasuringStatus) {
case 10: color = 'yellow'; break;
case 20: color = 'blue'; break;
case 30: color = 'green'; break;
case 40: color = 'red'; break;
default: color = 'gray';
}
return '<span class="grid-report-item ' + color + '">' + data + '</span>';
}
function renderColumnCustomer(data, type, row, meta) {
console.log("Hello World 2");
var link = '@Url.Content("~/Admin/Customer/Edit/")' + row.CustomerId;

View File

@ -154,10 +154,6 @@
<th>
@T("FruitBank.IsMeasurable")
</th>
<th>
Mérés állapota
</th>
@* <th>
@T("Admin.Orders.Products.Discount")
</th> *@
@ -328,12 +324,6 @@
<input type="hidden" name="pvIsMeasurable@(item.Id)" id="pvIsMeasurable@(item.Id)" value="@(item.IsMeasurable.ToString())" disabled />
</td>
<td style="width: 100px;" class="text-center">
<div>
<span>@($"{item.MeasuringStatusString}")</span>
</div>
</td>
@* <td style="width: 15%;" class="text-center">
@if (Model.AllowCustomersToSelectTaxDisplayType)
{

View File

@ -12,7 +12,6 @@ using Mango.Nop.Core.Repositories;
using Nop.Core;
using Nop.Core.Caching;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Common;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Orders;
using Nop.Core.Events;
@ -64,8 +63,6 @@ public class FruitBankDbContext : MgDbContextBase,
public IRepository<CustomerCustomerRoleMapping> CustomerRoleMappings { get; set; }
public IRepository<CustomerAddressMapping> CustomerAddressMappings { get; set; }
public IRepository<GenericAttribute> GenericAttributes { get; set; }
public FruitBankDbContext(INopDataProvider dataProvider, ILockService lockService, FruitBankAttributeService fruitBankAttributeService, IStoreContext storeContext,
PartnerDbTable partnerDbTable, ShippingDbTable shippingDbTable, ShippingDocumentDbTable shippingDocumentDbTable, ShippingItemDbTable shippingItemDbTable,
ShippingItemPalletDbTable shippingItemPalletDbTable, FilesDbTable filesDbTable, ShippingDocumentToFilesDbTable shippingDocumentToFilesDbTable,
@ -77,9 +74,7 @@ public class FruitBankDbContext : MgDbContextBase,
IRepository<Customer> customerRepository,
IRepository<CustomerCustomerRoleMapping> customerCustomerRoleMappingRepository,
IRepository<CustomerAddressMapping> customerAddressMappingRepository,
IRepository<CustomerRole> customerRoleRepository,
IRepository<GenericAttribute> genericAttributes,
IEventPublisher eventPublisher,
IRepository<CustomerRole> customerRoleRepository,IEventPublisher eventPublisher,
IEnumerable<IAcLogWriterBase> logWriters) : base(productRepository, orderRepository, orderItemRepository, dataProvider, lockService, new Logger<FruitBankDbContext>(logWriters.ToArray()))
{
_eventPublisher = eventPublisher;
@ -108,8 +103,6 @@ public class FruitBankDbContext : MgDbContextBase,
CustomerRoles = customerRoleRepository;
CustomerRoleMappings = customerCustomerRoleMappingRepository;
CustomerAddressMappings = customerAddressMappingRepository;
GenericAttributes = genericAttributes;
}
public IQueryable<Customer> GetCustomersBySystemRoleName(string systemRoleName)
@ -200,7 +193,7 @@ public class FruitBankDbContext : MgDbContextBase,
ProductDto? productDto = null;
var productIsMeasurable = false;
if (shippingItem.ProductId.GetValueOrDefault(0) > 0)
if (shippingItem.ProductId > 0)
{
productDto = await ProductDtos.GetByIdAsync(shippingItem.ProductId!.Value, true);
@ -270,7 +263,7 @@ public class FruitBankDbContext : MgDbContextBase,
//if (productIdUnchanged || !dbShippingItem.IsMeasured) return true;
if (!productIdChanged && (shippingItem.IsMeasured || !dbShippingItem.IsMeasured)) return true;
productDto = await ProductDtos.GetByIdAsync(dbShippingItem.ProductId!.Value, true);
productDto = await ProductDtos.GetByIdAsync(dbShippingItem.ProductId);
if (productDto != null)
{
@ -438,65 +431,24 @@ public class FruitBankDbContext : MgDbContextBase,
{
if (orderItemDto.TrayQuantity != orderItemDto.Quantity) return null;
foreach (var orderItemPallet in orderItemDto.OrderItemPallets.Where(oip => oip.RevisorId <= 0))
{
orderItemPallet.RevisorId = revisorId;
await OrderItemPallets.UpdateAsync(orderItemPallet, false);
}
//orderItemDto.ProductDto!.StockQuantity -= orderItemDto.TrayQuantity;
//await ProductDtos.UpdateAsync(orderItemDto.ProductDto);
if (!orderItemDto.IsMeasurable) continue;
var prevNetWeightFromGa = orderItemDto.GenericAttributes.GetValueOrDefault(nameof(IMeasuringNetWeight.NetWeight), 0);
//var gaNetWeight = CommonHelper.To<double>(orderItemDto.GenericAttributes.FirstOrDefault(x => x.Key == nameof(IMeasuringNetWeight.NetWeight))?.Value ?? "0");
var gaNetWeight = CommonHelper.To<double>(orderItemDto.GenericAttributes.FirstOrDefault(x => x.Key == nameof(IMeasuringNetWeight.NetWeight))?.Value ?? "0");
await _fruitBankAttributeService.InsertOrUpdateGenericAttributeAsync<OrderItem, double>
(orderItemDto.Id, nameof(IMeasuringNetWeight.NetWeight), orderItemDto.NetWeight);
await _fruitBankAttributeService.InsertOrUpdateMeasuringAttributeValuesAsync<Product>
(orderItemDto.ProductId, -(orderItemDto.NetWeight - prevNetWeightFromGa), orderItemDto.IsMeasurable, true);
(orderItemDto.ProductId, -(orderItemDto.NetWeight-gaNetWeight), orderItemDto.IsMeasurable, true);
}
//await _eventPublisher.PublishAsync(new OrderStatusChangedEvent(order, prevOrderStatus));
return orderDto;
}
public Task DeleteOrderItemConstraintsSafeAsync(OrderItem orderItem, bool publishEvent = false)
{
return TransactionSafeAsync(async _ =>
{
await DeleteOrderItemConstraintsAsync(orderItem, publishEvent);
return true;
});
}
public async Task DeleteOrderItemConstraintsAsync(OrderItem orderItem, bool publishEvent = false)
{
//Itt nincs már OrderItemDto!!!! - J.
var storeId = _storeContext.GetCurrentStore().Id;
var orderItemGenericAttributes = await GenericAttributes.Table.Where(x => x.EntityId == orderItem.Id && x.KeyGroup == nameof(OrderItem) && x.StoreId == storeId).ToListAsync();
var validOrderItemNetWeight = orderItemGenericAttributes.GetValueOrDefault<double>(nameof(IMeasuringNetWeight.NetWeight), 0);
if (validOrderItemNetWeight != 0)
{
var productDto = await ProductDtos.GetByIdAsync(orderItem.ProductId, true);
if (productDto != null && productDto.IsMeasurable)
{
var newProductNetWeight = productDto.NetWeight + validOrderItemNetWeight;
await _fruitBankAttributeService.InsertOrUpdateGenericAttributeAsync<Product, double>(productDto.Id, nameof(IMeasuringNetWeight.NetWeight), newProductNetWeight);
Logger.Info($"DeleteOrderItemConstraints; Product netWeight updated! productId: {productDto.Id}; newNetWeight: {newProductNetWeight}; oldNetWeight: {productDto.NetWeight}; deleted orderItemNetWeight: {validOrderItemNetWeight}; orderItem.Id: {orderItem.Id};");
}
}
await _fruitBankAttributeService.DeleteGenericAttributesAsync(orderItemGenericAttributes);
var deletedPalletCount = await OrderItemPallets.DeleteAsync(x => x.OrderItemId == orderItem.Id);
//await OrderItems.DeleteAsync(orderItem, publishEvent);
Logger.Info($"DeleteOrderItemConstraints; OrderItem constraints deleted! deletedPalletCount: {deletedPalletCount}; orderItem.Id: {orderItem.Id};");
}
public async Task<OrderItemPallet?> AddOrderItemPalletAsync(OrderItemPallet orderItemPallet)
{
if (!await SetupOrderItemPalletMeauringValues(orderItemPallet)) return null;
@ -534,7 +486,10 @@ public class FruitBankDbContext : MgDbContextBase,
private async Task<bool> SetupOrderItemPalletMeauringValues(OrderItemPallet orderItemPallet)
{
var orderItemDto = await OrderItemDtos.GetByIdAsync(orderItemPallet.OrderItemId, true);
OrderItemDto orderItemDto;
if (orderItemPallet.OrderItemDto?.ProductDto == null) orderItemDto = await OrderItemDtos.GetByIdAsync(orderItemPallet.OrderItemId, true);
else orderItemDto = orderItemPallet.OrderItemDto;
if (orderItemDto == null || orderItemPallet.OrderItemId != orderItemDto.Id || //orderItemDto.IsOtherMeasuringInProgress(orderItemPallet.CreatorId) ||
orderItemPallet.TrayQuantity > orderItemDto.Quantity || !orderItemPallet.IsValidSafeMeasuringValues()) return false;
@ -548,7 +503,7 @@ public class FruitBankDbContext : MgDbContextBase,
private async Task<bool> UpdateProductDtoStockQuantityAsync(int productDtoId, bool publishEvent)
{
var productDto = await ProductDtos.GetByIdAsync(productDtoId, false);
var productDto = await ProductDtos.GetByIdAsync(productDtoId);
if (productDto != null) return await UpdateProductDtoStockQuantityAsync(productDto, publishEvent);
Logger.Error($"product == null; id: {productDtoId}");

View File

@ -8,7 +8,6 @@ using Nop.Core.Domain.Orders;
using Nop.Core.Events;
using Nop.Data;
using Mango.Nop.Core.Loggers;
using Nop.Core.Domain.Payments;
namespace Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;
@ -35,10 +34,7 @@ public class OrderDtoDbTable : MgDtoDbTableBase<OrderDto, Order>
=> GetAll(loadRelations).Where(o => o.OrderStatusId == (int)orderStatus);
public IQueryable<OrderDto> GetAllForMeasuring(bool loadRelations = true)
=> GetAll(loadRelations).Where(o => o.PaymentStatusId < (int)PaymentStatus.Paid && o.GenericAttributes.Any(ga => ga.Key == nameof(OrderDto.DateOfReceipt)));
//=> GetAllByOrderStatus(OrderStatus.Pending, loadRelations).Where(o => o.GenericAttributes.Any(ga => ga.Key == nameof(OrderDto.DateOfReceipt)));
public IQueryable<OrderDto> GetAllByProductId(int productId, bool loadRelations = true) => GetAll(loadRelations).Where(o => o.OrderItemDtos.Any(oi => oi.ProductId == productId));
=> GetAllByOrderStatus(OrderStatus.Pending, loadRelations).Where(o => o.GenericAttributes.Any(ga => ga.Key == nameof(OrderDto.DateOfReceipt)));
public IQueryable<OrderDto> GetAllByIds(IEnumerable<int> orderIds, bool loadRelations = true) => GetAll(loadRelations).Where(o => orderIds.Contains(o.Id));
}

View File

@ -20,17 +20,15 @@ public class OrderItemDtoDbTable : MgDtoDbTableBase<OrderItemDto, OrderItem>
public IQueryable<OrderItemDto> GetAll(bool loadRelations)
{
return GetAll()
.LoadWith(oi => oi.OrderDto)
.LoadWith(oi => oi.OrderItemPallets)
.LoadWith(oi => oi.GenericAttributes)
.LoadWith(oi => oi.OrderDto).ThenLoad(prod => prod.GenericAttributes)
.LoadWith(oi => oi.OrderItemPallets).ThenLoad(oip => oip.OrderItemDto).ThenLoad(oi => oi.GenericAttributes)
.LoadWith(oi => oi.ProductDto).ThenLoad(prod => prod.GenericAttributes);
}
public Task<OrderItemDto> GetByIdAsync(int orderItemId, bool loadRelations) => GetAll(loadRelations).Where(oi => oi.Id == orderItemId).FirstOrDefaultAsync(null);
public IQueryable<OrderItemDto> GetAllByOrderId(int orderId, bool loadRelations = true)=> GetAll(loadRelations).Where(oi => oi.OrderId == orderId);
public IQueryable<OrderItemDto> GetAllByProductId(int productId, bool loadRelations = true)=> GetAll(loadRelations).Where(oi => oi.ProductId == productId);
public IQueryable<OrderItemDto> GetAllByIds(IEnumerable<int> orderItemIds, bool loadRelations = true) => GetAll(loadRelations).Where(oi => orderItemIds.Contains(oi.Id));
public IQueryable<OrderItemDto> GetAllByOrderIds(IEnumerable<int> orderIds, bool loadRelations = true) => GetAll(loadRelations).Where(oi => orderIds.Contains(oi.OrderId));
}

View File

@ -21,21 +21,13 @@ public class OrderItemPalletDbTable : MeasuringItemPalletBaseDbTable<OrderItemPa
{
return loadRelations
? GetAll()
.LoadWith(oip => oip.OrderItemDto).ThenLoad(oi => oi.OrderDto).ThenLoad(o => o.GenericAttributes)
.LoadWith(oip => oip.OrderItemDto).ThenLoad(oi => oi.ProductDto).ThenLoad(p => p.GenericAttributes)
.LoadWith(oip => oip.OrderItemDto).ThenLoad(oi => oi.ProductDto).ThenLoad(oip => oip.GenericAttributes)
: GetAll();
}
public Task<OrderItemPallet> GetByIdAsync(int id, bool loadRelations)
=> GetAll(loadRelations).FirstOrDefaultAsync(oip => oip.Id == id);
public IQueryable<OrderItemPallet> GetAllByOrderItemId(int orderItemId, bool loadRelations)
public IQueryable<OrderItemPallet> GetAllByOrderItemIdAsync(int orderItemId, bool loadRelations)
=> GetAll(loadRelations).Where(oip => oip.OrderItemId == orderItemId);
public IQueryable<OrderItemPallet> GetAllByOrderId(int orderId)
=> GetAll(true).Where(oip => oip.OrderItemDto.OrderId == orderId);
public IQueryable<OrderItemPallet> GetAllByProductId(int productId)
=> GetAll(true).Where(oip => oip.OrderItemDto.ProductId == productId);
}

View File

@ -29,21 +29,19 @@ public class FruitBankEventConsumer :
IConsumer<EntityDeletedEvent<ShippingItemPallet>>,
IConsumer<EntityInsertedEvent<OrderItem>>,
IConsumer<EntityUpdatedEvent<OrderItem>>,
IConsumer<EntityDeletedEvent<OrderItem>>
IConsumer<EntityUpdatedEvent<OrderItem>>
{
//private readonly CustomPriceCalculationService _customPriceCalculationService;
private readonly CustomPriceCalculationService _customPriceCalculationService;
private readonly FruitBankDbContext _ctx;
private readonly MeasurementService _measurementService;
private readonly FruitBankAttributeService _fruitBankAttributeService;
public FruitBankEventConsumer(IHttpContextAccessor httpContextAcc, FruitBankDbContext ctx, MeasurementService measurementService,
FruitBankAttributeService fruitBankAttributeService, IEnumerable<IAcLogWriterBase> logWriters) : base(ctx, httpContextAcc, logWriters)
public FruitBankEventConsumer(IHttpContextAccessor httpContextAcc, IPriceCalculationService customPriceCalculationService, FruitBankDbContext ctx, FruitBankAttributeService fruitBankAttributeService, IEnumerable<IAcLogWriterBase> logWriters) : base(ctx, httpContextAcc, logWriters)
{
_ctx = ctx;
_measurementService = measurementService;
_fruitBankAttributeService = fruitBankAttributeService;
_customPriceCalculationService = customPriceCalculationService as CustomPriceCalculationService;
}
public override async Task HandleEventAsync(EntityUpdatedEvent<Product> eventMessage)
@ -259,22 +257,26 @@ public class FruitBankEventConsumer :
await _ctx.ShippingItemPallets.DeleteAsync(sp => sp.ShippingItemId == eventMessage.Entity.Id, false);
}
public async Task HandleEventAsync(EntityDeletedEvent<OrderItem> eventMessage)
{
await _measurementService.DeleteOrderItemConstraintsAsync(eventMessage.Entity);
}
public async Task HandleEventAsync(EntityUpdatedEvent<OrderItem> eventMessage)
{
await _measurementService.OrderItemInsertedOrUpdatedPostProcess(eventMessage.Entity);
//await _customPriceCalculationService.CheckAndUpdateOrderItemFinalPricesAsync(eventMessage.Entity);
if (await _customPriceCalculationService.CheckAndUpdateOrderItemFinalPricesAsync(eventMessage.Entity))
{
var order = await _ctx.Orders.GetByIdAsync(eventMessage.Entity.OrderId);
await _customPriceCalculationService.CheckAndUpdateOrderTotalPrice(order);
}
}
public async Task HandleEventAsync(EntityInsertedEvent<OrderItem> eventMessage)
{
await _measurementService.OrderItemInsertedOrUpdatedPostProcess(eventMessage.Entity);
//await _customPriceCalculationService.CheckAndUpdateOrderItemFinalPricesAsync(eventMessage.Entity);
if (await _customPriceCalculationService.CheckAndUpdateOrderItemFinalPricesAsync(eventMessage.Entity))
{
var order = await _ctx.Orders.GetByIdAsync(eventMessage.Entity.OrderId);
await _customPriceCalculationService.CheckAndUpdateOrderTotalPrice(order);
}
}
}
#endregion Delete

View File

@ -177,7 +177,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Factories
private static void PrepareOrderModelExtended(OrderModelExtended orderModelExtended, OrderDto orderDto)
{
orderModelExtended.IsMeasured = orderDto.IsMeasured;
orderModelExtended.MeasuringStatus = orderDto.MeasuringStatus;
orderModelExtended.IsMeasurable = orderDto.IsMeasurable;
orderModelExtended.DateOfReceipt = orderDto.DateOfReceipt;
orderModelExtended.OrderTotal = !orderDto.IsComplete && orderDto.IsMeasurable ? "kalkuláció alatt..." : orderModelExtended.OrderTotal;
@ -211,14 +210,11 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Factories
orderItemModelExtended.IsMeasured = orderItemDto.IsMeasured;
orderItemModelExtended.IsMeasurable = orderItemDto.IsMeasurable;
orderItemModelExtended.MeasuringStatus = orderItemDto.MeasuringStatus;
orderItemModelExtended.NetWeight = (decimal)orderItemDto.NetWeight;
orderItemModelExtended.ProductStockQuantity = orderItemDto.ProductDto!.StockQuantity;
orderItemModelExtended.ProductIncomingQuantity = orderItemDto.ProductDto.IncomingQuantity;
orderItemModelExtended.ProductAvailableQuantity = orderItemDto.ProductDto.AvailableQuantity;
orderItemModelExtended.SubTotalInclTax = orderItemDto.IsMeasurable && !orderItemDto.IsAudited ? "kalkuláció alatt..." : orderItemModelExtended.SubTotalInclTax;
//orderItemModelExtended.SubTotalInclTax = !orderDto.IsComplete && orderItemDto.IsMeasurable ? "kalkuláció alatt..." : orderItemModelExtended.SubTotalInclTax;
orderModelExtended.ItemExtendeds ??= new List<OrderItemModelExtended>();
orderModelExtended.ItemExtendeds.Add(orderItemModelExtended);

View File

@ -72,8 +72,6 @@ public class PluginNopStartup : INopStartup
services.AddScoped<ShippingDocumentToFilesDbTable>();
services.AddScoped<FruitBankDbContext>();
services.AddScoped<SignalRSendToClientService>();
services.AddScoped<IFruitBankDataControllerServer, FruitBankDataController>();
services.AddScoped<ICustomOrderSignalREndpointServer, CustomOrderSignalREndpoint>();
@ -86,8 +84,6 @@ public class PluginNopStartup : INopStartup
services.AddScoped<InnVoiceApiService>();
services.AddScoped<InnVoiceOrderService>();
services.AddScoped<MeasurementService>();
//services.AddScoped<OrderListModel, OrderListModelExtended>();
//services.AddScoped<OrderModel, OrderModelExtended>();
//services.AddScoped<OrderSearchModel, OrderSearchModelExtended>();
@ -104,13 +100,7 @@ public class PluginNopStartup : INopStartup
options.Filters.AddService<PendingMeasurementCheckoutFilter>();
});
services.AddSignalR(hubOptions =>
{
//hubOptions.EnableDetailedErrors = true;
hubOptions.MaximumReceiveMessageSize = 256 * 1024;
hubOptions.KeepAliveInterval = TimeSpan.FromSeconds(FruitBankConstClient.SignalRKeepAliveIntervalSecond);
hubOptions.ClientTimeoutInterval = TimeSpan.FromSeconds(FruitBankConstClient.SignarlRTimeoutIntervalSecond);
});
services.AddSignalR(options => options.MaximumReceiveMessageSize = 256 * 1024);
}
/// <summary>

View File

@ -3,18 +3,16 @@ using Nop.Plugin.Misc.FruitBankPlugin.Models.MgBase.OrderModels;
namespace Nop.Plugin.Misc.FruitBankPlugin.Models.Orders;
public interface IOrderItemModelExtended : /*IMgOrderItemModelExtended,*/ IMeasurable, IMeasured, IMeasurableStatus
public interface IOrderItemModelExtended : /*IMgOrderItemModelExtended,*/ IMeasurable, IMeasured
{
string MeasuringStatusString { get; }
decimal NetWeight { get; set; }
int ProductStockQuantity { get; set; }
int ProductIncomingQuantity { get; set; }
int ProductAvailableQuantity { get; set; }
}
public interface IOrderModelExtended : IMgOrderModelExtended, IMeasurable, IMeasured, IMeasurableStatus
public interface IOrderModelExtended : IMgOrderModelExtended, IMeasurable, IMeasured
{
string MeasuringStatusString { get; }
DateTime? DateOfReceipt { get; set; }
string CustomerCompany { get; set; }
}

View File

@ -1,5 +1,4 @@
using FruitBank.Common.Enums;
using Nop.Plugin.Misc.FruitBankPlugin.Models.MgBase.OrderModels;
using Nop.Plugin.Misc.FruitBankPlugin.Models.MgBase.OrderModels;
using Nop.Web.Areas.Admin.Models.Orders;
namespace Nop.Plugin.Misc.FruitBankPlugin.Models.Orders
@ -8,8 +7,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Models.Orders
{
public bool IsMeasured { get; set; }
public bool IsMeasurable { get; set; }
public MeasuringStatus MeasuringStatus { get; set; }
public string MeasuringStatusString => MeasuringStatus.ToString();
public decimal NetWeight { get; set; }
public int ProductStockQuantity { get; set; }
public int ProductIncomingQuantity { get; set; }
@ -20,8 +17,6 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Models.Orders
{
public bool IsMeasured { get; set; }
public bool IsMeasurable { get; set; }
public MeasuringStatus MeasuringStatus { get; set; }
public string MeasuringStatusString => MeasuringStatus.ToString();
public DateTime? DateOfReceipt { get; set; }
public string CustomerCompany { get; set; }

View File

@ -71,10 +71,10 @@ public class CustomPriceCalculationService : PriceCalculationService
return (finalPriceInclTax, finalPriceExclTax);
}
public async Task<bool> CheckAndUpdateOrderItemFinalPricesAsync(OrderItem orderItem, OrderItemDto? orderItemDtoHelper = null)
public async Task<bool> CheckAndUpdateOrderItemFinalPricesAsync(OrderItem orderItem)
{
orderItemDtoHelper ??= await _dbContext.OrderItemDtos.GetByIdAsync(orderItem.Id, true);
return await CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDtoHelper.IsMeasurable, orderItemDtoHelper.NetWeight);
var orderItemDto = await _dbContext.OrderItemDtos.GetByIdAsync(orderItem.Id, true);
return await CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDto.IsMeasurable, orderItemDto.NetWeight);
}
//public async Task<bool> CheckAndUpdateOrderItemFinalPricesAsync(OrderItemDto orderItemDto)

View File

@ -166,12 +166,6 @@ public class FruitBankAttributeService(IGenericAttributeService genericAttribute
var ga = await GetGenericAttributeAsync<TEntity>(entityId, key, storeId);
if (ga == null) return;
await DeleteGenericAttributeAsync(ga);
await genericAttributeService.DeleteAttributeAsync(ga);
}
public async Task DeleteGenericAttributeAsync(GenericAttribute genericAttribute)
=> await genericAttributeService.DeleteAttributeAsync(genericAttribute);
public async Task DeleteGenericAttributesAsync(IList<GenericAttribute> genericAttributes)
=> await genericAttributeService.DeleteAttributesAsync(genericAttributes);
}

View File

@ -1,4 +1,4 @@
using Mango.Nop.Core.Services;
using Mango.Nop.Services;
namespace Nop.Plugin.Misc.FruitBankPlugin.Services;

View File

@ -1,8 +0,0 @@
using FruitBank.Common.Interfaces;
namespace Nop.Plugin.Misc.FruitBankPlugin.Services;
public interface IMeasurementService : IMeasurementServiceBase
{
}

View File

@ -1,59 +0,0 @@
using AyCode.Core.Loggers;
using FruitBank.Common.Dtos;
using FruitBank.Common.Interfaces;
using FruitBank.Common.Server.Services.SignalRs;
using FruitBank.Common.Services;
using Mango.Nop.Core.Extensions;
using Mango.Nop.Core.Loggers;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Orders;
using Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;
using Nop.Services.Catalog;
namespace Nop.Plugin.Misc.FruitBankPlugin.Services;
#nullable enable
public class MeasurementService : MeasurementServiceBase<Logger>, IMeasurementService
{
private readonly FruitBankDbContext _dbContext;
private readonly SignalRSendToClientService _signalRSendToClientService;
private readonly CustomPriceCalculationService _customPriceCalculationService;
public MeasurementService(FruitBankDbContext dbContext, SignalRSendToClientService signalRSendToClientService, FruitBankAttributeService fruitBankAttributeService,
IPriceCalculationService customPriceCalculationService, IEnumerable<IAcLogWriterBase> logWriters) : base(new Logger<MeasurementService>(logWriters.ToArray()))
{
_dbContext = dbContext;
_signalRSendToClientService = signalRSendToClientService;
_customPriceCalculationService = (CustomPriceCalculationService)customPriceCalculationService;
}
public async Task DeleteOrderItemConstraintsAsync(int orderItemId) => await DeleteOrderItemConstraintsAsync(await _dbContext.OrderItems.GetByIdAsync(orderItemId));
public async Task DeleteOrderItemConstraintsAsync(OrderItem orderItem)
{
Logger.Info($"DeleteOrderItemConstraintsAsync invoked; orderItem.Id: {orderItem?.Id}");
if (orderItem == null) return;
await _dbContext.DeleteOrderItemConstraintsSafeAsync(orderItem);
await _signalRSendToClientService.SendOrderItemDeleted(orderItem);
}
public async Task OrderItemInsertedOrUpdatedPostProcess(OrderItem orderItem)
{
var orderItemDto = await _dbContext.OrderItemDtos.GetByIdAsync(orderItem.Id, true);
await CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDto);
await _signalRSendToClientService.SendOrderItemChanged(orderItemDto);
}
public async Task CheckAndUpdateOrderItemFinalPricesAsync(OrderItem orderItem, OrderItemDto? orderItemDtoHelper = null)
{
if (await _customPriceCalculationService.CheckAndUpdateOrderItemFinalPricesAsync(orderItem, orderItemDtoHelper))
{
var order = await _dbContext.Orders.GetByIdAsync(orderItem.OrderId);
await _customPriceCalculationService.CheckAndUpdateOrderTotalPrice(order);
}
}
}