add: progress authentication
This commit is contained in:
		
							
								
								
									
										44
									
								
								src/transaction/entities/coa.entity.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								src/transaction/entities/coa.entity.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| 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'; | ||||
|  | ||||
| enum type { | ||||
|   SYSTEM_BANk, | ||||
|   INCOME, | ||||
| } | ||||
|  | ||||
| enum balanceType { | ||||
|   DEBIT, | ||||
|   CREDIT, | ||||
| } | ||||
|  | ||||
| @Entity() | ||||
| export class COA extends BaseModel { | ||||
|   @Column() | ||||
|   name: string; | ||||
|  | ||||
|   @Column('text') | ||||
|   type: type; | ||||
|  | ||||
|   @Column('text') | ||||
|   balanceType: balanceType; | ||||
|  | ||||
|   @Column() | ||||
|   amount: number; | ||||
|  | ||||
|   @ManyToMany(() => User) | ||||
|   @JoinTable() | ||||
|   user: User[]; | ||||
| } | ||||
| @@ -1 +1,38 @@ | ||||
| export class Transaction {} | ||||
| 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'; | ||||
|  | ||||
| enum status { | ||||
|   PENDING, | ||||
|   SUCCESS, | ||||
|   FAILED, | ||||
| } | ||||
|  | ||||
| @Entity() | ||||
| export class Transaction extends BaseModel { | ||||
|   @Column() | ||||
|   amount: number; | ||||
|  | ||||
|   @Column() | ||||
|   status: status; | ||||
|  | ||||
|   @ManyToOne(() => User, (user) => user.id) | ||||
|   user: User; | ||||
|  | ||||
|   @ManyToOne(() => ProductHistoryPrice, (productHistory) => productHistory.id) | ||||
|   product: ProductHistoryPrice; | ||||
| } | ||||
|   | ||||
							
								
								
									
										36
									
								
								src/transaction/entities/transaction_journal.entity.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/transaction/entities/transaction_journal.entity.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| 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 { ProductCategories } from '../../product/entities/product-category.entity'; | ||||
| import { COA } from './coa.entity'; | ||||
|  | ||||
| enum type { | ||||
|   SYSTEM_BANk, | ||||
|   INCOME, | ||||
| } | ||||
|  | ||||
| enum balanceType { | ||||
|   DEBIT, | ||||
|   CREDIT, | ||||
| } | ||||
|  | ||||
| @Entity() | ||||
| export class TransactionJournal extends BaseModel { | ||||
|   @Column('text') | ||||
|   type: type; | ||||
|  | ||||
|   @Column() | ||||
|   amount: number; | ||||
|  | ||||
|   @ManyToOne(() => COA, (coa) => coa.id) | ||||
|   coa: COA; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user