Files
mtusi2026lab2-fork/src/User/user.schema.ts
T

29 lines
686 B
TypeScript

import { ApiProperty } from '@nestjs/swagger';
export class CreateUserDto {
@ApiProperty({ example: 'alice', pattern: '^[a-z0-9_]{3,32}$' })
username!: string;
@ApiProperty({ example: 'Алиса', maxLength: 100 })
display_name!: string;
@ApiProperty({
writeOnly: true,
minLength: 12,
maxLength: 128,
example: 'Example-only-not-a-real-secret-123',
})
password!: string;
}
export class User {
@ApiProperty({ format: 'uuid' })
id!: string;
@ApiProperty({ pattern: '^[a-z0-9_]{3,32}$' })
username!: string;
@ApiProperty({ minLength: 1, maxLength: 100 })
display_name!: string;
@ApiProperty({ format: 'date-time' })
created_at!: string;
}