Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should models be handled? #26

Open
sevosevo opened this issue Jul 4, 2019 · 0 comments
Open

How should models be handled? #26

sevosevo opened this issue Jul 4, 2019 · 0 comments

Comments

@sevosevo
Copy link

sevosevo commented Jul 4, 2019

I am creating this project in Typescript.
I saw there are multiple models for the same entity (Product). For example:
-ProductComplete
-ProductDetail
...
Should these models be strictly separate entities (like classes or whatever) or is this
just how the JSON response should look like?
For example, in Sequelize I have a Product model, but that's Sequelize's model. Does it have to do anything with these models?
My question is basically, are these given models just data structures I should follow in terms of JSON response or they should be a separate entity?
I sent the image of my Product model as an example of how my model looks like.
Do I need separate ProductComplete and ProductDetails models?
Now I know this might be a stupid question, obviously, it depends on the design but what's recommended?

I hope you guys understand my question.
Thanks

Capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant