<?php

it('requires the BOOKINGS_ADD subuser node for own order booking creation', function (): void {
    $routeFile = app_path('routes/orderBookingRoute.php');
    expect(is_file($routeFile))->toBeTrue();

    $code = (string)file_get_contents($routeFile);
    $normalized = preg_replace('/\s+/', ' ', $code);

    expect($normalized)->toContain("definePermission('add_own_bookings', subusers_permission_node_key::BOOKINGS_ADD)");
    expect($normalized)->toContain("'add_own_bookings' => 'Permission to create own order bookings. Subusers require node: BOOKINGS_ADD.'");
});
