feat: add student wallet utility billing
This commit is contained in:
32
apps/server/src/entities/wallet-transaction.entity.ts
Normal file
32
apps/server/src/entities/wallet-transaction.entity.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('wallet_transactions')
|
||||
@Index(['studentId', 'createdAt'])
|
||||
export class WalletTransaction {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'student_id', type: 'integer' })
|
||||
studentId: number;
|
||||
|
||||
@Column({ name: 'bill_id', type: 'integer', nullable: true })
|
||||
billId: number | null;
|
||||
|
||||
@Column({ type: 'varchar', length: 30 })
|
||||
type: 'recharge' | 'adjustment' | 'bill_payment' | 'bill_refund';
|
||||
|
||||
@Column({ type: 'decimal', precision: 12, scale: 2 })
|
||||
amount: number;
|
||||
|
||||
@Column({ name: 'balance_after', type: 'decimal', precision: 12, scale: 2 })
|
||||
balanceAfter: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 300, nullable: true })
|
||||
description: string | null;
|
||||
|
||||
@Column({ name: 'recorded_by', type: 'integer', nullable: true })
|
||||
recordedBy: number | null;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user