package services_astrologer

import (
	dto "astrology-api/dto_astrologer"
)

type WalletService interface {

	//------------------------------------------------
	// Wallet Summary
	//------------------------------------------------

	GetWallet(userID uint) (*dto.WalletResponse, error)

	//------------------------------------------------
	// Transactions
	//------------------------------------------------

	GetTransactions(userID uint, filter string, page int, limit int) ([]dto.WalletTransactionResponse, int64, error)

	GetTransactionByID(userID uint, transactionID uint) (*dto.WalletTransactionResponse, error)

	//------------------------------------------------
	// Withdraw
	//------------------------------------------------

	// GetWithdrawConfig backs the withdraw screen before an amount is typed:
	// balance, limits, the fees in force and the saved payout methods.
	GetWithdrawConfig(userID uint) (*dto.WithdrawConfigResponse, error)

	// PreviewWithdraw computes the summary card without writing anything.
	PreviewWithdraw(userID uint, request dto.WithdrawRequest) (*dto.WithdrawPreviewResponse, error)

	// Withdraw creates a GENERAL (admin-approved) or INSTANT (TDS and flat
	// charge deducted, paid out immediately) withdrawal.
	Withdraw(userID uint, request dto.WithdrawRequest) (*dto.WithdrawCreateResponse, error)

	GetWithdrawHistory(userID uint) ([]dto.WithdrawResponse, error)

	//------------------------------------------------
	// Settlement
	//------------------------------------------------
	//
	// Read-only. Releasing and settling an earning is the admin's decision
	// and the settlement job's write; the astrologer app can only look at
	// where its money has got to.

	// GetSettlementHistory is the Statement screen's Settlements tab, in the
	// shared withdraw/settlement row shape.
	GetSettlementHistory(userID uint) ([]dto.WithdrawResponse, error)

	// GetConsultationEarnings is every billed session and where its money has
	// got to — the screen that works from the first consultation, unlike the
	// batch list above, which stays empty until a settlement run happens.
	GetConsultationEarnings(
		userID uint,
		status string,
		medium string,
		page int,
		limit int,
	) (*dto.ConsultationEarningsResponse, error)

	// GetSettlementBatches is the same history with the batch detail the
	// settlement screen shows: consultation count, period and the gross the
	// credit was derived from.
	GetSettlementBatches(
		userID uint,
		page int,
		limit int,
	) (*dto.SettlementHistoryResponse, error)

	// GetSettlementBatchDetail opens one batch and lists the sessions it
	// closed.
	GetSettlementBatchDetail(
		userID uint,
		settlementID uint,
	) (*dto.SettlementBatchDetailResponse, error)

	// GetUpcomingSettlement is what has been earned but not credited yet,
	// split by where it is in the admin review flow.
	GetUpcomingSettlement(userID uint) (*dto.UpcomingSettlementResponse, error)
}
