<?php

$functions = [
    'local_academic_ticket_system_update_presence' => [
        'classname'     => 'local_academic_ticket_system\external\update_presence',
        'methodname'    => 'execute',
        'description'   => 'Updates ticket presence',
        'type'          => 'write',
        'ajax'          => true,
        'loginrequired' => true,
    ],
    'local_academic_ticket_system_get_ticket_counts' => [
        'classname'     => 'local_academic_ticket_system\external\get_ticket_counts',
        'methodname'    => 'execute',
        'description'   => 'Returns counts of tickets by status',
        'type'          => 'read',
        'ajax'          => true,
        'loginrequired' => true,
    ],
    'local_academic_ticket_system_get_ticket_details' => [
        'classname'     => 'local_academic_ticket_system\external\get_ticket_details',
        'methodname'    => 'execute',
        'description'   => 'Returns full ticket info with replies, logs and feedback',
        'type'          => 'read',
        'ajax'          => true,
        'loginrequired' => true,
    ],
    'local_academic_ticket_system_submit_feedback' => [
        'classname'     => 'local_academic_ticket_system\external\submit_feedback',
        'methodname'    => 'execute',
        'description'   => 'Submits user rating and comment for a ticket',
        'type'          => 'write',
        'ajax'          => true,
        'loginrequired' => true,
    ],
    'local_academic_ticket_system_get_business_stats' => [
        'classname'     => 'local_academic_ticket_system\external\get_business_stats',
        'methodname'    => 'execute',
        'description'   => 'Returns advanced business metrics like CSAT and Avg Resolution Time',
        'type'          => 'read',
        'ajax'          => true,
        'loginrequired' => true,
    ],
    'local_academic_ticket_system_get_admin_report' => [
        'classname'     => 'local_academic_ticket_system\external\get_admin_report',
        'methodname'    => 'execute',
        'description'   => 'Returns productivity reports for support staff',
        'type'          => 'read',
        'ajax'          => true,
        'loginrequired' => true,
    ],
];

$services = [
    'Academic Ticket System API' => [
        'functions' => array_keys($functions),
        'restrictedusers' => 0,
        'enabled' => 1,
        'shortname' => 'acadtkt_api',
    ],
];