Add timetable scheduler Phases 1 + 2 to school-service
Phase 1 — Stammdaten (7 tables):
tt_class, tt_period, tt_room, tt_subject, tt_teacher,
tt_curriculum, tt_assignment with CRUD endpoints.
Phase 2 — Constraints (15 typed tables):
Teacher (6): unavailable_day, unavailable_window, max_hours_day,
max_hours_week, excluded_subject, excluded_room
Subject (5): min_day_gap, max_consecutive, contiguous_when_repeated,
preferred_period, double_lesson
Class (2): max_hours_day, no_gaps
Room (2): requires_type, unavailable
Each constraint row carries is_hard / weight / active / note /
created_by_user_id; ownership enforced via WHERE EXISTS against the
parent tt_teacher/tt_class/tt_subject/tt_room row.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// TimetableClass is a school class managed for timetabling.
|
||||
// Separate from the per-teacher `classes` table because timetabling is school-wide.
|
||||
type TimetableClass struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
Name string `json:"name" db:"name"`
|
||||
GradeLevel int `json:"grade_level" db:"grade_level"`
|
||||
StudentCount int `json:"student_count" db:"student_count"`
|
||||
Notes string `json:"notes,omitempty" db:"notes"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TimetablePeriod is one time slot in the weekly grid.
|
||||
// DayOfWeek: 1=Mon..7=Sun. PeriodIndex: 1=first lesson of the day.
|
||||
type TimetablePeriod struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
DayOfWeek int `json:"day_of_week" db:"day_of_week"`
|
||||
PeriodIndex int `json:"period_index" db:"period_index"`
|
||||
StartTime string `json:"start_time" db:"start_time"`
|
||||
EndTime string `json:"end_time" db:"end_time"`
|
||||
IsBreak bool `json:"is_break" db:"is_break"`
|
||||
Label string `json:"label,omitempty" db:"label"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TimetableRoom is a physical room that can host lessons.
|
||||
type TimetableRoom struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
Name string `json:"name" db:"name"`
|
||||
RoomType string `json:"room_type,omitempty" db:"room_type"`
|
||||
Capacity int `json:"capacity" db:"capacity"`
|
||||
FloorLevel int `json:"floor_level" db:"floor_level"`
|
||||
HasElevator bool `json:"has_elevator" db:"has_elevator"`
|
||||
Notes string `json:"notes,omitempty" db:"notes"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TimetableSubject is a school-wide subject for timetabling.
|
||||
type TimetableSubject struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
Name string `json:"name" db:"name"`
|
||||
ShortCode string `json:"short_code" db:"short_code"`
|
||||
Color string `json:"color,omitempty" db:"color"`
|
||||
IsMainSubject bool `json:"is_main_subject" db:"is_main_subject"`
|
||||
RequiredRoomType string `json:"required_room_type,omitempty" db:"required_room_type"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TimetableTeacher is a teacher as a schedulable resource.
|
||||
// Independent from BreakPilot users — the Rektor enters all teachers manually.
|
||||
type TimetableTeacher struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
FirstName string `json:"first_name" db:"first_name"`
|
||||
LastName string `json:"last_name" db:"last_name"`
|
||||
ShortCode string `json:"short_code" db:"short_code"`
|
||||
EmploymentPercentage int `json:"employment_percentage" db:"employment_percentage"`
|
||||
MaxHoursWeek int `json:"max_hours_week" db:"max_hours_week"`
|
||||
Notes string `json:"notes,omitempty" db:"notes"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TimetableCurriculum links a class to a subject with the weekly hour count.
|
||||
type TimetableCurriculum struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
ClassID uuid.UUID `json:"class_id" db:"class_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
WeeklyHours int `json:"weekly_hours" db:"weekly_hours"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
|
||||
// Joined fields
|
||||
SubjectName string `json:"subject_name,omitempty"`
|
||||
ClassName string `json:"class_name,omitempty"`
|
||||
}
|
||||
|
||||
// TimetableAssignment is the teaching contract: who teaches what subject in which class.
|
||||
type TimetableAssignment struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
ClassID uuid.UUID `json:"class_id" db:"class_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
|
||||
// Joined fields
|
||||
TeacherName string `json:"teacher_name,omitempty"`
|
||||
ClassName string `json:"class_name,omitempty"`
|
||||
SubjectName string `json:"subject_name,omitempty"`
|
||||
}
|
||||
|
||||
// Request DTOs
|
||||
|
||||
type CreateTimetableClassRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
GradeLevel int `json:"grade_level" binding:"required,min=1,max=13"`
|
||||
StudentCount int `json:"student_count" binding:"min=0"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
type CreateTimetablePeriodRequest struct {
|
||||
DayOfWeek int `json:"day_of_week" binding:"required,min=1,max=7"`
|
||||
PeriodIndex int `json:"period_index" binding:"required,min=1"`
|
||||
StartTime string `json:"start_time" binding:"required"`
|
||||
EndTime string `json:"end_time" binding:"required"`
|
||||
IsBreak bool `json:"is_break"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type CreateTimetableRoomRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
RoomType string `json:"room_type"`
|
||||
Capacity int `json:"capacity"`
|
||||
FloorLevel int `json:"floor_level"`
|
||||
HasElevator bool `json:"has_elevator"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
type CreateTimetableSubjectRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
ShortCode string `json:"short_code" binding:"required"`
|
||||
Color string `json:"color"`
|
||||
IsMainSubject bool `json:"is_main_subject"`
|
||||
RequiredRoomType string `json:"required_room_type"`
|
||||
}
|
||||
|
||||
type CreateTimetableTeacherRequest struct {
|
||||
FirstName string `json:"first_name" binding:"required"`
|
||||
LastName string `json:"last_name" binding:"required"`
|
||||
ShortCode string `json:"short_code" binding:"required"`
|
||||
EmploymentPercentage int `json:"employment_percentage" binding:"min=0,max=100"`
|
||||
MaxHoursWeek int `json:"max_hours_week" binding:"min=0"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
type CreateTimetableCurriculumRequest struct {
|
||||
ClassID string `json:"class_id" binding:"required,uuid"`
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
WeeklyHours int `json:"weekly_hours" binding:"required,min=1,max=10"`
|
||||
}
|
||||
|
||||
type CreateTimetableAssignmentRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
ClassID string `json:"class_id" binding:"required,uuid"`
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Each constraint table carries the same audit/policy columns:
|
||||
// - is_hard: true = solver must satisfy, false = soft (weighted)
|
||||
// - weight: higher = stronger penalty when violated (used for soft constraints)
|
||||
// - active: allows toggling a rule off without deletion
|
||||
// - note: free-text rationale ("Lehrer X im Rollstuhl")
|
||||
// - created_by_user_id: the Rektor account that owns this rule
|
||||
|
||||
// ---------- Teacher constraints (6) ----------
|
||||
|
||||
// TeacherUnavailableDay: Lehrer kann an Wochentag NIE.
|
||||
type TeacherUnavailableDay struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
DayOfWeek int `json:"day_of_week" db:"day_of_week"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TeacherUnavailableWindow: Lehrer kann an Tag X von HH:MM bis HH:MM nicht.
|
||||
type TeacherUnavailableWindow struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
DayOfWeek int `json:"day_of_week" db:"day_of_week"`
|
||||
StartTime string `json:"start_time" db:"start_time"`
|
||||
EndTime string `json:"end_time" db:"end_time"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TeacherMaxHoursDay: Lehrer darf max. N Stunden pro Tag haben.
|
||||
type TeacherMaxHoursDay struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
MaxHours int `json:"max_hours" db:"max_hours"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TeacherMaxHoursWeek: Teilzeit-Cap.
|
||||
type TeacherMaxHoursWeek struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
MaxHours int `json:"max_hours" db:"max_hours"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TeacherExcludedSubject: Lehrer darf bestimmtes Fach nicht unterrichten.
|
||||
type TeacherExcludedSubject struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// TeacherExcludedRoom: Lehrer kann Raum nicht nutzen (z.B. kein Aufzug).
|
||||
type TeacherExcludedRoom struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
TeacherID uuid.UUID `json:"teacher_id" db:"teacher_id"`
|
||||
RoomID uuid.UUID `json:"room_id" db:"room_id"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// ---------- Subject constraints (5) ----------
|
||||
|
||||
// SubjectMinDayGap: Mindestens N Tage Abstand zwischen zwei Lessons desselben Fachs.
|
||||
type SubjectMinDayGap struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
MinGapDays int `json:"min_gap_days" db:"min_gap_days"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// SubjectMaxConsecutive: Max. N aufeinander folgende Stunden des Fachs (keine Tripel-Stunde).
|
||||
type SubjectMaxConsecutive struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
MaxConsecutive int `json:"max_consecutive" db:"max_consecutive"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// SubjectContiguousWhenRepeated: Wenn das Fach mehrfach am gleichen Tag stattfindet, dann nur als Block.
|
||||
type SubjectContiguousWhenRepeated struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// SubjectPreferredPeriod: Fach lieber in einem bestimmten Period-Bereich (z.B. Hauptfächer morgens).
|
||||
type SubjectPreferredPeriod struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
PeriodFrom int `json:"period_from" db:"period_from"`
|
||||
PeriodTo int `json:"period_to" db:"period_to"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// SubjectDoubleLesson: Fach bevorzugt als Doppelstunde.
|
||||
type SubjectDoubleLesson struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// ---------- Class constraints (2) ----------
|
||||
|
||||
// ClassMaxHoursDay: Klasse darf max. N Stunden pro Tag haben.
|
||||
type ClassMaxHoursDay struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
ClassID uuid.UUID `json:"class_id" db:"class_id"`
|
||||
MaxHours int `json:"max_hours" db:"max_hours"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// ClassNoGaps: Keine Freistunden für die Klasse zwischen Lessons (Soft-Standard).
|
||||
type ClassNoGaps struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
ClassID uuid.UUID `json:"class_id" db:"class_id"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// ---------- Room constraints (2) ----------
|
||||
|
||||
// RoomRequiresType: Fach benötigt einen bestimmten Raumtyp (Sport → Sporthalle).
|
||||
type RoomRequiresType struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
SubjectID uuid.UUID `json:"subject_id" db:"subject_id"`
|
||||
RoomType string `json:"room_type" db:"room_type"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// RoomUnavailable: Raum an Tag X, Stunde Y blockiert (Wartung, Renovierung).
|
||||
type RoomUnavailable struct {
|
||||
ID uuid.UUID `json:"id" db:"id"`
|
||||
CreatedByUserID uuid.UUID `json:"created_by_user_id" db:"created_by_user_id"`
|
||||
RoomID uuid.UUID `json:"room_id" db:"room_id"`
|
||||
DayOfWeek int `json:"day_of_week" db:"day_of_week"`
|
||||
PeriodIndex int `json:"period_index" db:"period_index"`
|
||||
IsHard bool `json:"is_hard" db:"is_hard"`
|
||||
Weight int `json:"weight" db:"weight"`
|
||||
Active bool `json:"active" db:"active"`
|
||||
Note string `json:"note,omitempty" db:"note"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
}
|
||||
|
||||
// ---------- Request DTOs ----------
|
||||
|
||||
// Teacher
|
||||
type CreateTeacherUnavailableDayRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
DayOfWeek int `json:"day_of_week" binding:"required,min=1,max=7"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateTeacherUnavailableWindowRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
DayOfWeek int `json:"day_of_week" binding:"required,min=1,max=7"`
|
||||
StartTime string `json:"start_time" binding:"required"`
|
||||
EndTime string `json:"end_time" binding:"required"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateTeacherMaxHoursDayRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
MaxHours int `json:"max_hours" binding:"required,min=1,max=12"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateTeacherMaxHoursWeekRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
MaxHours int `json:"max_hours" binding:"required,min=1,max=40"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateTeacherExcludedSubjectRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateTeacherExcludedRoomRequest struct {
|
||||
TeacherID string `json:"teacher_id" binding:"required,uuid"`
|
||||
RoomID string `json:"room_id" binding:"required,uuid"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
// Subject
|
||||
type CreateSubjectMinDayGapRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
MinGapDays int `json:"min_gap_days" binding:"required,min=1,max=4"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateSubjectMaxConsecutiveRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
MaxConsecutive int `json:"max_consecutive" binding:"required,min=1,max=5"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateSubjectContiguousWhenRepeatedRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateSubjectPreferredPeriodRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
PeriodFrom int `json:"period_from" binding:"required,min=1,max=12"`
|
||||
PeriodTo int `json:"period_to" binding:"required,min=1,max=12"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateSubjectDoubleLessonRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
// Class
|
||||
type CreateClassMaxHoursDayRequest struct {
|
||||
ClassID string `json:"class_id" binding:"required,uuid"`
|
||||
MaxHours int `json:"max_hours" binding:"required,min=1,max=12"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateClassNoGapsRequest struct {
|
||||
ClassID string `json:"class_id" binding:"required,uuid"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
// Room
|
||||
type CreateRoomRequiresTypeRequest struct {
|
||||
SubjectID string `json:"subject_id" binding:"required,uuid"`
|
||||
RoomType string `json:"room_type" binding:"required"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type CreateRoomUnavailableRequest struct {
|
||||
RoomID string `json:"room_id" binding:"required,uuid"`
|
||||
DayOfWeek int `json:"day_of_week" binding:"required,min=1,max=7"`
|
||||
PeriodIndex int `json:"period_index" binding:"required,min=1,max=12"`
|
||||
IsHard bool `json:"is_hard"`
|
||||
Weight int `json:"weight" binding:"min=0,max=100"`
|
||||
Active bool `json:"active"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
Reference in New Issue
Block a user