Files
gridpilot.gg/core/payments/domain/entities/Wallet.ts
2025-12-29 18:34:12 +01:00

49 lines
883 B
TypeScript

/**
* Domain Entity: Wallet
*/
export interface Wallet {
id: string;
leagueId: string;
balance: number;
totalRevenue: number;
totalPlatformFees: number;
totalWithdrawn: number;
currency: string;
createdAt: Date;
}
export const Wallet = {
rehydrate(props: Wallet): Wallet {
return { ...props };
},
};
export enum TransactionType {
DEPOSIT = 'deposit',
WITHDRAWAL = 'withdrawal',
PLATFORM_FEE = 'platform_fee',
}
export enum ReferenceType {
SPONSORSHIP = 'sponsorship',
MEMBERSHIP_FEE = 'membership_fee',
PRIZE = 'prize',
}
export interface Transaction {
id: string;
walletId: string;
type: TransactionType;
amount: number;
description: string;
referenceId?: string;
referenceType?: ReferenceType;
createdAt: Date;
}
export const Transaction = {
rehydrate(props: Transaction): Transaction {
return { ...props };
},
};