54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
Column,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
DeleteDateColumn,
|
|
VersionColumn,
|
|
CreateDateColumn,
|
|
ManyToOne,
|
|
ManyToMany,
|
|
JoinTable,
|
|
} from 'typeorm';
|
|
import { BaseModel } from '../../config/basemodel.entity';
|
|
import { statusTransaction, typeTransaction } from '../../helper/enum-list';
|
|
import { Partner } from '../../users/entities/partner.entity';
|
|
import { ProductHistoryPrice } from '../../product/entities/product-history-price.entity';
|
|
import { User } from '../../users/entities/user.entity';
|
|
import { UserDetail } from '../../users/entities/user_detail.entity';
|
|
|
|
@Entity()
|
|
export class Transactions extends BaseModel {
|
|
@Column()
|
|
amount: number;
|
|
|
|
@Column()
|
|
status: statusTransaction;
|
|
|
|
@Column()
|
|
type: typeTransaction;
|
|
|
|
@Column({
|
|
type: 'uuid',
|
|
nullable: true,
|
|
})
|
|
user: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
user_destination: string;
|
|
|
|
@ManyToOne(() => ProductHistoryPrice, (product) => product.id)
|
|
product_price: ProductHistoryPrice;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
image_prove: string;
|
|
|
|
mark_up_price: number;
|
|
|
|
userData: UserDetail;
|
|
}
|