import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class BlogTranslationResponseDto {
  @ApiProperty({ example: 1 })
  translationId: number;

  @ApiProperty({ example: 1 })
  blogId: number;

  @ApiProperty({ example: 'en' })
  language: string;

  @ApiProperty({ example: 'My First Blog Post' })
  title: string;

  @ApiProperty({ example: '# Introduction\n\nThis is my first blog post.' })
  content: string;
}

export class IBlogResponseDto {
  @ApiProperty({ example: 1 })
  blogId: number;

  @ApiProperty({ example: false })
  isPublished: boolean;

  @ApiPropertyOptional({ example: ['technology', 'programming'] })
  tags?: string[];

  @ApiPropertyOptional({ example: 'https://example.com/image.jpg' })
  featuredImageUrl?: string;

  @ApiProperty({ example: 0 })
  viewCount: number;

  @ApiProperty({ type: [String] })
  authorNames: string[];

  @ApiProperty({ example: 'slug' })
  slug: string;

  @ApiProperty({ type: [BlogTranslationResponseDto] })
  translations: BlogTranslationResponseDto[];

  @ApiProperty({ example: '2025-03-12T10:00:00.000Z' })
  createdAt: Date;

  @ApiProperty({ example: '2025-03-12T10:00:00.000Z' })
  updatedAt: Date;
}

export class IBlogPaginationMeta {
  @ApiProperty({ example: 1 })
  page: number;

  @ApiProperty({ example: 10 })
  limit: number;

  @ApiProperty({ example: 1 })
  total: number;

  @ApiProperty({ example: 1 })
  totalPages: number;
}

export class IBlogResponsePaginationDto {
  @ApiProperty({ type: [IBlogResponseDto] })
  data: IBlogResponseDto[];

  @ApiProperty({ type: IBlogPaginationMeta })
  pagination: IBlogPaginationMeta;
}
