emargement-decisions

Implements attendance tracking and year-end student decisions for a Laravel school management API.

Updated May 5, 2025
One-click install
npx skills add https://github.com/sebauvray/toollab-api --skill emargement-decisions-sebauvray
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: emargement-decisions
Source: https://github.com/sebauvray/toollab-api/tree/main/.claude/skills/emargement-decisions
Command: npx skills add https://github.com/sebauvray/toollab-api --skill emargement-decisions-sebauvray

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Modifying attendance tracking or year-end decision features in this school management system risks breaking critical business rules, such as the full-state payload semantics where omitted records are deleted, or the three locks protecting decision entry. ## Core Features & Use Cases - Attendance Matrix: Documents the attendances table schema, the editable teacher matrix UI with autosave per session, and the critical rule that POST payloads describe the complete state so missing students are deleted. - Year-End Decisions: Covers the student_year_outcomes table, the three input locks (main teacher only, open year, outcomes_open toggle), and the continuous cursus rule rejecting passage/redoublement decisions. - Admin Read-Only Views: Specifies the admin suivi and outcomes overview endpoints plus validated UI design rules, such as displaying notes inline rather than behind hover popovers. - Use Case: When asked to add a new attendance status or change how decisions are saved, consult this Skill to preserve the full-state semantics, server-side name sorting, and N+1-free eager loading. ## Quick Start Use the emargement-decisions skill to review my changes to the teacher attendance endpoint before I modify the save logic.

Frequently Asked Questions about emargement-decisions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I modify the attendance save endpoint without breaking deletion?▼

Keep the full-state semantics: the payload describes the complete session state, and any student not included is deleted via whereNotIn with a [0] fallback. Never change the validation to required|min:1 or replace the delete with a simple upsert.

How do year-end student decisions work in a Laravel school API?▼

Decisions are stored in student_year_outcomes scoped by school_year_id and classroom_id, with one row per student per class. Only the main teacher can submit them, and only when the year is open and the outcomes_open toggle is enabled.

Why are passage and redoublement decisions rejected with a 422 error?▼

When the classroom cursus has progression set to continu, passage and redoublement outcomes are refused with a 422 response. The frontend hides these two columns and displays an explanatory banner instead.

Why does the attendance endpoint delete records when I send an empty array?▼

An empty records array is legal and means every attendance entry for that session should be removed. The controller deletes all rows whose student_id is not in the kept list, which is how clearing a cell works.

How is the main teacher of a classroom determined?▼

The classrooms.main_teacher_id column is set by syncMainTeacher after diffing schedules, preferring the requested id, then the current one, then the first schedule teacher. The effectiveMainTeacherId fallback uses the first class_schedules teacher_id by id.