Example #1
0
 public SaleController(ISaleService saleService,
                       IBaseObjectService <User> userService,
                       IBaseObjectService <SaleProduct> saleProductService,
                       IInfoMoneyService infoMoneyService,
                       IBaseObjectService <Partner> partnerService,
                       IBaseObjectService <ProductInformation> productInformationService,
                       IBaseObjectService <SupplyProduct> supplyProductService,
                       IBaseObjectService <Supplier> supplierService,
                       IBaseObjectService <Shop> shopService,
                       IMoneyOperationService moneyOperationService,
                       ShopContext db,
                       ISaleStatisticService saleStatisticService,
                       ISaleInfoService saleInfoService,
                       IProductOperationService productOperationService,
                       IBookingProductInformationService bookingProductInformationService,
                       PostgresContext postgresContext)
 {
     _saleService               = saleService;
     _userService               = userService;
     _saleProductService        = saleProductService;
     _infoMoneyService          = infoMoneyService;
     _partnerService            = partnerService;
     _productInformationService = productInformationService;
     _supplyProductService      = supplyProductService;
     _supplierService           = supplierService;
     _db                               = db;
     _shopService                      = shopService;
     _moneyOperationService            = moneyOperationService;
     _saleStatisticService             = saleStatisticService;
     _saleInfoService                  = saleInfoService;
     _productOperationService          = productOperationService;
     _bookingProductInformationService = bookingProductInformationService;
     _postgresContext                  = postgresContext;
 }
 /// <summary>
 /// Create controller to manage sales API.
 /// </summary>
 /// <param name="logger">Logger service.</param>
 /// <param name="mediator">Mediator service.</param>
 /// <param name="saleStatisticService">Service to calculate sales statistic.</param>
 public SalesController(ILogger <SalesController> logger,
                        IMediator mediator,
                        ISaleStatisticService saleStatisticService)
 {
     _logger               = logger ?? throw new ArgumentNullException(nameof(logger));
     _mediator             = mediator ?? throw new ArgumentNullException(nameof(mediator));
     _saleStatisticService = saleStatisticService ?? throw new ArgumentNullException(nameof(saleStatisticService));
 }