public async Task <IActionResult> PayDebt(DebtPayDTO model) { try { await _debtService.DebtPayAsync(model); return(Ok()); } catch (DbUpdateConcurrencyException) { return(BadRequest(new { Message = "The record you attempted to edit was modified by another user after you got the original value" })); } catch (UnauthorizedAccessException) { return(Unauthorized()); } catch (Exception e) { return(BadRequest(new { e.Message })); } }