forked from yy0ung/nibobnebob
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : review Info dto 및 entity 구현 #35
- Loading branch information
Showing
5 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { | ||
IsBoolean, | ||
IsString, | ||
IsNotEmpty, | ||
IsInt, | ||
MaxLength, | ||
IsOptional, | ||
MinLength | ||
} from "class-validator"; | ||
|
||
export class ReviewInfoDto { | ||
@ApiProperty({ | ||
example: "true", | ||
description: "The transportation for visiting", | ||
}) | ||
@IsBoolean() | ||
@IsNotEmpty() | ||
visitMethod: boolean; | ||
|
||
@ApiProperty({ example: "0", description: "transportation Accessibility for visiting" }) | ||
@IsInt() | ||
@IsOptional() | ||
@MaxLength(1) | ||
transportationAccessibility: number | null; | ||
|
||
@ApiProperty({ example: "0", description: "condition of the restaurant's parking area" }) | ||
@IsInt() | ||
@IsOptional() | ||
@MaxLength(1) | ||
parkingArea: number | null; | ||
|
||
@ApiProperty({ example: "0", description: "The taste of the food" }) | ||
@IsInt() | ||
@IsNotEmpty() | ||
@MaxLength(1) | ||
taste: number; | ||
|
||
@ApiProperty({ example: "0", description: "The service of the restaurant" }) | ||
@IsInt() | ||
@IsNotEmpty() | ||
@MaxLength(1) | ||
service: number; | ||
|
||
@ApiProperty({ example: "0", description: "The condition of the restaurant's restroom" }) | ||
@IsInt() | ||
@IsNotEmpty() | ||
@MaxLength(1) | ||
restroomtCleanliness: number; | ||
|
||
@ApiProperty({ example: "좋았음", description: "The overallExperience about the restaurant" }) | ||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(20) | ||
overallExperience: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, ManyToOne, JoinColumn } from 'typeorm'; | ||
import { User } from 'src/user/entities/user.entity'; | ||
import { RestaurantInfoEntity } from 'src/restaurant/entities/restaurant.entity'; | ||
|
||
@Entity('review') | ||
export class ReviewInfoEntity { | ||
@PrimaryGeneratedColumn('increment') | ||
id: number; | ||
|
||
@ManyToOne(() => User) | ||
@JoinColumn({ name: 'user_id' }) | ||
user: User; | ||
|
||
@ManyToOne(() => RestaurantInfoEntity) | ||
@JoinColumn({ name: 'restaurant_id' }) | ||
restaurant: RestaurantInfoEntity; | ||
|
||
@Column({ type: 'boolean' }) | ||
visitMethod: boolean; | ||
|
||
@Column({ type: 'smallint', nullable: true }) | ||
transportationAccessibility: number | null; | ||
|
||
@Column({ type: 'smallint', nullable: true }) | ||
parkingArea: number | null; | ||
|
||
@Column({ type: 'smallint' }) | ||
taste: number; | ||
|
||
@Column({ type: 'smallint' }) | ||
service: number; | ||
|
||
@Column({ type: 'smallint' }) | ||
restroomCleanliness: number; | ||
|
||
@Column({ type: 'text' }) | ||
overallExperience: string; | ||
|
||
@CreateDateColumn({ name: 'created_at' }) | ||
createdAt: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
@Module({}) | ||
export class ReviewModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters