<?php
declare(strict_types=1);
function catCases(array $c):array{$out=[];$add=static function($name,$method,$path,$params,$kind)use(&$out){$out[]=['name'=>$name,'method'=>$method,'path'=>$path,'params'=>$params,'kind'=>$kind];};
if($c['dishes']){foreach([1,2] as $page){$add('DISHES_'.$page,'POST','/api/consume/dishes',['category'=>$c['dishes']['category'],'keyword'=>$c['dishes']['name'],'page_size'=>5,'page'=>$page],'dishes');}}
if($c['recognize']){foreach([1,2] as $page){$add('RECOGNIZE_'.$page,'POST','/api/consume/dishesRecognizeImgList',['page'=>$page,'page_size'=>5],'recognize');}}
if($c['orders']){foreach([$c['orders']['date'],'1900-01-01'] as $i=>$date){$add('ORDERS_'.($i?'EMPTY':'SOURCE'),'POST','/api/consume/orderList',['meal_date'=>$date,'equipment_code'=>$c['orders']['equipment_code'],'meal_times'=>$c['orders']['meal_times'],'page'=>1],'orders');}}
if($c['card']){foreach([$c['card']['card_id'],'CDXCATALOG_NO_CARD_1010'] as $i=>$card){$add('CARD_'.($i?'MISSING':'SOURCE'),'POST','/api/consume/card',['card_id'=>trim((string)$card)],'card');}}
if($c['face']){foreach([1,2] as $page){$add('FACE_'.$page,'GET','/p/api/getFaceDataList',['appId'=>'CDXCATALOG10','deviceId'=>'CDXCATALOG10','updateTime'=>'0','page'=>$page],'face');}}
if($c['rotation']&&!isset($c['rotation']['empty_source'])){$add('ROTATION_SOURCE','POST','/p/api/rotation',['device_code'=>$c['rotation']['code']],'rotation');}$add('ROTATION_MISSING','POST','/p/api/rotation',['device_code'=>'CDXCATALOG_NO_STATION_1010'],'rotation');return $out;
}
