/**
 * 表单翻译 DTOs
 * 完全符合 API 文档规范
 */

import { IsString, IsObject, IsOptional } from 'class-validator';
// import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';  // TODO: Install @nestjs/swagger

// ============================================
// 创建翻译
// ============================================

export class CreateFormTranslationDto {
  // @ApiProperty({
    // description: '语言代码',
    // example: 'en-US',
  // })
  @IsString()
  locale: string;

  // @ApiProperty({
    // description: '翻译内容（键值对 JSON）',
    // example: {
      // title: 'Expense Report',
      // 'fields.amount.label': 'Amount',
      // 'fields.amount.placeholder': 'Enter amount',
    // },
  // })
  @IsObject()
  translations: Record<string, string>;
}

// ============================================
// 更新翻译
// ============================================

export class UpdateFormTranslationDto {
  // @ApiProperty({
    // description: '翻译内容（键值对 JSON）',
    // example: {
      // title: 'Expense Report',
      // 'fields.amount.label': 'Amount',
    // },
  // })
  @IsObject()
  translations: Record<string, string>;
}

// ============================================
// 批量导入翻译
// ============================================

export class BatchImportTranslationsDto {
  // @ApiProperty({
    // description: '翻译数据（按语言分组）',
    // example: {
      // 'zh-CN': {
        // title: '报销申请',
        // 'fields.amount.label': '金额',
      // },
      // 'en-US': {
        // title: 'Expense Report',
        // 'fields.amount.label': 'Amount',
      // },
    // },
  // })
  @IsObject()
  translations: Record<string, Record<string, string>>;

  // @ApiPropertyOptional({
    // description: '是否覆盖已有翻译',
    // default: false,
  // })
  @IsOptional()
  overwrite?: boolean;
}
