payfrit-works/api/admin/debugDrinkStructure.cfm
John Mizerek e757a4140b Add drink modifiers, unified schema improvements, and portal fixes
Menu System:
- Unified schema with Categories table integration
- Virtual category headers with proper parent ID remapping
- Filter out legacy category headers when using new schema
- Add drink modifier endpoints for Fountain Soda (Size/Flavor)

Admin Tools:
- addDrinkModifiers.cfm - Add size/flavor modifiers to drinks
- copyDrinksToBigDeans.cfm - Copy drink items between businesses
- debugDrinkStructure.cfm - Debug drink item hierarchy

Portal:
- Station assignment improvements with better drag-drop
- Enhanced debug task viewer

API Fixes:
- Application.cfm updated with new admin endpoint allowlist
- setLineItem.cfm formatting cleanup
- listMine.cfm task query fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:30:58 -08:00

76 lines
2.6 KiB
Text

<cfsetting showdebugoutput="false">
<cfsetting enablecfoutputonly="true">
<cfcontent type="application/json; charset=utf-8" reset="true">
<cfheader name="Cache-Control" value="no-store">
<cfscript>
// Find Fountain Drinks in In-N-Out (BusinessID 17) and show its hierarchy
response = { "OK": true };
try {
// Get Fountain Drinks item
qFountain = queryExecute("
SELECT ItemID, ItemName, ItemParentItemID, ItemPrice, ItemIsCollapsible, ItemRequiresChildSelection
FROM Items
WHERE ItemBusinessID = 17 AND ItemName LIKE '%Fountain%'
", {}, { datasource: "payfrit" });
response["FountainDrinks"] = [];
for (row in qFountain) {
fountainItem = {
"ItemID": row.ItemID,
"ItemName": row.ItemName,
"ItemPrice": row.ItemPrice,
"ItemIsCollapsible": row.ItemIsCollapsible,
"ItemRequiresChildSelection": row.ItemRequiresChildSelection,
"Children": []
};
// Get children of this item
qChildren = queryExecute("
SELECT ItemID, ItemName, ItemParentItemID, ItemPrice, ItemIsCollapsible, ItemRequiresChildSelection, ItemIsCheckedByDefault
FROM Items
WHERE ItemParentItemID = :parentId
ORDER BY ItemSortOrder
", { parentId: row.ItemID }, { datasource: "payfrit" });
for (child in qChildren) {
childItem = {
"ItemID": child.ItemID,
"ItemName": child.ItemName,
"ItemPrice": child.ItemPrice,
"ItemIsCollapsible": child.ItemIsCollapsible,
"ItemIsCheckedByDefault": child.ItemIsCheckedByDefault,
"Grandchildren": []
};
// Get grandchildren
qGrandchildren = queryExecute("
SELECT ItemID, ItemName, ItemPrice, ItemIsCheckedByDefault
FROM Items
WHERE ItemParentItemID = :parentId
ORDER BY ItemSortOrder
", { parentId: child.ItemID }, { datasource: "payfrit" });
for (gc in qGrandchildren) {
arrayAppend(childItem.Grandchildren, {
"ItemID": gc.ItemID,
"ItemName": gc.ItemName,
"ItemPrice": gc.ItemPrice,
"ItemIsCheckedByDefault": gc.ItemIsCheckedByDefault
});
}
arrayAppend(fountainItem.Children, childItem);
}
arrayAppend(response.FountainDrinks, fountainItem);
}
} catch (any e) {
response["OK"] = false;
response["ERROR"] = e.message;
}
writeOutput(serializeJSON(response));
</cfscript>