import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Users } from "./users.entity";

@Entity('notifications')
export class Notification {
    // Define your columns and relationships here
    @PrimaryGeneratedColumn('uuid')
    id: string;

    @ManyToOne(() => Users, { onDelete: 'CASCADE' })
    @JoinColumn({ name: 'id_utilisateur', referencedColumnName: 'id' })
    user: Users;

    @Column({ type: 'text', name: 'contenu' })
    content: string;

    @Column({type: 'boolean', name: 'lu', default: false})
    read: boolean;

    @CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
    created_at: Date;

}
