import { defaultDateGeneratorHelper } from "src/common/helpers/default-date-genarate";
import { Document } from "src/document/documents/entities/document.entity";
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";

@Entity('t_type_documents')
export class Typedocument extends defaultDateGeneratorHelper{
    @PrimaryGeneratedColumn({unsigned: true})
    id: number;

    @Column({name: 'r_code', type: 'character varying', nullable: true, unique: true, comment: 'code type de document'})
    code: string;

    @Column({name: 'r_libelle', type: 'character varying', nullable: false, unique: true, comment: 'type de document'})
    libelle: string;

    @Column({name: 'r_description', type: 'text', nullable: true, comment: 'commentaire'})
    description: string;

    @OneToMany(type=> Document, (document) => document.typedocument)
    document: Document[];
}
