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

41 lines
703 B
TypeScript

/**
* Domain Entity: Payment
*/
export enum PaymentType {
SPONSORSHIP = 'sponsorship',
MEMBERSHIP_FEE = 'membership_fee',
}
export enum PayerType {
SPONSOR = 'sponsor',
DRIVER = 'driver',
}
export enum PaymentStatus {
PENDING = 'pending',
COMPLETED = 'completed',
FAILED = 'failed',
REFUNDED = 'refunded',
}
export interface Payment {
id: string;
type: PaymentType;
amount: number;
platformFee: number;
netAmount: number;
payerId: string;
payerType: PayerType;
leagueId: string;
seasonId?: string;
status: PaymentStatus;
createdAt: Date;
completedAt?: Date;
}
export const Payment = {
rehydrate(props: Payment): Payment {
return { ...props };
},
};