<?php
require __DIR__.'/common.php';
if(is_file(__DIR__.'/private/request.json'))throw new RuntimeException('No auth replay');
$current=$source();$batch=json_decode(file_get_contents(__DIR__.'/private/batch-before.json'),true);foreach($current as $key=>$rows)if($rows!==$batch[$key])throw new RuntimeException('Auth source drift '.$key);
require __DIR__.'/app-init.php';$start=count(FLGate::$journal);new \app\p\logic\SupplementMealOrder();if(count(FLGate::$journal)!==$start)throw new RuntimeException('Business constructor SQL');
$actor=$current['operator'][0];$token=(new \app\p\logic\Login())->userTokenSet($actor);
$id=(string)$current['supplement'][0]['id'];
if($q('SELECT id FROM ydy_meal_order_supplement WHERE id=?',[2147483001])!==[])throw new RuntimeException('Missing ID collision');
$list=['keyword'=>'CDXFL11E2F7','page'=>'1','page_size'=>'10','status'=>'20'];
$cases=[['label'=>'list-positive','path'=>'/p/supplementMealOrder/list','params'=>$list,'kind'=>'business'],['label'=>'list-page2','path'=>'/p/supplementMealOrder/list','params'=>array_merge($list,['page'=>'2']),'kind'=>'business'],['label'=>'list-status40','path'=>'/p/supplementMealOrder/list','params'=>array_merge($list,['status'=>'40']),'kind'=>'business'],['label'=>'detail-positive','path'=>'/p/supplementMealOrder/detail','params'=>['id'=>$id],'kind'=>'business'],['label'=>'detail-missing','path'=>'/p/supplementMealOrder/detail','params'=>['id'=>'2147483001'],'kind'=>'business']];
$candidates=json_decode(file_get_contents(__DIR__.'/static-candidates.json'),true)['candidates'];foreach($candidates as $candidate){if(strpos($candidate['path'],'Lower')===false)continue;$detail=substr($candidate['path'],-7)==='/detail';$param=$detail?[(strpos($candidate['path'],'billing')!==false?'bill_id':(strpos($candidate['path'],'cashRefund')!==false?'refund_id':'id'))=>'2147483001']:$list;$cases[]=['label'=>'alias-'.count($cases),'path'=>$candidate['path'],'params'=>$param,'kind'=>'unreachable'];}
if(count($cases)!==15)throw new RuntimeException('Exact 15 scenarios per lane');
$save('request.json',['token'=>$token,'cases'=>$cases]);$save('auth-source.json',$current);$save('auth-native.json',FLGate::$journal);$save('auth-oracle.json',$GLOBALS['FL_ORACLE']);
echo json_encode(['lane'=>$lane,'auth_created'=>true,'case_count'=>count($cases),'constructor_native_SQL'=>0,'actor_type'=>$actor['type'],'actor_status'=>$actor['status'],'password_login_tested'=>false]),"\n";
