public async Task <SalesResponse> DeleteAsync(int id) { try { var existingSales = await _salesRepository.FindByIdAsync(id); if (existingSales == null) { return(new SalesResponse("Sales Transaction Not Found")); } existingSales.DeletedBy = _requestContext.UserId ?? 0; _salesRepository.Remove(existingSales); return(new SalesResponse(existingSales)); } catch (Exception ex) { return(new SalesResponse($"An error occurred when deleting the Sales Transaction: {ex.Message}")); } }