public OrderApplicationService(IOrderDomainService orderService, IEmployeeDomainService employeeService, IMapper mapper) { _orderService = orderService; _employeeService = employeeService; _mapper = mapper; }
public SubscriptionAppService(ISubscriptionRepository subscriptionRepository, IRepository <SubscriptionCycle, Guid> subscriptionCycleRepository, IRepository <SubscriptionCycleOrder, Guid> subscriptionCycleOrderRepository, IRepository <Plan, Guid> planRepository, IPlanPriceRepository planPriceRepository, IRepository <Order, Guid> orderRepository, IRepository <Invoice, Guid> invoiceRepository, IRepository <InvoicePaymentProvider, Guid> invoicePaymentProviderRepository, IOrderDomainService orderDomainService, ISubscriptionDomainService subscriptionDomainService, ISubscriptionCycleDomainService subscriptionCycleDomainService, ISubscriptionCycleOrderDomainService subscriptionCycleOrderDomainService, IInvoiceDomainService invoiceDomainService, IObjectMapper mapper, IPaypalService paypalService, IMobbexService mobbexService) { _subscriptionRepository = subscriptionRepository ?? throw new ArgumentNullException(nameof(subscriptionRepository)); _subscriptionCycleRepository = subscriptionCycleRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleRepository)); _subscriptionCycleOrderRepository = subscriptionCycleOrderRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleOrderRepository)); _planRepository = planRepository ?? throw new ArgumentNullException(nameof(planRepository)); _planPriceRepository = planPriceRepository ?? throw new ArgumentNullException(nameof(planPriceRepository)); _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _invoiceRepository = invoiceRepository ?? throw new ArgumentNullException(nameof(invoiceRepository)); _invoicePaymentProviderRepository = invoicePaymentProviderRepository ?? throw new ArgumentNullException(nameof(invoicePaymentProviderRepository)); _orderDomainService = orderDomainService ?? throw new ArgumentNullException(nameof(orderDomainService)); _subscriptionDomainService = subscriptionDomainService ?? throw new ArgumentNullException(nameof(subscriptionDomainService)); _subscriptionCycleDomainService = subscriptionCycleDomainService ?? throw new ArgumentNullException(nameof(subscriptionCycleDomainService)); _subscriptionCycleOrderDomainService = subscriptionCycleOrderDomainService ?? throw new ArgumentNullException(nameof(subscriptionCycleOrderDomainService)); _invoiceDomainService = invoiceDomainService ?? throw new ArgumentNullException(nameof(invoiceDomainService)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _paypalService = paypalService ?? throw new ArgumentNullException(nameof(paypalService)); _mobbexService = mobbexService ?? throw new ArgumentNullException(nameof(mobbexService)); }
public OrderRenewSubscriptionPayedEventHandler(IOrderRepository orderRepository, ISubscriptionRepository subscriptionRepository, IRepository <SubscriptionCycle, Guid> subscriptionCycleRepository, IRepository <SubscriptionCycleOrder, Guid> subscriptionCycleOrderRepository, IPlanPriceRepository planPriceRepository, ISubscriptionDomainService subscriptionDomainService, ISubscriptionCycleDomainService subscriptionCycleDomainService, IOrderDomainService orderDomainService, IRepository <Notification, Guid> noticationRepository, IMapper mapper, IClientOptions clientOptions, IHttpClientFactory httpClientFactory, IBackgroundJobManager backgroundJobManager, IRepository <Invoice, Guid> invoiceRepository, IInvoiceDomainService invoiceDomainService, INotificationDomainService notificationDomainService) { _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _subscriptionRepository = subscriptionRepository ?? throw new ArgumentNullException(nameof(subscriptionRepository)); _subscriptionCycleRepository = subscriptionCycleRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleRepository)); _subscriptionCycleOrderRepository = subscriptionCycleOrderRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleOrderRepository)); _planPriceRepository = planPriceRepository ?? throw new ArgumentNullException(nameof(planPriceRepository)); _subscriptionDomainService = subscriptionDomainService ?? throw new ArgumentNullException(nameof(subscriptionDomainService)); _subscriptionCycleDomainService = subscriptionCycleDomainService ?? throw new ArgumentNullException(nameof(subscriptionCycleDomainService)); _orderDomainService = orderDomainService ?? throw new ArgumentNullException(nameof(orderDomainService)); _notificationDomainService = notificationDomainService ?? throw new ArgumentNullException(nameof(notificationDomainService)); _noticationRepository = noticationRepository ?? throw new ArgumentNullException(nameof(noticationRepository)); _clientOptions = clientOptions ?? throw new ArgumentNullException(nameof(clientOptions)); _httpClient = httpClientFactory?.CreateClient() ?? throw new ArgumentNullException(nameof(httpClientFactory)); _backgroundJobManager = backgroundJobManager ?? throw new ArgumentNullException(nameof(backgroundJobManager)); _invoiceRepository = invoiceRepository ?? throw new ArgumentNullException(nameof(invoiceRepository)); _invoiceDomainService = invoiceDomainService ?? throw new ArgumentNullException(nameof(invoiceDomainService)); _eventBus = EventBus.Default; _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public PrivateOrderCommandHandler(IRepository <Person> personRepository, IFcmNotification fcmNotification, IRepository <ApplicationSetting> applicationSettingRepository, IOrderDomainService orderDomainService, IFactorDomainService factorDomainService, IRepository <Product> productRepository, IPercentDiscountDomainService percentDiscountDomainService, IApplicationSettingDomainService applicationSettingDomainService, IRepository <PrivateOrder> privateOrderRepository, IContext context, IRepository <AreaOrder> areaRepository, IRepository <OrderBase> orderRepository) { _personRepository = personRepository; _fcmNotification = fcmNotification; _applicationSettingRepository = applicationSettingRepository; _orderDomainService = orderDomainService; _factorDomainService = factorDomainService; _productRepository = productRepository; _percentDiscountDomainService = percentDiscountDomainService; _applicationSettingDomainService = applicationSettingDomainService; _privateOrderRepository = privateOrderRepository; _context = context; _areaRepository = areaRepository; _orderRepository = orderRepository; }
public void TestInitialize() { _scope = new UnitOfWorkScope(new EFUnitOfWorkFactory(() => new DataContainer())); _orderRepository = null;//new OrderRepository(_scope, new OrderConfigurator(new StateFactory(new )), new EFRepository<OrderItem>(_scope)); _orderRepository.GetAll(); _target = new OrderDomainService(_orderRepository); }
public GetOrderByIdQueryHandler(IDbContext dbContext, IMapper mapper, IDeliveryService deliveryService, IOrderDomainService orderDomainService) { _dbContext = dbContext; _mapper = mapper; _deliveryService = deliveryService; _orderDomainService = orderDomainService; }
public ImportOrderCommandHandler( HandlerBaseParameters handlerBaseParameters, IImportOrderCommandIsValidValidator importOrderCommandIsValidValidator, IOrderDomainService orderDomainService, ICustomerDomainService customerDomainService, IProductDomainService productDomainService ) : base(handlerBaseParameters) { _importOrderCommandIsValidValidator = importOrderCommandIsValidValidator; _orderDomainService = orderDomainService; _customerDomainService = customerDomainService; _productDomainService = productDomainService; }
public InvoiceWebhookAppService(IRepository <Invoice, Guid> invoiceRepository, IRepository <InvoiceWebhook, Guid> invoiceWebhookRepository, IRepository <InvoicePaymentProvider, Guid> invoicePaymentProviderRepository, IOrderDomainService orderDomainService, IInvoiceDomainService invoiceDomainService, IInvoiceWebhookDomainService invoiceWebhookDomainService, IPaypalService paypalService) { _invoiceRepository = invoiceRepository ?? throw new ArgumentNullException(nameof(invoiceRepository)); _invoiceWebhookRepository = invoiceWebhookRepository ?? throw new ArgumentNullException(nameof(invoiceWebhookRepository)); _invoiceDomainService = invoiceDomainService ?? throw new ArgumentNullException(nameof(invoiceDomainService)); _invoicePaymentProviderRepository = invoicePaymentProviderRepository ?? throw new ArgumentNullException(nameof(invoicePaymentProviderRepository)); _orderDomainService = orderDomainService ?? throw new ArgumentNullException(nameof(orderDomainService)); _invoiceWebhookDomainService = invoiceWebhookDomainService ?? throw new ArgumentNullException(nameof(invoiceWebhookDomainService)); _paypalService = paypalService ?? throw new ArgumentNullException(nameof(paypalService)); _eventBus = EventBus.Default; }
public OrderSuggestionCommandHandler(IRepository <OrderBase> orderRepository, IRepository <Person> personRepository, IRepository <Product> productRepository, IRepository <OrderSuggestion> repository, IFcmNotification fcmNotification, IRepository <ApplicationSetting> applicationSettingRepository, ISeqRepository seqRepository, IApplicationSettingDomainService applicationSettingDomainService, IOrderDomainService orderDomainService) { _personRepository = personRepository; _productRepository = productRepository; _repository = repository; _fcmNotification = fcmNotification; _applicationSettingRepository = applicationSettingRepository; _seqRepository = seqRepository; _applicationSettingDomainService = applicationSettingDomainService; _orderDomainService = orderDomainService; _orderRepository = orderRepository; }
public ApprovableFuelReportDomainService( IVoyageDomainService voyageDomainService, IFuelReportDomainService fuelReportDomainService, IInventoryOperationDomainService inventoryOperationDomainService, IGoodDomainService goodDomainService, IOrderDomainService orderDomainService, ICurrencyDomainService currencyDomainService, IBalanceDomainService balanceDomainService, IInventoryManagementDomainService inventoryManagementDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { this.voyageDomainService = voyageDomainService; this.fuelReportDomainService = fuelReportDomainService; this.inventoryOperationDomainService = inventoryOperationDomainService; this.goodDomainService = goodDomainService; this.orderDomainService = orderDomainService; this.inventoryOperationNotifier = inventoryOperationNotifier; this.currencyDomainService = currencyDomainService; this.balanceDomainService = balanceDomainService; this.inventoryManagementDomainService = inventoryManagementDomainService; }
public JobAppService(ISubscriptionRepository subscriptionRepository, ISubscriptionCycleRepository subscriptionCycleRepository, IRepository <SubscriptionCycleOrder, Guid> subscriptionCycleOrderRepository, IRepository <Notification, Guid> notificationRepository, INotificationDomainService notificationDomainService, IPlanPriceRepository planPriceRepository, IOrderRepository orderRepository, IRepository <Invoice, Guid> invoiceRepository, IRepository <InvoicePaymentProvider, Guid> invoicePaymentProviderRepository, IOrderDomainService orderDomainService, ISubscriptionDomainService subscriptionDomainService, ISubscriptionCycleDomainService subscriptionCycleDomainService, ISubscriptionCycleOrderDomainService subscriptionCycleOrderDomainService, IInvoiceDomainService invoiceDomainService, IObjectMapper mapper, IPaypalService paypalService, IMobbexService mobbexService, IClientOptions clientOptions, IHttpClientFactory httpClientFactory) { _subscriptionRepository = subscriptionRepository ?? throw new ArgumentNullException(nameof(subscriptionRepository)); _subscriptionCycleRepository = subscriptionCycleRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleRepository)); _subscriptionCycleOrderRepository = subscriptionCycleOrderRepository ?? throw new ArgumentNullException(nameof(subscriptionCycleOrderRepository)); _noticationRepository = notificationRepository ?? throw new ArgumentNullException(nameof(notificationRepository)); _notificationDomainService = notificationDomainService ?? throw new ArgumentNullException(nameof(notificationDomainService)); _planPriceRepository = planPriceRepository ?? throw new ArgumentNullException(nameof(planPriceRepository)); _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _invoiceRepository = invoiceRepository ?? throw new ArgumentNullException(nameof(invoiceRepository)); _invoicePaymentProviderRepository = invoicePaymentProviderRepository ?? throw new ArgumentNullException(nameof(invoicePaymentProviderRepository)); _orderDomainService = orderDomainService ?? throw new ArgumentNullException(nameof(orderDomainService)); _subscriptionDomainService = subscriptionDomainService ?? throw new ArgumentNullException(nameof(subscriptionDomainService)); _subscriptionCycleDomainService = subscriptionCycleDomainService ?? throw new ArgumentNullException(nameof(subscriptionCycleDomainService)); _subscriptionCycleOrderDomainService = subscriptionCycleOrderDomainService ?? throw new ArgumentNullException(nameof(subscriptionCycleOrderDomainService)); _invoiceDomainService = invoiceDomainService ?? throw new ArgumentNullException(nameof(invoiceDomainService)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _paypalService = paypalService ?? throw new ArgumentNullException(nameof(paypalService)); _mobbexService = mobbexService ?? throw new ArgumentNullException(nameof(mobbexService)); _clientOptions = clientOptions ?? throw new ArgumentNullException(nameof(clientOptions)); _httpClient = httpClientFactory?.CreateClient() ?? throw new ArgumentNullException(nameof(httpClientFactory)); }
public FuelReportDomainService( IFuelReportRepository fuelReportRepository, IVoyageDomainService voyageDomainService, IInventoryOperationDomainService inventoryOperationDomainService, IInventoryOperationRepository inventoryOperationRepository, IInventoryOperationFactory inventoryOperationFactory, IOrderDomainService orderDomainService, IInventoryManagementDomainService inventoryManagementDomainService, ICharteringDomainService charteringDomainService) { this.fuelReportRepository = fuelReportRepository; this.voyageDomainService = voyageDomainService; this.inventoryOperationDomainService = inventoryOperationDomainService; this.inventoryOperationRepository = inventoryOperationRepository; this.inventoryOperationFactory = inventoryOperationFactory; this.orderDomainService = orderDomainService; this.inventoryManagementDomainService = inventoryManagementDomainService; this.charteringDomainService = charteringDomainService; this.isFuelReportNotCancelled = new IsFuelReportNotCancelled(); this.isFuelReportIssued = new IsFuelReportIssued(inventoryOperationDomainService); this.isFuelReportInFinalApprovedState = new IsFuelReportClosed(); this.isFuelReportOperational = new IsFuelReportOperational(); isFuelReportSubmitted = new IsFuelReportSubmitted(); }
public OrderController(ApplicationContext context) { _domainService = new OrderDomainService(context); }
//=================================================================================== private void validateTransferPurchaseReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.TransferPurchase) { var finalApprovedPrurchaseTransferOrders = orderDomainService.GetBuyerFinalApprovedPurchaseTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedPrurchaseTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("BR_FR 16_2", string.Format("BR_FR 16 : Transfer-Purchase Receive Reference for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR 16_2", "BR_FR 16 - چنانچه نوع آن خرید انتقالی می باشد مرجع آن سفارش خرید انتقالی تائید نهایی شده باشد"); } }
public OrderService(IOrderDomainService orderDomainService) { _orderDomainService = orderDomainService; }
public OrdersController(IOrderDomainService service, IProductDomainService domainService, IExecutorDomainService executorDomain) { _orderDomainService = service; _productDomainService = domainService; _executorDomainService = executorDomain; }
//=================================================================================== private void validateTrustReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.Trust && !this.ReceiveReference.IsEmpty()) { var finalApprovedInternalTransferOrders = orderDomainService.GetFinalApprovedInternalTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedInternalTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("", string.Format("BR_FR31 : Trust Receive Reference for '{0}' is invalid.", this.Good.Code)); } }
//=================================================================================== private void validateTransferSaleReferenceValue(IOrderDomainService orderDomainService) { if (this.Transfer.HasValue && this.TransferType.Value == TransferTypes.TransferSale && !this.TransferReference.IsEmpty()) { var finalApprovedTransferOrder = orderDomainService.GetFinalApprovedTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var transferRefCount = finalApprovedTransferOrder.Count( o => o.Id == this.TransferReference.ReferenceId && this.TransferReference.ReferenceType == ReferenceType.Order); if (transferRefCount != 1) throw new BusinessRuleException("BR_FR19", string.Format("BR_FR19: TransferSale Reference Value for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR19", "BR_FR19 - چنانچه فیلد انتقال مقداردهی گردیده است و نوع آن فروش انتقالی می باشد مرجع آن سفارش انتقال تائید نهایی شده می باشد"); } }
public DashboardApplicationService(IOrderDomainService orderService) { _orderService = orderService; }
public void ValidateTransferReferences(IOrderDomainService orderDomainService, IInventoryManagementDomainService inventoryManagementDomainService) { validateEmptyTransferValues(); validateNotEmptyTransferValues(); validateNotEmptyTransferSaleValues(); validateTransferSaleReferenceValue(orderDomainService); validateNotEmptyInternalTransferValues(); validateInternalTransferReferenceValue(orderDomainService); validateNotEmptyRejectTransferValues(); validateRejectTransferReferenceValue(inventoryManagementDomainService); }
//=================================================================================== public void Submit( FuelReportState entityNewState, IVoyageDomainService voyageDomainService, IFuelReportDomainService fuelReportDomainService, IInventoryOperationDomainService inventoryOperationDomainService, IGoodDomainService goodDomainService, IOrderDomainService orderDomainService, ICurrencyDomainService currencyDomainService, IBalanceDomainService balanceDomainService, IInventoryManagementDomainService inventoryManagementDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { this.CheckToBeOperational(); validateSubmittingState( voyageDomainService, fuelReportDomainService, inventoryOperationDomainService, goodDomainService, orderDomainService, currencyDomainService, inventoryManagementDomainService); sendDataToBalancingDomainService(balanceDomainService); if (this.FuelReportType == FuelReportTypes.EndOfVoyage || this.FuelReportType == FuelReportTypes.EndOfYear || this.FuelReportType == FuelReportTypes.EndOfMonth) { var inventoryResult = inventoryOperationNotifier.NotifySubmittingFuelReportConsumption(this); this.ConsumptionInventoryOperations.Add(inventoryResult); } else { foreach (var fuelReportDetail in this.FuelReportDetails) { var inventoryResult = inventoryOperationNotifier.NotifySubmittingFuelReportDetail(fuelReportDetail, fuelReportDomainService); if (inventoryResult != null) fuelReportDetail.InventoryOperations.AddRange(inventoryResult); } } setEntityState(entityNewState); }
//=================================================================================== private void validateInternalTransferReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.InternalTransfer) { var finalApprovedInternalTransferOrders = orderDomainService.GetFinalApprovedInternalTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedInternalTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("BR_FR 31", string.Format("BR_FR31 : Internal-Transfer Receive Reference for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR 31", "BR_FR31 - چنانچه نوع دریافت انتقال داخلی می باشد مرجع آن که سفارش انتقال داخلی تائید نهایی شده می باشد مشخص شده باشد"); } }
//=================================================================================== private void validateSubmittingState(IVoyageDomainService voyageDomainService, IFuelReportDomainService fuelReportDomainService, IInventoryOperationDomainService inventoryOperationDomainService, IGoodDomainService goodDomainService, IOrderDomainService orderDomainService, ICurrencyDomainService currencyDomainService, IInventoryManagementDomainService inventoryManagementDomainService) { validateToBeOpenOrSubmitRejected(); validateVoyageId(this.VoyageId, voyageDomainService); //BR_FR37 validatePreviousEndedVoyagesToBeIssued( voyageDomainService, fuelReportDomainService, inventoryOperationDomainService); //BR_FR38 validatePreviousFuelReportsToBeFinalApproved(fuelReportDomainService); //BR_FR39 validateFuelReportsOfPreviousDayForMandatoryType( fuelReportDomainService, goodDomainService); var isTheFirstReport = isCurrentFuelReportTheFirstOne(fuelReportDomainService); FuelReport previousFuelReport = getYesterdayLastFuelReport(fuelReportDomainService); validateFuelReportOfTheDayBefore(previousFuelReport, isTheFirstReport); foreach (var detailItem in this.FuelReportDetails) { FuelReportDetail fuelReportDetailOfYesterdayForRelevantGood = getGoodRelevantFuelReportDetailOfYesterday( detailItem.GoodId, isTheFirstReport, previousFuelReport); //All Edit Rules must be checked for details. detailItem.ValidateCurrentValues( fuelReportDetailOfYesterdayForRelevantGood, isTheFirstReport, currencyDomainService); detailItem.ValidateTransferReferences(orderDomainService, inventoryManagementDomainService); detailItem.ValidateReceiveReferences(orderDomainService); detailItem.ValidateCorrectionReferences(isTheFirstReport, voyageDomainService, fuelReportDomainService); } }
//=================================================================================== public void ValidateReceiveReferences(IOrderDomainService orderDomainService) { validateEmptyReceiveValues(); validateNotEmptyReceiveTypeValue(); validateNotEmptyReceiveReferenceValue(); validatePurchaseReceiveTypeReference(orderDomainService); validateTransferPurchaseReceiveReference(orderDomainService); validateInternalTransferReceiveReference(orderDomainService); validateTrustReceiveReference(orderDomainService); }