100 lines
3.5 KiB
JavaScript
100 lines
3.5 KiB
JavaScript
import { z } from 'zod';
|
|
export function registerLaborTools(client) {
|
|
return [
|
|
{
|
|
name: 'toast_list_shifts',
|
|
description: 'List all shifts within a date range',
|
|
inputSchema: z.object({
|
|
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
|
endDate: z.string().describe('End date (ISO 8601 format)'),
|
|
page: z.number().optional().describe('Page number (default: 1)'),
|
|
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
|
}),
|
|
execute: async (args) => {
|
|
const result = await client.labor.listShifts(args.startDate, args.endDate, {
|
|
page: args.page,
|
|
pageSize: args.pageSize,
|
|
});
|
|
return {
|
|
content: [
|
|
{
|
|
type: 'text',
|
|
text: JSON.stringify(result, null, 2),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
},
|
|
{
|
|
name: 'toast_get_shift',
|
|
description: 'Get details of a specific shift',
|
|
inputSchema: z.object({
|
|
shiftGuid: z.string().describe('Shift GUID'),
|
|
}),
|
|
execute: async (args) => {
|
|
const result = await client.labor.getShift(args.shiftGuid);
|
|
return {
|
|
content: [
|
|
{
|
|
type: 'text',
|
|
text: JSON.stringify(result, null, 2),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
},
|
|
{
|
|
name: 'toast_list_shift_breaks',
|
|
description: 'List all breaks for a specific shift',
|
|
inputSchema: z.object({
|
|
shiftGuid: z.string().describe('Shift GUID'),
|
|
}),
|
|
execute: async (args) => {
|
|
const result = await client.labor.listBreaks(args.shiftGuid);
|
|
return {
|
|
content: [
|
|
{
|
|
type: 'text',
|
|
text: JSON.stringify(result, null, 2),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
},
|
|
{
|
|
name: 'toast_get_labor_cost',
|
|
description: 'Get labor cost summary for a business date',
|
|
inputSchema: z.object({
|
|
businessDate: z.string().describe('Business date (YYYYMMDD format)'),
|
|
}),
|
|
execute: async (args) => {
|
|
const result = await client.labor.getLaborCost(args.businessDate);
|
|
return {
|
|
content: [
|
|
{
|
|
type: 'text',
|
|
text: JSON.stringify(result, null, 2),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
},
|
|
{
|
|
name: 'toast_list_jobs',
|
|
description: 'List all available jobs/positions',
|
|
inputSchema: z.object({}),
|
|
execute: async (args) => {
|
|
const result = await client.labor.listJobs();
|
|
return {
|
|
content: [
|
|
{
|
|
type: 'text',
|
|
text: JSON.stringify(result, null, 2),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
},
|
|
];
|
|
}
|
|
//# sourceMappingURL=labor-tools.js.map
|