This repository has been archived on 2025-11-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
trafficcue-server/src/entities/Review.ts
Jannik fae7308af8
All checks were successful
TrafficCue Server CI / check (push) Successful in 23s
style: run eslint and prettier
2025-08-30 10:31:03 +02:00

41 lines
528 B
TypeScript

import {
BaseEntity,
Column,
Entity,
ManyToOne,
PrimaryGeneratedColumn,
} from "typeorm";
import { type User } from "./User";
@Entity()
export class Review extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@ManyToOne("User", (u: User) => u.reviews)
user: User;
@Column({
type: "float",
})
latitude: number;
@Column({
type: "float",
})
longitude: number;
@Column()
rating: number;
@Column({
type: "text",
})
comment: string;
@Column({
default: () => "NOW()",
})
created_at: Date;
}