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

@Entity({name: "credit_note_counter"})
export default class CreditNoteCounterEntity {

    @PrimaryGeneratedColumn()
    id?: number;

    @Column()
    code?: string;

    @Column()
    title?: string;

    @Column()
    prefix?: string;

    @Column()
    suffix?: string;

    @Column(
        { name: "current_number" }
    )
    currentNumber?: number;

    @Column()
    active?: number;

    @JoinColumn({name: "id_store"})
    @ManyToOne(type => StoreEntity)
    store?: StoreEntity;

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

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

}