public void UpdateClaimStatus(Guid claimId, Guid statusId) { var claim = GetClaimInteractor.GetById(claimId); var status = GetStatusInteractor.GetById(statusId); UpdateClaimInteractor.UpdateStatus(claim, status); }
public ClaimDomainModel StartClaim(Guid policyId) { var policy = GetPolicyInteractor.GetById(policyId); var openStatus = GetStatusInteractor.GetByName("New"); if (policy == null) { throw new ArgumentException("There is no policy for that ID."); } var existingClaimEntity = GetClaimInteractor.GetById(policyId); if (existingClaimEntity != null) { return(new ClaimDomainModel(existingClaimEntity)); } else { var newClaimEntity = CreateClaimInteractor.Execute(policyId, openStatus.Id); newClaimEntity.Status = GetStatusInteractor.GetById(newClaimEntity.StatusId); newClaimEntity.Policy = policy; return(new ClaimDomainModel(newClaimEntity)); } }
public ClaimDomainModel GetById(Guid id) { var claim = GetClaimInteractor.GetById(id); if (claim == null) { throw new ArgumentException("Claim does not exist"); } return(GetCustomerNameForClaim(claim)); }
public ClaimDomainModel ViewClaim(Guid policyId) { var policy = GetPolicyInteractor.GetById(policyId); if (policy == null) { throw new ArgumentException("There is no policy for that ID."); } var existingClaim = GetClaimInteractor.GetById(policyId); return(GetCustomerNameForClaim(existingClaim)); }
public void GetById_BadClaimId_ReturnsNull() { // Arrange var claimRepo = CreateMockListClaimRepo(); var storedClaim = CreateNewClaim(); claimRepo.Create(storedClaim); var nonexistingClaimId = Guid.NewGuid(); GetClaimInteractor interactor = CreateInteractor(claimRepo); // Act var result = interactor.GetById(nonexistingClaimId); // Assert result.ShouldBe(null); }