mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
35 lines
779 B
TypeScript
35 lines
779 B
TypeScript
import { ApiProperty, OmitType } from "@nestjs/swagger";
|
|
import {
|
|
IsJWT,
|
|
IsMongoId,
|
|
IsString,
|
|
MaxLength,
|
|
MinLength,
|
|
} from "class-validator";
|
|
|
|
export class UserDto {
|
|
@ApiProperty({ description: "Идентификатор (ObjectId)" })
|
|
@IsMongoId()
|
|
id: string;
|
|
@ApiProperty({ example: "n08i40k", description: "Имя" })
|
|
@IsString()
|
|
@MinLength(4)
|
|
@MaxLength(10)
|
|
username: string;
|
|
@ApiProperty({ description: "Соль пароля" })
|
|
@IsString()
|
|
salt: string;
|
|
@ApiProperty({ description: "Хеш пароля" })
|
|
@IsString()
|
|
password: string;
|
|
@ApiProperty({ description: "Последний токен доступа" })
|
|
@IsJWT()
|
|
access_token: string;
|
|
}
|
|
|
|
export class ClientUserDto extends OmitType(UserDto, [
|
|
"password",
|
|
"salt",
|
|
"access_token",
|
|
]) {}
|