refactor
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Repository Interface: IMembershipFeeRepository
|
||||
*/
|
||||
|
||||
import type { MembershipFee } from '../entities/MembershipFee';
|
||||
import type { MemberPayment } from '../entities/MemberPayment';
|
||||
|
||||
export interface IMembershipFeeRepository {
|
||||
findById(id: string): Promise<MembershipFee | null>;
|
||||
findByLeagueId(leagueId: string): Promise<MembershipFee | null>;
|
||||
create(fee: MembershipFee): Promise<MembershipFee>;
|
||||
update(fee: MembershipFee): Promise<MembershipFee>;
|
||||
}
|
||||
|
||||
export interface IMemberPaymentRepository {
|
||||
findById(id: string): Promise<MemberPayment | null>;
|
||||
findByFeeIdAndDriverId(feeId: string, driverId: string): Promise<MemberPayment | null>;
|
||||
findByLeagueIdAndDriverId(leagueId: string, driverId: string, membershipFeeRepo: IMembershipFeeRepository): Promise<MemberPayment[]>;
|
||||
create(payment: MemberPayment): Promise<MemberPayment>;
|
||||
update(payment: MemberPayment): Promise<MemberPayment>;
|
||||
}
|
||||
15
core/payments/domain/repositories/IPaymentRepository.ts
Normal file
15
core/payments/domain/repositories/IPaymentRepository.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Repository Interface: IPaymentRepository
|
||||
*/
|
||||
|
||||
import type { Payment, PaymentType } from '../entities/Payment';
|
||||
|
||||
export interface IPaymentRepository {
|
||||
findById(id: string): Promise<Payment | null>;
|
||||
findByLeagueId(leagueId: string): Promise<Payment[]>;
|
||||
findByPayerId(payerId: string): Promise<Payment[]>;
|
||||
findByType(type: PaymentType): Promise<Payment[]>;
|
||||
findByFilters(filters: { leagueId?: string; payerId?: string; type?: PaymentType }): Promise<Payment[]>;
|
||||
create(payment: Payment): Promise<Payment>;
|
||||
update(payment: Payment): Promise<Payment>;
|
||||
}
|
||||
15
core/payments/domain/repositories/IPrizeRepository.ts
Normal file
15
core/payments/domain/repositories/IPrizeRepository.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Repository Interface: IPrizeRepository
|
||||
*/
|
||||
|
||||
import type { Prize } from '../entities/Prize';
|
||||
|
||||
export interface IPrizeRepository {
|
||||
findById(id: string): Promise<Prize | null>;
|
||||
findByLeagueId(leagueId: string): Promise<Prize[]>;
|
||||
findByLeagueIdAndSeasonId(leagueId: string, seasonId: string): Promise<Prize[]>;
|
||||
findByPosition(leagueId: string, seasonId: string, position: number): Promise<Prize | null>;
|
||||
create(prize: Prize): Promise<Prize>;
|
||||
update(prize: Prize): Promise<Prize>;
|
||||
delete(id: string): Promise<void>;
|
||||
}
|
||||
18
core/payments/domain/repositories/IWalletRepository.ts
Normal file
18
core/payments/domain/repositories/IWalletRepository.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Repository Interface: IWalletRepository
|
||||
*/
|
||||
|
||||
import type { Wallet, Transaction } from '../entities/Wallet';
|
||||
|
||||
export interface IWalletRepository {
|
||||
findById(id: string): Promise<Wallet | null>;
|
||||
findByLeagueId(leagueId: string): Promise<Wallet | null>;
|
||||
create(wallet: Wallet): Promise<Wallet>;
|
||||
update(wallet: Wallet): Promise<Wallet>;
|
||||
}
|
||||
|
||||
export interface ITransactionRepository {
|
||||
findById(id: string): Promise<Transaction | null>;
|
||||
findByWalletId(walletId: string): Promise<Transaction[]>;
|
||||
create(transaction: Transaction): Promise<Transaction>;
|
||||
}
|
||||
4
core/payments/domain/repositories/index.ts
Normal file
4
core/payments/domain/repositories/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './IPaymentRepository';
|
||||
export * from './IMembershipFeeRepository';
|
||||
export * from './IPrizeRepository';
|
||||
export * from './IWalletRepository';
|
||||
Reference in New Issue
Block a user