feat: add payment module and factory

This commit is contained in:
mahyargdz
2025-02-03 15:41:53 +03:30
parent 8fb587f976
commit 31368610dd
48 changed files with 931 additions and 81 deletions
@@ -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;
}