import { ApiProperty } from '@nestjs/swagger';
import { PublicGoodDto } from './public-good.dto';

export class PublicGoodDetailDto extends PublicGoodDto {
  @ApiProperty({ nullable: true })
  productCode!: string | null;

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

  @ApiProperty({ nullable: true })
  productionCycleHours!: number | null;

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

  @ApiProperty({ type: Object })
  details!: Record<string, string | null>;

  @ApiProperty({ nullable: true, type: Object })
  media!: Record<string, unknown> | null;

  @ApiProperty({ nullable: true, type: Object })
  options!: Record<string, unknown> | null;

  @ApiProperty({ nullable: true, type: Object })
  sizeChart!: Record<string, unknown> | null;

  @ApiProperty({ nullable: true, type: Object })
  packageSpecs!: Record<string, unknown> | null;

  @ApiProperty({ type: Array })
  variants!: Array<{
    id: string;
    sku: string;
    sizeId: string | null;
    sizeName: string | null;
    colorId: string | null;
    colorName: string | null;
    colorHex: string | null;
    imageUrl: string | null;
    price: string | null;
    originalPrice: string | null;
    weightG: string | null;
    boxLengthCm: string | null;
    boxWidthCm: string | null;
    boxHeightCm: string | null;
    enabled: boolean;
    sortOrder: number;
  }>;

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

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

  @ApiProperty()
  groupName!: string;

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

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

  @ApiProperty()
  sortOrder!: number;

  @ApiProperty({ type: Array })
  tags!: Array<{
    id: string;
    tagName: string;
    tagColor: string | null;
    tagFontColor: string | null;
    sortOrder: number;
    productCount: number;
  }>;
}
