feat: add schema for schedule generation
This commit is contained in:
@@ -35,3 +35,59 @@ export const extractedFactSchema = {
|
|||||||
required: ["statement", "summary", "source", "confidence", "topics"],
|
required: ["statement", "summary", "source", "confidence", "topics"],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const timeString = {
|
||||||
|
type: "string",
|
||||||
|
pattern: "^([01][0-9]|2[0-3]):[0-5][0-9]$",
|
||||||
|
};
|
||||||
|
const endTimeString = {
|
||||||
|
type: "string",
|
||||||
|
pattern: "^([01][0-9]|2[0-3]):[0-5][0-9]$|^24:00$",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dailyScheduleSchema = {
|
||||||
|
type: "array",
|
||||||
|
minItems: 48,
|
||||||
|
maxItems: 48,
|
||||||
|
items: {
|
||||||
|
type: "object",
|
||||||
|
additionalProperties: false,
|
||||||
|
properties: {
|
||||||
|
start: timeString,
|
||||||
|
end: endTimeString,
|
||||||
|
activity: { type: "string" },
|
||||||
|
notes: { type: "string" },
|
||||||
|
},
|
||||||
|
required: ["start", "end", "activity"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const monthlyScheduleSchema = {
|
||||||
|
type: "array",
|
||||||
|
minItems: 28,
|
||||||
|
maxItems: 31,
|
||||||
|
items: {
|
||||||
|
type: "object",
|
||||||
|
additionalProperties: false,
|
||||||
|
properties: {
|
||||||
|
day: { type: "integer", minimum: 1, maximum: 31 },
|
||||||
|
summary: { type: "string" },
|
||||||
|
},
|
||||||
|
required: ["day", "summary"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const availabilitySchema = {
|
||||||
|
type: "array",
|
||||||
|
minItems: 1,
|
||||||
|
items: {
|
||||||
|
type: "object",
|
||||||
|
additionalProperties: false,
|
||||||
|
properties: {
|
||||||
|
start: timeString,
|
||||||
|
end: endTimeString,
|
||||||
|
status: { type: "string", enum: ["online", "do-not-disturb", "offline"] },
|
||||||
|
},
|
||||||
|
required: ["start", "end", "status"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user