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

/**
 * @title IRegulatedEntityRegistry
 * @notice Interface for Regulated Entity Registry
 * @dev Tracks regulated financial entities eligible for vault operations
 */
interface IRegulatedEntityRegistry {
    /**
     * @notice Register a regulated entity
     * @param entity Entity address
     * @param jurisdictionHash Hash of jurisdiction identifier
     * @param authorizedWallets Initial authorized wallets
     */
    function registerEntity(
        address entity,
        bytes32 jurisdictionHash,
        address[] calldata authorizedWallets
    ) external;

    /**
     * @notice Check if an entity is registered and eligible
     * @param entity Entity address
     * @return isEligible True if entity is registered and not suspended
     */
    function isEligible(address entity) external view returns (bool);

    /**
     * @notice Check if a wallet is authorized for an entity
     * @param entity Entity address
     * @param wallet Wallet address
     * @return isAuthorized True if wallet is authorized
     */
    function isAuthorized(address entity, address wallet) external view returns (bool);

    /**
     * @notice Check if an address is an operator for an entity
     * @param entity Entity address
     * @param operator Operator address
     * @return isOperator True if address is an operator
     */
    function isOperator(address entity, address operator) external view returns (bool);

    /**
     * @notice Add authorized wallet to an entity
     * @param entity Entity address
     * @param wallet Wallet address to authorize
     */
    function addAuthorizedWallet(address entity, address wallet) external;

    /**
     * @notice Remove authorized wallet from an entity
     * @param entity Entity address
     * @param wallet Wallet address to remove
     */
    function removeAuthorizedWallet(address entity, address wallet) external;

    /**
     * @notice Set operator status for an entity
     * @param entity Entity address
     * @param operator Operator address
     * @param status True to grant operator status, false to revoke
     */
    function setOperator(address entity, address operator, bool status) external;

    /**
     * @notice Suspend an entity
     * @param entity Entity address
     */
    function suspendEntity(address entity) external;

    /**
     * @notice Unsuspend an entity
     * @param entity Entity address
     */
    function unsuspendEntity(address entity) external;

    /**
     * @notice Get entity information
     * @param entity Entity address
     * @return registered True if entity is registered
     * @return suspended True if entity is suspended
     * @return jurisdictionHash Jurisdiction hash
     * @return authorizedWallets List of authorized wallets
     */
    function getEntity(address entity) external view returns (
        bool registered,
        bool suspended,
        bytes32 jurisdictionHash,
        address[] memory authorizedWallets
    );

    event EntityRegistered(address indexed entity, bytes32 jurisdictionHash, uint256 timestamp);
    event EntitySuspended(address indexed entity, uint256 timestamp);
    event EntityUnsuspended(address indexed entity, uint256 timestamp);
    event AuthorizedWalletAdded(address indexed entity, address indexed wallet);
    event AuthorizedWalletRemoved(address indexed entity, address indexed wallet);
    event OperatorSet(address indexed entity, address indexed operator, bool status);
}
