49 lines
883 B
TypeScript
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 };
|
|
},
|
|
}; |