Best practice for converting DTO to Entity when DTO is a plain object with partial fields of the Entity
I’m building an API with Express.js, TypeScript, and Mongoose, and I’m aiming for industry best practices. I have a UserEntity with required fields like id, but during creation, Mongoose automatically generates the id. I don’t want to make a workaround by marking the id optional, and creating separate entities for each operation (e.g. UserCreateEntity, UserUpdateEntity, etc.) seems excessive.