Description
I'm fetching some data from 3rd party library to access their API.
For example, i created two use cases(FetchUserList and FetchUserDetail) to fetch user list and user detail.
The user list will be displayed in recycler view but only the user name part. And in user detail view, user name and company name will be displayed.
The model received from the server(API model, as in the library) as follow:
class User {
String name;
Int companyId;
...
}
class Company {
Int id;
String companyName;
...
}
What model should i create in my domain layer?
Should i create two models, one for the fetch user list use case and another one for fetch detail use case?
Seems the result model will be dictated by the view, in recycler view i don't need company name(exclude unnecessary data), but in the detail view i need to display more data.
I'm thinking something like below, but in the user list view case i do not need the Company
data
class UserModel {
String name;
Company company;
}
What would you suggest?
Thank you.