Initial commit: ERP system with advance verification fixes
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
|
||||
import { Purchase } from './purchase.entity';
|
||||
import { Product } from '../products/product.entity';
|
||||
|
||||
@Entity('purchase_items')
|
||||
export class PurchaseItem {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
purchase_id: string;
|
||||
|
||||
@ManyToOne(() => Purchase, purchase => purchase.purchase_items)
|
||||
purchase: Purchase;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
product_id: string;
|
||||
|
||||
@ManyToOne(() => Product, product => product.purchase_items)
|
||||
product: Product;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
quantity: number;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
unit_price: number;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
total_price: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 10, nullable: false })
|
||||
currency: string;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
rmb_equivalent: number;
|
||||
}
|
||||
Reference in New Issue
Block a user