import { Entity, Column, PrimaryGeneratedColumn, ChildEntity, TableInheritance } from "typeorm";

@Entity()
@TableInheritance({column: { type: "varchar", name: "type" }})
export abstract class Violation {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    guildId: string;

    @Column()
    userId: string;

    @Column({ type: "text", nullable: true })
    reason?: string;

    @Column()
    valid: boolean;
}

@ChildEntity()
export class Mute extends Violation {
    @Column()
    endsAt: Date;
}

@ChildEntity()
export class Ban extends Violation {
    @Column()
    endsAt: Date;
}

@ChildEntity()
export class Kick extends Violation {}