// PRD §7 任务清单（封闭，15 个）。D4 的 T8-T10 与 D1 的 T1-T3 逐字相同。

export interface TaskDef {
  id: string;
  day: number;
  title: string;      // 与 PRD §7 表逐字一致
  reward: number;     // 幸福奖励
  refusable: boolean;
}

export const TASKS: Record<string, TaskDef> = {
  T1:  { id: 'T1',  day: 1, title: '从圆圆处取蜂蜜面包送给大宝、咪咪、龟爷爷', reward: 15, refusable: false },
  T2:  { id: 'T2',  day: 1, title: '给广场花坛浇水 ×3', reward: 10, refusable: false },
  T3:  { id: 'T3',  day: 1, title: '与任意三位村民问好', reward: 10, refusable: false },
  T4:  { id: 'T4',  day: 2, title: '替大宝送信 ×3（收件人：圆圆、咪咪、芙医生）', reward: 15, refusable: false },
  T5:  { id: 'T5',  day: 2, title: '帮咪咪清点货架', reward: 10, refusable: false },
  T6:  { id: 'T6',  day: 3, title: '去花田采莓果 ×5', reward: 10, refusable: false },
  T7:  { id: 'T7',  day: 3, title: '湖畔野餐（走到野餐布触发过场）', reward: 15, refusable: false },
  // D4：与 T1–T3 逐字相同
  T8:  { id: 'T8',  day: 4, title: '从圆圆处取蜂蜜面包送给大宝、咪咪、龟爷爷', reward: 15, refusable: false },
  T9:  { id: 'T9',  day: 4, title: '给广场花坛浇水 ×3', reward: 10, refusable: false },
  T10: { id: 'T10', day: 4, title: '与任意三位村民问好', reward: 10, refusable: false },
  T11: { id: 'T11', day: 5, title: '帮圆圆揉面（可拒绝）', reward: 10, refusable: true },
  T12: { id: 'T12', day: 5, title: '擦拭公告板（可拒绝）', reward: 10, refusable: true },
  T13: { id: 'T13', day: 6, title: '在广场挂彩带 ×4', reward: 10, refusable: false },
  T14: { id: 'T14', day: 6, title: '保持微笑 60 秒（原地站立，镜头缓慢拉近，全村注视）', reward: 15, refusable: false },
  T15: { id: 'T15', day: 7, title: '参加第 413 届丰收庆典', reward: 0, refusable: false },
};

/** 每日任务列表 */
export const DAILY_TASKS: Record<number, string[]> = {
  1: ['T1', 'T2', 'T3'],
  2: ['T4', 'T5'],
  3: ['T6', 'T7'],
  4: ['T8', 'T9', 'T10'],
  5: ['T11', 'T12'],
  6: ['T13', 'T14'],
  7: ['T15'],
};

export function tasksOfDay(day: number): TaskDef[] {
  return (DAILY_TASKS[day] ?? []).map((id) => TASKS[id]);
}
