This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c929153
commit 5e6d691
Showing
2 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,76 @@ | ||
import { IsEmail, IsString, MinLength } from 'class-validator'; | ||
import { | ||
IsBoolean, | ||
IsEmail, | ||
IsIn, | ||
IsLocale, | ||
IsNotEmpty, | ||
IsObject, | ||
IsOptional, | ||
IsString, | ||
IsUrl, | ||
Length, | ||
MinLength, | ||
} from 'class-validator'; | ||
|
||
export class RegisterDto { | ||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(3) | ||
name: string; | ||
|
||
@IsEmail() | ||
@IsNotEmpty() | ||
email: string; | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
checkLocationOnLogin: boolean; | ||
|
||
@IsString() | ||
@MinLength(3) | ||
name: string; | ||
@Length(2, 2) | ||
@IsOptional() | ||
countryCode: string; | ||
|
||
@IsString() | ||
@IsIn(['MALE', 'FEMALE', 'NONBINARY', 'UNKNOWN']) | ||
@IsOptional() | ||
gender: 'MALE' | 'FEMALE' | 'NONBINARY' | 'UNKNOWN'; | ||
|
||
@IsIn(['ACCOUNT', 'UPDATES', 'PROMOTIONS']) | ||
@IsOptional() | ||
notificationEmails: 'ACCOUNT' | 'UPDATES' | 'PROMOTIONS'; | ||
|
||
@IsString() | ||
@IsOptional() | ||
password: string | null; | ||
|
||
@IsLocale() | ||
@IsOptional() | ||
prefersLanguage: string; | ||
|
||
@IsString() | ||
@IsIn(['NO_PREFERENCE', 'LIGHT', 'DARK']) | ||
@IsOptional() | ||
prefersColorScheme: 'NO_PREFERENCE' | 'LIGHT' | 'DARK'; | ||
|
||
@IsString() | ||
@IsIn(['NO_PREFERENCE', 'REDUCE']) | ||
@IsOptional() | ||
prefersReducedMotion: 'NO_PREFERENCE' | 'REDUCE'; | ||
|
||
@IsUrl() | ||
@IsOptional() | ||
profilePictureUrl: string; | ||
|
||
@IsString() | ||
@IsOptional() | ||
timezone: string; | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
twoFactorEnabled: boolean; | ||
|
||
@IsObject() | ||
@IsOptional() | ||
attributes: Record<string, any>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters