public IActionResult GetByCustomerId(int customerId) { var result = _findeksScoreService.GetByCustomerId(customerId); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
private IResult CheckFindeksScore(Rental rental) { var car = _carService.GetById(rental.CarId).Data; var findeks = _findeksScoreService.GetByCustomerId(rental.CustomerId).Data; if (findeks == null) { return(new ErrorResult(Messages.FindeksScoreNotFound)); } if (findeks.Score < car.FindeksScore) { return(new ErrorResult(Messages.FindeksScoreInsufficient)); } return(new SuccessResult()); }