User entity
We shall now create the User entity, defining its class and attributes.
Now that we have our project configured, we can start marching towards our main objective - developing our shop backend system. Let's create the User
resource. We shall do so inside the domain folder, to group domain's entities together.
The nest resource includes:
The entity class
DTOs for creating and updating an entity
A module to encapsulate this context
A controller with the basic routes for this entity
A service with the logic for the routes
Automated tests
But right now, we should focus on the entity class. So let's go to src/domain/users/entities/user.entity.
Inside the class, we will insert the entity's attributes.
After that, we should copy all these fields (except id
) and paste them in the create-user.dto file located in the dto folder inside users. This process will be necessary for the next lesson.
Commit - Creating the first entity
Last updated