add new entity: initial stock
This commit is contained in:
51
src/entity/pharmacy/initial_stock.ts
Normal file
51
src/entity/pharmacy/initial_stock.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, ManyToMany } from "typeorm";
|
||||
|
||||
import { Room } from "../room";
|
||||
import { ItemMaster } from "./item_master";
|
||||
import { ItemOrigin } from "./item_origin";
|
||||
|
||||
@Entity("pharmacy_initial_stock", { schema: "pharmacy" })
|
||||
export class InitialStock {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id!: string;
|
||||
|
||||
@ManyToOne(() => ItemMaster, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
itemmaster: ItemMaster;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => ItemOrigin, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
itemorigin: ItemOrigin;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
batch: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
exp_date: Date;
|
||||
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by?: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by?: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by?: string;
|
||||
}
|
||||
@ -17,3 +17,4 @@ export * from "../entity/pharmacy/item_master";
|
||||
export * from "../entity/pharmacy/pharmacy_info";
|
||||
export * from "../entity/pharmacy/item_price";
|
||||
export * from "../entity/pharmacy/selling_price_percentage";
|
||||
export * from "../entity/pharmacy/initial_stock";
|
||||
|
||||
Reference in New Issue
Block a user