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

import "../IVaultfireBonds.sol";

/// @dev Mock bonds registry for testing. Allows creating and modifying bonds.
contract MockBondsRegistry is IVaultfireBonds {
    struct Bond {
        address creator;
        uint256 stakeAmount;
        uint256 createdAt;
        bool active;
    }

    mapping(uint256 => Bond) private _bonds;
    uint256 public bondCount;

    function createBond(address creator, uint256 stakeAmount) external returns (uint256 bondId) {
        bondId = bondCount++;
        _bonds[bondId] = Bond({
            creator: creator,
            stakeAmount: stakeAmount,
            createdAt: block.timestamp,
            active: true
        });
    }

    function setBondStake(uint256 bondId, uint256 newStake) external {
        _bonds[bondId].stakeAmount = newStake;
    }

    function deactivateBond(uint256 bondId) external {
        _bonds[bondId].active = false;
    }

    function activateBond(uint256 bondId) external {
        _bonds[bondId].active = true;
    }

    function getBond(uint256 bondId) external view override returns (
        address creator,
        uint256 stakeAmount,
        uint256 createdAt,
        bool active
    ) {
        Bond storage b = _bonds[bondId];
        return (b.creator, b.stakeAmount, b.createdAt, b.active);
    }
}
