Loading backend/src/place/entities/place.entity.ts +20 −2 Original line number Diff line number Diff line import { PointOfInterest } from 'src/pointOfInterest/entities/PointOfInterest.entity'; import { Available } from 'src/pointOfInterest/enum/available.enum'; import { Town } from 'src/town/entities/town.entity'; import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Column, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, } from 'typeorm'; import { AvailableDate } from './available-date.entity'; import { Category } from 'src/category/entities/category.entity'; import { PlaceTraduction } from './place-traduction.entity'; @Entity() export class Place { Loading @@ -11,7 +22,7 @@ export class Place { @JoinColumn({ name: 'idTown' }) @ManyToOne(() => Town, (town) => town.townId, { nullable: false }) idTown: Town; town: Town; @OneToMany(() => PointOfInterest, (point) => point.idPoint) points: PointOfInterest[]; Loading @@ -19,6 +30,13 @@ export class Place { @OneToMany(() => AvailableDate, (available) => available.idPlace) availableDates: AvailableDate[]; @ManyToMany(() => Category) @JoinTable() categories: Category[]; @OneToMany(() => PlaceTraduction, (placeTraduction) => placeTraduction.idPlace) placeTraduction: PlaceTraduction[]; @Column() available: Available; Loading Loading
backend/src/place/entities/place.entity.ts +20 −2 Original line number Diff line number Diff line import { PointOfInterest } from 'src/pointOfInterest/entities/PointOfInterest.entity'; import { Available } from 'src/pointOfInterest/enum/available.enum'; import { Town } from 'src/town/entities/town.entity'; import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Column, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, } from 'typeorm'; import { AvailableDate } from './available-date.entity'; import { Category } from 'src/category/entities/category.entity'; import { PlaceTraduction } from './place-traduction.entity'; @Entity() export class Place { Loading @@ -11,7 +22,7 @@ export class Place { @JoinColumn({ name: 'idTown' }) @ManyToOne(() => Town, (town) => town.townId, { nullable: false }) idTown: Town; town: Town; @OneToMany(() => PointOfInterest, (point) => point.idPoint) points: PointOfInterest[]; Loading @@ -19,6 +30,13 @@ export class Place { @OneToMany(() => AvailableDate, (available) => available.idPlace) availableDates: AvailableDate[]; @ManyToMany(() => Category) @JoinTable() categories: Category[]; @OneToMany(() => PlaceTraduction, (placeTraduction) => placeTraduction.idPlace) placeTraduction: PlaceTraduction[]; @Column() available: Available; Loading