/*
 * Copyright (c) 2022.
 * Author Peter Placzek (tada5hi)
 * For the full copyright and license information,
 * view the LICENSE file that was distributed with this source code.
 */

import {
    Column,
    CreateDateColumn,
    Entity, ManyToOne,
    PrimaryGeneratedColumn,
    UpdateDateColumn
} from "typeorm";
import {ChatRoom} from "../room";

@Entity()
export class ChatInvitation {
    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column({type: "varchar"})
    code: string;

    @Column({type: "varchar"})
    room_id: string;

    @ManyToOne(() => ChatRoom, {onDelete: "CASCADE"})
    room: ChatRoom;

    @CreateDateColumn()
    created_at: string;

    @UpdateDateColumn()
    updated_at: string
}
