209 похожих чатов

Export class UpdateUserDto { @ApiProperty({ example: 'test@teameights.com', description: 'Email'

})
@IsString({ message: 'Should be string' })
@IsEmail({}, { message: 'Email is not correct' })
@IsNotEmpty({ message: 'Should not be empty' })
readonly email: string;

@ApiProperty({ example: 'teameights', description: 'Username' })
@IsString({ message: 'Should be string' })
@Length(1, 20, {
message: 'Should be at least 8 and less than 20 characters',
})
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly username: string;

@ApiProperty({ example: 'Nikita Mashchenko', description: 'Full Name' })
@IsString({ message: 'Should be string' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly fullName: string;

@ApiProperty({ example: '17', description: 'Age of user' })
@IsString({ message: 'Should be string' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly age: string;

@ApiProperty({
example: '20 y.o. developer from Ukraine',
description: 'Description of user',
})
@IsString({ message: 'Should be string' })
@IsOptional()
readonly description: string;

@ApiProperty({
example: 'Frontend Developer',
description: 'Concentration of user',
})
@IsString({ message: 'Should be string' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly concentration: string;

@ApiProperty({ example: 'Ukraine', description: 'Country of user' })
@IsString({ message: 'Should be string' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly country: string;

@ApiProperty({
example: '0-1 years',
description: 'How many years of experience user has',
})
@IsString({ message: 'Should be string' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly experience: string;

@ApiProperty({
example: 'true',
description: 'Does user want to be leader of team?',
})
@IsBoolean({ message: 'Should be boolean' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly isLeader: Boolean;

@ApiProperty({
example: {
github: 'https://github.com',
linkedin: 'https://linkedin.com',
instagram: 'https://instagram.com',
telegram: 'https://telegram.com',
},
description: 'Links of the user',
})
@IsObject({ message: 'Should be object' })
@ValidateNested()
@Type(() => LinksUserDto)
@IsOptional()
readonly links: LinksUserDto;

@ApiProperty({
example: ['JS', 'C++'],
description: 'Programming languages',
})
@IsArray({ message: 'Should be array' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsOptional()
readonly programmingLanguages: string[];

@ApiProperty({ example: ['NestJS', 'NodeJS'], description: 'Frameworks' })
@IsNotEmpty({ message: 'Should not be empty' })
@IsArray({ message: 'Should be array' })
@IsOptional()
readonly frameworks: string[];

@ApiProperty({ example: 'UIC', description: 'University (if any)' })
@IsString({ message: 'Should be string' })
@IsOptional()
readonly university: string;

@ApiProperty({
example: 'Computer Science',
description: 'Area of studies of user',
})
@IsString({ message: 'Should be string' })
@IsOptional()
readonly major: string;

@ApiProperty({
example: 'UNIX Date',
description: 'Date when user graudates',
})
@IsString({ message: 'Should be string' })
@IsOptional()
readonly graduationDate: string;
}

2 ответов

64 просмотра

import * as faker from 'faker'; import { UpdateUserDto } from './dto/update-user.dto'; export const generateFakeUpdateUserDto = (): UpdateUserDto => { const dto = new UpdateUserDto(); dto.email = faker.internet.email(); dto.username = faker.internet.userName(); dto.fullName = faker.name.findName(); dto.age = String(faker.datatype.number({ min: 18, max: 65 })); dto.description = faker.lorem.sentence(); dto.concentration = faker.name.jobTitle(); dto.country = faker.address.country(); dto.experience = `${faker.datatype.number({ min: 0, max: 10 })}-${faker.datatype.number({ min: 1, max: 10 })} years`; dto.isLeader = faker.datatype.boolean(); dto.links = { github: faker.internet.url(), linkedin: faker.internet.url(), instagram: faker.internet.url(), telegram: faker.internet.url(), }; dto.programmingLanguages = [faker.random.word(), faker.random.word(), faker.random.word()]; dto.frameworks = [faker.random.word(), faker.random.word()]; dto.university = faker.random.words(2); dto.major = faker.random.words(2); dto.graduationDate = faker.date.future().toISOString(); return dto; };

Nikita-Mashchenko Автор вопроса
Илюша 🎂
import * as faker from 'faker'; import { UpdateUs...

да ток фейкер чекал, лучший, спс

Похожие вопросы

Обсуждают сегодня

@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Hello, Is iExec also part of the "inception program" or another one ? Would it be a name to qualified the nature of the relationship between iExec and Nvidia? And does Secret ...
Ñïķøłäś
8
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
any reference of this implementation?
BitBuddha
29
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Карта сайта