update
This commit is contained in:
60
src/entity/ledgers.ts
Normal file
60
src/entity/ledgers.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||||
|
import { Status } from '../types/status';
|
||||||
|
import { Category } from './categories';
|
||||||
|
import { Product } from './products';
|
||||||
|
|
||||||
|
@Entity('ledgers')
|
||||||
|
export class Ledger {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256
|
||||||
|
})
|
||||||
|
code: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 4096
|
||||||
|
})
|
||||||
|
description: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Category)
|
||||||
|
@JoinColumn({ name: 'categoryId' })
|
||||||
|
category: Category;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
categoryId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Product)
|
||||||
|
@JoinColumn({ name: 'productId' })
|
||||||
|
product: Product;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
productId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
@ -38,6 +38,7 @@ import { SummarizeLogStatus, SummarizeType } from "./types/summarize";
|
|||||||
import { Goods } from "./entity/goods";
|
import { Goods } from "./entity/goods";
|
||||||
import { Supplier } from "./entity/supplier";
|
import { Supplier } from "./entity/supplier";
|
||||||
import { TelegramBody, TelegramResponseSend } from "./types/telegram";
|
import { TelegramBody, TelegramResponseSend } from "./types/telegram";
|
||||||
|
import { Ledger } from "./entity/ledgers";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
User, //
|
User, //
|
||||||
@ -83,5 +84,6 @@ export {
|
|||||||
SummarizeLogStatus,
|
SummarizeLogStatus,
|
||||||
SummarizeType,
|
SummarizeType,
|
||||||
Goods,
|
Goods,
|
||||||
Supplier
|
Supplier,
|
||||||
|
Ledger
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user