import { type PropertyType, type TransactionType, type Direction, type Furnishing, type PropertyCondition } from '@prisma/client';

/**
 * Optional "rich" property fields. Bundled so the command constructor does
 * not grow unbounded each time we add a field.
 */
export interface PropertyExtras {
  furnishing?: Furnishing;
  propertyCondition?: PropertyCondition;
  balconyDirection?: Direction;
  maintenanceFeeVND?: bigint;
  parkingSlots?: number;
  viewType?: string[];
  petFriendly?: boolean;
  suitableFor?: string[];
  whyThisLocation?: string;
}

export class CreateListingCommand {
  constructor(
    public readonly sellerId: string,
    public readonly transactionType: TransactionType,
    public readonly priceVND: bigint,
    // Property details
    public readonly propertyType: PropertyType,
    public readonly title: string,
    public readonly description: string,
    public readonly address: string,
    public readonly ward: string,
    public readonly district: string,
    public readonly city: string,
    public readonly latitude: number,
    public readonly longitude: number,
    public readonly areaM2: number,
    // Optional property fields
    public readonly usableAreaM2?: number,
    public readonly bedrooms?: number,
    public readonly bathrooms?: number,
    public readonly floors?: number,
    public readonly floor?: number,
    public readonly totalFloors?: number,
    public readonly direction?: Direction,
    public readonly yearBuilt?: number,
    public readonly legalStatus?: string,
    public readonly amenities?: unknown,
    public readonly nearbyPOIs?: unknown,
    public readonly metroDistanceM?: number,
    public readonly projectName?: string,
    // Optional listing fields
    public readonly agentId?: string,
    public readonly rentPriceMonthly?: bigint,
    public readonly commissionPct?: number,
    // Rich property fields bundled as options object (keeps ctor scalable)
    public readonly extras?: PropertyExtras,
  ) {}
}
