import {Entity, PrimaryColumn, ManyToOne, OneToMany} from "typeorm";
import {Contest} from "./Contest";
import { ContestVote } from "./ContestVote";

@Entity()
export class ContestEntry {

    @PrimaryColumn()
    msgId: string;

    // @ManyToOne(type => Contest, contest => contest.entries)
    @ManyToOne("Contest", "entries")
    contest: Contest;

    // @OneToMany(type => ContestVote, vote => vote.contestEntry)
    @OneToMany("ContestVote", "contestEntry")
    votes: ContestVote[];
}