payfrit-works/api/admin/closeAllChats.cfm
John Mizerek f919ef1cfe Add chat expiration and order management improvements
- Auto-expire stale chats older than 20 minutes in createChat.cfm
- Add expireStaleChats.cfm for scheduled cleanup
- Add abandonOrder.cfm for Start Fresh functionality
- Add closeAllChats action to debugTasks.cfm
- Fix setOrderType NULL value for non-delivery orders
- Add ForceNew parameter to setLineItem for customized items
- Add public endpoint allowlist entries for new endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:46:39 -08:00

26 lines
621 B
Text

<cfsetting showdebugoutput="false">
<cfcontent type="application/json; charset=utf-8">
<cfscript>
// Close all open chat tasks
try {
result = queryExecute("
UPDATE Tasks
SET TaskCompletedOn = NOW()
WHERE TaskTypeID = 2
AND TaskCompletedOn IS NULL
", {}, { datasource: "payfrit" });
affected = result.recordCount ?: 0;
writeOutput(serializeJSON({
"OK": true,
"MESSAGE": "Closed all open chats",
"AFFECTED": affected
}));
} catch (any e) {
writeOutput(serializeJSON({
"OK": false,
"ERROR": e.message
}));
}
</cfscript>