<?php
declare(strict_types=1);
function n6Cases(array $p):array{
    $out=[];if($p['equipment_read']){$out[]=['name'=>'EQUIPMENT_READ','path'=>'/p/equipment/read','params'=>['id'=>$p['equipment_read']['id']],'kind'=>'read'];}
    if($p['weigh']){foreach([1,2] as $page){$out[]=['name'=>'PUSH_LIST_'.$page,'path'=>'/p/equipment/pushList','params'=>['page'=>$page,'pageSize'=>5,'type'=>$p['weigh']['type'],'restaurant_id'=>$p['weigh']['restaurant_id']],'kind'=>'push'];}}
    if($p['version']){$out[]=['name'=>'VERSION_CODE','path'=>'/p/equipment/getcode','params'=>['type'=>$p['version']['type']],'kind'=>'code'];$out[]=['name'=>'VERSION_CODE_EMPTY','path'=>'/p/equipment/getcode','params'=>['type'=>2147483646],'kind'=>'code'];}
    if($p['weigh_dishes']){$out[]=['name'=>'WEIGH_DISHES','path'=>'/api/weigh/dishes','params'=>['code'=>$p['weigh_dishes']['code']],'kind'=>'weigh'];}
    foreach([$p['owned_recipe']['date'],'1900-01-01'] as $i=>$date){$out[]=['name'=>'MOBILE_RECIPE_'.($i?'EMPTY':'OWNED'),'path'=>'/m/Dishes/recipe','params'=>['menu_date'=>$date,'meal_times'=>1,'type'=>1,'restaurant_id'=>$p['owned_recipe']['restaurant_id']],'kind'=>'recipe'];}
    if($p['dining']){foreach(['','1'] as $i=>$flag){$out[]=['name'=>'STAFF_DINING_'.($i?'MEAL1':'ALL'),'path'=>'/p/dateMenu/getStaffDiningLists','params'=>['page'=>1,'name'=>$p['dining']['name'],'department_uuid'=>$p['dining']['department_uuid'],'start_time'=>$p['dining']['date'],'end_time'=>$p['dining']['date'],'dining'=>$flag],'kind'=>'dining'];}}
    return $out;
}
