title: How to transform input data with NestJS and TypeORM
body: <p>I want to create functionality where I can transform incoming data before it hits the database. Let's say that we want to make sure that when a new user is created, the firstName and lastName attribute values are always starting with a capital letter. Or another great example is to prevent login issues and store email addresses always in lowercase letters.</p>
  <p>I've taken a look at the pipe documentation of NestJS but it's too generic. I want to be able to specify which fields need transformation and I don't want to create a pipe for each attribute or endpoint that needs transformation.</p>
  <p>I've also tried the @Transform decorator form the 'class-transformer' package but this doesn't seem to work.</p>
  <pre><code>export class UserRoleCreateDto {
    @IsDefined()
    @IsString()
    @IsNotEmpty()
    @Transform((name) =&gt; name.toUpperCase())
    readonly name;
  }
  </code></pre>
  <p>The expected result should be the name in uppercase letters but it's not.</p>
  <p>Anyone any ideas or examples on how to implement proper input transformation for NestJS / TypeORM before it hits the database?</p>
  <p>Thanks for your time!</p>