<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Simulatore contabilità
 *
 * @package    mod_mtcontabilita
 * @copyright  2026 Mediatouch 2000 Srl <https://www.mediatouch.it>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @author     Marco Cappuccio <m.cappuccio@mediatouch.it>
 */

defined('MOODLE_INTERNAL') || die();

$functions = [
    'mod_mtcontabilita_get_listaccounts' => [
        'classname'   => mod_mtcontabilita\external::class,
        'methodname'  => 'get_listaccounts',
        'description' => 'Restituisce i conti per autocomplete',
        'type'        => 'read',
        'capabilities' => 'mod/mtcontabilita:view',
        'ajax'        => true,
    ],

    'mod_mtcontabilita_get_session_description' => [
        'classname'    => mod_mtcontabilita\external::class,
        'methodname'   => 'get_session_decription',
        'description'  => 'Return decription of session',
        'type'         => 'read',
        'capabilities' => 'mod/mtcontabilita:view',
        'ajax'         => true,
    ],
    'mod_mtcontabilita_delete_session' => [
        'classname'    => mod_mtcontabilita\external::class,
        'methodname'   => 'delete_session',
        'description'  => 'Delete the session',
        'type'         => 'write',
        'capabilities' => 'mod/mtcontabilita:view',
        'ajax'         => true,
    ],
    'mod_mtcontabilita_user_signup' => [
        'classname'    => mod_mtcontabilita\external::class,
        'methodname'   => 'user_signup',
        'description'  => 'Sing up user for the session',
        'type'         => 'write',
        'capabilities' => 'mod/mtcontabilita:view',
        'ajax'         => true,
        'services'     => [MOODLE_OFFICIAL_MOBILE_SERVICE, 'local_mobile'],
    ],
    'mod_mtcontabilita_user_cancel' => [
        'classname'    => mod_mtcontabilita\external::class,
        'methodname'   => 'user_cancel',
        'description'  => 'Cancel user session booking',
        'type'         => 'write',
        'capabilities' => 'mod/mtcontabilita:view',
        'services'     => [MOODLE_OFFICIAL_MOBILE_SERVICE, 'local_mobile'],
    ],
];
