import { Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Column } from "typeorm/browser";
import TipologyEntity from "./tipology.entity";

@Entity({name: "attribute"})
export default class AttributeEntity {

    @PrimaryGeneratedColumn()
    id?: number;

    @Column()
    code?: string;

    @Column()
    title?: string;

    @JoinColumn({name: "id_tipology"})
    @ManyToOne(type => TipologyEntity)
    tipology?: TipologyEntity;

    @Column(
        { type: "datetime", name: "created_at" }
    )
    createdAt?: Date;

    @Column(
        { type: "datetime", name: "updated_at" }
    )
    updatedAt?: Date;


}