import { IsEmail, IsEnum, IsString, MinLength } from 'class-validator';
import { ErrorCode } from '../../../common/errors';

export class AcceptOrganizationInviteDto {
  @IsString()
  @MinLength(1, { message: ErrorCode.VALIDATION_TOKEN_REQUIRED })
  token: string;

  @IsString()
  @MinLength(2, { message: ErrorCode.VALIDATION_ORGANIZATION_NAME_REQUIRED })
  organizationName: string;

  @IsEmail({}, { message: ErrorCode.VALIDATION_EMAIL_INVALID })
  organizationEmail: string;

  @IsEnum(['CLINIC', 'LAB'], { message: ErrorCode.VALIDATION_ORGANIZATION_TYPE_INVALID })
  organizationType: 'CLINIC' | 'LAB';

  @IsString()
  @MinLength(2, { message: ErrorCode.VALIDATION_NAME_TOO_SHORT })
  ownerName: string;

  @IsString()
  @MinLength(8, { message: ErrorCode.VALIDATION_PASSWORD_TOO_SHORT })
  password: string;
}
