Currently, the Chat model used to represent a chat in the service's business logic is also used to unmarshal data records. This implies that database fields have to have the same names than the ones defined in the service model.
A possible solution would be to add struct tags to the Chat model so that the records are parsed correctly. However, that would mean adding repository-specific details to a logic model. Ideally, both should be fully decoupled, even if that implies implementing parsing routines to translate between them.
Currently, the
Chatmodel used to represent a chat in the service's business logic is also used to unmarshal data records. This implies that database fields have to have the same names than the ones defined in the service model.A possible solution would be to add struct tags to the
Chatmodel so that the records are parsed correctly. However, that would mean adding repository-specific details to a logic model. Ideally, both should be fully decoupled, even if that implies implementing parsing routines to translate between them.