Initial commit: ERP system with advance verification fixes
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||
import { Project } from '../projects/project.entity';
|
||||
import { Supplier } from '../suppliers/supplier.entity';
|
||||
import { Contract } from '../contracts/contract.entity';
|
||||
import { PurchaseItem } from './purchase-item.entity';
|
||||
|
||||
@Entity('purchases')
|
||||
export class Purchase {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
project_id: string;
|
||||
|
||||
@ManyToOne(() => Project, project => project.purchases)
|
||||
project: Project;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
supplier_id: string;
|
||||
|
||||
@ManyToOne(() => Supplier, supplier => supplier.purchases)
|
||||
supplier: Supplier;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
contract_id: string;
|
||||
|
||||
@ManyToOne(() => Contract, contract => contract.purchases)
|
||||
contract: Contract;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
total_amount: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 10, nullable: false })
|
||||
currency: string;
|
||||
|
||||
@Column({ type: 'decimal', precision: 18, scale: 2, nullable: false })
|
||||
rmb_equivalent: number;
|
||||
|
||||
@Column({ type: 'date', nullable: true })
|
||||
expected_delivery_date: Date;
|
||||
|
||||
@Column({ type: 'varchar', length: 50, nullable: false })
|
||||
status: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@OneToMany(() => PurchaseItem, purchaseItem => purchaseItem.purchase)
|
||||
purchase_items: PurchaseItem[];
|
||||
}
|
||||
Reference in New Issue
Block a user