import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import ArticleEntity from "./article.entity";

@Entity({name: "article_barcode"})
export default class ArticleBarcodeEntity {

    @PrimaryGeneratedColumn()
    id?: number;

    @JoinColumn({name: "id_article"})
    @ManyToOne(type => ArticleEntity)
    article?: ArticleEntity;

    @Column()
    barcode?: string;

    @Column({type: "decimal"})
    ratio?: number;

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

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

}