public void MakeRequestOffer(Guid requestId, RequestOfferDto requestOfferDto) { Guard.ArgNotEmpty(requestId, nameof(requestId)); Guard.ArgNotEmpty(requestOfferDto, nameof(requestOfferDto)); IIdentity requestIdentity = requestId.ToIdentity(); ProductRequest productRequest = requestRepository.GetEntityById(requestIdentity); if (productRequest == null) { throw new Exception("Product request not found"); } RequestOffer requestOffer = new RequestOffer(requestOfferDto.Price); productRequest.MakeRequestOffer(requestOffer); requestRepository.Update(productRequest); }
public IActionResult PostRequestOffer(Guid requestId, [FromBody] RequestOfferDto requestOfferDto) { productRequestService.MakeRequestOffer(requestId, requestOfferDto); return(Ok()); }