Files
backend/src/invite-user/dtos/add.invite-user.dto.ts

84 lines
1.7 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import {
ArrayMinSize,
IsArray,
IsNotEmpty,
IsOptional,
IsString,
} from 'class-validator';
export class AddUserInvitationDto {
@ApiProperty({
description: 'The first name of the user',
example: 'John',
required: true,
})
@IsString()
@IsNotEmpty()
public firstName: string;
@ApiProperty({
description: 'The last name of the user',
example: 'Doe',
required: true,
})
@IsString()
@IsNotEmpty()
public lastName: string;
@ApiProperty({
description: 'The email of the user',
example: 'OqM9A@example.com',
required: true,
})
@IsString()
@IsNotEmpty()
public email: string;
@ApiProperty({
description: 'The job title of the user',
example: 'Software Engineer',
required: false,
})
@IsString()
@IsOptional()
public jobTitle?: string;
@ApiProperty({
description: 'The phone number of the user',
example: '+1234567890',
required: false,
})
@IsString()
@IsOptional()
public phoneNumber?: string;
@ApiProperty({
description: 'The role uuid of the user',
example: 'd290f1ee-6c54-4b01-90e6-d701748f0851',
required: true,
})
@IsString()
@IsNotEmpty()
public roleUuid: string;
@ApiProperty({
description: 'The project uuid of the user',
example: 'd290f1ee-6c54-4b01-90e6-d701748f0851',
required: true,
})
@IsString()
@IsNotEmpty()
public projectUuid: string;
@ApiProperty({
description: 'The array of space UUIDs (at least one required)',
example: ['b5f3c9d2-58b7-4377-b3f7-60acb711d5d9'],
required: true,
})
@IsArray()
@ArrayMinSize(1)
public spaceUuids: string[];
constructor(dto: Partial<AddUserInvitationDto>) {
Object.assign(this, dto);
}
}