Put in order · NestJS course · Module 3: TypeORM and Databases

Data validation layers in NestJS

Arrange the data validation layers from outermost to innermost:

Items to put in order

  • Validation at the TypeORM entity level
  • DTO with class-validator decorators (controller layer)
  • Validation in service business logic
  • Database constraints (UNIQUE, NOT NULL, CHECK)

You can check the correct answer by solving this task in the CodeWorlds game.