From 21dcb19ec40ff1ff91b68c2ba6295db40b0f639f Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 11 Jan 2026 17:58:31 -0800 Subject: [PATCH] Add debug endpoint for employee data --- api/admin/debugEmployees.cfm | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 api/admin/debugEmployees.cfm diff --git a/api/admin/debugEmployees.cfm b/api/admin/debugEmployees.cfm new file mode 100644 index 0000000..51107f1 --- /dev/null +++ b/api/admin/debugEmployees.cfm @@ -0,0 +1,40 @@ + + + + + +data = {}; +try { + requestBody = toString(getHttpRequestData().content); + if (len(requestBody)) data = deserializeJSON(requestBody); +} catch (any e) {} + +businessId = structKeyExists(data, "BusinessID") ? val(data.BusinessID) : 17; + +q = queryExecute(" + SELECT EmployeeID, UserID, EmployeeStatusID, EmployeeIsActive, + CAST(EmployeeIsActive AS UNSIGNED) AS IsActiveInt + FROM lt_Users_Businesses_Employees + WHERE BusinessID = ? +", [{ value: businessId, cfsqltype: "cf_sql_integer" }], { datasource: "payfrit" }); + +rows = []; +for (r in q) { + arrayAppend(rows, { + "EmployeeID": r.EmployeeID, + "UserID": r.UserID, + "StatusID": r.EmployeeStatusID, + "RawIsActive": r.EmployeeIsActive, + "CastIsActive": r.IsActiveInt, + "ValRaw": val(r.EmployeeIsActive), + "ValCast": val(r.IsActiveInt), + "EqRaw1": r.EmployeeIsActive == 1, + "EqCast1": r.IsActiveInt == 1 + }); +} + +writeOutput(serializeJSON({ + "OK": true, + "ROWS": rows +})); +