data transform and validation.
- 어떻게 검증할까?
- class-validator lib
- 어떤 level로 사용?
- whitelist: any property not included in the whitelist is automatically stripped from the resulting object. (stripped property: this will automatically remove non-whitelisted properties (those without any decorator in the validation class)) → decorator있으면 whitelist
- 어떻게 dto와 entity를 map할까?
- spread operator
- Mapped types
- Partial: make all fields optional.
- Pick: constructs a new type (class) by picking a set of properties
- Omit: removing a particular set of keys.
- Intersection: combines two types into one new type (class).
- Composition: all of the properties except for something, and those properties will be set to optional.