public async Task <Offer> AssignOffer(OfferType offerType, IOfferValueCalculator offerValueCalculator) { var value = await offerValueCalculator.Calculate(this, offerType); var offer = new Offer(this, offerType, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return(offer); }
public OfferAssignmentService( IMemberRepository memberRepository, IOfferTypeRepository offerTypeRepository, IOfferValueCalculator offerValueCalculator, IOfferRepository offerRepository ) { _memberRepository = memberRepository; _offerTypeRepository = offerTypeRepository; _offerValueCalculator = offerValueCalculator; _offerRepository = offerRepository; }
public Offer AssignOffer(OfferType offerType, IOfferValueCalculator valueCalculator) { DateTime dateExpiring = offerType.CalculateExpirationDate(); int value = valueCalculator.CalculateValue(this, offerType); var offer = new Offer(this, offerType, dateExpiring, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return(offer); }
public Offer AssignOffer(OfferType offerType, IOfferValueCalculator valueCalculator) { DateTime dateExpiring = offerType.CalculateExpirationDate(); int value = valueCalculator.CalculateValue(this, offerType); var offer = new Offer(this, offerType, dateExpiring, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return offer; }
public Offer AssignOffer(OfferType offerType, IOfferValueCalculator offerValueCalulator) { var value = offerValueCalulator.CalculateValue(this, offerType); var dateExpiring = offerType.ExpirationType.GetDateExpiring(offerType); var offer = new Offer(this, offerType, dateExpiring, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return offer; }
public Offer AssignOffer(OfferType offerType, IOfferValueCalculator offerValueCalulator) { var value = offerValueCalulator.CalculateValue(this, offerType); var dateExpiring = offerType.ExpirationType.GetDateExpiring(offerType); var offer = new Offer(this, offerType, dateExpiring, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return(offer); }
public AssignOfferHandler( AppDbContext appDbContext, IOfferValueCalculator offerValueCalculator) { _appDbContext = appDbContext; _offerValueCalculator = offerValueCalculator; }