import { ApiProperty } from '@nestjs/swagger';
import type { Country as PrismaCountry } from '@prisma/client';

export class PublicCountryDto {
  @ApiProperty()
  id!: string;

  @ApiProperty()
  countryName!: string;

  @ApiProperty({ nullable: true })
  countryIcon!: string | null;

  static from(country: PrismaCountry): PublicCountryDto {
    return {
      id: country.id.toString(),
      countryName: country.countryName,
      countryIcon: country.countryIcon,
    };
  }
}
