1"""Data models for natural language scheduler.

2

3 This module provides data models for reminders, scheduling context,

4 and reminder types/statuses used throughout the scheduler system.

5"""

6

7 from __future__ import annotations

8

9 from dataclasses import dataclass, field

10 from datetime import datetime

11 from enum import Enum

12 from typing import Any

13

14

15 class ReminderType(Enum):

16 """Type of reminder."""

17

18 TASK = "task"

19 DEADLINE = "deadline"

20 RECURRING = "recurring"

21 SESSION_RELATIVE = "session_relative"

22

23

24 class ReminderStatus(Enum):

25 """Status of a reminder."""

26

27 PENDING = "pending"

28 EXECUTED = "executed"

29 CANCELLED = "cancelled"

30 FAILED = "failed"

31 EXPIRED = "expired"

32

33

34@dataclass

35 class NaturalReminder:

36 """Represents a reminder created from natural language."""

37

38 reminder_id: str

39 reminder_type: ReminderType

40 expression: str

41 scheduled_time: datetime

42 action: str

43 status: ReminderStatus = ReminderStatus.PENDING

44 created_at: datetime = field(default_factory=datetime.now)

45 executed_at: datetime | None = None

46 failure_reason: str | None = None

47 recurrence_pattern: str | None = None

48 metadata: dict[str, Any] = field(default_factory=dict)

49

50

51@dataclass

52 class SchedulingContext:

53 """Context for scheduling operations."""

54

55 session_start: datetime | None = None

56 session_end: datetime | None = None

57 current_task: str | None = None

58 project: str | None = None

59 metadata: dict[str, Any] = field(default_factory=dict)