{"type":"object","properties":{"config":{"$ref":"#/components/schemas/SchoolConfig"},"logo":{"$ref":"#/components/schemas/SchoolLogo"},"subjects_custom":{"description":"Custom subjects","x-domain":{"entity":"subject","fieldDefault":"manage_entities"},"type":"object","patternProperties":{"^customsubject-[a-z-]+$":{"$ref":"#/components/schemas/SubjectFull"}}},"families_custom":{"description":"Custom subject families","type":"object","patternProperties":{"^customfamily-[a-z-]+$":{"$ref":"#/components/schemas/Family"}}},"users":{"description":"Users (with roles: admin, teacher, student...)","type":"object","additionalProperties":{"$ref":"#/components/schemas/User"}},"access":{"description":"API access credentials: internal keypairs and provider secret keys. Writable by unrestricted admins only","x-domain":{"capability":"unrestricted_only"},"type":"object"},"school_years":{"description":"School years (academic years)","type":"object","additionalProperties":{"$ref":"#/components/schemas/SchoolYear"}},"translations":{"$ref":"#/components/schemas/Translations"},"api":{"$ref":"#/components/schemas/APISettings"},"snapshots":{"description":"Configuration of automatic snapshots","type":"object","properties":{"automations":{"type":"array","items":{"type":"object","properties":{"rrule":{"$ref":"#/components/schemas/Rrule"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["rrule","time"]}}},"x-premiumOnly":true},"jobs":{"description":"Internal storage of jobs to be executed regularly and automatically by the system","type":"object","additionalProperties":{"description":"Job by type ID (e.g. \"snapshots\" or \"aurion\")","type":"object","properties":{"action":{"type":"string"},"what":{"type":"string"},"when":{"type":"array","items":{"type":"object","properties":{"rrule":{"$ref":"#/components/schemas/Rrule"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string"},"date":{"type":"string","format":"date"}},"required":["rrule","time","timezone","date"]}},"data":{"type":"object"},"metadata":{"type":"object","properties":{"priority":{"type":"string","enum":["low","medium","high"]},"created_by":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["priority","created_by","created_at"]}},"required":["action","what","when","data","metadata"]},"x-premiumOnly":true},"panels":{"type":"object","additionalProperties":{"allOf":[{"$ref":"#/components/schemas/Panel"},{"type":"object","properties":{"lockcode":{"description":"Random unique access key","type":"string","readOnly":true}},"required":["lockcode"]}]}},"alterations":{"description":"Storing diff lessons to remove/add for specific dates, diverging from the regular weekly/cycle timetable, ordered by week number (from EPOCH)","type":"object","patternProperties":{"^[0-9]+$":{"description":"Alterations for the week (counting from EPOCH, e.g. 2024-09-10 => 2854)","type":"object","properties":{"added":{"title":"Lessons to add at specific date","description":"Lessons to add at specific date. That can be a new lesson or a lesson replacing another one (we store everything fields again)","x-domain":{"items":"edit_placement","fieldDefault":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/LessonAlteration"}},"removed":{"title":"Lessons to remove at specific date","description":"Lessons to remove at specific date. As we do not have ID on lessons, we store the complete footprint of the lesson to be removed","x-domain":{"items":"edit_placement","fieldDefault":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/LessonAlteration"}}}}},"properties":{"_buffers":{"description":"Buffer of lessons not yet scheduled (temporary storage), by school year","type":"object","additionalProperties":{"x-domain":{"items":"edit_placement","fieldDefault":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/LessonBuffered"}}}}},"absences":{"description":"Absences for teachers, classes, or students","type":"object","properties":{"teachers":{"description":"Absences of teachers","type":"object","additionalProperties":{"description":"Absences for a specific teacher (by ID of teacher, then by index)","type":"object","patternProperties":{"^[0-9]+$":{"$ref":"#/components/schemas/AbsenceTeacher"}}}},"classes":{"description":"Absences of classes (= canceled lessons on a time span)","type":"object","additionalProperties":{"description":"Absences of specific class (by ID of class, then by index)","type":"object","patternProperties":{"^[0-9]+$":{"$ref":"#/components/schemas/AbsenceClass"}}}},"staff":{"description":"Absences of staff","type":"object","additionalProperties":{"description":"Absences for a specific staff member (by ID)","type":"object","patternProperties":{"^[0-9]+$":{"$ref":"#/components/schemas/AbsenceStaff"}}}},"students":{"description":"Absences of students","type":"object","additionalProperties":{"description":"Absences for a specific student (by ID)","type":"object","patternProperties":{"^[0-9]+$":{"$ref":"#/components/schemas/AbsenceStudent"}}}}}},"staffing":{"$ref":"#/components/schemas/Staffing"},"timetables":{"description":"All timetables","x-domain":{"entity":"timetable"},"type":"object","additionalProperties":{"$ref":"#/components/schemas/Timetable"}},"events":{"title":"Events (as in a regular calendar)","description":"Calendar events that are not lessons, such as a council or a parent-teacher meeting","type":"object","x-domain":{"entity":"event","fieldDefault":"manage_entities"},"patternProperties":{"^event-[0-9]+$":{"$ref":"#/components/schemas/Event"}},"x-premiumOnly":true}},"required":["config"],"components":{"schemas":{"TimetableDefaults":{"description":"Default new timetable configuration","type":"object","properties":{"time_unit":{"type":"integer","default":1},"time_period":{"type":"integer","default":60},"displaymode":{"description":"Display mode of a timetable created from these defaults","type":"string","enum":["hours","periods","calendar"],"default":"hours"}}},"TimetablesConfig":{"description":"Timetable settings of the account. A setting left out takes its default","type":"object","properties":{"defaults":{"$ref":"#/components/schemas/TimetableDefaults"},"subjectlabel":{"description":"Subject label shown to admins","type":"string","enum":["name","short","code"],"default":"name"},"grouplabel":{"description":"Group label shown to admins","type":"string","enum":["name","code"],"default":"name"},"weekalt":{"description":"Alternate weeks label (no = not in use)","type":"string","enum":["numbers","letters","no"],"default":"numbers"},"videolinkorder":{"description":"Order in which a lesson without a video link of its own takes one from its class or its teachers","type":"array","items":{"type":"string","enum":["class","teacher"]},"uniqueItems":true,"default":["class","teacher"]},"subjecttypemandatory":{"description":"Require a type for each subject assignment","type":"boolean","default":false},"teachervideolink":{"description":"Videoconference link of the teachers in use","type":"boolean","default":false},"classroomneeds":{"description":"Classroom needs of the lessons in use: their editors, in the lessons listing and the memo popup","type":"boolean","default":false},"lessontags":{"description":"Tags of the lessons in use: their editors, in the lessons listing and the memo popup","type":"boolean","default":false},"lessonheadcount":{"description":"Headcount of the lessons in use: shown and edited on the cards, the fiches and the lessons listing","type":"boolean","default":false},"formerteachers":{"description":"Teachers marked by a pictogram in the timetables of the current school year and later, by the state of their user","type":"string","enum":["no","inactive","missing","both"],"default":"both"},"exclude":{"description":"What the account turned off. Anything not listed is in use, a later addition included","type":"object","properties":{"features":{"description":"Features taken off the screens","type":"array","items":{"type":"string","enum":["resources","teacherclassroom","classwishes","classclassroom","offgrid","recurrence","links","pweight","policies","groupsets","spacesets","subgroups","groupwishes"]},"uniqueItems":true},"types":{"description":"Timetable types not offered at creation; one at least stays offered","type":"array","items":{"type":"string","enum":["week","cycle","calendar"]},"uniqueItems":true,"maxItems":2},"statuses":{"description":"Lesson statuses not offered","type":"array","items":{"type":"string","enum":["planned","draft","canceled","done"]},"uniqueItems":true}}}}},"SchoolConfig":{"type":"object","properties":{"timetables":{"$ref":"#/components/schemas/TimetablesConfig"},"defaults":{"description":"Deprecated, see timetables.defaults","deprecated":true,"allOf":[{"$ref":"#/components/schemas/TimetableDefaults"}]},"firstday":{"description":"First day of the week, 0 = Sunday, 1 = Monday","type":"integer","enum":[0,1],"default":1},"levels":{"type":"array","items":{"type":"string"}},"campuses":{"description":"Configured campus labels","type":"array","items":{"type":"string"}},"opening_hours":{"description":"Global school opening hours by day","type":"object","patternProperties":{"^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)$":{"type":"object","properties":{"from":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$"},"to":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["from","to"]}}},"login":{"description":"Pattern to generate user's login","type":"string","enum":["firstlast","lastfirst","idnumber"],"default":"firstlast","readOnly":true},"middlename":{"description":"Activate middle name support","type":"boolean","default":false},"namecapitalize":{"description":"Name parts to capitalize (first name, middle name, last name)","type":"array","items":{"type":"string","enum":["first","middle","last"]},"uniqueItems":true,"default":[]},"weekalt":{"description":"Deprecated, see timetables.weekalt","deprecated":true,"type":"string","enum":["numbers","letters","no"]},"subjecttypemandatory":{"description":"Deprecated, see timetables.subjecttypemandatory","deprecated":true,"type":"boolean"},"nocommonsubjects":{"description":"Deactivate common country subjects","type":"boolean","default":false},"displayextids":{"description":"Show the identifiers external systems give the entities and lessons, on the screens of admins","type":"boolean","default":false},"wishes":{"description":"Support for teachers' wishes","type":"string","enum":["week","calendar","both","no"]},"creation":{"allOf":[{"$ref":"#/components/schemas/CustomDateTimeFormat"},{"description":"Creation date of the school account"}]},"name":{"description":"School account name","type":"string"},"uai":{"description":"Établissement code (UAI/RNE), initialized by an STS-web import; the OneRoster Org identifier when present","type":"string"},"country":{"description":"Account country","type":"string"},"types":{"description":"Types of subjects","type":"array","items":{"type":"string"}},"current_school_year":{"description":"Current school year id (from school_years)","type":"string"},"timezone":{"description":"School timezone (useful for iCal generation)","type":"string"},"studentrestriction":{"description":"View restriction of lessons, in weeks, for students (0 = none)","type":"integer","default":0},"teacherrestriction":{"description":"Account restriction for teachers, preventing them to see other information besides their owns","type":"boolean","default":false},"loginrestriction":{"description":"Roles not allowed to log in. A user with several roles can log in if one of them is allowed","type":"array","items":{"type":"string","enum":["teacher","staff","student"]},"uniqueItems":true,"default":[],"x-accountLevel":"staffing"},"secondaryemails":{"description":"Roles whose users may have secondary e-mail addresses (one listed role is enough). Absent = no one","type":"array","items":{"type":"string","enum":["admin","staff","teacher","student"]},"uniqueItems":true},"roles":{"type":"object","patternProperties":{"^[a-z0-9-]+$":{"description":"Custom roles for admin, restricting their access to the platform (requires custom roles option)","type":"object","properties":{"name":{"type":"string"},"exclude_modules":{"type":"array","items":{"type":"string"}},"exclude_rights":{"description":"Denied rights as 'entity:verb', the entity as in the URL (timetables.sites.classrooms). Denying update also denies create and delete; denying read, all four, on that entity only","type":"array","items":{"type":"string","pattern":"^[a-z0-9._-]+:(read|create|update|delete)$"}}}}},"x-premiumOnly":true},"domains":{"description":"Planning domains: perimeters with their own rights, assigned to admin users to split the planning work (requires custom roles option)","x-domain":{"capability":"unrestricted_only"},"type":"object","patternProperties":{"^[a-z0-9-]+$":{"type":"object","properties":{"name":{"description":"Display name of the domain","type":"string"},"description":{"description":"Free description of the domain","type":"string"},"rules":{"description":"Perimeter rules: ORed on the same entity, ANDed across entities. An entity without a rule is unconstrained","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity targeted by the rule. campus constrains the classes, classrooms and timetables carrying one; sites constrains the classrooms only","type":"string","enum":["sites","campus","classes","classrooms","subjects","groups","timetables"]},"field":{"description":"Matched attribute: name (label for timetables) and, per entity, classes: level, site; classrooms: building, specialisation, tags, capacity; subjects: code, type, family; groups: code; timetables: active, date_start, date_end; id except on campus","type":"string","enum":["name","level","site","campus","building","specialisation","tags","capacity","code","type","family","label","active","date_start","date_end","id"]},"op":{"description":"Matching operator (gte/lte on date fields only; in is API-only: value among a list)","type":"string","enum":["eq","prefix","contains","gte","lte","in"]},"value":{"description":"Value to match: a string, a number (capacity), a boolean (active), or a list of strings for in","type":["string","number","boolean","array"],"items":{"type":"string"}},"not":{"description":"Exclusion rule: positives OR together per dimension, exclusions carve out of the result","type":"boolean","default":false}},"required":["entity","field","op","value"]}},"soft":{"description":"Soft domain: hidden by default in the UI, never blocking (backup duty)","type":"boolean","default":false},"rights":{"description":"Rights on the domain perimeter: only the denied ones are stored","type":"object","additionalProperties":false,"properties":{"denied":{"description":"Denied rights, as entities.<entity>.<create|update|delete> or lessons.<action>. Absent = granted","type":"array","items":{"type":"string","enum":["entities.configuration.update","entities.classes.update","entities.classes.create","entities.classes.delete","entities.teachers.update","entities.teachers.create","entities.teachers.delete","entities.classrooms.update","entities.classrooms.create","entities.classrooms.delete","entities.subjects.update","entities.subjects.create","entities.subjects.delete","entities.sites.update","entities.sites.create","entities.sites.delete","lessons.create","lessons.update","lessons.delete","lessons.position","lessons.duration","lessons.teachers","lessons.classroom","lessons.modality","lessons.videolink","lessons.status","lessons.memos","lessons.generate"]}}}}},"required":["name","rules"]}},"x-premiumOnly":true},"extsync":{"$ref":"#/components/schemas/SchoolConfigExtsync"},"oidc":{"$ref":"#/components/schemas/SchoolConfigOidc"},"mfa":{"$ref":"#/components/schemas/SchoolConfigMfa"},"type":{"description":"Type of account (school, premium, etc.)","x-permission":"superadmin-only","type":"string","enum":["lite","staffing","school","schoolplus","premium","gold"],"default":"school"},"provider":{"description":"List of providers allowed on the platform","x-permission":"superadmin-only","type":"array","items":{"type":"string"}},"studentsonclasses":{"description":"Reverse students/classes association (students first)","x-permission":"superadmin-only","type":"boolean","default":false},"multipleactivation":{"description":"Allow several timetables published in parallel (non-premium accounts)","x-permission":"superadmin-only","type":"boolean","default":false},"cycletimetables":{"description":"Allow cycle timetables, but not calendar ones (non-premium accounts)","x-permission":"superadmin-only","type":"boolean","default":false},"customroles":{"description":"Activate support for custom roles","x-permission":"superadmin-only","type":"boolean","default":false},"mfaallowed":{"description":"Allow the school to ask its accounts for a second factor","x-permission":"superadmin-only","type":"boolean","default":false},"extramodules":{"description":"Enable additional modules","x-permission":"superadmin-only","type":"array","items":{"type":"string"},"default":[]},"snapshotsmax":{"description":"Number of allowed snapshots (0 = disabled)","x-permission":"superadmin-only","type":"number","default":0},"logsmax":{"description":"Number of days to keep logs (0 = disabled)","x-permission":"superadmin-only","type":"integer","default":0},"collab":{"description":"Activate collaboration features","x-permission":"superadmin-only","type":"boolean","default":false},"algoinstance":{"description":"Force use of a dedicated scheduling instance","x-permission":"superadmin-only","type":"string","enum":["c8g.4xlarge","c8g.8xlarge","c8g.12xlarge","c8g.16xlarge","c7g.4xlarge","c7g.8xlarge","c7g.12xlarge","c7g.16xlarge"]},"linkedaccounts":{"title":"Linked accounts to this account","description":"Allow seeing shared teachers/classrooms occupation from linked accounts","x-permission":"superadmin-only","type":"array","items":{"type":"string"}},"chunks":{"title":"Timetable chunk storage","description":"Support-controlled storage settings for large timetable course rows","x-permission":"superadmin-only","type":"object","properties":{"enabled":{"description":"Store eligible timetables' lessons (and classes, on the classes boundary) as CouchDB attachments","type":"boolean","default":false},"threshold":{"description":"Minimum course and lesson count before externalizing a timetable (0 = externalize all)","type":"integer","minimum":0,"default":4000}}},"accesskey":{"description":"Private unique random key used to salt","type":"string","readOnly":true}},"required":["accesskey","name","country"]},"SchoolConfigMfa":{"description":"Second factor asked of the school's accounts after their password or SSO","type":"object","x-premiumOnly":true,"properties":{"roles":{"description":"Roles whose accounts prove a second factor (none = off)","type":"array","items":{"type":"string","enum":["admin","staff","teacher"]},"uniqueItems":true},"factors":{"description":"Factor types an account may enroll (all when empty)","type":"array","items":{"type":"string","enum":["passkey","totp","email"]},"uniqueItems":true},"remember":{"description":"Days a browser skips the factor once proven on it (0 = never)","type":"integer","minimum":0,"maximum":90}},"additionalProperties":false},"SchoolConfigOidc":{"description":"OpenID Connect configuration for external authentication (Azure AD, Keycloak, Google)","type":"object","x-premiumOnly":true,"properties":{"enabled":{"description":"Enable OIDC authentication for this school","type":"boolean","default":false},"providerType":{"description":"Type of OIDC provider (for UI hints and special handling)","type":"string","enum":["azure","keycloak","google","generic"],"default":"generic"},"providerName":{"description":"Display name for the provider (shown on login button)","type":"string","default":"SSO"},"issuer":{"description":"OIDC Issuer URL (discovery endpoint = issuer + /.well-known/openid-configuration)","type":"string","format":"uri"},"clientId":{"description":"OAuth2 Client ID","type":"string"},"clientSecret":{"description":"OAuth2 Client Secret (stored encrypted)","type":"string"},"scopes":{"description":"OAuth2 scopes to request","type":"array","items":{"type":"string"},"default":["openid","email","profile"]},"allowedDomains":{"description":"Restrict login to users with email matching these domains","type":"array","items":{"type":"string"}},"ssoOnly":{"description":"Force SSO-only login (except break-glass)","type":"boolean","default":false},"tenantId":{"description":"Azure tenant ID (shortcut, can be derived from issuer)","type":"string"}}},"SchoolConfigExtsync":{"type":"object","title":"External systems synchronization configuration","description":"Configuration for synchronization with external systems (Auriga, Aimaira, Neil, etc.)","properties":{"systems":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystems"},"sync":{"$ref":"#/components/schemas/SchoolConfigExtsyncSync"},"export":{"$ref":"#/components/schemas/SchoolConfigExtsyncExport"},"schedules":{"$ref":"#/components/schemas/SchoolConfigExtsyncSchedules"}},"x-premiumOnly":true},"SchoolConfigExtsyncMappingEntry":{"type":"object","description":"Generic ExtSync mapping entry stored by Omniscol between a local value/entity and an external ERP value/entity","properties":{"external_id":{"type":"string","description":"Canonical external entity identifier, independent from ERP-native field names"},"external_code":{"type":"string","description":"Optional external code used for display and fallback resolution"},"external_label":{"type":"string","description":"Optional external label used for display and fallback resolution"},"create":{"type":"boolean"},"ignore":{"type":"boolean"}},"additionalProperties":true},"SchoolConfigExtsyncMappingMap":{"type":"object","description":"Generic ExtSync mapping map keyed by the Omniscol source id/value","additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncMappingEntry"}},"SchoolConfigExtsyncMappings":{"type":"object","description":"Generic ExtSync mappings by mapping key and Omniscol source id/value (for example: subjects, teachers, classes, groups, classrooms, status)","additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncMappingMap"}},"SchoolConfigExtsyncExtension":{"type":"string","description":"The connector's plugin this account runs: the file extensions/erp-<system>-<name>.js. Only a superadmin sets it.","pattern":"^[a-z0-9][a-z0-9_-]*$"},"SchoolConfigExtsyncCache":{"type":"object","description":"How long the datasets read from this system are served from the school's cache before being read again","properties":{"ttl_minutes":{"type":"integer","minimum":0,"description":"Minutes a dataset stays fresh after a read (0: read again on every access)"},"retry_minutes":{"type":"integer","minimum":0,"description":"Minutes without a new attempt after a failed read, the last payload being served meanwhile"}},"additionalProperties":false},"SchoolConfigExtsyncSyncWindow":{"type":"object","title":"Synchronization window","description":"Days, counted from today, within which the export of one family to one system creates, updates and deletes; nothing outside is touched. A bound left out leaves its side open","properties":{"startOffsetDays":{"type":"integer","description":"First day, in days from today (negative: in the past)"},"endOffsetDays":{"type":"integer","description":"Last day, in days from today, with the same signs"}},"additionalProperties":false},"SchoolConfigExtsyncGiven":{"type":"object","description":"What this system's feeds have ever given, kept by the synchronization","properties":{"classrooms":{"type":"object","properties":{"tags":{"description":"Tags given by the room feed: the only ones the room synchronization adds and removes","type":"array","items":{"type":"string"}}}}}},"SchoolConfigExtsyncSystemAurion":{"type":"object","title":"Aurion system configuration","description":"Configuration for Aurion (Hyperplanning) ERP system","properties":{"cache":{"$ref":"#/components/schemas/SchoolConfigExtsyncCache"},"extension":{"$ref":"#/components/schemas/SchoolConfigExtsyncExtension"},"enabled":{"type":"boolean","description":"Enable Aurion integration","default":false},"configuration":{"type":"object","description":"Aurion-specific configuration","properties":{"domain":{"type":"string","description":"Aurion domain"},"login":{"type":"string","description":"Aurion login"},"password":{"type":"string","description":"Aurion password (sensitive)"},"favori_interventions_sync":{"type":"string","description":"Favori ID of the Omniscol-mapped interventions feed, for a one-shot import or a read-only overlay of Aurion data"},"favori_interventions_aurion":{"type":"string","description":"Favori ID of the id-only interventions feed filling the lessons cache, when lessons are synchronized from Aurion"},"favori_interventions_verification":{"type":"string","description":"Optional favori ID used to manually verify exported interventions"},"favori_statuts_intervention":{"type":"string","description":"Favori ID for intervention statuses"},"favori_matieres":{"type":"string","description":"Favori ID for subjects"},"favori_cours":{"type":"string","description":"Favori ID for courses"},"favori_types_activite":{"type":"string","description":"Favori ID for activity types"},"favori_intervenants":{"type":"string","description":"Favori ID for teachers"},"favori_groupes":{"type":"string","description":"Favori ID for groups"},"favori_ressources":{"type":"string","description":"Favori ID for resources/classrooms"},"favori_programmes":{"type":"string","description":"Favori ID of the programmes (id, code, label), from which a school extension may derive classes"},"interventions_managed_fields":{"type":"array","description":"Lesson fields Omniscol pushes back to Aurion when lessons are synchronized from Aurion (default: classrooms)","items":{"type":"string","enum":["teachers","classrooms","positions"]},"uniqueItems":true},"attribut_omniscol_id":{"type":"string","description":"Aurion parameterized attribute number carrying the Omniscol lesson _id in the exported pivot (declared in the Aurion console, database-specific)"},"attribut_omniscol_osrev":{"type":"string","description":"Aurion parameterized attribute number carrying the Omniscol lesson _osrev in the exported pivot (declared in the Aurion console, database-specific)"},"attribut_omniscol_target":{"type":"string","enum":["intervention","evenement"],"description":"Aurion object the two attributes above are declared on (default: intervention)"},"pivot_labels":{"type":"boolean","description":"Debugging: the exported pivot also gives the code and label of the Aurion objects it links by id"},"pivot_chunk_size":{"type":"integer","minimum":1,"description":"Lessons per import sent to Aurion (default 100); lower it when Aurion takes over two minutes to answer one"},"database":{"type":"string","description":"Database name"}},"required":["domain","login","password","database"]},"defaults":{"type":"object","description":"Default Aurion values used during Omniscol lesson export","properties":{"activityType":{"type":"string","description":"Default Aurion activity type code"},"interventionStatus":{"type":"string","description":"Default Aurion intervention status code"}}},"mappings":{"allOf":[{"$ref":"#/components/schemas/SchoolConfigExtsyncMappings"}],"description":"Stored Aurion mappings, including status mappings under mappings.status"},"given":{"$ref":"#/components/schemas/SchoolConfigExtsyncGiven"}}},"SchoolConfigExtsyncSystemAuriga":{"type":"object","title":"Auriga system configuration","description":"Configuration for Auriga ERP system (Keycloak OAuth2 + REST API)","properties":{"cache":{"$ref":"#/components/schemas/SchoolConfigExtsyncCache"},"extension":{"$ref":"#/components/schemas/SchoolConfigExtsyncExtension"},"enabled":{"type":"boolean","description":"Enable Auriga integration","default":false},"configuration":{"type":"object","description":"Auriga-specific configuration","properties":{"apiBaseUrl":{"type":"string","description":"Auriga API base URL (e.g., https://auriga.xxxxx.fr)","format":"uri"},"keycloakServer":{"type":"string","description":"Keycloak server hostname (e.g., xxxxxx-auth.np-auriga.nfrance.net)"},"realm":{"type":"string","description":"Keycloak realm"},"clientId":{"type":"string","description":"OAuth2 client ID"},"clientSecret":{"type":"string","description":"OAuth2 client secret (sensitive)"},"username":{"type":"string","description":"User login for password grant flow"},"password":{"type":"string","description":"User password for password grant flow (sensitive)"},"scope":{"type":"string","description":"OAuth2 scope (default: offline_access)","default":"offline_access"},"defaults":{"type":"object","description":"Default codes used by Omniscol when exporting lessons to Auriga","properties":{"activityType":{"type":"string","description":"Default activity type code (e.g., CM)"},"interventionStatus":{"type":"string","description":"Default intervention status code (e.g., PLANIFIE)"},"instructorInterventionStatus":{"type":"string","description":"Status code given to the instructors of each intervention, or @intervention for the intervention's own. An instructor without a status does not see the intervention in Auriga"},"keepInstructorStatus":{"type":"boolean","description":"Keep the status an instructor already holds in Auriga at each push (one more Auriga read per push). Unset, every push gives instructorInterventionStatus again"}},"additionalProperties":false}},"required":["apiBaseUrl","keycloakServer","realm","clientId","clientSecret","username","password"]},"mappings":{"allOf":[{"$ref":"#/components/schemas/SchoolConfigExtsyncMappings"}],"description":"Stored Auriga mappings, including status mappings under mappings.status"},"given":{"$ref":"#/components/schemas/SchoolConfigExtsyncGiven"}}},"SchoolConfigExtsyncSystemOneroster":{"type":"object","title":"OneRoster system configuration","description":"Configuration for OneRoster (IMS Global 1.2 Rostering + Advanced Groups) integration, as producer and/or consumer","properties":{"cache":{"$ref":"#/components/schemas/SchoolConfigExtsyncCache"},"enabled":{"type":"boolean","description":"Enable OneRoster integration","default":false},"configuration":{"type":"object","description":"OneRoster-specific configuration","properties":{"mode":{"type":"string","description":"Transport: REST API or OneRoster CSV bundle (zip)","enum":["rest","csv"],"default":"rest"},"direction":{"type":"string","description":"Integration direction: consume (SIS to Omniscol), produce (Omniscol to LMS/ENT), or both","enum":["consume","produce","both"],"default":"consume"},"apiBaseUrl":{"type":"string","description":"Remote provider base URL in consumer mode, e.g. https://.../ims/oneroster/rostering/v1p2","format":"uri"},"tokenUrl":{"type":"string","description":"OAuth2 token endpoint for client_credentials grant (consumer mode)","format":"uri"},"clientId":{"type":"string","description":"OAuth2 client ID (consumer mode)"},"clientSecret":{"type":"string","description":"OAuth2 client secret (sensitive, consumer mode)"},"scope":{"type":"string","description":"OAuth2 scope requested from the remote provider (consumer mode)"},"profile":{"type":"string","description":"OneRoster profile: core Rostering 1.2, additive Advanced Groups, or French K12 mapping","enum":["core","groups","frenchK12"],"default":"core"}},"required":["mode","direction"]},"mappings":{"allOf":[{"$ref":"#/components/schemas/SchoolConfigExtsyncMappings"}],"description":"Stored OneRoster mappings (external sourcedId to local id), keyed by entity type"}}},"SchoolConfigExtsyncSystemEdusign":{"type":"object","title":"Edusign system configuration","description":"Configuration for Edusign, the attendance and e-signature platform: Omniscol pushes the sessions and finds their students and professors in Edusign","properties":{"cache":{"$ref":"#/components/schemas/SchoolConfigExtsyncCache"},"enabled":{"type":"boolean","description":"Enable Edusign integration","default":false},"configuration":{"type":"object","description":"Edusign-specific configuration","properties":{"apiKey":{"type":"string","description":"School API key created from the Edusign platform, sent as a bearer token (sensitive)"},"apiUrl":{"type":"string","description":"API base URL. Defaults to https://ext.edusign.fr, which serves both the v1 and v3 endpoints","format":"uri","default":"https://ext.edusign.fr"},"externalReferenceType":{"type":"string","description":"Value written to API_TYPE on the sessions we own, and the filter used to decide which Edusign courses are ours","default":"omniscol"},"createMissing":{"type":"array","description":"Entity types the connector may create in Edusign when a session needs them (never students: Edusign would duplicate them)","items":{"type":"string","enum":["teachers","groups"]},"default":[]}},"required":["apiKey"]},"mappings":{"allOf":[{"$ref":"#/components/schemas/SchoolConfigExtsyncMappings"}],"description":"Stored Edusign mappings (Edusign id to local id), keyed by entity type"}}},"SchoolConfigExtsyncSystemGeneric":{"type":"object","description":"Configuration for other external systems","properties":{"cache":{"$ref":"#/components/schemas/SchoolConfigExtsyncCache"}},"additionalProperties":true},"SchoolConfigExtsyncSystem":{"description":"Configuration for a single external system","oneOf":[{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemAurion"},{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemAuriga"},{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemOneroster"},{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemEdusign"},{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemGeneric"}]},"SchoolConfigExtsyncSystems":{"type":"object","description":"External systems configurations","properties":{"aurion":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemAurion"},"auriga":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemAuriga"},"oneroster":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemOneroster"},"edusign":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemEdusign"}},"additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncSystemGeneric"}},"SchoolConfigExtsyncSyncEntity":{"type":"object","description":"Synchronization settings for a single entity type","properties":{"system":{"type":"string","description":"System to sync from (auriga, aimaira, neil, etc.)"},"creation":{"type":"boolean","description":"Allow creating new entities locally (not synced from external system)","default":true},"update":{"type":"boolean","description":"Allow updating entity attributes locally (diverge from external system)","default":true}},"additionalProperties":false},"SchoolConfigExtsyncSync":{"type":"object","description":"Per-entity synchronization settings","propertyNames":{"enum":["teachers","subjects","types","sites","classrooms","resources","classes","groups","lessons"]},"patternProperties":{"^(teachers|subjects|types|sites|classrooms|resources|classes|groups|lessons)$":{"$ref":"#/components/schemas/SchoolConfigExtsyncSyncEntity"}},"additionalProperties":false},"SchoolConfigExtsyncExportLessonsFull":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Enable full export (all lessons) on schedule","default":false},"time":{"type":"array","items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}}}},"SchoolConfigExtsyncExportLessonsSystem":{"type":"object","description":"Lessons export settings of one system","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Enable lessons export to this system","default":false},"rt":{"type":"boolean","description":"Enable real-time differential export (triggered on lesson modifications)","default":false},"syncstate":{"type":"boolean","description":"Keep the system's answer for each lesson pushed, to show admins whether it was received, refused or is still waiting","default":false},"campuses":{"type":"array","description":"Campus labels whose lessons are exported to this system (empty: the whole school). A lesson qualifies when one of its classes is on a listed campus","items":{"type":"string"},"default":[]},"full":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportLessonsFull"},"syncWindow":{"$ref":"#/components/schemas/SchoolConfigExtsyncSyncWindow"}}},"SchoolConfigExtsyncExportLessons":{"type":"object","description":"Export configuration for lessons/courses to external systems. The key is the system (auriga, aurion, aimaira, neil, etc.).","additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportLessonsSystem"}},"SchoolConfigExtsyncExportEventsSystem":{"type":"object","description":"Calendar events export settings of one system, with their own schedule; their runs leave the lessons alone","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Enable the calendar events export to this system","default":false},"rt":{"type":"boolean","description":"Push the events again whenever one of them changes in Omniscol","default":false},"campuses":{"type":"array","description":"Campus labels whose events are exported to this system (empty: the whole school), read from the classes the event is addressed to","items":{"type":"string"},"default":[]},"includeTags":{"type":"array","description":"Event tags to export. Empty means every event, which is the usual setting.","items":{"type":"string"},"default":[]},"excludeTags":{"type":"array","description":"Event tags to leave out; an excluded tag wins over an included one","items":{"type":"string"},"default":[]},"activityType":{"type":"string","description":"Activity type code the events take in Auriga (required there to export them)"},"interventionStatus":{"type":"string","description":"Intervention status code the events take in Auriga or Aurion. Unset: none in Auriga, Omniscol's technical status in Aurion"},"matiere":{"type":"object","description":"Aurion matière the events' interventions are linked to, by Aurion id; it carries their activity type","additionalProperties":false,"required":["objet_id"],"properties":{"objet_id":{"type":"string","minLength":1},"code":{"type":"string"},"libelle":{"type":"string"},"activityType":{"type":"object","description":"The Aurion activity type set on that link.","additionalProperties":false,"required":["objet_id"],"properties":{"objet_id":{"type":"string","minLength":1},"code":{"type":"string"},"libelle":{"type":"string"}}}}},"syncstate":{"type":"boolean","description":"Keep the system's answer for each event pushed, to show admins whether it was received, refused or is still waiting","default":false},"full":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportLessonsFull"},"syncWindow":{"$ref":"#/components/schemas/SchoolConfigExtsyncSyncWindow"}}},"SchoolConfigExtsyncExportEvents":{"type":"object","description":"Export configuration for calendar events to external systems. The key is the system.","additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEventsSystem"}},"SchoolConfigExtsyncExport":{"type":"object","description":"Per-entity export settings to external systems","additionalProperties":false,"properties":{"lessons":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportLessons"},"events":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEvents"},"entities":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntities"}}},"SchoolConfigExtsyncExportEntities":{"type":"object","description":"Master data pushed to external systems, one family per entity type, each with its own realtime flag and schedule per system","properties":{"teachers":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntityFamily"},"groups":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntityFamily"},"classes":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntityFamily"},"students":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntityFamily"}}},"SchoolConfigExtsyncExportEntityFamily":{"type":"object","description":"Per-system export settings for one entity type. The key is the system (edusign, ...).","additionalProperties":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportEntitiesSystem"}},"SchoolConfigExtsyncExportEntitiesSystem":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean","description":"Enable the export of this entity type to this system","default":false},"rt":{"type":"boolean","description":"Push this entity type again whenever it changes in Omniscol","default":false},"full":{"$ref":"#/components/schemas/SchoolConfigExtsyncExportLessonsFull"}}},"SchoolConfigExtsyncSchedules":{"type":"object","description":"Automation schedule / refresh policy (used by jobs), to import lessons to display.","properties":{"enabled":{"type":"boolean","description":"Enable schedules synchronization","default":true},"system":{"type":"string","description":"External system to sync schedules from (aurion, auriga, etc.)"},"refresh_per_day":{"type":"integer","minimum":0,"default":0,"description":"How many times per day to refresh (0 = disabled)."}},"additionalProperties":false},"SchoolLogo":{"type":"object","properties":{"data":{"type":"string","description":"Base64 encoded logo"}},"required":["data"]},"Translations":{"description":"Custom translation overloading/redefinitions","type":"object","properties":{"rules":{"description":"Generic rule of expression to replace by other expression","type":"array","items":{"$ref":"#/components/schemas/TranslationRule"}},"keys":{"description":"Replacement of an internal translation key by a custom user-defined string","type":"object","additionalProperties":{"type":"string"}}},"x-premiumOnly":true},"TranslationRule":{"type":"object","properties":{"from":{"description":"Expression to be replaced","type":"string"},"to":{"description":"Replacement string","type":"string"},"alpha":{"description":"Case sensitive?","type":"boolean","default":false},"regexp":{"description":"Is it a regular expression?","type":"boolean","default":false},"complete":{"description":"Only match the complete expression (no substring match)?","type":"boolean","default":false}},"required":["from","to"]},"APISettings":{"description":"API rules to redefine or make hooks","type":"object","properties":{"config":{"type":"object","properties":{"headers":{"type":"object","additionalProperties":{"type":"string"}}}},"endpoints":{"type":"object","additionalProperties":{}},"hooks":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/APIHook"}},"oauth":{"type":"object","properties":{"clients":{"description":"All registered OAuth clients","type":"object","additionalProperties":{"$ref":"#/components/schemas/APIOAuthClient"}},"revoked":{"description":"Revoked tokens, redeemed authorization codes and revoked grants, each kept until it expires: id → expiry (epoch ms)","type":"object","additionalProperties":{"type":"number"}},"refresh":{"description":"The one refresh token each grant can still be renewed with: grant → its id and expiry (epoch ms)","type":"object","additionalProperties":{"type":"object","properties":{"jti":{"type":"string"},"exp":{"type":"number"}}}}}}},"x-premiumOnly":true},"APIHook":{"type":"object","properties":{"url":{"type":"string","format":"url"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE","PATCH","HEAD","OPTIONS"]},"payload":{"type":"boolean"}},"required":["url","method","payload"]},"APIOAuthClient":{"description":"Registered OAuth client","type":"object","properties":{"software_id":{"type":"string"},"client_name":{"type":"string","minLength":1,"maxLength":100},"client_secret":{"type":"string"},"client_secret_hash":{"type":"string","readOnly":true},"secret_generation":{"type":"integer","minimum":0,"readOnly":true,"description":"Every secret signed for it in this generation matches; a rotation moves it on"},"fingerprint":{"type":"string","readOnly":true,"description":"Of the metadata it was registered with: a re-registration of the same answers with this client"},"managed":{"type":"boolean","readOnly":true,"description":"Its registrant rotated or updated it with its registration token: no re-registration reaches it"},"client_secret_is_jwt":{"type":"boolean","default":true,"readOnly":true},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri","pattern":"^https?://"},"minItems":1,"maxItems":10,"uniqueItems":true},"scopes":{"type":"array","items":{"type":"string","enum":["read:basic","read:user","write:data","admin"]},"minItems":1,"uniqueItems":true},"contacts":{"type":"array","items":{"type":"string","format":"email"},"maxItems":5,"uniqueItems":true},"client_uri":{"type":["string","null"],"format":"uri"},"logo_uri":{"type":["string","null"],"format":"uri"},"registered_at":{"type":"integer","minimum":0},"registered_by":{"type":["string","null"]},"active":{"type":"boolean","default":true},"notes":{"type":["string","null"],"maxLength":500}},"required":["client_name","redirect_uris","scopes"]},"ExternalIds":{"description":"External system identifiers mapping (e.g., {auriga: '12345', aimaira: '67890'}). A write keeps the systems it does not name; null on one drops it.","type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}},"Subject":{"description":"A subject is what is taught during a lesson, such as mathematics, physics or PE, identified by its name or its code","type":"object","properties":{"name":{"description":"Name of the subject","type":"string"},"short":{"description":"Short name of the subject, used to be displayed by default on the grid/schedule","type":"string"},"code":{"description":"Code of the subject","type":"string"},"type":{"description":"Type of the subject (e.g. exam, practical work...)","type":"string"},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"anyOf":[{"required":["name"]},{"required":["code"]}]},"SubjectFull":{"allOf":[{"$ref":"#/components/schemas/Subject"},{"type":"object","properties":{"parent":{"description":"Parent subject (another subject)","type":"string"},"family":{"description":"Family of the subject","type":"string"},"color":{"description":"Color (if not defined, will be automatically computed based on name hash)","type":"string"}}}]},"Family":{"description":"A grouping of subjects, such as a department (Sciences, Humanities) or a curriculum area","type":"object","properties":{"name":{"description":"Name of the family","type":"string"},"code":{"description":"Code of the family","type":"string"},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["name"]},"Timetable":{"description":"A scheduling unit: the classes having lessons over one period, such as a school year or a semester. In premium mode, several can run in parallel (middle school, high school)","x-domain":{"fieldDefault":"manage_entities"},"type":"object","properties":{"config":{"x-domain":{"capability":"edit_config"},"allOf":[{"$ref":"#/components/schemas/TimetableConfig"}]},"sites":{"description":"Sites (campuses)","x-domain":{"entity":"site","fieldDefault":"manage_entities"},"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableSite"}},"teachers":{"description":"Teachers assigned to the timetable, by ID (should be the same as in users)","x-domain":{"entity":"teacher","fieldDefault":"manage_entities"},"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableTeacher"}},"classes":{"title":"Classes","description":"A class is a stable set of students having lessons together, except when split into groups (a homeroom or grade in the US, a form in the UK, a cohort in higher education)","x-domain":{"entity":"class","fieldDefault":"manage_entities"},"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableClass"}},"lessons":{"description":"Lessons common to different classes because of groups of groups","x-domain":{"items":"manage_lessons","fieldDefault":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/Lesson"}},"_chunk":{"description":"Internal storage marker for an externalized timetable payload","x-domain":{"capability":"system"},"type":"object","properties":{"name":{"description":"Attachment name","type":"string"},"version":{"description":"Attachment format version (3: class lessons under lessons; 2, still read: under courses)","type":"integer"},"mode":{"description":"Payload mode: lessons, or classes (the classes too, in a second attachment)","type":"string","enum":["lessons","classes"]},"hash":{"description":"Versioned fingerprint of the uncompressed serialized attachment payload","type":"string"},"classes":{"description":"The attachment holding the timetable's classes, in classes mode","type":"object","properties":{"name":{"description":"Attachment name","type":"string"},"hash":{"description":"Versioned fingerprint of the uncompressed serialized classes payload","type":"string"}},"required":["name"]},"stats":{"description":"Lesson count (class lessons plus shared lessons) and class count, readable without fetching","type":"object","properties":{"lessons_count":{"type":"integer","minimum":0},"classes_count":{"type":"integer","minimum":0}},"required":["lessons_count"]}},"required":["name","version","mode","stats"]},"groups":{"description":"Rules between groups","type":"object","properties":{"timeset":{"$ref":"#/components/schemas/TimetableGroupTimeset"},"spaceset":{"$ref":"#/components/schemas/TimetableGroupSpaceset"},"groupset":{"$ref":"#/components/schemas/TimetableGroupGroupset"}}},"activation":{"description":"When the weekly or cycle timetable is published (boolean true = published for all weeks)","type":["array","boolean"],"items":{"description":"Start/end in weeks (since EPOCH)","type":"array","items":{"type":"integer"}}},"active":{"description":"Is this timetable published?","type":"boolean"},"generation":{"description":"Last generation run: its status while it runs, then the proposed timetable","x-domain":{"capability":"edit_generation"},"type":"object"},"result":{"description":"Legacy alias of `generation`, migrated on read","x-domain":{"capability":"edit_generation"},"type":"object"},"date_generation":{"x-domain":{"capability":"system"},"allOf":[{"$ref":"#/components/schemas/CustomDateTimeFormat"},{"description":"When this timetable was generated, in ISO 8601 UTC"}]},"date_creation":{"x-domain":{"capability":"system"},"allOf":[{"$ref":"#/components/schemas/CustomDateTimeFormat"},{"description":"When this timetable was created, in ISO 8601 UTC"}]},"date_update":{"x-domain":{"capability":"system"},"allOf":[{"$ref":"#/components/schemas/CustomDateTimeFormat"},{"description":"When this timetable was last updated, in ISO 8601 UTC"}]}}},"TimetableConfig":{"description":"Configuration of the timetable","type":"object","properties":{"label":{"description":"Label","type":"string"},"description":{"description":"Description","type":"string"},"time_period":{"description":"Time slot duration (most of the time 60 = 1 hour)","type":"integer","default":60},"time_unit":{"description":"Division of the time slot (e.g. 2 with a time_period of 60 enables lessons of 1h30","type":"integer","default":1},"colors":{"description":"Colors of the different entities","x-domain":{"capability":"system"},"type":"object","properties":{"classes":{"description":"Colors of classes","type":"object","additionalProperties":{"type":"string"}},"subjects":{"description":"Colors of subjects","type":"object","additionalProperties":{"type":"string"}}}},"campuses":{"description":"Campus labels associated with the whole timetable","type":"array","items":{"type":"string"}},"weekdays":{"description":"Days of the week (open days with lessons)","type":"array","items":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"examples":[["monday","tuesday","wednesday","thursday","friday"],["sunday","monday","tuesday","wednesday","thursday"]]},"displaymode":{"description":"Grid layout: \"hours\" shows real times (09:15–10:10), \"periods\" numbered slots, \"calendar\" a fixed hourly layout","type":"string","enum":["hours","periods","calendar"],"default":"hours"},"type":{"description":"Type of timetable: \"week\" repeats weekly, \"cycle\" rotates over several days (e.g. 6), \"calendar\" schedules dates one by one","type":"string","enum":["week","cycle","calendar"],"default":"week"},"cycle":{"description":"Number of the multi-day cycle (if type = cycle)","type":"integer"},"dates":{"description":"First and last date the timetable spans. Only valid when type is 'calendar'","type":"array","items":{"type":"string","format":"date"},"minItems":2,"maxItems":2,"examples":[["2024-09-03","2025-06-22"],["2025-01-01","2026-12-31"]],"x-dependsOn":{"type":"calendar"}},"date_windows":{"description":"Date windows (time constraints for timetable generation). Only valid when type is 'calendar'","type":"object","additionalProperties":{"$ref":"#/components/schemas/DateWindow"},"x-dependsOn":{"type":"calendar"}},"tweaks":{"x-domain":{"capability":"edit_generation"},"allOf":[{"$ref":"#/components/schemas/TimetableGenerationTweaks"}]}}},"DateWindow":{"description":"Date window for timetable generation constraints","type":"object","required":["label","type","intervals"],"properties":{"label":{"description":"Label of the date window","type":"string"},"comment":{"description":"Optional comment","type":"string"},"type":{"description":"Type of constraint: allow (lessons can only be placed in these intervals) or exclude (lessons cannot be placed in these intervals)","type":"string","enum":["allow","exclude"]},"intervals":{"description":"List of date intervals","type":"array","items":{"$ref":"#/components/schemas/DateWindowInterval"}}}},"DateWindowInterval":{"description":"Date interval (from/to dates in ISO format)","type":"object","required":["from","to"],"properties":{"from":{"description":"Start date (ISO format YYYY-MM-DD)","type":"string","format":"date"},"to":{"description":"End date (ISO format YYYY-MM-DD)","type":"string","format":"date"}}},"DurationHHMMOrHours":{"description":"Duration as \"HH:MM\" (preferred) or integer number of hours","oneOf":[{"type":"string","pattern":"^[0-9]{1,3}:[0-5][0-9]$"},{"type":"integer","minimum":0}],"examples":["05:30",5]},"TimetableGenerationTweaks":{"description":"Tweaks for the generation algorithm","type":"object","properties":{"classes":{"description":"Tweaks for classes/students","type":"object","properties":{"gaps":{"description":"How do the algorithm shoud reduce gaps for students?","type":"string","enum":["high","medium","none"],"default":"high"},"packeddays":{"description":"Packing lessons into fewer days: \"earliest\" or \"latest\" days, \"whatever\" without preference, \"none\" not at all","type":"string","enum":["none","earliest","latest","whatever"],"default":"none"},"selfincompatibility":{"description":"Is each subject incompatible with itself during the day (trying to prevent more than 1 subject for each student on the same day)","type":"boolean","default":true},"equaldistribution":{"description":"Trying to balance the number of lessons for each day","type":"boolean","default":true},"minhours":{"description":"Minimum number of lesson hours per day for a class","type":"integer","default":0},"maxhours":{"description":"Maximum number of lesson hours the algorithm should not exceed (0 = deactivated, format \"HH:MM\" preferred)","allOf":[{"$ref":"#/components/schemas/DurationHHMMOrHours"}],"default":0},"maxhoursweek":{"description":"Maximum number of lesson hours in a week the algorithm should not exceed (0 = deactivated, format \"HH:MM\" preferred)","allOf":[{"$ref":"#/components/schemas/DurationHHMMOrHours"}],"default":0}}},"teachers":{"description":"Tweaks for teachers","type":"object","properties":{"days":{"description":"Preference regarding the number of working days per teacher. \"less\": group lessons on fewer days, \"more\": spread lessons over more days, \"whatever\": no preference.","type":"string","enum":["more","whatever","less"],"default":"less"},"equaldistribution":{"description":"If true, tries to distribute lessons evenly across the teacher's working days (best effort)","type":"boolean","default":true},"minhours":{"description":"Minimum number of lesson hours per day for a teacher","type":"integer","default":2},"maxhours":{"description":"Maximum number of lesson hours per day for a teacher (0 = deactivated)","type":"integer","default":0},"gaps":{"description":"Preference for minimizing gaps (idle periods) between lessons during the day. \"high\": strongly avoid gaps, \"medium\": moderate tolerance, \"none\": gaps are acceptable","type":"string","enum":["high","medium","none"],"default":"high"}}}}},"TimetableSite":{"description":"Site (campus)","type":"object","properties":{"name":{"description":"Name of the site. A create or rename onto a name another site of the timetable wears, case, accents and spaces aside, is refused","type":"string"},"distances":{"description":"Distances between sites","type":"object","additionalProperties":{"description":"Number of minutes between the site and this one (ID)","type":"integer"}},"hours":{"$ref":"#/components/schemas/TimetableSiteHours"},"classrooms":{"description":"Classrooms","x-domain":{"entity":"classroom","fieldDefault":"manage_entities"},"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableClassroom"}},"resources":{"description":"Equipment limited in quantity, such as projectors, laptops or tablets, allocated to lessons","type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableResource"}},"_extids":{"$ref":"#/components/schemas/ExternalIds"}}},"TimetableSiteHours":{"description":"Definition of the different slots","type":"object","properties":{"courses":{"description":"Time slots for lessons","type":"object","additionalProperties":{"type":"object","properties":{"from":{"description":"General start hour of all days/the grid","type":"string"},"to":{"description":"General end hour of all days/the grid","type":"string"}},"required":["from","to"]}},"periods":{"description":"Time slots, aka periods","type":"array","items":{"type":"object","properties":{"begin":{"description":"General start hour of the slot","type":["string","number"]},"end":{"description":"General end hour of the slot","type":["string","number"]},"label":{"description":"Label of the slot","type":"string"}},"required":["begin","end"]}},"breaks":{"description":"Breaks during day","type":"array","items":{"description":"Break object","type":"object","properties":{"name":{"description":"Name of the break","type":"string"},"time":{"description":"Start time of the break","type":"string","pattern":"^\\d{2}:\\d{2}$"},"duration":{"description":"Duration of the break","type":"integer"}},"required":["name","time","duration"]}},"lunch":{"description":"Lunch break","type":"object","properties":{"from":{"description":"Start of the lunch break","type":"string"},"to":{"description":"End of the lunch break","type":"string"},"duration":{"description":"Duration of the lunch break, at most end - start; shorter, lessons may take the rest (12:00–14:00 with 60: one hour of lesson at 12:00 or 13:00)","type":"integer"},"pre":{"description":"Is the canteen opened just before the official lunch break, so that a gap on this slot does not count?","type":"boolean"}}},"wishes":{"$ref":"#/components/schemas/Wishes"}}},"TimetableClassroom":{"description":"Classroom","type":"object","properties":{"name":{"description":"Name of the classroom. A create or rename onto a name another room of the site wears, case, accents and spaces aside, is refused","type":"string"},"capacity":{"description":"Capacity of the classroom (number of seats)","type":"integer"},"specialisation":{"description":"Specialization of the classroom (free label). To be associated with specific subjects (e.g. stadium with PE)","type":"string"},"maxclasses":{"description":"Maximal number of simultaneous classes having different lessons at the same time. For example, an examination room, or a gymnasium.","type":"integer"},"building":{"description":"Building of the classroom (can also be used to specify the floor)","type":"string"},"wishes":{"allOf":[{"$ref":"#/components/schemas/Wishes"},{"description":"Specific slots when the classroom is available"}]},"description":{"description":"Description of the room","type":"string"},"tags":{"description":"Different tags","type":"array","items":{"type":"string"}},"campuses":{"description":"Campus labels associated with the classroom","type":"array","items":{"type":"string"}},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["name","capacity"]},"TimetableResource":{"description":"Resource","type":"object","properties":{"name":{"description":"Name of the resource. A create or rename onto a name another resource of the site wears, case, accents and spaces aside, is refused","type":"string"},"number":{"description":"How many of this resource","type":"integer"},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["name","number"]},"TimetableTeacher":{"description":"Teacher of the timetable: a partial copy of a user with the teacher role, or a virtual teacher (a placeholder for one still unknown)","type":"object","properties":{"first_name":{"description":"First name","type":"string"},"middle_name":{"description":"Middle name","type":"string"},"last_name":{"description":"Last name","type":"string"},"gender":{"description":"Gender (Male, Female, Unknown)","type":"string","enum":["M","F","U"]},"virtual_name":{"description":"Virtual teacher name representing a generic role for a teacher not yet hired, e.g., \"math teacher\".","type":"string"},"subjects":{"description":"Subjects taught by the virtual teacher","type":"array","items":{"description":"Subject label, identified by its name and code (no id)","type":"object","properties":{"name":{"type":"string","description":"Subject name"},"code":{"type":"string","description":"Subject code"},"short":{"type":"string","description":"Short subject name"}}}},"idnumber":{"description":"Teacher's identifier","type":"string"},"servicehours":{"description":"Service time the teacher should give on this timetable, in minutes","type":"integer"},"classroom":{"description":"Preferred room for the teacher (format <siteid>:<classroomid>)","type":"string"},"videolink":{"description":"Videoconference link of the teacher's lessons","type":"string","x-premiumOnly":true},"wishes":{"allOf":[{"$ref":"#/components/schemas/WishesTeachers"},{"description":"Wishes/preferences/availabilities of the teacher"}]},"former":{"description":"Read with infos, as the account's setting asks: the teacher's user is inactive, or missing from the users","type":"string","enum":["inactive","missing"],"readOnly":true},"_extids":{"$ref":"#/components/schemas/ExternalIds"}}},"TimetableClassroomPreference":{"description":"Classroom criterion: a campus, a tag, a building or a seats need","type":"object","properties":{"type":{"description":"Criterion type (capacity: a seats need)","type":"string","enum":["campus","tag","building","capacity"]},"value":{"description":"Campus label, tag or building name; for a seats need, a positive decimal such as \"2.5\"","type":"string"},"operator":{"description":"Seats need: x multiplies the headcount, + adds seats, - removes seats; absent, the value is the number of seats","type":"string","enum":["x","+","-"]},"site":{"description":"Site of a building criterion","type":"string"},"mandatory":{"description":"Seats need: never give the lesson a smaller room","type":"boolean"}},"required":["type","value"]},"TimetableClass":{"description":"Class object","allOf":[{"$ref":"#/components/schemas/TimetableClassBase"},{"type":"object","properties":{"students":{"description":"Explicit list of students, only if \"studentsonclasses\" option is set","type":"array","items":{"type":"string"}},"wishes":{"allOf":[{"$ref":"#/components/schemas/Wishes"},{"description":"Time preferences for this class"}]},"subjects":{"description":"Subjects taught to the class. An id may carry a ~<typeslug> suffix (custom123~tp)","type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableClassSubject"}},"groups":{"$ref":"#/components/schemas/TimetableClassGroups"},"lessons":{"description":"Lessons of the class, placed in the timetable grid","x-domain":{"items":"manage_lessons","fieldDefault":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/LessonClass"}}}}],"required":["name"]},"TimetableClassBase":{"description":"Base class for all timetable classes","type":"object","properties":{"name":{"description":"Name of the class. A create or rename onto a name another class of the timetable wears, case, accents and spaces aside, is refused","type":"string"},"level":{"description":"Level of the class","type":"string"},"campus":{"description":"Campus label of the class","type":"string"},"site":{"description":"Default site of the class. Prefer \"sites\" key","type":"string"},"sites":{"description":"Default sites of the class. As for now, used only with first element","type":"array","items":{"type":"string"}},"offgrid":{"description":"Lessons of this class are placed off the grid, at their own start and end times (calendar timetables only)","type":"boolean","x-premiumOnly":true,"x-dependsOn":{"type":"calendar"}},"time_unit":{"description":"Steps per hour when placing the lessons of an offgrid class, e.g. 4 for 15 minutes (calendar timetables only)","type":"integer","minimum":1,"x-premiumOnly":true,"x-dependsOn":{"type":"calendar"}},"recurring":{"description":"Lessons of this class repeat weekly instead of being placed date by date (calendar timetables only)","type":"boolean","x-dependsOn":{"type":"calendar"}},"date_window":{"description":"Id of the date window the class runs inside, typically its semester; absent, the whole timetable (calendar timetables only)","type":"string","x-dependsOn":{"type":"calendar"}},"classroom":{"description":"Default classroom for the class (format <siteid>:<classroomid>). If several classrooms are set, they are separated by commas","type":"string"},"preferredClassrooms":{"description":"Classroom preferences of the class: a room matching one of them is preferred. Its seats needs apply to the lessons stating none","type":"array","items":{"$ref":"#/components/schemas/TimetableClassroomPreference"}},"studentsnb":{"description":"Number of students of the class","type":"integer"},"videolink":{"description":"Video link to be set on every lessons on grid, by default (can be overloaded by a specific videolink on lesson)","type":"string","x-premiumOnly":true},"resourcelink":{"description":"Resource link to be set on every lessons on grid, by default (such as a LMS space for the class)","type":"string","x-premiumOnly":true},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["name"]},"TimetableClassSubject":{"description":"A subject object as a local copy either from the common subjects of a country, or a specific custom subject (local to the school)","allOf":[{"$ref":"#/components/schemas/Subject"},{"type":"object","properties":{"incompatibilities":{"description":"Rules of incompatibilities between the subject and the other ones","type":"array","items":{"description":"Rule of incompatibility","type":"object","properties":{"notbefore":{"description":"This subject should not be put before this other subject","type":"string"},"type":{"description":"Type of the rule, as the time span to consider its effects","type":"string","enum":["consecutive","halfday","day","week","always"]}},"required":["notbefore","type"]}},"pweight":{"description":"Pedagogical weight. Useful for the algorithm to balance days with subject difficulties","type":"number","default":1},"teachers":{"description":"Teachers by default teaching this subject","type":"array","items":{"type":"string"}},"assistants":{"description":"Teachers assisting on this subject, beside the ones teaching it","type":"array","items":{"type":"string"}},"minutes":{"description":"Number of minutes to teach on the timetable (from the student point of view). If a subject is 3 hours every 2 weeks, put 90. If group A has 4 hours and group B also, put 240","x-domain":{"capability":"manage_lessons"},"type":"number"},"specialisation":{"description":"Optional specialization of the needed classroom, must match at least one classroom with the exact same \"specialisation\" field","type":"string"},"wishes":{"allOf":[{"$ref":"#/components/schemas/Wishes"},{"description":"When this subject should be taught. Useful to forbid PE when it's too hot in the middle of the day, to forbid finance in the evening, or maths as a first lesson"}]},"policies":{"description":"Lessons this subject is expected to have, per group or class: how many, how long, with which teachers and classrooms","x-domain":{"capability":"manage_lessons"},"type":"array","items":{"$ref":"#/components/schemas/TimetableClassSubjectPolicy"},"x-premiumOnly":true},"nonrecurring":{"description":"Keeps this subject's lessons out of the weekly pattern of a recurring class (calendar timetables only)","x-domain":{"capability":"manage_lessons"},"type":"boolean","x-dependsOn":{"type":"calendar"}}}}]},"TimetableClassSubjectPolicy":{"description":"One line of a distribution policy: which lessons must exist, never when they happen","type":"object","properties":{"code":{"description":"Code of these lessons in the school's own nomenclature","type":"string"},"group":{"description":"Groups taught by these lessons, comma-separated (omitted = the whole class)","type":"string"},"teachers":{"description":"Teachers of these lessons (omitted = free, null = no teacher, list = exactly those)","type":["array","null"],"items":{"type":"string"}},"classroom":{"description":"Classrooms of these lessons, <siteid>:<classroomid> comma-separated (omitted = free, null = none)","type":["string","null"]},"comment":{"description":"Free note for whoever places these lessons","type":"string","maxLength":2000},"resources":{"description":"Resources (ID) pre-assigned to the generated lessons","type":"array","items":{"type":"string"}},"count":{"description":"Number of lessons this line asks for (0 = asleep: asks for nothing, reports no gap)","type":"integer","default":1,"minimum":0},"duration":{"description":"Length of one lesson of this line, in minutes","type":"integer","default":60,"minimum":1},"cadence":{"description":"Teaching rhythm asked for these lessons (omitted = chosen by the generation)","type":"object","properties":{"count":{"description":"Number of occurrences per period","type":"integer","default":1,"minimum":1},"weeks":{"description":"Length of the period, in weeks","type":"integer","default":1,"minimum":1}},"required":["count","weeks"]},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["count","duration"]},"TimetableClassGroups":{"title":"Groups","description":"Groups are subsets of one class; students of several classes meet through alignments or groups of groups. IDs are unique across classes, by default prefixed with <classid>:","type":"object","patternProperties":{"^[a-z0-9:]+$":{"$ref":"#/components/schemas/TimetableClassGroup"}}},"TimetableClassGroup":{"description":"Group object, identified by its name or its code","type":"object","properties":{"name":{"description":"Name of the group. A create or rename onto a name another group of the class wears, case, accents and spaces aside, is refused","type":"string"},"code":{"description":"Code of the group","type":"string"},"description":{"description":"Description of the group","type":"string"},"free":{"description":"Is this a free group? Free groups deactivate all conflicts with the rest of the class, teacher teaching another lesson or classroom being already occupied.","type":"boolean","default":false,"x-premiumOnly":true},"wishes":{"allOf":[{"$ref":"#/components/schemas/Wishes"},{"description":"Time preferences for this group"}],"x-premiumOnly":true},"parent":{"description":"Parent group, so that this group is a child, inheriting of partition rules from its parent","type":"string","x-premiumOnly":true},"studentsnb":{"description":"Number of students of the group (should be <= to the number of students of the class)","type":"integer","default":0},"students":{"description":"Explicit list of students, only if \"studentsonclasses\" option is set","type":"array","items":{"type":"string"}},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"anyOf":[{"required":["name"]},{"required":["code"]}]},"TimetableGroupTimeset":{"description":"Class partitions. Groups of a same class are incompatible by default (they could share students) EXCEPT if declared as forming a class partition","type":"array","items":{"description":"The list of groups forming the partition","type":"array","items":{"type":"string"}}},"TimetableGroupSpaceset":{"title":"Group alignment","description":"Group alignment. Groups of different classes working together, as long as they are set on mirrored lessons with same teacher(s) and classroom.","type":"array","items":{"description":"Explicit list of groups in alignement, i.e. strongly linked as the courses of the different classes will be kind of merged together","type":"array","items":{"type":"string"}}},"TimetableGroupGroupset":{"title":"Groups of groups","description":"Groups of groups. Groups of groups allow to create a meta-group regrouping the groups","type":"object","additionalProperties":{"$ref":"#/components/schemas/TimetableGroupGroupsetItem"}},"TimetableGroupGroupsetItem":{"title":"Group of groups definition","description":"Definition of a single group of groups (meta-group)","type":"object","properties":{"name":{"description":"Name of the group of groups","type":"string"},"code":{"description":"Code of the group of groups","type":"string"},"groups":{"description":"Groups constituting the meta-group","type":"array","items":{"type":"string"}}},"required":["name","code","groups"]},"UserMinimal":{"description":"User minimal fields","type":"object","properties":{"first_name":{"description":"Fist name","type":"string"},"middle_name":{"description":"Middle name (if support activated)","type":"string"},"last_name":{"description":"Last name","type":"string"},"gender":{"description":"Gender (Male, Female, Unknown)","type":"string","enum":["M","F","U"]},"birthdate":{"description":"Birthdate (YYYY-MM-DD)","type":"string","format":"date"},"email":{"description":"E-mail","type":"string","format":"email"},"secondary_emails":{"description":"Further e-mail addresses copied on the mails sent to the user, except sign-in and account recovery; only for the roles config.secondaryemails lists","type":"array","items":{"type":"string","format":"email"},"uniqueItems":true},"phone":{"description":"Phone number","type":"string"},"idnumber":{"description":"ID number (e.g. defined by the Ministry of Education, or the school)","type":"string"},"comment":{"description":"Free comment","type":"string"}}},"TeacherMinimal":{"description":"Teacher minimal fields","allOf":[{"$ref":"#/components/schemas/UserMinimal"},{"type":"object","properties":{"wishes":{"allOf":[{"$ref":"#/components/schemas/WishesTeachers"},{"description":"Teacher's wishes/availabilities"}]},"external":{"description":"External teacher flag (only stored if true)","type":"boolean","x-premiumOnly":true}}}]},"UserEditable":{"description":"User fields editable through the admin user updates, credentials and provider links excluded","type":"object","allOf":[{"$ref":"#/components/schemas/UserMinimal"},{"$ref":"#/components/schemas/Placements"},{"type":"object","properties":{"roles":{"description":"List of roles","type":"array","items":{"type":"string","enum":["superadmin","admin","staff","teacher","student"]}},"customrole":{"description":"Custom role","type":"string"},"domains":{"description":"Planning domains assigned to this admin user (IDs from config.domains). Absent or empty = unrestricted access","x-domain":{"capability":"unrestricted_only"},"type":"array","items":{"type":"string"},"x-premiumOnly":true},"servicehours":{"description":"Service time the teacher should teach, in minutes","type":"integer"},"external":{"description":"External teacher flag (only stored if true)","type":"boolean","x-premiumOnly":true},"subjects":{"description":"Subjects to be taught by the teacher (useful for automatic suggestions)","type":"array","items":{"description":"Subject label, identified by its name and its code (no id)","type":"object","properties":{"name":{"description":"Subject name","type":"string"},"code":{"description":"Subject code","type":"string"},"short":{"description":"Short subject name","type":"string"}},"anyOf":[{"required":["name"]},{"required":["code"]}]}},"tags":{"description":"Free labels the school gives the user, to find or filter users","type":"array","items":{"type":"string"}},"campuses":{"description":"Campus labels associated with the user, usually among config.campuses","type":"array","items":{"type":"string"}},"wishes":{"allOf":[{"$ref":"#/components/schemas/WishesTeachers"},{"description":"Teacher's wishes/availabilities"}]},"auth":{"$ref":"#/components/schemas/AuthEditable"},"schedules_options":{"$ref":"#/components/schemas/SchedulesOptions"},"_extids":{"$ref":"#/components/schemas/ExternalIds"}}}]},"User":{"description":"User","type":"object","allOf":[{"$ref":"#/components/schemas/UserEditable"},{"type":"object","properties":{"login":{"description":"Login","type":"string"},"password":{"description":"Password (hashed + salt + peppper)","type":"string"},"auth":{"$ref":"#/components/schemas/Auth"}}}],"required":["first_name","last_name","login","roles"]},"AuthEditable":{"description":"Editable authentication flags exposed in the generic user update flow","type":"object","properties":{"breakGlass":{"description":"Allow local password login even in OIDC-only mode (emergency access)","type":"boolean"}}},"Auth":{"description":"Authentication metadata for a user","type":"object","allOf":[{"$ref":"#/components/schemas/AuthEditable"},{"type":"object","properties":{"providers":{"description":"External identity providers linked to this user","type":"array","items":{"$ref":"#/components/schemas/OidcProviderLink"}}}}]},"OidcProviderLink":{"description":"Link to an external OIDC identity provider","type":"object","properties":{"type":{"description":"Provider type identifier","type":"string","enum":["oidc"],"default":"oidc"},"providerName":{"description":"Provider name (azure, keycloak, google, etc.)","type":"string"},"issuer":{"description":"OIDC issuer URL","type":"string","format":"uri"},"subject":{"description":"OIDC subject claim (sub) - stable user ID from IdP","type":"string"},"tenantId":{"description":"Azure tenant ID (tid claim) if applicable","type":"string"},"objectId":{"description":"Azure object ID (oid claim) if applicable","type":"string"},"emailAtLink":{"description":"Email address at the time of linking (for audit)","type":"string","format":"email"},"linkedAt":{"description":"ISO timestamp when the link was created","type":"string","format":"date-time"}},"required":["type","issuer","subject","linkedAt"]},"Placements":{"type":"object","properties":{"placements":{"description":"Student placement (classes/groups, during school years), by ID = school year","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Placement"}}}}},"PlacementGroup":{"type":"object","properties":{"group":{"description":"Group ID. Can be a regular group ID, a named groupset ID, or a virtual multigroup ID using CSV notation (for example c1:g1,c2:g2).","type":"string"},"weeks":{"description":"Weeks in the group, from the school year's first week: [start, end] ranges or single numbers. Absent: as long as its placement","type":"array","items":{"oneOf":[{"type":"number"},{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2}]}}}},"Placement":{"type":"object","properties":{"class":{"description":"Class assigned to the student","type":"string"},"date_start":{"description":"Start date (if absent = start of the school year) (YYYY-MM-DD)","type":"string","format":"date"},"date_end":{"description":"End date (if absent = end of the school year) (YYYY-MM-DD)","type":"string","format":"date"},"groups":{"description":"Groups assigned to the student","type":"array","items":{"$ref":"#/components/schemas/PlacementGroup"}}},"required":["class"]},"SchedulesOptions":{"description":"Schedules to restore in schedule module","type":"object","properties":{"customs":{"description":"Entries of schedules to diplay all at once","type":"array","items":{"type":"object","properties":{"name":{"description":"Name of the entry","type":"string"},"schedules":{"description":"List of the schedules to display","type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"string"}}}}}}}}}},"restore":{"description":"automatic restoration of previously displayed scheduled (stored in browser local cookie)","type":"boolean"}}},"Wishes":{"type":"object","properties":{"hours":{"description":"Specific rules on hours for availabilities","type":"array","items":{"description":"Time span with associated rule for availability/wish/preference","type":"object","properties":{"day":{"description":"Day, date or cycle day. If no time bound is provided, the wish applies to the whole day.","type":"string","oneOf":[{"format":"date"},{"enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},{"pattern":"^[0-9]+$"}]},"school_year":{"description":"Optional school year scope for recurring non-dated wishes in calendar mode.","type":"string"},"period_begin":{"description":"Start in period number (exclusive to minute bounds). If omitted while period_end is present, the span starts at the beginning of the day.","type":"integer"},"period_end":{"description":"End in period number, excluded (not with minute bounds). Omitted while period_begin is set: the end of the day","type":"integer"},"begin":{"description":"Start in minutes (exclusive to period bounds). If omitted while end is present, the span starts at the beginning of the day.","type":"integer"},"end":{"description":"End in minutes (exclusive to period bounds). If omitted while begin is present, the span ends at the end of the day.","type":"integer"},"priority":{"description":"Priority: \"mandatory\" must be avoided, \"high\" strongly avoided, \"medium\" not preferred, \"preferred\" wanted, \"none\" erases the earlier wishes on the span","type":"string","enum":["mandatory","high","medium","preferred","none"]},"sites":{"description":"Optional sites the wishes are referring to","type":"array","items":{"type":"string"}}},"required":["day","priority"],"oneOf":[{"properties":{"period_begin":{"not":{}},"period_end":{"not":{}},"begin":{"not":{}},"end":{"not":{}}}},{"anyOf":[{"required":["period_begin"]},{"required":["period_end"]}],"properties":{"begin":{"not":{}},"end":{"not":{}}}},{"anyOf":[{"required":["begin"]},{"required":["end"]}],"properties":{"period_begin":{"not":{}},"period_end":{"not":{}}}}]}},"time_unit":{"description":"If it is in period number, what is the time unit as in the grid","type":"number","default":1},"time_period":{"description":"If it is in period number, what is the time period as in the grid","type":"number","default":60},"maxhours":{"description":"Maximum number of lesson hours per day (format \"HH:MM\" preferred, integer hours accepted)","allOf":[{"$ref":"#/components/schemas/DurationHHMMOrHours"}]},"maxhoursweek":{"description":"Maximum number of lesson hours per week (format \"HH:MM\" preferred, integer hours accepted)","allOf":[{"$ref":"#/components/schemas/DurationHHMMOrHours"}]},"comment":{"description":"Free comment, for example to be used by teachers to communicate specific remarks on their wishes","type":"string"},"date_windows":{"description":"Ids of the date windows narrowing when these lessons may be scheduled (calendar timetables only)","type":"array","items":{"type":"string"},"x-dependsOn":{"type":"calendar"}}}},"WishesTeachers":{"allOf":[{"$ref":"#/components/schemas/Wishes"},{"type":"object","properties":{"priority":{"description":"What is the priority of this wish compared to other wishes (low, normal or high)","type":"string","enum":["low","normal","high"],"default":"normal"},"consecutivedaysmin":{"description":"Minimum number of consecutive teaching days the teacher wishes","type":"integer","minimum":2},"consecutivedaysmax":{"description":"Maximum number of consecutive teaching days the teacher wishes","type":"integer","minimum":1}}}]},"SchoolYear":{"type":"object","properties":{"name":{"description":"Name of the school year","type":"string"},"date_start":{"description":"Start date","type":"string","format":"date"},"date_end":{"description":"End date","type":"string","format":"date"},"holidays":{"description":"Holidays","type":"array","items":{"$ref":"#/components/schemas/Holiday"}},"altweeks":{"description":"Array of alternate weeks to determine wether to change the alterations at some point, mainly because of holidays","type":"array","items":{"type":"integer"}}},"required":["name","date_start","date_end"]},"Holiday":{"type":"object","properties":{"name":{"type":"string"},"begin":{"type":"string","format":"date"},"end":{"type":"string","format":"date"}},"required":["name","begin","end"]},"Event":{"description":"Event object","type":"object","properties":{"title":{"description":"Title of the event (to be displayed)","type":"string"},"start":{"description":"Start of the event (format YYYYMMDDTHHmmSS)","type":"string","pattern":"^\\d{8}T\\d{6}$"},"end":{"description":"End of the event (format YYYYMMDDTHHmmSS)","type":"string","pattern":"^\\d{8}T\\d{6}$"},"rrule":{"$ref":"#/components/schemas/Rrule"},"attendees":{"title":"Users/entities to attend the event","description":"Users/entities to attend the event. It can be a user, a class, a group, a custom name or the whole school (everybody) or anyone who wants to (anyone)","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"id":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"last_name":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}},"required":["type","id","first_name","middle_name","last_name"]},{"type":"object","properties":{"type":{"type":"string","enum":["class"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"object","properties":{"type":{"type":"string","enum":["group"]},"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"}},"required":["type","id","name","code"]},{"type":"object","properties":{"type":{"type":"string","enum":["custom"]},"name":{"type":"string"}},"required":["type","name"]},{"type":"object","properties":{"type":{"type":"string","enum":["everybody","anyone"]}},"required":["type"]}]}},"location":{"description":"The location(s) of the event (either a classroom or a custom label)","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["classroom"]},"name":{"type":"string"},"id":{"type":"string"},"sitename":{"type":"string"}},"required":["type","name","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["custom"]},"name":{"type":"string"}},"required":["type","name"]}]}},"resources":{"description":"The resources to be used/reserved for the event","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["resource"]},"id":{"type":"string"},"name":{"type":"string"},"sitename":{"type":"string"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["custom"]},"name":{"type":"string"}},"required":["type","name"]}]}},"videolink":{"description":"Video link to remotely attend to the event","type":"string"},"memos":{"description":"Comments on the event","type":"array","items":{"$ref":"#/components/schemas/Memo"}},"color":{"description":"Color of the event (hexadecimal without #, e.g. '1bc5b3')","type":"string","pattern":"^[0-9A-Fa-f]{6}$"},"tags":{"description":"Free labels on the event, which integrations may use to choose what they pick up","type":"array","items":{"type":"string"}},"subjects":{"description":"Subjects the event relates to, by id (labels only: no teaching hours)","type":"array","items":{"type":"string"}},"_osrev":{"description":"Optimistic locking revision counter for the event","x-domain":{"capability":"system"},"type":"string"},"_extids":{"$ref":"#/components/schemas/ExternalIds"}},"required":["title","start","end"]},"LessonClass":{"allOf":[{"$ref":"#/components/schemas/Lesson"},{"type":"object","properties":{"assoc":{"description":"Associated lessons have groups switching together","type":"array","items":{"$ref":"#/components/schemas/LessonBase"}},"concat":{"description":"Concatenated lessons are strictly happening one after the other, they cannot be cut","type":"array","items":{"$ref":"#/components/schemas/LessonBase"}}}}]},"Memo":{"description":"Comments, with different levels of display","type":"object","properties":{"comment":{"description":"Text of the comment","type":"string"},"pub":{"description":"Public who can view this comment","type":"string","enum":["admin","teacher","all"]},"owner":{"description":"Who made this comment","type":"string"},"tstp":{"description":"Timestamp of when this comment was issued/created","type":"integer"}},"required":["comment"]},"Memos":{"type":"object","properties":{"memos":{"description":"Comments on the lesson","type":"array","items":{"$ref":"#/components/schemas/Memo"}},"tags":{"description":"Free tags of the lesson, to filter and query lessons; shown to admins only","type":"array","items":{"type":"string"}}}},"PositionCommon":{"type":"object","properties":{"position":{"type":"object","properties":{"period":{"description":"Period of the lesson (no period and no start/end = holiday)","type":"integer"},"start":{"description":"Exact start hour (format HH:MM)","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$","examples":["08:30","14:05"]},"end":{"description":"Exact end hour (format HH:MM)","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$","examples":["08:30","14:05"]}}}}},"PositionTimetable":{"description":"Position used in database for timetables: can be a date (calendar), a weekday (weekly timetable) or a day number (cycle).","allOf":[{"$ref":"#/components/schemas/PositionCommon"},{"type":"object","properties":{"position":{"x-domain":{"capability":"edit_placement"},"type":"object","properties":{"day":{"description":"Position of the lesson, can be a date (calendar timetable), a day (weekly timetable) or a day number (cycle)","type":"string","oneOf":[{"format":"date"},{"enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},{"pattern":"^[0-9]+$"}]},"fixed":{"description":"Is this lesson fixed? (Cannot be moved by the automatic generation algorithm)","type":"boolean","default":false}},"required":["day"]}}}]},"PositionDate":{"description":"Position used in API returns: strict date only (YYYY-MM-DD).","allOf":[{"$ref":"#/components/schemas/PositionCommon"},{"type":"object","properties":{"position":{"description":"Position as a date of the lesson on the timetable","x-domain":{"capability":"edit_placement"},"type":"object","properties":{"day":{"description":"Date of the lesson","type":"string","format":"date"}},"required":["day"]}}}]},"LessonIdentity":{"type":"object","properties":{"_id":{"description":"Stable identifier for the lesson, generated from lesson content","x-domain":{"capability":"system"},"type":"string","x-premiumOnly":true},"_osrev":{"description":"Optimistic locking revision counter for the lesson","x-domain":{"capability":"system"},"type":"string","x-premiumOnly":true},"_extids":{"$ref":"#/components/schemas/ExternalIds"}}},"Lesson":{"allOf":[{"$ref":"#/components/schemas/LessonBase"},{"$ref":"#/components/schemas/PositionTimetable"},{"$ref":"#/components/schemas/Memos"},{"$ref":"#/components/schemas/LessonIdentity"},{"type":"object","properties":{"status":{"description":"Lesson status (planned, draft, canceled, done)","x-domain":{"capability":"edit_status"},"type":"string","enum":["planned","draft","canceled","done"],"x-premiumOnly":true},"weekalt":{"description":"Lessons in alternate week (several weeks but at least one can be free, set \"subject\": \"free\")","type":"array","items":{"$ref":"#/components/schemas/LessonBase"}}}}]},"LessonBuffered":{"description":"A course waiting in the buffer: a dated alteration without position. A groupset's course names its groups instead of a class","allOf":[{"$ref":"#/components/schemas/LessonBase"},{"$ref":"#/components/schemas/PositionDate"},{"$ref":"#/components/schemas/Memos"},{"$ref":"#/components/schemas/LessonIdentity"},{"type":"object","properties":{"class":{"description":"Class of the lesson, when it belongs to one","type":"string"},"schedid":{"description":"Timetable ID of the lesson","type":"string"},"osubject":{"description":"Complete subject object (copy), for a subject the class does not carry","$ref":"#/components/schemas/Subject"}},"required":["schedid"]}]},"LessonAlteration":{"allOf":[{"$ref":"#/components/schemas/LessonSchedule"},{"type":"object","properties":{"osubject":{"description":"Complete subject object (copy). A new lesson on a specific date can use a subject which is not existing on the class, so we need to store it there.","$ref":"#/components/schemas/Subject"}}}]},"LessonSchedule":{"allOf":[{"$ref":"#/components/schemas/LessonBase"},{"$ref":"#/components/schemas/PositionDate"},{"$ref":"#/components/schemas/Memos"},{"$ref":"#/components/schemas/LessonIdentity"},{"type":"object","properties":{"class":{"description":"Class of the lesson","type":"string"},"schedid":{"description":"Timetable ID of the lesson","type":"string"},"status":{"description":"Lesson status at this date (planned, draft, canceled, done)","x-domain":{"capability":"edit_status"},"type":"string","enum":["planned","draft","canceled","done"],"x-premiumOnly":true},"substitutes":{"description":"Computed substitutions for absent teachers on a lesson (absences module)","x-domain":{"capability":"edit_teachers"},"type":"object","additionalProperties":{"type":"object","properties":{"substitute":{"description":"Teacher ID acting as substitute","type":"string"},"absence":{"description":"Absence reason of the original teacher","type":"string"},"sticky":{"description":"Absence ID that forced this substitution (when sticky)","type":"string"}}}}},"required":["schedid","position"],"anyOf":[{"required":["class"]},{"required":["group"]}]}]},"LessonBase":{"type":"object","properties":{"duration":{"description":"Duration of the lesson, in period number (period = #slot * time_unit)","x-domain":{"capability":"edit_duration"},"type":"integer"},"duration_actual":{"description":"Actual duration of the lesson, in minutes (used instead of position start/end when computing accounted duration)","type":"integer","minimum":0,"x-domain":{"capability":"edit_duration"},"x-premiumOnly":true},"duration_accounted":{"description":"Accounted duration of the lesson, in minutes (billing purposes)","type":"integer","minimum":0,"x-domain":{"capability":"edit_duration"},"x-premiumOnly":true},"modality":{"description":"Lesson modality (in person, remote, hybrid, self-study)","type":"string","enum":["in_person","remote","hybrid","self_study"],"x-domain":{"capability":"edit_modality"},"x-premiumOnly":true},"subject":{"description":"Subject ID","x-domain":{"capability":"manage_lessons"},"type":"string"},"group":{"description":"Group ID","x-domain":{"capability":"manage_lessons"},"type":"string"},"teachers":{"description":"Teachers (ID). null: no teacher on purpose; an empty list: back to awaiting a teacher","x-domain":{"capability":"edit_teachers"},"type":["array","null"],"items":{"type":"string"}},"classroom":{"description":"Classroom ID, <site_id>:<classroom_id> for another site than the class's, several separated by commas. null: no classroom on purpose; empty string: back to awaiting one","x-domain":{"ref":"classroom","capability":"edit_classroom"},"type":["string","null"]},"videolink":{"description":"Video link to attend remotely to the lesson","x-domain":{"capability":"edit_videolink"},"type":"string"},"resources":{"description":"Resources (ID) used by the lesson","x-domain":{"capability":"manage_lessons"},"type":"array","items":{"type":"string"}},"preferredClassrooms":{"description":"Classroom needs of the lesson: every tag, one of the campuses and one of the buildings named. Its seats needs replace its class's","x-domain":{"capability":"edit_lesson"},"type":"array","items":{"$ref":"#/components/schemas/TimetableClassroomPreference"}},"specialisation":{"description":"Special room the lesson imposes over its subject's: a specialization label, or null for an ordinary classroom","x-domain":{"capability":"edit_lesson"},"type":["string","null"]},"studentsnb":{"description":"Expected headcount, from the ERP or a user; replaces the one computed from the class and its groups. 0 removes it","x-domain":{"capability":"manage_lessons"},"type":"integer","minimum":0}},"required":["subject","duration"]},"CustomDateTimeFormat":{"type":"string","description":"Date-time value used in timetable metadata. Canonical format is ISO 8601 UTC; legacy format is still accepted during migration.","oneOf":[{"description":"Legacy format kept for backward compatibility (YYYY-MM-DD HH:MM:SS with optional AM/PM).","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{1,2}:\\d{2}:\\d{2}(?: AM| PM)?$","examples":["2023-06-14 10:02:37 AM","2023-10-05 1:18:19 PM","2025-01-10 15:42:00"]},{"format":"date-time","description":"ISO 8601 format. Canonical storage should be UTC (`Z`).","examples":["2026-03-03T14:52:19.123Z","2026-03-03T14:52:19Z"]}]},"AbsenceTeacher":{"allOf":[{"$ref":"#/components/schemas/Absence"},{"description":"Absence of the teacher","type":"object","properties":{"subjects":{"description":"Absence only for these subjects. A teacher can only be unavailable for chemistry but ok for physics","type":"array","items":{"type":"string"}},"classes":{"description":"Absence only for those classes. A teacher can only be allergic to one specific class","type":"array","items":{"type":"string"}},"substitutes":{"description":"All substitution rules","x-domain":{"capability":"system"},"type":"array","items":{"$ref":"#/components/schemas/AbsenceTeacherSubstitute"}},"status":{"$ref":"#/components/schemas/AbsenceTeacherStatus"}}}]},"AbsenceTeacherStatus":{"description":"Status of the absence, set to `ok` or `ko` by an administrator only:\n- `ok`: accepted\n- `pending`: awaiting a decision\n- `ko`: refused\n- `aborted`: canceled by the teacher or an administrator","type":"string","enum":["ok","pending","ko","aborted"],"default":"ok"},"AbsenceTeacherSubstitute":{"description":"Substitution rule for a teacher's absence","type":"object","oneOf":[{"type":"object","properties":{"substitute":{"description":"Substitute teacher's name","type":"string"},"date_start":{"description":"Start date of the substitution rule (YYYY-MM-DD)","type":"string","format":"date"},"date_end":{"description":"End date of the substitution rule (YYYY-MM-DD)","type":"string","format":"date"},"hours":{"description":"Time slots of the substitution rule","type":"array","items":{"type":"object","properties":{"begin":{"description":"Start time of the slot (in minutes)","type":"number"},"end":{"description":"End time of the slot (in minutes)","type":"number"},"day":{"description":"Date concerned (YYYY-MM-DD)","type":"string","format":"date"}},"required":["day"]}},"classes":{"description":"List of classes concerned by the rule","type":"array","items":{"type":"string"}},"subjects":{"description":"List of subjects concerned by the rule","type":"array","items":{"type":"string"}},"comment":{"description":"Comment or additional information about the rule","type":"string"}},"required":["substitute","date_start"]},{"type":"object","properties":{"substitute":{"description":"Substitute teacher's name","type":"string"},"lesson":{"description":"The substituted lesson, as a footprint. It stops matching as soon as the lesson moves","type":"object","properties":{"class":{"description":"Class of the substituted lesson","type":"string"},"subject":{"description":"Subject of the substituted lesson","type":"string"},"group":{"description":"Group of the substituted lesson (optional)","type":"string"},"day":{"description":"Day of the week of the substituted lesson","type":"string"},"period":{"description":"Period of the substituted lesson","type":"integer"}},"required":["class","subject","day","period"]}},"required":["substitute","lesson"]}]},"AbsenceClass":{"allOf":[{"$ref":"#/components/schemas/Absence"},{"description":"Absence of the class","type":"object","properties":{"subjects":{"description":"Specific subjects (ID) the class is absent from. Left out, the class is absent from all of them.","type":"array","items":{"type":"string"}},"status":{"description":"Status of the absence","type":"string","enum":["ok","aborted"]}}}]},"AbsenceStaff":{"allOf":[{"$ref":"#/components/schemas/Absence"},{"description":"Absence of the staff member","type":"object","properties":{"subjects":{"description":"Specific subjects (ID) to exclude. For example, the staff member can only be absent to PE course","type":"array","items":{"type":"string"}},"assignments":{"description":"Supervision assignments (ID) the staff member was holding, to show what is left uncovered","type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/AbsenceStaffStatus"}}}]},"AbsenceStaffStatus":{"description":"Status of the absence, set to `ok` or `ko` by an administrator only:\n- `ok`: accepted\n- `pending`: awaiting a decision\n- `ko`: refused\n- `aborted`: canceled by the staff member or an administrator","type":"string","enum":["ok","pending","ko","aborted"],"default":"ok"},"AbsenceStudent":{"allOf":[{"$ref":"#/components/schemas/Absence"},{"description":"Absence of the student","type":"object","properties":{"subjects":{"description":"Specific subjects (ID) to exclude. For example, the student can only be absent to PE course","type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/AbsenceStudentStatus"}}}]},"AbsenceStudentStatus":{"description":"Status of the absence, set to `ok` or `ko` by an administrator only:\n- `ok`: accepted\n- `pending`: awaiting a decision\n- `ko`: refused\n- `aborted`: canceled by the student or an administrator","type":"string","enum":["ok","pending","ko","aborted"],"default":"ok"},"Absence":{"type":"object","properties":{"date_start":{"description":"Start date (YYYY-MM-DD)","type":"string","format":"date"},"date_end":{"description":"End date (YYYY-MM-DD)","type":"string","format":"date"},"reason":{"description":"Reason of the absence (ID refering to a translation key, OR custom label)","type":"string"},"tstp":{"description":"Creation timestamp (since EPOCH)","type":"integer"},"createdby":{"description":"User creating this absence","oneOf":[{"type":"string"},{"properties":{"first_name":{"type":"string"},"middle_name":{"type":"string"},"last_name":{"type":"string"}}}]},"comment":{"description":"Free comment","type":"string"},"hours":{"description":"Specific optional hour spans (all day/date, or with specific hours)","type":"array","items":{"type":"object","properties":{"begin":{"description":"Start in minutes","type":"integer"},"end":{"description":"End in minutes","type":"integer"},"day":{"description":"Date of the day (YYYY-MM-DD)","type":"string","format":"date"}},"required":["day"]}},"statusby":{"description":"User last modifying the status","oneOf":[{"type":"string"},{"properties":{"first_name":{"type":"string"},"middle_name":{"type":"string"},"last_name":{"type":"string"}}}]},"statuststp":{"description":"Status update timestamp (since EPOCH)","type":"number"}},"required":["date_start","reason"]},"Panel":{"description":"Display panel with lessons of the day (for entrance hall, classroom...)","type":"object","properties":{"label":{"description":"Panel label (for internal reference use)","type":"string"},"title":{"description":"Title of the panel, to be displayed","type":"string"},"spanhours":{"description":"How many hours to show starting from now (0 = all day)","type":"integer","default":0},"messages":{"description":"Messages to display on the panel","type":"array","items":{"type":"object","properties":{"text":{"description":"Text of the message","type":"string"},"start":{"description":"Start hour","type":"string","pattern":"^\\d{2}:\\d{2}$","examples":["13:45","8:00"]},"end":{"description":"End hour","type":"string","pattern":"^\\d{2}:\\d{2}$","examples":["18:00","12:00"]}},"required":["text","start","end"]}},"fontsize":{"description":"Font size","type":"string","enum":["small","medium","large"],"default":"medium"},"formatname":{"description":"Format of the teachers' name (like First name first or last, or Mr. Lastname, etc.)","type":"string","enum":["firstmiddlelast","lastmiddlefirst","titlelast","titlefirst"],"default":"firstmiddlelast"},"title_name_m":{"description":"Title for Mr. (localized)","type":"string"},"title_name_f":{"description":"Title for Mrs. (localized)","type":"string"},"colorbackground":{"description":"Background color","type":"string"},"colorfont":{"description":"Font color","type":"string"},"colorodd":{"description":"Font color for odd lines","type":"string"},"coloreven":{"description":"Font color for even lines","type":"string"},"topline":{"description":"What to display in header (order matters)","type":"array","items":{"type":"string","enum":["title","logo","date"]}},"columns":{"description":"What columns to display in the lesson grid (order matters)","type":"array","items":{"type":"string","enum":["room","classes","teachers","subject","hours"]}},"filters":{"description":"Explicit items to display, can be levels, classes, sites, or classrooms. Empty = all","type":"object","properties":{"levels":{"description":"Levels to display (= all classes from this level)","type":"array","items":{"type":"string"}},"classes":{"description":"Classes (ID) to display","type":"array","items":{"type":"string"}},"sites":{"description":"Sites (ID) to display (= all classrooms from this site)","type":"array","items":{"type":"string"}},"classrooms":{"description":"Classrooms (ID) to display","type":"array","items":{"type":"string"}}}},"exclusions":{"description":"Specific items to exclude from display","type":"object","properties":{"subjects":{"description":"Specific subjects (ID) to exclude","type":"array","items":{"type":"string"},"examples":[["pe","theater"],["mathematics"]]},"types":{"description":"Specific types to exclude","type":"array","items":{"type":"string"},"examples":[["exams"],["remote","outside"]]}}}}},"Staffing":{"description":"Staffing module: the configuration and schedule of the supervision staff","type":"object","properties":{"grids":{"$ref":"#/components/schemas/StaffingGrids"},"sites":{"$ref":"#/components/schemas/StaffingSites"},"assignments":{"$ref":"#/components/schemas/StaffingAssignments"},"display_order":{"$ref":"#/components/schemas/StaffingDisplayOrder"},"staff":{"$ref":"#/components/schemas/StaffingStaff"},"schedule":{"$ref":"#/components/schemas/StaffingSchedule"}},"required":["grids","assignments","staff","schedule"]},"StaffingGrids":{"description":"Multiple grids, by numeric id, each with its own active date ranges.","type":"object","additionalProperties":{"$ref":"#/components/schemas/StaffingGrid"}},"StaffingGrid":{"description":"Definition of the grid : days, periods and generic availability wishes. Acts as the template for building the weekly schedule.","type":"object","properties":{"dates":{"description":"Inclusive date ranges when this grid is active, as an array of [begin,end] pairs (YYYY-MM-DD).","type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"date"}}},"days":{"description":"List of days (e.g. monday, tuesday, ...)","type":"array","items":{"type":"string"}},"periods":{"description":"List of periods (time slots).","type":"array","items":{"type":"object","properties":{"begin":{"description":"Period start time (HH:MM)","type":"string"},"end":{"description":"Period end time (HH:MM)","type":"string"},"label":{"description":"Optional label for the period.","type":"string"},"comment":{"description":"Optional comment for the period.","type":"string"}},"required":["begin","end"]}},"wishes":{"$ref":"#/components/schemas/Wishes"}},"required":["days","periods"]},"StaffingSites":{"description":"List of sites or sites, including names and relative distances, used to compute feasibility and travel times.","type":"object","additionalProperties":{"type":"object","properties":{"name":{"description":"Site name.","type":"string"},"distances":{"description":"Distances to other sites (by id, in meters).","type":"object","additionalProperties":{"type":"number"}}},"required":["name"]}},"StaffingNeeds":{"description":"List of staffing needs, per grid.","additionalProperties":{"type":"object","properties":{"spans":{"description":"Per-assignment exact needs by time spans. Spans should not overlap and must have begin < end (enforced at application level).","type":"array","items":{"$ref":"#/components/schemas/StaffingNeedSpan"}}}}},"StaffingNeedSpan":{"type":"object","description":"Exact staffing need for a time span. If headcount=0, no staff is required in that window.","properties":{"day":{"description":"Day or date","type":"string","oneOf":[{"format":"date"},{"enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]}]},"begin":{"type":"string","description":"Start time (HH:MM, 24h).","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","description":"End time (HH:MM, 24h).","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"headcount":{"type":"integer","minimum":0,"description":"Exact number of staff required for this window (0 = no need)."}},"required":["begin","end","headcount"],"additionalProperties":false},"StaffingAssignment":{"type":"object","properties":{"name":{"description":"Assignment name.","type":"string"},"compatibility":{"description":"List of compatible assignments (by id).","type":"array","items":{"type":"string"}},"req":{"type":"integer","minimum":0,"description":"Hard minimum staff to cover."},"ideal":{"type":"integer","minimum":0,"description":"Preferred headcount (≥ required)."},"site":{"description":"Site ID where this assignment takes place (optional).","type":"string"},"priority":{"description":"Assignment priority.","type":"string","enum":["high","normal","low"]},"needs":{"$ref":"#/components/schemas/StaffingNeeds"},"allowed_staff":{"description":"List of allowed staff ids for this assignment (if empty, all staff are allowed).","type":"array","items":{"type":"string"}}},"required":["name"]},"StaffingAssignments":{"description":"Catalog of the assignments (duties to cover)","type":"object","additionalProperties":{"$ref":"#/components/schemas/StaffingAssignment"}},"StaffingDisplayOrder":{"description":"Preferred display order of assignments in the user interface, e.g. in the weekly grid view.","type":"object","properties":{"assignments":{"description":"Order of assignments (array of assignment ids).","type":"array","items":{"type":"string"}}}},"StaffingStaffMember":{"type":"object","properties":{"first_name":{"description":"Staff member's first name.","type":"string"},"middle_name":{"description":"Staff member's middle name.","type":"string"},"last_name":{"description":"Staff member's last name.","type":"string"},"virtual_name":{"description":"Staff member's virtual name = a staff member not yet hired.","type":"string"},"color":{"description":"Hex color for visual identification in the UI (e.g., 27AE60).","type":"string","pattern":"^[0-9A-Fa-f]{6}$"}},"required":["first_name","last_name"]},"StaffingStaff":{"description":"List of staff members included in this module, with their basic information (identifiers, names, etc.).","type":"object","additionalProperties":{"$ref":"#/components/schemas/StaffingStaffMember"}},"StaffingScheduleDate":{"description":"Shift schedule for a specific date and specific assignment.","type":"object","additionalProperties":{"description":"Shift schedule for a specific date, specific assignment, by period (mapped to the grid).","type":"array","items":{"type":["object","null"],"properties":{"comment":{"description":"Optional comment for this entry.","type":"string"},"staff":{"description":"List of assigned staff ids.","type":"array","items":{"type":"string"}},"locked_staff":{"description":"List of locked staff ids (cannot be changed).","type":"array","items":{"type":"string"}}}}}},"StaffingSchedule":{"description":"The effective schedule of assignments: for each assignment and date, the list of shifts, assigned staff members, comments, and optional locks (locked_staff).","type":"object","properties":{"grids":{"description":"Grid templates used for the schedule by date, as an history","type":"object","additionalProperties":{"description":"Grid template for a specific starting date (until the next one), as a summary.","type":"object","properties":{"days":{"description":"List of days (0 = sunday)","type":"array","items":{"type":"integer"}},"periods":{"description":"List of periods (start hours HH:MM, one per period)","type":"array","items":{"type":"string"}}}}},"assignments":{"description":"Name of the assignments (for reference)","type":"object","additionalProperties":{"description":"Name of the assignment.","type":"string"}},"dates":{"description":"Shift schedules, by dates.","type":"object","additionalProperties":{"type":"object","description":"Shift schedules for a specific date, by assignment.","additionalProperties":{"type":"object","properties":{"dates":{"$ref":"#/components/schemas/StaffingScheduleDate"}}}}}}},"Rrule":{"description":"Recurrence rule","type":"object","properties":{"freq":{"description":"Frequence of the event (optional). Daily, weekly, monthly.","type":"string","enum":["DAILY","WEEKLY","MONTHLY"]},"interval":{"description":"Recurrence interval (optional, default is 1) - interval of 2 with freq: \"WEEKLY\" means the event repeats every two weeks","type":"integer","default":1},"until":{"description":"End date of reccurrence (UTC format 'YYYYMMDDTHHMMSSZ')","type":"string","pattern":"^\\d{8}T\\d{6}Z$"},"count":{"description":"Total number of occurrences before the recurrence stops","type":"integer"},"bysetpos":{"description":"Specific occurrence position (e.g., the 3rd instance of a specific day)","type":"array","items":{"type":"integer"}}}}}}}