Task System: - Tasks auto-created when KDS marks order Ready (status 3) - Duplicate task prevention via TaskOrderID check - Task completion now marks associated order as Completed (status 4) - Fixed isNull() check for TaskCompletedOn (use len() instead) - Added TaskOrderID to task queries for order linking Worker APIs: - api/workers/myBusinesses.cfm with GROUP BY to prevent duplicates - api/tasks/listMine.cfm for worker's claimed tasks with filters - api/tasks/complete.cfm updates both task and order status - api/tasks/accept.cfm for claiming tasks KDS/Portal: - KDS only shows orders with status < 4 - Portal dashboard improvements Admin/Debug: - Debug endpoints for tasks and businesses - Test data reset endpoint 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
866 B
Text
43 lines
866 B
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
|
|
<cfset result = {}>
|
|
<cftry>
|
|
<cfset queryExecute(
|
|
"
|
|
INSERT INTO Tasks (
|
|
TaskBusinessID,
|
|
TaskOrderID,
|
|
TaskClaimedByUserID,
|
|
TaskAddedOn
|
|
) VALUES (
|
|
1,
|
|
999,
|
|
0,
|
|
NOW()
|
|
)
|
|
",
|
|
[],
|
|
{ datasource = "payfrit" }
|
|
)>
|
|
|
|
<cfset qCount = queryExecute("SELECT COUNT(*) AS cnt FROM Tasks", [], { datasource = "payfrit" })>
|
|
|
|
<cfset result = {
|
|
"OK": true,
|
|
"MESSAGE": "Task inserted successfully",
|
|
"TASK_COUNT": qCount.cnt
|
|
}>
|
|
|
|
<cfcatch>
|
|
<cfset result = {
|
|
"OK": false,
|
|
"ERROR": cfcatch.message,
|
|
"DETAIL": cfcatch.detail,
|
|
"TYPE": cfcatch.type
|
|
}>
|
|
</cfcatch>
|
|
</cftry>
|
|
|
|
<cfoutput>#serializeJSON(result)#</cfoutput>
|