mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
feat: finish working on account transaction webhook
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { TransactionType } from '../enums';
|
||||
import { TransactionScope, TransactionType } from '../enums';
|
||||
import { Account } from './account.entity';
|
||||
import { Card } from './card.entity';
|
||||
|
||||
@ -8,12 +8,15 @@ export class Transaction {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ name: 'card_reference', nullable: true, type: 'varchar' })
|
||||
cardReference!: string;
|
||||
@Column({ name: 'transaction_scope', type: 'varchar', nullable: false })
|
||||
transactionScope!: TransactionScope;
|
||||
|
||||
@Column({ name: 'transaction_type', type: 'varchar', default: TransactionType.EXTERNAL })
|
||||
transactionType!: TransactionType;
|
||||
|
||||
@Column({ name: 'card_reference', nullable: true, type: 'varchar' })
|
||||
cardReference!: string;
|
||||
|
||||
@Column({ name: 'account_reference', nullable: true, type: 'varchar' })
|
||||
accountReference!: string;
|
||||
|
||||
@ -44,6 +47,9 @@ export class Transaction {
|
||||
@Column({ type: 'decimal', name: 'fees', precision: 12, scale: 2 })
|
||||
fees!: number;
|
||||
|
||||
@Column({ type: 'decimal', name: 'vat_on_fees', precision: 12, scale: 2, default: 0.0 })
|
||||
vatOnFees!: number;
|
||||
|
||||
@Column({ name: 'card_id', type: 'uuid', nullable: true })
|
||||
cardId!: string;
|
||||
|
||||
@ -57,6 +63,7 @@ export class Transaction {
|
||||
@ManyToOne(() => Account, (account) => account.transactions, { onDelete: 'CASCADE', nullable: true })
|
||||
@JoinColumn({ name: 'account_id' })
|
||||
account!: Account;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at', type: 'timestamp with time zone' })
|
||||
createdAt!: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user