This commit is contained in:
fro1991
2025-11-06 21:57:13 +07:00
parent 61a2309641
commit b602c5f5f1

View File

@ -1,52 +1,52 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { BrizziCardStatus } from '../types/brizzi';
import { BrizziBatch } from './brizzi_batchs';
import { BrizziCardStatus } from "../types/brizzi";
import { BrizziBatch } from "./brizzi_batchs";
@Entity('brizzi_cards', { schema: 'brizzis' })
@Entity("brizzi_cards", { schema: "brizzis" })
export class BrizziCard {
@PrimaryGeneratedColumn('uuid')
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => BrizziBatch, { onDelete: 'RESTRICT' })
@ManyToOne(() => BrizziBatch, { onDelete: "RESTRICT" })
@JoinTable()
batch: BrizziBatch;
@Column({
nullable: false,
length: 256
length: 256,
})
brand: string;
@Column({
nullable: false,
length: 256
length: 256,
})
model: string;
@Column({
nullable: false,
unique: true,
length: 256
length: 256,
})
code: string;
@Column({
nullable: false,
length: 256
length: 256,
})
uid: string;
@Column({
nullable: true,
length: 4096
length: 4096,
})
notes: string;
@Column({
type: 'float8',
type: "float8",
nullable: false,
default: 0
default: 0,
})
balance: number;
@ -55,10 +55,13 @@ export class BrizziCard {
@Column({
nullable: false,
length: 64
length: 64,
})
status: BrizziCardStatus;
@Column({ nullable: true })
active_at: Date;
@Column()
@CreateDateColumn()
created_at: Date;