import { ApiProperty } from "@nestjs/swagger";
import { IsString, MinLength } from "class-validator";

export class CreateLoginDto {
  @ApiProperty({
    description: "nombre de usuario",
    example: "usuario@gmail.com"
  })
  @IsString()
  email: string;

  @ApiProperty({
    description: "contraseña del usuario",
    example: "Contrasenia$$124!"
  })
  @MinLength(1)
  contrasena: string;
}



export class SwaggerLoginResponseDto {
  @ApiProperty({ type: CreateLoginDto })
  user: CreateLoginDto;

  @ApiProperty({
    example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTU3LCJpYXQi',
  })
  token: string;
}