Séances de mobilité : exercices génériques, étirements, échauffement par séance
Une ref inconnue devient un exercice générique au lieu de faire refuser la proposition ; 18 étirements ajoutés ; champ warmup par séance ; durées en minutes et en « sec » reconnues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f0f7a7bceb
commit
32b5831126
+3
-2
@@ -9,7 +9,7 @@
|
||||
|
||||
import { createEvent } from "./events.js";
|
||||
import { stableId } from "./ids.js";
|
||||
import { validateProgram } from "./program.js";
|
||||
import { normalizeProgram, validateProgram } from "./program.js";
|
||||
import { validateProfile } from "./profile.js";
|
||||
|
||||
/** Taille maximale acceptée une fois décompressé : protège d'une « bombe ». */
|
||||
@@ -52,7 +52,8 @@ export function createProposal(payload, source, { device, now = new Date() }) {
|
||||
if (wrapped && p.profile !== undefined) problems.push(...validateProfile(p.profile).map((x) => "profil : " + x));
|
||||
if (wrapped && p.reason !== undefined && typeof p.reason !== "string") problems.push("'reason' doit être un texte.");
|
||||
if (problems.length) throw new ProposalError("Proposition invalide :", problems);
|
||||
const data = { program, source, reason: wrapped && typeof p.reason === "string" ? p.reason : "" };
|
||||
// Une ref inconnue devient un exercice générique (normalizeProgram).
|
||||
const data = { program: normalizeProgram(program).program, source, reason: wrapped && typeof p.reason === "string" ? p.reason : "" };
|
||||
if (wrapped && p.profile !== undefined) Object.assign(data, { profile: p.profile });
|
||||
// `profile` est un champ facultatif de ProgramProposed (cadrage du 2026-11-18).
|
||||
return /** @type {any} */ (createEvent("ProgramProposed", /** @type {any} */ (data), {
|
||||
|
||||
Reference in New Issue
Block a user