<?php

namespace HelpGent\App\Providers;

defined( "ABSPATH" ) || exit;

use HelpGent\WpMVC\Contracts\Provider;

class AgentRoleProvider implements Provider {
    public function boot() {
        add_action( 'init', [ $this, 'add_agent_role' ] );
    }

    public function add_agent_role(): void {
        if ( get_role( 'helpgent_agent' ) ) {
            remove_role( 'helpgent_agent' );
        }

        add_role(
            'helpgent_agent', 'HelpGent Agent', apply_filters(
                'helpgent_agent_capabilities', [ 
                    'read'           => true,
                    'manage_options' => true
                ] 
            ) 
        );
    }
}