{
  "schemaVersion": "1.0",
  "id": "child-today",
  "title": "Việc của con",
  "purpose": "Child nhìn own assignments, chưa có điểm cho pending.",
  "roles": [
    "child"
  ],
  "group": "members-children",
  "variantOf": null,
  "layout": {
    "canvas": {
      "width": 390,
      "height": 844
    },
    "responsive": {
      "minimumWidth": 360,
      "maximumWidth": 430,
      "scroll": "vertical",
      "safeAreaBottom": true,
      "fontScale": "native dynamic type; reflow without clipping",
      "keyboard": "composer sticky within resized viewport; dialog scrolls; no fixed keyboard overlay"
    },
    "regions": [
      {
        "id": "header",
        "order": 0,
        "type": "safe-area/header",
        "height": "intrinsic"
      },
      {
        "id": "content",
        "order": 1,
        "type": "purpose-specific child-today",
        "componentIds": [
          "screen-header",
          "child-today-0",
          "child-today-1",
          "child-today-2",
          "child-today-3",
          "child-today-4",
          "screen-actions",
          "primary-navigation"
        ]
      },
      {
        "id": "actions",
        "order": 2,
        "type": "one primary + secondary controls"
      },
      {
        "id": "navigation",
        "order": 3,
        "type": "child-two-tabs"
      }
    ]
  },
  "components": [
    {
      "id": "screen-header",
      "type": "Header",
      "props": {
        "homeLabel": "Bông",
        "scopeGate": "C own scope",
        "backTarget": "child-today",
        "settingsTarget": "child-settings"
      },
      "tokens": {
        "foreground": "{semantic.light.fg}",
        "darkForeground": "{semantic.dark.fg}"
      },
      "accessibility": {
        "label": "Thanh đầu màn hình",
        "readingOrder": 0,
        "focusOrder": "back then settings"
      }
    },
    {
      "id": "child-today-0",
      "type": "ChildGreeting",
      "props": {
        "contentText": "Chào Bông.  Làm từng việc nhỏ thôi nhé."
      },
      "tokens": {
        "background": "{semantic.light.surface}",
        "foreground": "{semantic.light.fg}",
        "darkBackground": "{semantic.dark.surface}",
        "darkForeground": "{semantic.dark.fg}",
        "bodySize": "{primitive.type.body}",
        "touchTarget": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Việc của con · ChildGreeting",
        "readingOrder": 1,
        "colorOnly": false,
        "fontScaling": true,
        "minimumTouchTarget": 48,
        "instructions": "Đọc theo thứ tự; công bố nhãn trạng thái và lỗi, không chỉ màu."
      }
    },
    {
      "id": "child-today-1",
      "type": "SectionHeading",
      "props": {
        "text": "Con có thể làm"
      },
      "tokens": {
        "background": "{semantic.light.surface}",
        "foreground": "{semantic.light.fg}",
        "darkBackground": "{semantic.dark.surface}",
        "darkForeground": "{semantic.dark.fg}",
        "bodySize": "{primitive.type.body}",
        "touchTarget": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Việc của con · SectionHeading",
        "readingOrder": 2,
        "colorOnly": false,
        "fontScaling": true,
        "minimumTouchTarget": 48,
        "instructions": "Đọc theo thứ tự; công bố nhãn trạng thái và lỗi, không chỉ màu."
      }
    },
    {
      "id": "child-today-2",
      "type": "TaskCard",
      "props": {
        "title": "Gấp chăn, xếp gối",
        "assignee": "Bông",
        "room": "Phòng khách",
        "statusLabel": "Chưa xong",
        "effort": 1,
        "occurrenceId": "occ-blanket",
        "sampleOnly": true,
        "ownCompletion": false
      },
      "tokens": {
        "background": "{semantic.light.surface}",
        "foreground": "{semantic.light.fg}",
        "darkBackground": "{semantic.dark.surface}",
        "darkForeground": "{semantic.dark.fg}",
        "bodySize": "{primitive.type.body}",
        "touchTarget": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Việc của con · TaskCard",
        "readingOrder": 3,
        "colorOnly": false,
        "fontScaling": true,
        "minimumTouchTarget": 48,
        "instructions": "Đọc theo thứ tự; công bố nhãn trạng thái và lỗi, không chỉ màu."
      }
    },
    {
      "id": "child-today-3",
      "type": "SectionHeading",
      "props": {
        "text": "Chờ phụ huynh xem"
      },
      "tokens": {
        "background": "{semantic.light.surface}",
        "foreground": "{semantic.light.fg}",
        "darkBackground": "{semantic.dark.surface}",
        "darkForeground": "{semantic.dark.fg}",
        "bodySize": "{primitive.type.body}",
        "touchTarget": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Việc của con · SectionHeading",
        "readingOrder": 4,
        "colorOnly": false,
        "fontScaling": true,
        "minimumTouchTarget": 48,
        "instructions": "Đọc theo thứ tự; công bố nhãn trạng thái và lỗi, không chỉ màu."
      }
    },
    {
      "id": "child-today-4",
      "type": "TaskCard",
      "props": {
        "title": "Tưới cây nhỏ",
        "assignee": "Bông",
        "room": "Phòng khách",
        "statusLabel": "Chờ duyệt · chưa có điểm",
        "effort": 1,
        "occurrenceId": "occ-plants",
        "sampleOnly": true,
        "ownCompletion": false
      },
      "tokens": {
        "background": "{semantic.light.surface}",
        "foreground": "{semantic.light.fg}",
        "darkBackground": "{semantic.dark.surface}",
        "darkForeground": "{semantic.dark.fg}",
        "bodySize": "{primitive.type.body}",
        "touchTarget": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Việc của con · TaskCard",
        "readingOrder": 5,
        "colorOnly": false,
        "fontScaling": true,
        "minimumTouchTarget": 48,
        "instructions": "Đọc theo thứ tự; công bố nhãn trạng thái và lỗi, không chỉ màu."
      }
    },
    {
      "id": "screen-actions",
      "type": "ActionGroup",
      "props": {
        "actions": [
          {
            "id": "navigate-0",
            "label": "Nhờ AI hướng dẫn việc của con",
            "kind": "navigate",
            "target": "ai-chat",
            "confirmationRequired": false
          },
          {
            "id": "link-child-today",
            "label": "Việc của con",
            "kind": "navigate",
            "target": "child-today",
            "confirmationRequired": false
          },
          {
            "id": "link-child-settings",
            "label": "Tùy chọn của con",
            "kind": "navigate",
            "target": "child-settings",
            "confirmationRequired": false
          },
          {
            "id": "link-child-task-detail",
            "label": "Gấp chăn, xếp gối",
            "kind": "navigate",
            "target": "child-task-detail",
            "confirmationRequired": false
          },
          {
            "id": "link-child-achievements",
            "label": "Thành tích của con",
            "kind": "navigate",
            "target": "child-achievements",
            "confirmationRequired": false
          }
        ],
        "primaryCount": 0
      },
      "tokens": {
        "lightBackground": "{component.light.button.background}",
        "lightForeground": "{component.light.button.foreground}",
        "darkBackground": "{component.dark.button.background}",
        "darkForeground": "{component.dark.button.foreground}",
        "height": "{primitive.space.48}"
      },
      "accessibility": {
        "label": "Hành động của màn hình",
        "keyboard": true,
        "focusVisible": true,
        "disabledOnlyLowContrast": true
      }
    },
    {
      "id": "primary-navigation",
      "type": "Navigation",
      "props": {
        "items": [
          [
            "child-today",
            "Việc của con",
            "check"
          ],
          [
            "child-achievements",
            "Thành tích",
            "history"
          ]
        ],
        "active": "child-today"
      },
      "tokens": {
        "activeBackground": "{semantic.light.sage}",
        "activeDarkBackground": "{semantic.dark.sage}",
        "foreground": "{semantic.light.fg}",
        "darkForeground": "{semantic.dark.fg}"
      },
      "accessibility": {
        "label": "Điều hướng chính",
        "ariaCurrent": "page",
        "touchTarget": 48,
        "noColorOnly": true
      }
    }
  ],
  "fields": [],
  "states": [
    {
      "id": "own",
      "when": "Active child device",
      "visibleUI": "Chỉ own occurrence/room instructions",
      "availableActions": [
        "navigate-0",
        "link-child-today",
        "link-child-settings",
        "link-child-task-detail",
        "link-child-achievements"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    },
    {
      "id": "pending",
      "when": "Submission awaiting_approval",
      "visibleUI": "Không cộng points",
      "availableActions": [
        "navigate-0",
        "link-child-today",
        "link-child-settings",
        "link-child-task-detail",
        "link-child-achievements"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    },
    {
      "id": "needs-redo",
      "when": "Rejected cycle",
      "visibleUI": "Lời nhắn G, cho submit lại",
      "availableActions": [
        "navigate-0",
        "link-child-today",
        "link-child-settings",
        "link-child-task-detail",
        "link-child-achievements"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    },
    {
      "id": "revoked",
      "when": "Access revoked",
      "visibleUI": "Hide scope and stop queue",
      "availableActions": [
        "navigate-0",
        "link-child-today",
        "link-child-settings",
        "link-child-task-detail",
        "link-child-achievements"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    }
  ],
  "actions": [
    {
      "id": "navigate-0",
      "label": "Nhờ AI hướng dẫn việc của con",
      "kind": "navigate",
      "targetScreenId": "ai-chat",
      "permission": "C own scope",
      "confirmationRequired": false,
      "contractRef": "local navigation",
      "localBehavior": "Only validated draft/local domain where supported; remote adapters never report success.",
      "idempotency": null
    },
    {
      "id": "link-child-today",
      "label": "Việc của con",
      "kind": "navigate",
      "targetScreenId": "child-today",
      "permission": "C own scope",
      "confirmationRequired": false,
      "contractRef": "local navigation"
    },
    {
      "id": "link-child-settings",
      "label": "Tùy chọn của con",
      "kind": "navigate",
      "targetScreenId": "child-settings",
      "permission": "C own scope",
      "confirmationRequired": false,
      "contractRef": "local navigation"
    },
    {
      "id": "link-child-task-detail",
      "label": "Gấp chăn, xếp gối",
      "kind": "navigate",
      "targetScreenId": "child-task-detail",
      "permission": "C own scope",
      "confirmationRequired": false,
      "contractRef": "local navigation"
    },
    {
      "id": "link-child-achievements",
      "label": "Thành tích của con",
      "kind": "navigate",
      "targetScreenId": "child-achievements",
      "permission": "C own scope",
      "confirmationRequired": false,
      "contractRef": "local navigation"
    }
  ],
  "dataBindings": [
    {
      "source": "GET /v1/households/{hid}/today",
      "shape": {
        "local_date": "date",
        "timezone": "IANA",
        "server_time": "UTC",
        "occurrences": "ChildOccurrenceDto[] (no assignee roster/eligibility/contact)",
        "net_points": "integer own ledger"
      },
      "sample": {
        "local_date": "2026-10-14",
        "timezone": "Asia/Ho_Chi_Minh",
        "server_time": "2026-10-14T05:00:00Z",
        "occurrences": [
          {
            "occurrence_id": "occ-blanket",
            "task_id": "blanket",
            "task_title": "Gấp chăn, xếp gối",
            "instructions": "Gấp chăn rồi xếp gối.",
            "room_id": "living",
            "room_name": "Phòng khách",
            "due_local_date": "2026-10-14",
            "due_timezone": "Asia/Ho_Chi_Minh",
            "snoozed_until_local_date": null,
            "effort_snapshot": 1,
            "status": "open",
            "version": 1,
            "latest_submission_event_id": null,
            "can_submit": true
          }
        ],
        "net_points": 0
      },
      "sampleOnly": true,
      "actorConstraint": "exact actor allowlist",
      "envelope": "API refs use CommandEnvelope; local review context is not an API property."
    }
  ],
  "copy": {
    "heading": "Việc của con",
    "primary": null,
    "empty": null,
    "notices": [],
    "locale": "vi",
    "demoLabel": "Bản thiết kế · dữ liệu mẫu · không kết nối dịch vụ"
  },
  "implementation": {
    "nativeRoute": "/design/child-today",
    "nativeRouteStatus": "proposed mapping, verify against implementing native navigator",
    "apiRefs": [
      "GET /v1/households/{hid}/today"
    ],
    "newContractRefs": [],
    "notes": [
      "Tất cả ví dụ là dữ liệu thiết kế, không bằng chứng native/API/store đã chạy.",
      "Native route dưới đây là đề xuất mapping cho agent, không tuyên bố route source đã tồn tại.",
      "Mọi mutation dùng envelope {data,version,household_revision,replayed}, stable Idempotency-Key và expected_version khi sửa.",
      "Child DTO allowlist: own assignments/history + relevant room instructions; không adult contacts, invites, billing hoặc household aggregates."
    ],
    "integrationStatus": "design complete; local static/draft interactions; native/API adapters pending",
    "sourceAuthority": [
      "docs/product-brief.md",
      "plans/261013-1409-sweepy-vietnam-mobile/mobile-flows.md",
      "plans/261013-1409-sweepy-vietnam-mobile/api-contracts.md",
      "packages/domain/src/contracts/phase2.ts",
      "packages/domain/src/index.ts",
      "packages/domain/src/contracts/phase3.ts",
      "packages/domain/src/contracts/billing.ts",
      "apps/mobile/src/lib/api.ts"
    ],
    "capability": "C own scope",
    "errors": {
      "401": "Stop queue; adult login or child re-pair without parent account.",
      "403": "Do not retry lost capability. FEATURE_REQUIRED never grants Pro.",
      "409": "Fetch canonical scoped state; review/reconfirm new intent, do not rewrite old replay payload.",
      "422": "Field error with retained draft.",
      "429": "Respect Retry-After.",
      "503": "Backoff only retryable commands with original key."
    }
  }
}
