import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator';

export class LoginDto {
  @ApiProperty({ example: '12345678', description: 'Usuario (RUC o username)' })
  @IsNotEmpty({ message: 'Usuario es obligatorio' })
  usuario: string;

  @ApiProperty({ example: '123456', description: 'Password' })
  @IsNotEmpty({ message: 'Password es obligatorio' })
  password: string;
}

export class LoginRefreshDto {
  @ApiProperty({ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6...', description: 'Refresh token' })
  @IsNotEmpty({ message: 'Refresh token es obligatorio' })
  refresh_token: string;
}

export class LoginLogoutDto {
  @ApiProperty({ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6...', description: 'Refresh token' })
  @IsNotEmpty({ message: 'Refresh token es obligatorio' })
  refresh_token: string;
}

export type LoginUserInfo = {
  id: string;
  username: string;
  empresa_id: string;
};
