package srequest

// Asset represents a chain/token pair for blockchain endpoints.
type Asset struct {
	Chain           ChainNetwork `json:"chain"`
	TokenSymbol     string       `json:"token_symbol"`
	ContractAddress string       `json:"contract_address,omitempty"`
}

// LedgerEndpoint represents a ledger account payload.
type LedgerEndpoint struct {
	LedgerAccountRef       string `json:"ledger_account_ref"`
	ContraLedgerAccountRef string `json:"contra_ledger_account_ref,omitempty"`
}

// ManagedWalletEndpoint represents a managed wallet payload.
type ManagedWalletEndpoint struct {
	ManagedWalletRef string `json:"managed_wallet_ref"`
	Asset            *Asset `json:"asset,omitempty"`
}

// ExternalChainEndpoint represents an external chain address payload.
type ExternalChainEndpoint struct {
	Asset   *Asset `json:"asset,omitempty"`
	Address string `json:"address"`
	Memo    string `json:"memo,omitempty"`
}

// CardEndpoint represents a card payout payload (PAN or network token).
type CardEndpoint struct {
	Pan       string `json:"pan"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	ExpMonth  uint32 `json:"exp_month,omitempty"`
	ExpYear   uint32 `json:"exp_year,omitempty"`
	Country   string `json:"country,omitempty"`
}

// CardTokenEndpoint represents a vaulted card token payout payload.
type CardTokenEndpoint struct {
	Token     string `json:"token"`
	MaskedPan string `json:"masked_pan"`
}

// WalletEndpoint represents a Sendico wallet payout payload.
type WalletEndpoint struct {
	WalletID string `json:"walletId"`
}

// BankAccountEndpoint represents a domestic bank account payout payload.
type BankAccountEndpoint struct {
	RecipientName        string `json:"recipientName"`
	Inn                  string `json:"inn"`
	Kpp                  string `json:"kpp"`
	BankName             string `json:"bankName"`
	Bik                  string `json:"bik"`
	AccountNumber        string `json:"accountNumber"`
	CorrespondentAccount string `json:"correspondentAccount"`
}

// IBANEndpoint represents an international bank account payout payload.
type IBANEndpoint struct {
	IBAN          string `json:"iban"`
	AccountHolder string `json:"accountHolder"`
	BIC           string `json:"bic,omitempty"`
	BankName      string `json:"bankName,omitempty"`
}

// LegacyPaymentEndpoint mirrors the previous bag-of-pointers DTO for backward compatibility.
type LegacyPaymentEndpoint struct {
	Ledger        *LedgerEndpoint        `json:"ledger,omitempty"`
	ManagedWallet *ManagedWalletEndpoint `json:"managed_wallet,omitempty"`
	ExternalChain *ExternalChainEndpoint `json:"external_chain,omitempty"`
	Card          *CardEndpoint          `json:"card,omitempty"`
	Metadata      map[string]string      `json:"metadata,omitempty"`
}
