- Move menu manager button to toolbar next to Save Menu for visibility - Implement server-side photo upload for menu items - Strip base64 data URLs from save payload to reduce size - Add scheduled tasks, quick tasks, ratings, and task categories APIs - Add vertical support and brand color features Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
59 lines
1.9 KiB
Text
59 lines
1.9 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
<cfscript>
|
|
try {
|
|
// Create TaskRatings table
|
|
queryExecute("
|
|
CREATE TABLE IF NOT EXISTS TaskRatings (
|
|
TaskRatingID INT AUTO_INCREMENT PRIMARY KEY,
|
|
TaskRatingTaskID INT NOT NULL,
|
|
|
|
TaskRatingByUserID INT NOT NULL,
|
|
TaskRatingForUserID INT NOT NULL,
|
|
TaskRatingDirection VARCHAR(25) NOT NULL,
|
|
|
|
-- Customer/Admin rates Worker
|
|
TaskRatingOnTime TINYINT(1) NULL,
|
|
TaskRatingCompletedScope TINYINT(1) NULL,
|
|
TaskRatingRequiredFollowup TINYINT(1) NULL,
|
|
TaskRatingContinueAllow TINYINT(1) NULL,
|
|
|
|
-- Worker rates Customer
|
|
TaskRatingPrepared TINYINT(1) NULL,
|
|
TaskRatingRespectful TINYINT(1) NULL,
|
|
TaskRatingWouldAutoAssign TINYINT(1) NULL,
|
|
|
|
-- For rating links in receipts
|
|
TaskRatingAccessToken VARCHAR(64) NOT NULL UNIQUE,
|
|
TaskRatingExpiresOn DATETIME NOT NULL,
|
|
|
|
-- Timestamps
|
|
TaskRatingCreatedOn DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
TaskRatingCompletedOn DATETIME NULL,
|
|
|
|
INDEX idx_task (TaskRatingTaskID),
|
|
INDEX idx_for_user (TaskRatingForUserID),
|
|
INDEX idx_by_user (TaskRatingByUserID),
|
|
INDEX idx_token (TaskRatingAccessToken)
|
|
)
|
|
", {}, { datasource: "payfrit" });
|
|
|
|
// Verify table was created
|
|
cols = queryExecute("DESCRIBE TaskRatings", {}, { datasource: "payfrit" });
|
|
colNames = [];
|
|
for (c in cols) {
|
|
arrayAppend(colNames, c.Field);
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"MESSAGE": "TaskRatings table created successfully",
|
|
"COLUMNS": colNames
|
|
}));
|
|
} catch (any e) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": e.message
|
|
}));
|
|
}
|
|
</cfscript>
|