Closed nazrinharris closed 1 year ago
Should also consider having the enforcement in the Account
data class itself. This kind of logic seems more appropriate there
Here's an idea. Maybe have a ValueValidator
kinda object, where it checks if the description
is an empty String an turns it into null.
Then, update the local ds methods to receive an AccountDTO
rather than parameters. So the flow of it will be like this.
Account
entity.Account
into an AccountDTO
.This wouldn't be that major of a change, because the local ds is technically taking the parameters and converting it to a DTO before inserting it to the table.
Did an epic. Because I changed the logic in the Account
data class to essentially have a Description
ValueObject
, I barely need to change any of the repo, local_ds or the dao code. Just a minor change to the fromDTO
and toDTO
. Lovely.
Should be completed with 3c5ad7e in #14
Or more specifically,
Value.absent
when kept in the database, but setting as null should make drift put it asValue.absent
. Right now, description is stored as an empty string, which is undesired.Deed