Пример #1
0
 public SubmitState(IInventoryOperationDomainService inventoryOperationDomainService,
     IInvoiceStateFactory invoiceStateFactory, IInventoryOperationNotifier inventoryOperationNotifier)
 {
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.invoiceStateFactory = invoiceStateFactory;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
 }
Пример #2
0
 public OpenState(
     IInvoiceItemDomainService invoiceItemDomainService,
     IBalanceDomainService balanceDomainService,
     IInventoryOperationNotifier inventoryOperationNotifier, 
     IInvoiceStateFactory invoiceStateFactory)
 {
     this.invoiceItemDomainService = invoiceItemDomainService;
     this.balanceDomainService = balanceDomainService;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
     this.invoiceStateFactory = invoiceStateFactory;
 }
 public CharterInApplicationService(ICharterInRepository charterInRepository,
     ICharterInToDtoMapper charterInToDtoMapper, IUnitOfWorkScope unitOfWorkScope,
     IWorkflowRepository workflowRepository, ICharterOutDomainService charterOutDomainService,
     ICharterInDomainService charterInDomainService, IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier)
 {
     this._charterInRepository = charterInRepository;
     this._charterInToDtoMapper = charterInToDtoMapper;
     this._unitOfWorkScope = unitOfWorkScope;
     _charterFactory = new CharterFactory(workflowRepository,
              charterInDomainService, charterOutDomainService, eventPublisher, vesselInCompanyDomainService, inventoryOperationNotifier);
 }
Пример #4
0
 public CharterFactory(IWorkflowRepository workflowRepository,
     ICharterInDomainService charterInDomainService,
     ICharterOutDomainService charterOutDomainService,
     IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier)
 {
     _workflowRepository = workflowRepository;
     _charterInDomainService = charterInDomainService;
     _charterOutDomainService = charterOutDomainService;
     _eventPublisher = eventPublisher;
     this.vesselInCompanyDomainService = vesselInCompanyDomainService;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
 }
 public ApprovableScrapDomainService(
     IVesselInCompanyDomainService vesselDomainService, IInventoryOperationNotifier inventoryOperationNotifier,
     ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService,
     IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService)
 {
     this.vesselDomainService = vesselDomainService;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
     this.tankDomainService = tankDomainService;
     this.currencyDomainService = currencyDomainService;
     this.goodDomainService = goodDomainService;
     this.goodUnitDomainService = goodUnitDomainService;
 }
 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;
 }
Пример #7
0
        public void SubmitInvoice(
                        IInvoiceItemDomainService invoiceItemDomainService,
                        IBalanceDomainService balanceDomainService,
                        IInventoryOperationNotifier inventoryOperationNotifier)
        {
            //  CheckInvoiceAnyInvoiceItem();

            if (OrderRefrences == null)
                throw new BusinessRuleException("", "Reference not Set");

            var c = new CalculateChangeInOrderBlance(invoiceItemDomainService, balanceDomainService);
            var orderItemsBalances = c.Process(this, this.InvoiceItems, this.OrderRefrences);

            foreach (var orderItemsBalance in orderItemsBalances)
            {
                var inventoryResult = inventoryOperationNotifier.NotifySubmittingOrderItemBalance(orderItemsBalance);

                if (inventoryResult == null)
                    throw new InvalidOperation("SubmitInvoiceOrderItemBalance", "Submit the OrderItemBalance of Invoice to Inventory resulted to an error.");

                orderItemsBalance.InventoryOperation = inventoryResult;
            }

            State = States.Submitted;
        }
Пример #8
0
        //================================================================================
        public void Submit(SubmittedState submittedState,
            IVesselInCompanyDomainService vesselDomainService, IInventoryOperationNotifier eventNotifier,
            ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService,
            IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService)
        {
            this.validateToBeOpenOrSubmitRejected();

            this.validateApproveAction(vesselDomainService, tankDomainService, currencyDomainService, goodDomainService, goodUnitDomainService);

            //Perform Submit operations.
            //foreach (var scrapDetail in this.ScrapDetails)
            //{
            //    scrapDetail.InventoryOperations.AddRange(eventNotifier.NotifySubmittingScrapDetail(scrapDetail));
            //}

            if (this.isOpen.IsSatisfiedBy(this))
                vesselDomainService.ScrapVessel(this.VesselInCompanyId);

            var invResult = eventNotifier.NotifySubmittingScrap(this);

            this.InventoryOperations.AddRange(invResult);

            this.setState(submittedState);
        }
Пример #9
0
        //================================================================================
        public void Cancel(CancelledState cancelledState, IInventoryOperationNotifier eventNotifier)
        {
            //this.setState(cancelledState);

            //eventNotifier.NotifyScrapCancelled(this);
        }
Пример #10
0
        //===================================================================================
        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);
        }
Пример #11
0
 public void Resolve(ICharterInDomainService charterInDomainService, ICharterOutDomainService charterOutDomainService
     , IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier)
 {
     _charterInDomainService = charterInDomainService;
     _charterOutDomainService = charterOutDomainService;
     _eventPublisher = eventPublisher;
     InventoryOperationNotifier = inventoryOperationNotifier;
     VesselInCompanyDomainService = vesselInCompanyDomainService;
 }