<?php

use App\Support\SiteAdminDefaultRolePermissions;
use App\Support\SiteCsDefaultRolePermissions;
use App\Support\SiteFinanceDefaultRolePermissions;

test('site admin template includes draw view export and excludes integration and wallet adjust', function (): void {
    $slugs = SiteAdminDefaultRolePermissions::templateSlugs();

    expect($slugs)
        ->toContain('prd.dashboard.view')
        ->toContain('prd.agent.manage')
        ->toContain('prd.settlement.agent.manage')
        ->toContain('prd.report.view')
        ->toContain('prd.report.export')
        ->toContain('prd.draw_result.view')
        ->toContain('prd.wallet_reconcile.manage')
        ->not->toContain('prd.integration.view')
        ->not->toContain('prd.wallet_adjust.manage');
});

test('site finance template focuses on reconcile reports and settlement without agent manage', function (): void {
    $slugs = SiteFinanceDefaultRolePermissions::templateSlugs();

    expect($slugs)
        ->toContain('prd.report.export')
        ->toContain('prd.wallet_adjust.manage')
        ->toContain('prd.settlement.agent.manage')
        ->toContain('prd.draw_result.view')
        ->not->toContain('prd.agent.manage')
        ->not->toContain('prd.users.manage');
});

test('site cs template is single-player scoped without global reports', function (): void {
    $slugs = SiteCsDefaultRolePermissions::templateSlugs();

    expect($slugs)
        ->toContain('prd.dashboard.view')
        ->toContain('prd.users.view_cs')
        ->toContain('prd.tickets.view')
        ->toContain('prd.wallet_reconcile.view_cs')
        ->not->toContain('prd.report.view')
        ->not->toContain('prd.agent.view');
});
