コード例 #1
0
        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);
        }
コード例 #2
0
        public IActionResult PostRequestOffer(Guid requestId, [FromBody] RequestOfferDto requestOfferDto)
        {
            productRequestService.MakeRequestOffer(requestId, requestOfferDto);

            return(Ok());
        }