import { ApiProperty } from '@nestjs/swagger';
export class UserDto {
  @ApiProperty({ example: 1 })
  userId: number;

  @ApiProperty({ example: 'Иван' })
  firstName: string;

  @ApiProperty({ example: 'Андреев' })
  lastName: string;

  @ApiProperty({ example: '+79009009090' })
  phone: string;

  @ApiProperty({ example: 'ivan@yachting.ru' })
  email: string;

  @ApiProperty({ example: 'Северный Флот', required: false })
  companyName?: string;

  @ApiProperty({ example: 1234567890, required: false })
  inn?: number;

  @ApiProperty({ example: 1122334455667, required: false })
  ogrn?: number;
}

export class ReviewDto {
  @ApiProperty({ example: 1 })
  id: number;

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

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

  @ApiProperty({ example: 5 })
  starsCount: number;

  @ApiProperty({ example: 'Excellent yacht!' })
  description: string;
}

export class ReservationDto {
  @ApiProperty({ example: 1 })
  id: number;

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

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

  @ApiProperty({ example: 1733097600 })
  startUtc: number;

  @ApiProperty({ example: 1733133600 })
  endUtc: number;
}

export class CatalogItemShortDto {
  @ApiProperty({ example: 1 })
  id?: number;

  @ApiProperty({ example: 'Азимут 55' })
  name: string;

  @ApiProperty({ example: 16.7 })
  length: number;

  @ApiProperty({ example: 32 })
  speed: number;

  @ApiProperty({ example: 85000 })
  minCost: number;

  @ApiProperty({ example: 'api/uploads/1765727362318-238005198.jpg' })
  mainImageUrl: string;

  @ApiProperty({
    type: [String],
    example: ['api/uploads/1765727362318-238005198.jpg'],
  })
  galleryUrls: string[];

  @ApiProperty({ example: true })
  hasQuickRent: boolean;

  @ApiProperty({ example: true })
  isFeatured: boolean;

  @ApiProperty({ required: false, example: '🔥 Лучшее предложение' })
  topText?: string;

  @ApiProperty({ required: false, example: true })
  isBestOffer?: boolean;
}

export class CatalogItemLongDto extends CatalogItemShortDto {
  @ApiProperty({ example: 2022 })
  year: number;

  @ApiProperty({ example: 8 })
  comfortCapacity: number;

  @ApiProperty({ example: 12 })
  maxCapacity: number;

  @ApiProperty({ example: 4.8 })
  width: number;

  @ApiProperty({ example: 3 })
  cabinsCount: number;

  @ApiProperty({ example: 'Стеклопластик' })
  matherial: string;

  @ApiProperty({ example: 1200 })
  power: number;

  @ApiProperty({ example: 'Роскошная моторная яхта...' })
  description: string;

  @ApiProperty({ type: UserDto })
  owner: UserDto;

  @ApiProperty({ type: [ReviewDto] })
  reviews: ReviewDto[];

  @ApiProperty({ type: [ReservationDto] })
  reservations: ReservationDto[];
}
