add: progress transaction
This commit is contained in:
		| @@ -5,13 +5,15 @@ import { | ||||
|   UpdateDateColumn, | ||||
|   DeleteDateColumn, | ||||
|   VersionColumn, | ||||
|   CreateDateColumn, ManyToOne, ManyToMany, JoinTable, | ||||
|   CreateDateColumn, ManyToOne, ManyToMany, JoinTable, OneToOne, | ||||
| } from 'typeorm'; | ||||
| import { Product } from '../../product/entities/product.entity'; | ||||
| import { User } from '../../users/entities/user.entity'; | ||||
| import { BaseModel } from '../../config/basemodel.entity'; | ||||
| import { ProductCategories } from '../../product/entities/product-category.entity'; | ||||
| import { COA } from './coa.entity'; | ||||
| import { Transactions } from './transactions.entity'; | ||||
| import { TransactionType } from './transaction-type.entity'; | ||||
| 
 | ||||
| enum type { | ||||
|   SYSTEM_BANk, | ||||
| @@ -31,6 +33,12 @@ export class TransactionJournal extends BaseModel { | ||||
|   @Column() | ||||
|   amount: number; | ||||
| 
 | ||||
|   @OneToOne(() => Transactions, (trans) => trans.id) | ||||
|   transaction: Transactions; | ||||
| 
 | ||||
|   @ManyToOne(() => COA, (coa) => coa.id) | ||||
|   coa: COA; | ||||
| 
 | ||||
|   @ManyToOne(() => TransactionType, (transType) => transType.id) | ||||
|   transactionType: TransactionType; | ||||
| } | ||||
							
								
								
									
										23
									
								
								src/transaction/entities/transaction-type.entity.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/transaction/entities/transaction-type.entity.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| import { | ||||
|   Entity, | ||||
|   Column, | ||||
|   PrimaryGeneratedColumn, | ||||
|   UpdateDateColumn, | ||||
|   DeleteDateColumn, | ||||
|   VersionColumn, | ||||
|   CreateDateColumn, | ||||
|   ManyToOne, | ||||
|   ManyToMany, | ||||
|   JoinTable, | ||||
| } from 'typeorm'; | ||||
| import { Product } from '../../product/entities/product.entity'; | ||||
| import { User } from '../../users/entities/user.entity'; | ||||
| import { BaseModel } from '../../config/basemodel.entity'; | ||||
| import { COA } from './coa.entity'; | ||||
| import { ProductHistoryPrice } from '../../product/entities/product-history-price.entity'; | ||||
|  | ||||
| @Entity() | ||||
| export class TransactionType extends BaseModel { | ||||
|   @Column() | ||||
|   name: string; | ||||
| } | ||||
| @@ -23,7 +23,7 @@ enum status { | ||||
| } | ||||
| 
 | ||||
| @Entity() | ||||
| export class Transaction extends BaseModel { | ||||
| export class Transactions extends BaseModel { | ||||
|   @Column() | ||||
|   amount: number; | ||||
| 
 | ||||
| @@ -32,7 +32,4 @@ export class Transaction extends BaseModel { | ||||
| 
 | ||||
|   @ManyToOne(() => User, (user) => user.id) | ||||
|   user: User; | ||||
| 
 | ||||
|   @ManyToOne(() => ProductHistoryPrice, (productHistory) => productHistory.id) | ||||
|   product: ProductHistoryPrice; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user