{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://life-helper.local/schema/reward_declaration.schema.json", "title": "Reward Declaration (사전 선언 보상)", "description": "phase.started_at 후 7일 안에만 생성 가능 (R4). 사후 즉흥 결정 차단 — variable schedule 강박 방지.", "type": "object", "required": ["id", "phase_id", "habit_id", "tier", "milestone_rule", "reward_text", "declared_at"], "additionalProperties": false, "properties": { "id": { "type": "string" }, "phase_id": { "type": "string" }, "habit_id": { "type": "string" }, "tier": { "$ref": "enums.schema.json#/$defs/RewardTier" }, "milestone_rule": { "type": "string", "description": "체크 조건 (예: '7일 중 6일 done', '30일 중 24일 done', '3회 연속 done')" }, "milestone_machine_rule": { "type": "object", "additionalProperties": false, "description": "선택 — 기계 평가용. 예: { window_days: 30, min_done: 24 }", "properties": { "window_days": { "type": "integer", "minimum": 1 }, "min_done": { "type": "integer", "minimum": 1 }, "require_consecutive": { "type": "boolean" } } }, "reward_text": { "type": "string", "description": "사용자가 본인 언어로 작성 (SDT autonomy)" }, "reward_menu_item_id": { "type": ["string", "null"], "description": "카탈로그에서 선택했다면 참조" }, "estimated_cost_krw": { "type": "integer", "minimum": 0 }, "is_effort_tied": { "type": "boolean" }, "declared_at": { "$ref": "enums.schema.json#/$defs/DateTimeString" } } }