import 'server-only'; import { NextResponse } from 'next/server'; import Model, { ModelError } from './model'; import Location from './location'; import Pagination from './helpers/pagination'; import type { HestiaPropertyData, PropertySearchParams, PropertyLink, SimilarPropertiesSearchParams, DBAPIPropertyData, PropertyHestiaSearchParams, RoomDetail } from './property.types'; import Branch from './branch'; import AgencyEmployee from './agency-employee'; import CalendarEvent from './calendar-event'; export * from './property.types'; export default class Property extends Model { static pagination: Pagination | undefined; /** * Find a single property by ID. * * @example * ```ts * const { result, errors } = await Property.findById(12345); * ``` */ static findById(id: string | number): Promise<{ result: Property | null; errors: ModelError[] | null; }>; /** * Find a property from search params. * * @example * ```ts * const { result, errors } = await Property.findOne({ searchableKeyword: 'ABC123' }); * ``` */ static findOne(params?: Partial): Promise<{ result: Property | null; errors: ModelError[] | null; }>; /** * Find multiple properties based on an array of ids. * * @example * ```ts * const results = await Property.findByIds([123,456,789]); * ``` */ static findByIds(params: string[]): Promise>; /** * Find all properties matching given search params. * * @example * ```ts * const { results, errors, pagination } = await Property.findAll({ minBeds: 3, maxPrice: 500000 }); * ``` */ static findAll(params?: PropertySearchParams): Promise<{ results: Property[]; pagination: Pagination | null; errors: ModelError[] | null; }>; /** * Perform a full property search after retrieving location data when required. * * @example * ```ts * const { results, errors, pagination } = await Property.search({ search, location: 'taunton', county: 'somerset' }); * ``` */ static search({ search, location, county, postcode, branch, page, pageSize, fields, }: { search: any; location?: string; county?: string; postcode?: string; branch?: string; page?: number | string; pageSize?: number | string; fields?: string[]; }): Promise<{ results: Property[]; pagination: Pagination | null; errors: ModelError[] | null; } | { results: never[]; pagination: null; errors: { message: string; }[]; }>; static branchProperties({ search, branchSlug, page, pageSize, }: { search: any; branchSlug: string; page?: number | string; pageSize?: number | string; }): Promise<{ results: Property[]; pagination: Pagination | null; errors: ModelError[] | null; }>; /** * Perform a similar properties search on a passed property and search params * * @example * ```ts * const similarPropertiesParams = { * percentage: 50, * minBedrooms: 2, * maxBedrooms: 5, * }; * * const { results, errors } = await property.similarProperties({ * params: similarPropertiesParams, * limit: 12, * }); * * ``` */ similarProperties({ params, limit, }: { params: SimilarPropertiesSearchParams; limit: number; }): Promise<{ errors: ModelError[] | null; results: Property[]; }>; /** * Perform a search to find recently sold properties near this property * * @example * ```ts * const { results, errors } = await property.recentlySold({ * limit: 12, * }); * ``` */ recentlySold({ limit }: { limit: number; }): Promise<{ errors: { message: string; }[]; results?: undefined; } | { errors: ModelError[] | { message: string; }[] | null; results: Property[]; }>; get id(): number | null; /** * The channel will be either 'sales' or 'lettings'. */ get primaryChannel(): 'sales' | 'lettings' | null; get displayAddress(): string | null; get roadName(): string | null; get description(): string | null; get shortDescription(): string | null; get contactTelephone(): string | null; get propertyType(): string | null; get mainPhoto(): string | null; get agencyLogo(): string | null; get agencyName(): string | null; get agencyId(): number | null; get agencyExternalDomain(): string | null; get agencyBranchName(): string | null; get agencyBranchLabel(): string | null; get photos(): string[] | null; get metaAddress2(): string | null; get metaAddress3(): string | null; get metaOpenHouseEvents(): { start: string; end: string; }[] | null; get virtualTours(): PropertyLink[] | null; get status(): string | null; get floorplans(): string[] | null; get epcCharts(): string[] | null; get epcClassification(): string | null; get brochures(): string[] | null; get imageOnlyBrochures(): string[] | null; get branchId(): number | null; get town(): string | null; get bedrooms(): number | null; get bathrooms(): number | null; get buildingName(): string | null; get county(): string | null; get receptionRooms(): number | null; get features(): string[] | null; get postcode(): string | null; get roomDetails(): RoomDetail | null; /** * The property price as a string, including currency symbol and qualifiers * e.g '£950 pcm' or 'Guide price £350,000' */ get price(): string | null; get priceValue(): number | null; /** * The price without any qualifier */ get priceWithoutQualifier(): string | null; /** * The price formatted as a curreny string, eg `£350,000` without a qualifier */ get formattedPrice(): string | null; get priceQualifierFull(): string | null; get priceQualifier(): string | null; get lat(): number | null; get lng(): number | null; get createdAt(): string | null; get tags(): string[]; get childProperties(): HestiaPropertyData[] | null; get hasChildProperties(): boolean; get childPropertiesBedroomsRange(): { min: number; max: number; } | null; get childPropertiesPriceRange(): { min: number; max: number; } | null; get childPropertiesBathroomsRange(): { min: number; max: number; } | null; get childPropertyTypes(): string | null; get searchableKeyword(): string | null; get councilTaxBand(): string | null; get councilTaxExempt(): boolean | null; get tenure(): string | null; get annualGroundRent(): string | null; get groundRentReviewDate(): string | null; get groundRentReviewPeriodYears(): string | null; get groundRentPercentageIncrease(): string | null; get annualServiceCharge(): string | null; get tenureUnexpiredYears(): string | null; get sharedOwnership(): boolean | null; get sharedOwnershipPercentage(): string | null; get sharedOwnershipRent(): string | null; get sharedOwnershipRentFrequency(): string | null; get minimumTerm(): number | null; get isAvailable(): boolean; get featured(): boolean; get availableOn(): string | null; get furnished(): boolean | null; get partFurnished(): boolean | null; get unfurnished(): boolean | null; get securityDeposit(): string | null; get squareFeet(): number | null; get squareFeetInternal(): number | null; get salesPriceTooltipContent(): string; get lettingsPriceTooltipContent(): string; get tenureTooltipContent(): string; get councilTaxBandTooltipContent(): string; get ratesPayableTooltipContent(): string; get depositTooltipContent(): string; get leaseLengthTooltipContent(): string; get annualServiceChargeTooltipContent(): string; get groundRentTooltipContent(): string; get groundRentReviewPeriodTooltipContent(): string; get sharedOwnershipPercentageTooltipContent(): string; get sharedOwnershipRentTooltipContent(): string; get commonholdDetailsTooltipContent(): string; get furnishingTooltipContent(): string; get availableOnTooltipContent(): string; get sizeTooltipContent(): string; get useClassTooltipContent(): string; get minimumTermTooltipContent(): string; get urlLabel(): string | null; get urlLabelWithKeyword(): string | null; get videos(): PropertyLink[] | null; get facets(): Record[] | null; getBranch(): Promise; getStaffProfiles(): Promise; getNearestLocation(): Promise; getEvents(): Promise; get orderedFutureEvents(): CalendarEvent[] | null; } //# sourceMappingURL=property.d.ts.map