Esempio n. 1
0
 public SubmitState(IInventoryOperationDomainService inventoryOperationDomainService,
     IInvoiceStateFactory invoiceStateFactory, IInventoryOperationNotifier inventoryOperationNotifier)
 {
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.invoiceStateFactory = invoiceStateFactory;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
 }
Esempio n. 2
0
        public SubmitState(IInventoryOperationDomainService inventoryOperationDomainService,
            IOrderStateFactory orderStateFactory
            )
        {
            this.inventoryOperationDomainService = inventoryOperationDomainService;

            this.orderStateFactory = orderStateFactory;
        }
 public InvoiceStateFactory(
     IInventoryOperationDomainService inventoryOperationDomainService, 
     IInventoryOperationNotifier inventoryOperationNotifier,
     IInvoiceItemDomainService invoiceItemDomainService,
     IBalanceDomainService balanceDomainService
     )
 {
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.inventoryOperationNotifier = inventoryOperationNotifier;
     this.invoiceItemDomainService = invoiceItemDomainService;
     this.balanceDomainService = balanceDomainService;
 }
Esempio n. 4
0
 public ScrapFacadeService(
     IScrapApplicationService scrapApplicationService,
     IScrapDomainService scrapDomainService,
     IScrapToScrapDtoMapper scrapDtoMapper,
     IScrapDetailToScrapDetailDtoMapper scrapDetailDtoMapper, IInventoryOperationDomainService inventoryOperationDomainService, IInventoryOperationToInventoryOperationDtoMapper inventoryOperationDtoMapper)
 {
     this.scrapApplicationService = scrapApplicationService;
     this.scrapDomainService = scrapDomainService;
     this.scrapDtoMapper = scrapDtoMapper;
     this.scrapDetailDtoMapper = scrapDetailDtoMapper;
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.inventoryOperationDtoMapper = inventoryOperationDtoMapper;
 }
 //================================================================================
 public FuelReportFacadeService(
     IFuelReportApplicationService appService,
     IFuelReportFuelReportDtoMapper fuelReportMapper,
     IFuelReportDetailToFuelReportDetailDtoMapper fuelReportDetailToFuelReportDetailDtoMapper,
     ICurrencyDomainService currencyDomainService,
     ICurrencyToCurrencyDtoMapper currencyToCurrencyDtoMapper,
     IFuelReportDomainService fuelReportDomainService,
     IInventoryOperationDomainService inventoryOperationDomainService,
     IInventoryOperationToInventoryOperationDtoMapper inventoryOperationMapper)
 {
     this.appService = appService;
     this.fuelReportMapper = fuelReportMapper;
     this.fuelReportDetailToFuelReportDetailDtoMapper = fuelReportDetailToFuelReportDetailDtoMapper;
     this.currencyToCurrencyDtoMapper = currencyToCurrencyDtoMapper;
     this.fuelReportDomainService = fuelReportDomainService;
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.inventoryOperationMapper = inventoryOperationMapper;
     this.currencyDomainService = currencyDomainService;
 }
 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 VoyageFacadeService(
     IVoyageDomainService voyageDomainService,
     IVoyageToVoyageDtoMapper voyageDtoMapper,
     IFuelReportDomainService fuelReportDomainService,
     IFuelReportFuelReportDtoMapper fuelReportDtoMapper,
     IInventoryOperationDomainService inventoryOperationDomainService,
     IInventoryOperationToInventoryOperationDtoMapper inventoryOperationDtoMapper,
     IVoyageLogDomainService voyageLogDomainService,
     IVoyageLogToVoyageLogDtoMapper voyageLogDtoMapper,
     IGoodToGoodDtoMapper goodDtoMapper)
 {
     this.voyageDomainService = voyageDomainService;
     this.voyageDtoMapper = voyageDtoMapper;
     //this.fuelReportDomainService = fuelReportDomainService;
     this.fuelReportDtoMapper = fuelReportDtoMapper;
     this.inventoryOperationDomainService = inventoryOperationDomainService;
     this.inventoryOperationDtoMapper = inventoryOperationDtoMapper;/**/
     this.voyageLogDtoMapper = voyageLogDtoMapper;
     this.goodDtoMapper = goodDtoMapper;
     this.voyageLogDomainService = voyageLogDomainService;
 }
 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();
 }
Esempio n. 9
0
 public void CancelInvoice(IInventoryOperationDomainService inventoryOperationDomainService)
 {
     //            if (inventoryOperationDomainService.HasInvoiceAnyReceipt(Id))
     //                throw new BusinessRuleException("a1");
     //            if (invoiceDomainService.InvoiceHaveAnyInvoices(Id))
     //                throw new BusinessRuleException("a2");
     State = States.Closed;
 }
Esempio n. 10
0
        public void CancelOrder(IInventoryOperationDomainService inventoryOperationDomainService)
        {
            if (OrderItems.Sum(c => c.ReceivedInMainUnit) > 0)
                throw new BusinessRuleException("", "can not cancel beacuse have refrenced !");

            State = States.Cancelled;
        }
Esempio n. 11
0
 public OrderStateFactory(IInventoryOperationDomainService inventoryOperationDomainService                           
     )
 {
     this.inventoryOperationDomainService = inventoryOperationDomainService;
 }
Esempio n. 12
0
        //===================================================================================
        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);
            }
        }
Esempio n. 13
0
        //===================================================================================
        /// <summary>
        /// BR_FR37
        /// </summary>
        private void validatePreviousEndedVoyagesToBeIssued(
            IVoyageDomainService voyageDomainService,
            IFuelReportDomainService fuelReportDomainService,
            IInventoryOperationDomainService inventoryOperationDomainService)
        {
            var notIssuedEOVFuelReportsOfPreviousVoyages = fuelReportDomainService.GetNotIssuedEOVFuelReportsOfPreviousVoyages(this);

            if (notIssuedEOVFuelReportsOfPreviousVoyages.Count != 0)
                throw new BusinessRuleException("BR_FR37", "There are some ended voyages before current Fuel Report with no issue for End Of Voyage Fuel Report.");
        }
Esempio n. 14
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);
        }