import { BaseEntity, Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn } from "typeorm";
import { DiscordAccount } from "./DiscordAccount";
import { MovieTicket } from "./MovieTicket";

@Entity()
export class DiscordRequest extends BaseEntity
{
	@PrimaryGeneratedColumn()
	id!: number;

	@Column({ length: 20 })
	channelId!: string;

	@Column({ length: 20 })
	messageId!: string;

	@CreateDateColumn()
	createdAt!: Date;

	@ManyToOne(() => DiscordAccount, account => account.requests)
	account!: DiscordAccount;

	@OneToOne(() => MovieTicket)
	@JoinColumn()
	ticket!: MovieTicket;
}
