// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title IReserveOracle
 * @notice Interface for reserve verification oracles
 * @dev Quorum-based oracle system for verifying fiat reserves
 */
interface IReserveOracle {
    struct ReserveReport {
        address reporter;
        uint256 reserveBalance;
        uint256 timestamp;
        bytes32 attestationHash;
        bool isValid;
    }

    /**
     * @notice Submit reserve report for a currency
     * @param currencyCode ISO-4217 currency code
     * @param reserveBalance Reserve balance in base currency units
     * @param attestationHash Hash of custodian attestation
     */
    function submitReserveReport(
        string memory currencyCode,
        uint256 reserveBalance,
        bytes32 attestationHash
    ) external;

    /**
     * @notice Get verified reserve balance for a currency
     * @param currencyCode ISO-4217 currency code
     * @return reserveBalance Verified reserve balance
     * @return timestamp Last update timestamp
     */
    function getVerifiedReserve(string memory currencyCode) external view returns (
        uint256 reserveBalance,
        uint256 timestamp
    );

    /**
     * @notice Check if oracle quorum is met for a currency
     * @param currencyCode ISO-4217 currency code
     * @return quorumMet True if quorum is met
     * @return reportCount Number of valid reports
     */
    function isQuorumMet(string memory currencyCode) external view returns (bool quorumMet, uint256 reportCount);

    /**
     * @notice Get consensus reserve balance (median/average of quorum reports)
     * @param currencyCode ISO-4217 currency code
     * @return consensusReserve Consensus reserve balance
     */
    function getConsensusReserve(string memory currencyCode) external view returns (uint256 consensusReserve);

    event ReserveReportSubmitted(
        string indexed currencyCode,
        address indexed reporter,
        uint256 reserveBalance,
        uint256 timestamp
    );
    event QuorumMet(string indexed currencyCode, uint256 consensusReserve);
}
