<?php

// +----------------------------------------------------------------------
// | Hook 契约配置
// +----------------------------------------------------------------------
// | 第三阶段用于描述核心 Hook 的 payload 语义、返回结构和建议执行模式。
// | 未声明的历史 Hook 不受影响；严格阻断仍由 hook.yb_hook_contract_mode 控制。
// +----------------------------------------------------------------------

$standard = [
    'payload' => 'readonly',
    'result' => ['code' => 'int', 'data' => 'array', 'msg' => 'string'],
    'exe_type' => 1,
    'multiple' => true,
];

return [
    'version' => 1,
    'contracts' => [
        'PayHook_createPay' => $standard + [
            'providers' => ['service_pay', 'pay_account'],
            'description' => '创建支付单',
        ],
        'PayHook_queryPay' => $standard + [
            'providers' => ['service_pay', 'pay_account'],
            'description' => '查询支付单',
        ],
        'PayHook_closePay' => $standard + [
            'providers' => ['service_pay', 'pay_account'],
            'description' => '关闭支付单',
        ],
        'SmsHook_sendSms' => $standard + [
            'providers' => [],
            'description' => '发送短信',
        ],
        'FileHook_upload' => $standard + [
            'providers' => ['remote_baidu', 'remote_huawei'],
            'description' => '上传文件',
        ],
    ],
];
