feat: add payment module and factory
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Column, Entity, ManyToOne } from "typeorm";
|
||||
|
||||
import { Wallet } from "./wallet.entity";
|
||||
import { BaseEntity } from "../../../common/entities/base.entity";
|
||||
import { TransactionType } from "../enums/transaction-type.enum";
|
||||
|
||||
@Entity()
|
||||
export class WalletTransaction extends BaseEntity {
|
||||
@ManyToOne(() => Wallet, (wallet) => wallet.transactions, { onDelete: "CASCADE", nullable: false })
|
||||
wallet: Wallet;
|
||||
|
||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: false })
|
||||
amount: number;
|
||||
|
||||
@Column({ type: "enum", enum: TransactionType, nullable: false })
|
||||
type: TransactionType;
|
||||
|
||||
@Column({ type: "text", nullable: false })
|
||||
description: string;
|
||||
}
|
||||
Reference in New Issue
Block a user