mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
chore(mood): account for MoodContext in the four whole-schema guards
- the wipe plan names it before its parent, so the confirmation screen's count is the number of rows that existed rather than zero - the backup plan classifies it as carried and two-ended, and the round-trip registry seeds one, which is what makes that claim provable - the sharing surface admits the linked-day read with the reason it may answer - CHANGELOG for the release
This commit is contained in:
1 parent
8f263e4767
commit
7b1a44e799
6 files changed
+56
-7
No files matched your search
@@ -887,6 +887,10 @@ const DELEGABLE_ROUTES: Record<string, DelegableEntry> = {
|
||||
domain: "mind",
|
||||
why: "The record's mood entries. The nested include is the tag vocabulary — a key and a kind, no identifiers. Note that `GET /api/mood/tags` is refused and stays refused: it pulls the owner's tag LAYOUT, which is a presentation preference and belongs to the person, not the record.",
|
||||
},
|
||||
"app/api/mood/linked-context/route.ts": {
|
||||
domain: "mind",
|
||||
why: "What the sleep, activity, vitals and illness modules already hold for one of the record's days, read-only and resolved per request. Every figure it returns is a figure a delegate can already read on the record's own surfaces; nothing here is a preference of the person, and nothing is written.",
|
||||
},
|
||||
"app/api/mood-entries/[id]/route.ts": {
|
||||
domain: "mind",
|
||||
why: "One mood entry of the record, fetch-then-guard against the resolved user.",
|
||||
@@ -1808,8 +1812,9 @@ const ACTOR_ROUTES: Record<string, string> = {
|
||||
* managed-record configuration adds one more: 196 → 197. The bounded
|
||||
* read-only profile summary makes the next explicit admission: 197 → 198.
|
||||
* The two initial Cycle reads follow as separate, scoped admissions: 198 → 200.
|
||||
* The mood day's linked figures, read-only, add one: 200 → 201.
|
||||
*/
|
||||
const FROZEN_ENTRY_COUNT = 200;
|
||||
const FROZEN_ENTRY_COUNT = 201;
|
||||
|
||||
/**
|
||||
* The two surfaces that authenticate a Bearer token outside `requireAuth` —
|
||||
|
||||
@@ -447,12 +447,7 @@ async function postBulk(request: NextRequest): Promise<Response> {
|
||||
// client was already being told.
|
||||
// v1.38 — the day context, inside the same transaction as the row, so
|
||||
// an entry reported as skipped really did write nothing.
|
||||
await persistMoodContext(
|
||||
tx,
|
||||
upserted.id,
|
||||
user.id,
|
||||
parsedContext.data,
|
||||
);
|
||||
await persistMoodContext(tx, upserted.id, user.id, parsedContext.data);
|
||||
|
||||
if (
|
||||
(entry.tagKeys && entry.tagKeys.length > 0) ||
|
||||
|
||||
@@ -71,6 +71,10 @@ export const WIPE_MODELS = [
|
||||
"MedicationComplianceRollup",
|
||||
|
||||
// ── Mood ────────────────────────────────────────────────────────────────
|
||||
// The day context, before the entry it hangs off: it cascades either way,
|
||||
// but a parent deleted first leaves the child's own count reporting zero for
|
||||
// rows that existed, and the confirmation screen quotes those counts.
|
||||
"MoodContext",
|
||||
"MoodEntry",
|
||||
"MoodEntryRollup",
|
||||
"MoodReminderDispatch",
|
||||
|
||||
@@ -80,6 +80,7 @@ export const BACKED_UP_MODELS = [
|
||||
|
||||
// ── Mood ──────────────────────────────────────────────────────────────────
|
||||
"MoodEntry",
|
||||
"MoodContext",
|
||||
"MoodEntryTagLink",
|
||||
"MoodTag",
|
||||
"MoodTagCategory",
|
||||
@@ -212,6 +213,7 @@ export const TWO_ENDED_MODELS = [
|
||||
"MedicationIntakeEvent",
|
||||
"MedicationSideEffect",
|
||||
"MoodEntry",
|
||||
"MoodContext",
|
||||
"MoodEntryTagLink",
|
||||
"MoodTag",
|
||||
"LabResult",
|
||||
|
||||
Reference in new issue
Block a user