private Claim AddAttachmentsAndCosts(Claim claim)
        {
            var fetchClaimRequest = new FetchClaimByClaimIdRequest(claim.ClaimId, this.fetchAttachmentAndCostsFlags);

            var claimWithAttachmentAndCosts = this.mediator.Send(fetchClaimRequest, this.cancellationToken).Result;

            return(claimWithAttachmentAndCosts);
        }
Example #2
0
        public async Task <GetClaimByClaimIdApiResponseModel> Handle(GetClaimByClaimIdApiRequest request, CancellationToken cancellationToken)
        {
            var fetchClaimRequest = new FetchClaimByClaimIdRequest(request.ClaimId,
                                                                   FetchClaimRequestFlags.WithClaimAttachments |
                                                                   FetchClaimRequestFlags.WithClaimCosts |
                                                                   FetchClaimRequestFlags.WithClaimCostAttachments);

            var claim = await this.mediator.Send(fetchClaimRequest);

            if (claim == null)
            {
                return(null);
            }

            var mapper = this.mapperFactory.GetMapper <Claim, ClaimApiModel>();

            var claimCostAttachmentApiModel = mapper.Map(claim);

            return(new GetClaimByClaimIdApiResponseModel
            {
                Claim = claimCostAttachmentApiModel
            });
        }