The admin plane gains quest-definition routes on the existing admin
router, mirroring the children routes' thin-adapter pattern: the body
model carries the shape, the handler builds ONE ScheduleRule from the
request's rule object through the recurrence model's own from_dict
(rule validation stays the model's construction-time job), and every
call goes to ONE nestquest_core.quest_definitions business function —
the title/window/assignee policies, the whole-set window replacement
and the never-hard-delete policy all live in the core, never in a
handler.
- POST /quest-definitions: title + rule + assignees + windows (+
optional description/icon), persisted atomically by the core.
- PATCH /quest-definitions/{id}: only supplied fields are forwarded
(exclude_unset); an explicit null description/icon clears it, a null
rule/windows is rejected; assignment stays unsettable here.
- PATCH /quest-definitions/{id}/active: the only removal path — the
flag flips, the row, rule, assignees and windows survive.
Error mapping stays deliberately narrow: the core's definition_id:-
prefixed not-exist error is 404; every other ValueError (including
RuleValidationError) is 422 with the core's message, so a rejected
rule, window, assignee or title from the BODY never disguises itself
as a missing resource and an unexpected error is never swallowed as a
4xx.
Task: b586a2f1-1532-4194-a19a-8f8386d22590 (Feature 16).
HA event triggers expose the payload as trigger.event.data, not
trigger.payload; fix the blueprint, its tests, and the README
examples, with a regression guard.
README gains the blueprint section: all four blueprints, their
inputs, the wiring table to the options-flow notification settings,
the celebration helper setup, event/sensor payload reference, and a
copy-pasteable example package. Tests assert every event trigger
references a real NestQuest event and no reminder is produced for an
absent child.
Child ids sharing a prefix no longer suppress each other (split and
compare entries for equality), and queued mode keeps a second child's
day-complete event from being dropped while the first notify runs.
Triggers on nestquest_child_day_complete (never a zero-quest day),
notifies with the payload's child name, and dedupes per child per
day via an input_text helper holding <child_id>:<today> entries
pruned to today — a re-cleared day does not re-fire, but a second
child clearing the same day still celebrates.
A missing or non-numeric remaining sensor reads as -1 in the
all-clear guard, so a degraded day reaches the parent instead of
looking like a clear day.
Defaults to 20:00 local — deliberately before the midnight missed
sweep, reading the same day's data. Every present child gets a
completion line; owed lines name still-open quests; absent children
are omitted; nothing sends when all clear unless opted in.
The modern HA action schema passes title and message to the notify
service only under data; fix the morning summary and afternoon
reminder blueprints and the test accessors accordingly.
Lists only present children who still owe quests; sends nothing at
all when every present child is clear (a false template condition
stops the action). Blueprint test helpers move to a shared module.