{
  "schemaVersion": "1.0",
  "id": "task-snooze",
  "title": "Hoãn lần này",
  "purpose": "Snooze một occurrence mà không đổi anchor/lịch lặp.",
  "roles": [
    "adult"
  ],
  "group": "chores-spaces",
  "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 occurrence",
        "componentIds": [
          "screen-header",
          "task-snooze-0",
          "task-snooze-1",
          "task-snooze-2",
          "screen-actions"
        ]
      },
      {
        "id": "actions",
        "order": 2,
        "type": "one primary + secondary controls"
      },
      {
        "id": "navigation",
        "order": 3,
        "type": "none"
      }
    ]
  },
  "components": [
    {
      "id": "screen-header",
      "type": "Header",
      "props": {
        "homeLabel": "Nhà Lá",
        "scopeGate": "A",
        "backTarget": "task-detail",
        "settingsTarget": "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": "task-snooze-0",
      "type": "DetailList",
      "props": {
        "items": [
          [
            "Việc",
            "Rửa bát sau bữa tối"
          ],
          [
            "Hạn hiện tại",
            "14/10/2026"
          ],
          [
            "Lặp",
            "Mỗi ngày · giữ nguyên"
          ]
        ]
      },
      "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": "Hoãn lần này · DetailList",
        "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": "task-snooze-1",
      "type": "Field",
      "props": {
        "name": "until_local_date",
        "label": "Hạn mới",
        "type": "date",
        "value": "2026-10-15",
        "required": true,
        "min": "2026-10-15",
        "max": null,
        "options": null,
        "hint": null,
        "pattern": null
      },
      "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": "Hạn mới",
        "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": "task-snooze-2",
      "type": "Notice",
      "props": {
        "text": "Chỉ hoãn kỳ đang mở. Không áp dụng cho việc đang chờ phụ huynh duyệt.",
        "tone": ""
      },
      "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": "Hoãn lần này · Notice",
        "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": "screen-actions",
      "type": "ActionGroup",
      "props": {
        "actions": [
          {
            "id": "snooze",
            "label": "Xác nhận hoãn cục bộ",
            "kind": "mutate",
            "target": "task-detail",
            "confirmationRequired": true
          },
          {
            "id": "link-settings",
            "label": "Cài đặt",
            "kind": "navigate",
            "target": "settings",
            "confirmationRequired": false
          }
        ],
        "primaryCount": 1
      },
      "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
      }
    }
  ],
  "fields": [
    {
      "id": "until_local_date",
      "label": "Hạn mới",
      "control": "date",
      "default": "2026-10-15",
      "options": null,
      "validation": {
        "required": true,
        "trim": false,
        "type": "date",
        "min": "2026-10-15",
        "max": null,
        "pattern": null,
        "serverAuthoritative": true,
        "errorMessage": "Kiểm tra hạn mới."
      },
      "binding": "until_local_date",
      "keyboard": "date",
      "accessibleErrorAssociation": "form error summary via role alert; native bind field-specific error ID"
    }
  ],
  "states": [
    {
      "id": "open",
      "when": "Occurrence open",
      "visibleUI": "Cho chọn hạn sau effective due",
      "availableActions": [
        "snooze",
        "link-settings"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    },
    {
      "id": "pending",
      "when": "awaiting_approval",
      "visibleUI": "Chặn snooze",
      "availableActions": [
        "link-settings"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    },
    {
      "id": "offline",
      "when": "Mất mạng",
      "visibleUI": "Online-only, giữ draft",
      "availableActions": [
        "link-settings"
      ],
      "mutationPolicy": "Actor, exact capability and current versions must still pass; this state never grants rights."
    }
  ],
  "actions": [
    {
      "id": "snooze",
      "label": "Xác nhận hoãn cục bộ",
      "kind": "mutate",
      "targetScreenId": "task-detail",
      "permission": "E or own A",
      "confirmationRequired": true,
      "contractRef": "POST /v1/households/{hid}/occurrences/{oid}/snooze",
      "localBehavior": "Only validated draft/local domain where supported; remote adapters never report success.",
      "idempotency": "Stable actor/household/command key and canonical body; changed payload is a new confirmed intent."
    },
    {
      "id": "link-settings",
      "label": "Cài đặt",
      "kind": "navigate",
      "targetScreenId": "settings",
      "permission": "A",
      "confirmationRequired": false,
      "contractRef": "local navigation"
    }
  ],
  "dataBindings": [
    {
      "source": "POST /v1/households/{hid}/occurrences/{oid}/snooze",
      "shape": {
        "occurrence_id": "opaque ID",
        "task_id": "opaque ID",
        "task_title": "string",
        "room_id": "same-home ID",
        "due_local_date": "YYYY-MM-DD",
        "due_timezone": "IANA",
        "snoozed_until_local_date": "date|null",
        "effort_snapshot": "1|2|3 immutable",
        "assigned_member_id": "opaque ID|null",
        "status": "open|awaiting_approval|needs_redo|completed|cancelled",
        "version": "integer",
        "latest_cycle_id": "opaque ID|null",
        "latest_completion_event_id": "opaque ID|null"
      },
      "sample": {
        "occurrence_id": "occ-dishes",
        "task_id": "dishes",
        "task_title": "Rửa bát sau bữa tối",
        "room_id": "kitchen",
        "due_local_date": "2026-10-14",
        "due_timezone": "Asia/Ho_Chi_Minh",
        "snoozed_until_local_date": null,
        "effort_snapshot": 2,
        "assigned_member_id": "an",
        "status": "open",
        "version": 1,
        "latest_cycle_id": null,
        "latest_completion_event_id": null
      },
      "sampleOnly": true,
      "actorConstraint": "exact actor allowlist",
      "envelope": "API refs use CommandEnvelope; local review context is not an API property."
    }
  ],
  "copy": {
    "heading": "Hoãn lần này",
    "primary": "Xác nhận hoãn cục bộ",
    "empty": null,
    "notices": [
      "Chỉ hoãn kỳ đang mở. Không áp dụng cho việc đang chờ phụ huynh duyệt."
    ],
    "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/task-snooze",
    "nativeRouteStatus": "proposed mapping, verify against implementing native navigator",
    "apiRefs": [
      "POST /v1/households/{hid}/occurrences/{oid}/snooze"
    ],
    "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.",
      "Accepted-day recurrence; occurrence due/effort snapshot bất biến; snooze không đổi anchor; pending không reassign; undo điều chỉnh ledger đúng một lần."
    ],
    "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": "A",
    "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."
    }
  }
}
