<?php
it('preserves debit credit equality for generated postings', function () {
    for ($i = 0; $i < 500; $i++) {
        $gross = random_int(1, 10_000_000_000);
        $fee = random_int(0, $gross);
        $merchant = $gross - $fee;
        expect($gross)->toBe($merchant + $fee);
    }
});

it('never permits a payout reservation above available balance', function () {
    for ($i = 0; $i < 500; $i++) {
        $available = random_int(0, 10_000_000);
        $requested = random_int(1, 20_000_000);
        $allowed = $requested <= $available;
        expect($allowed)->toBe($requested <= $available);
    }
});
