<?php
declare(strict_types=1);
namespace app\common;
class QwRobot
{
    public const CAPTURE_MODE='OWN_STAFF_POWER_ONLY_NO_NETWORK_V1';
    public static function pushMsgFormat($data,$title='',$msgtype='msg',$storeId=0)
    {
        $map=json_decode((string)file_get_contents((string)getenv('CATEGORY_RUNTIME').'/private-owned-map.json'),true);
        if((int)$storeId!==2147000621||!is_array($data)||array_keys($data)!==['staffId','date']
            ||(int)$data['staffId']!==(int)($map['staff_id']??0)||!in_array($data['date'],['2030-03-02','2030-03-03'],true)
            ||$title!=='推荐能量任务队列消费'||$msgtype!=='msg')throw new \RuntimeException('Unapproved robot payload');
        file_put_contents((string)getenv('CATEGORY_RUNTIME').'/robot-captures.jsonl',json_encode(['store_id'=>(int)$storeId,
            'staff_id'=>(int)$data['staffId'],'date'=>$data['date'],'title'=>$title,'type'=>$msgtype])."\n",FILE_APPEND|LOCK_EX);
        return true;
    }
}
// Publisher/sync substitutes are only safety tripwires. Their execution fails the batch.
class Serve
{
    public static function push(string $action,array $data=[],int $delay=0):bool{throw new \RuntimeException('Unexpected queue publisher');}
    public static function pushJump(string $action,array $data=[]):bool{throw new \RuntimeException('Unexpected queue publisher');}
}
class UserApi {public function run($apiType,$params=[]):array{throw new \RuntimeException('Unexpected external user sync');}}
