setup.getConsumableMenu = function(id:string){
    const constData = setup.consumableMenus[id] ?? {categories:{},payment:'cash'};
    let result = clone(constData);

    for(const [categoryId,categoryData] of Object.entries(result.categories)){
        let items = categoryData.items ?? {};
        for(const [itemId,itemData] of Object.entries(items)){
            const consumableConstData = setup.getConsumable(itemId);
            let newItemData = consumableConstData;
            if(itemData.price !== undefined){
                if(typeof itemData.price == "number")
                    newItemData.price = itemData.price;
                else if(typeof itemData.price == "function")
                    newItemData.price = Math.round(itemData.price(newItemData.price));
            }
            result.categories[categoryId].items[itemId] = consumableConstData;
        }
    }
    return result;
}

setup.consumableMenus ??={};