Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "properties" ADD COLUMN "virtual_tour_url" TEXT;
ALTER TABLE "properties" ADD COLUMN "video_url" TEXT;
8 changes: 5 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@ model Property {
neighborhoodId String? @map("neighborhood_id")
latitude Float?
longitude Float?
features String[] // Array of features (pool, garage, etc.)
features String[] // Array of features (pool, garage, etc.)
virtualTourUrl String? @map("virtual_tour_url")
videoUrl String? @map("video_url")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
viewCount Int @default(0) @map("view_count")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")

// Relations
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
Expand Down
22 changes: 21 additions & 1 deletion src/properties/dto/property.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsString, IsNumber, IsOptional, IsArray, IsIn } from 'class-validator';
import { IsString, IsNumber, IsOptional, IsArray, IsIn, IsUrl } from 'class-validator';
import { InputType, Field, Float } from '@nestjs/graphql';

export const PROPERTY_STATUS_ENUM = [
Expand Down Expand Up @@ -91,6 +91,16 @@ export class CreatePropertyDto {
@IsOptional()
@IsNumber()
longitude?: number;

@Field({ nullable: true })
@IsOptional()
@IsUrl()
virtualTourUrl?: string;

@Field({ nullable: true })
@IsOptional()
@IsUrl()
videoUrl?: string;
}

import { PropertyStatus } from '../../common/common.types';
Expand Down Expand Up @@ -182,4 +192,14 @@ export class UpdatePropertyDto {
@IsOptional()
@IsNumber()
longitude?: number;

@Field({ nullable: true })
@IsOptional()
@IsUrl()
virtualTourUrl?: string;

@Field({ nullable: true })
@IsOptional()
@IsUrl()
videoUrl?: string;
}
6 changes: 6 additions & 0 deletions src/properties/models/property.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export class Property {
@Field(() => [String])
features: string[];

@Field({ nullable: true })
virtualTourUrl?: string;

@Field({ nullable: true })
videoUrl?: string;

@Field()
createdAt: Date;

Expand Down