That is bad, avoid bringing any kind of logic to your DB / queries etc. It's harder to test as just integration and acceptance tests can get it, they are slow and costly.

Abstract the logic into domain layer and cover with unit test, it's the way to go.

Rodrigo Farias Rezino
Rodrigo Farias Rezino

Written by Rodrigo Farias Rezino

Writing code for more than 20 years and still learning every day.

Responses (1)