public MarketRequestorApiController(IRequestorMarketProcessor marketProcessor,
                                     ISubscriptionRepository subscriptionRepository,
                                     IProposalRepository proposalRepository,
                                     IAgreementRepository agreementRepository,
                                     MarketRequestorEventMapper requestorEventMapper,
                                     DemandMapper demandMapper,
                                     OfferMapper offerMapper)
 {
     this.MarketProcessor        = marketProcessor;
     this.SubscriptionRepository = subscriptionRepository;
     this.ProposalRepository     = proposalRepository;
     this.AgreementRepository    = agreementRepository;
     this.RequestorEventMapper   = requestorEventMapper;
     this.DemandMapper           = demandMapper;
     this.OfferMapper            = offerMapper;
 }
        public Task <GetOfferDetailsResponseDto> Handle(GetOfferDetailsRequestDto request, CancellationToken cancellationToken)
        {
            var offer = dbContext.Offer.Include(x => x.Covers).Include(x => x.PolicyHolder).FirstOrDefault(x => x.OfferNumber == request.OfferNumber);

            if (offer == null)
            {
                throw new OfferNotFoundException(request.OfferNumber);
            }

            var response = new GetOfferDetailsResponseDto()
            {
                Offer = OfferMapper.MapOfferToOfferDto(offer)
            };

            return(Task.FromResult(response));
        }
Пример #3
0
 public MarketProviderApiController(IProviderMarketProcessor marketProcessor,
                                    ISubscriptionRepository subscriptionRepository,
                                    IProposalRepository proposalRepository,
                                    IAgreementRepository agreementRepository,
                                    MarketProviderEventMapper providerEventMapper,
                                    OfferMapper offerMapper,
                                    DemandMapper demandMapper,
                                    ILogger <MarketProviderApiController> logger)
 {
     this.MarketProcessor        = marketProcessor;
     this.SubscriptionRepository = subscriptionRepository;
     this.ProposalRepository     = proposalRepository;
     this.AgreementRepository    = agreementRepository;
     this.ProviderEventMapper    = providerEventMapper;
     this.OfferMapper            = offerMapper;
     this.DemandMapper           = demandMapper;
     this._logger = logger;
 }
Пример #4
0
 public OfferDataAccess()
 {
     _offerMapper = new OfferMapper();
 }