public QuoteSummaryVm CalculateQuote(CalculateQuoteModel model) { //Todo: need to have data driven engine here for calculating prices //Todo: The menu needs to have a 1 to many relationship with GuestNumberTypes (new table) //Todo: which is linked to each menu by venue also and has a calculation factor for price reductions //Todo: for now this is being hard coded var returnModel = new QuoteSummaryVm(); var package = _priceTariffManager.GetPackage(model.WeddingDate, model.VenueId); //returnModel.VenueName = package. returnModel.VenuePrice = package.Price; returnModel.VenueName = _venueManager.GetVenue(model.VenueId).name; returnModel.WeddingDate = model.WeddingDate; foreach (var sectionId in model.MenuSections) { var menu = _menuManager.GetMenu(sectionId); switch (menu.Id) { case 1: menu.Price = CalculateBreakfast(menu.Price, model.AdultNumbers, model.TeenNumbers, model.ChildNumbers); break; case 2: menu.Price = CalculateDrinks(menu.Price, model.AdultNumbers); break; case 3: case 5: menu.Price = CalculateEvening(menu.Price, model.EveningNumbers); break; case 4: menu.Price = CalculateCanape(menu.Price, model.AdultNumbers, model.TeenNumbers); break; } returnModel.Menus.Add(menu); } return(returnModel); }
public IHttpActionResult Post([FromBody] CalculateQuoteModel model) { return(Ok(_quoteManager.CalculateQuote(model))); }