You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'The type of restriction being applied. Restrict before restricts all times before \'endTime\', Restrict Before restricts all times after \'startTime\', Restrict Between restricts all times between \'startTime\' and \'endTime\', Restrict Day restricts the entirety of each day in field \'days\', and Days Off enforces as least \'numDays\' days off per week.',
66
-
),
67
-
days: z.array(DayOfWeekEnum)
68
-
.default(['MO','TU','WE','TH','FR'])
69
-
.describe('Specific days of the week this restriction applies to'),
70
-
numDays:
71
-
z.number()
72
-
.positive()
73
-
.max(4,'Cannot block all days of the week')
74
-
.optional()
75
-
.describe(
76
-
'If type is Days Off, then this field is used and describes min number of days off per week. For example, if set to 2, and \'type\' is Days Off, then this means we want at least 2 days off per week.',
77
-
),
78
-
maxGap:
79
-
z.number()
80
-
.positive()
81
-
.max(23,'Cannot have a gap of an entire day for between courses')
82
-
.optional()
83
-
.describe(
84
-
'If type is Max Gap, then this field is used to describe the maximum gap between courses, in hours. For example, if set to 3, then 2 entires must not be further than 3 hours apart. '),
85
-
startTime: z.string().optional().describe(
86
-
'If type is Restrict After, or Restrict Between, then this field describes the start time of the restricted time. Formatted HH:mm:ss',
87
-
),
88
-
endTime: z.string().optional().describe(
89
-
'If type is Restrict Before, or Restrict Between, then this field describes the end time of the restricted time. Formatted HH:mm:ss',
90
-
),
91
-
disabled: z.boolean().optional().describe(
92
-
'Whether this restriction is currently disabled'),
62
+
type: z
63
+
.enum([
64
+
"Restrict Before",
65
+
"Restrict After",
66
+
"Restrict Between",
67
+
"Restrict Day",
68
+
"Days Off",
69
+
"Max Gap",
70
+
])
71
+
.describe(
72
+
"The type of restriction being applied. Restrict before restricts all times before 'endTime', Restrict Before restricts all times after 'startTime', Restrict Between restricts all times between 'startTime' and 'endTime', Restrict Day restricts the entirety of each day in field 'days', and Days Off enforces as least 'numDays' days off per week.",
73
+
),
74
+
days: z
75
+
.array(DayOfWeekEnum)
76
+
.default(["MO","TU","WE","TH","FR"])
77
+
.describe("Specific days of the week this restriction applies to"),
78
+
numDays: z
79
+
.number()
80
+
.positive()
81
+
.max(4,"Cannot block all days of the week")
82
+
.optional()
83
+
.describe(
84
+
"If type is Days Off, then this field is used and describes min number of days off per week. For example, if set to 2, and 'type' is Days Off, then this means we want at least 2 days off per week.",
85
+
),
86
+
maxGap: z
87
+
.number()
88
+
.positive()
89
+
.max(23,"Cannot have a gap of an entire day for between courses")
90
+
.optional()
91
+
.describe(
92
+
"If type is Max Gap, then this field is used to describe the maximum gap between courses, in hours. For example, if set to 3, then 2 entires must not be further than 3 hours apart. ",
93
+
),
94
+
startTime: z
95
+
.string()
96
+
.optional()
97
+
.describe(
98
+
"If type is Restrict After, or Restrict Between, then this field describes the start time of the restricted time. Formatted HH:mm:ss",
99
+
),
100
+
endTime: z
101
+
.string()
102
+
.optional()
103
+
.describe(
104
+
"If type is Restrict Before, or Restrict Between, then this field describes the end time of the restricted time. Formatted HH:mm:ss",
105
+
),
106
+
disabled: z
107
+
.boolean()
108
+
.optional()
109
+
.describe("Whether this restriction is currently disabled"),
93
110
});
94
111
95
112
exportconstTimetableFormSchema=z.object({
96
-
name: z.string()
97
-
.max(100,'Name cannot exceed 100 characters')
98
-
.min(1,'Name cannot be empty')
99
-
.describe('Title of timetable'),
100
-
date: z.string().describe('Creation time of timetable'),
113
+
name: z
114
+
.string()
115
+
.max(100,"Name cannot exceed 100 characters")
116
+
.min(1,"Name cannot be empty")
117
+
.describe("Title of timetable"),
118
+
date: z.string().describe("Creation time of timetable"),
101
119
semester: SemesterEnum,
102
-
search: z.string().optional().describe(
103
-
'Keeps track of search query. Only used in UI.'),
120
+
search: z
121
+
.string()
122
+
.optional()
123
+
.describe("Keeps track of search query. Only used in UI."),
0 commit comments