payfrit-works/api/admin/debugTasks.cfm
John Mizerek 1f4d06edba Add Payfrit Works (WDS) support and task completion flow
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>
2026-01-03 14:52:04 -08:00

38 lines
1 KiB
Text

<cfsetting showdebugoutput="false">
<cfsetting enablecfoutputonly="true">
<cfcontent type="application/json; charset=utf-8">
<cftry>
<cfset qDesc = queryExecute("DESCRIBE Tasks", [], { datasource = "payfrit" })>
<cfset cols = []>
<cfloop query="qDesc">
<cfset arrayAppend(cols, { "Field": qDesc.Field, "Type": qDesc.Type })>
</cfloop>
<cfset qCount = queryExecute("SELECT COUNT(*) AS cnt FROM Tasks", [], { datasource = "payfrit" })>
<cfset qAll = queryExecute("SELECT * FROM Tasks LIMIT 5", [], { datasource = "payfrit" })>
<cfset tasks = []>
<cfloop query="qAll">
<cfset row = {}>
<cfloop list="#qAll.columnList#" index="col">
<cfset row[col] = qAll[col]>
</cfloop>
<cfset arrayAppend(tasks, row)>
</cfloop>
<cfoutput>#serializeJSON({
"OK": true,
"COLUMNS": cols,
"TASK_COUNT": qCount.cnt,
"SAMPLE_TASKS": tasks
})#</cfoutput>
<cfcatch>
<cfoutput>#serializeJSON({
"OK": false,
"ERROR": cfcatch.message,
"DETAIL": cfcatch.detail
})#</cfoutput>
</cfcatch>
</cftry>