feat: Refactor ScheduleModal to support interval scheduling with date input and deadline toggle
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 2m30s
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 2m30s
- Updated ChoreSchedule model to include anchor_date and interval_has_deadline. - Refactored interval scheduling logic in scheduleUtils to use anchor_date. - Introduced DateInputField component for selecting anchor dates in ScheduleModal. - Enhanced ScheduleModal to include a stepper for interval days and a toggle for deadline. - Updated tests for ScheduleModal and scheduleUtils to reflect new interval scheduling logic. - Added DateInputField tests to ensure proper functionality and prop handling.
This commit is contained in:
@@ -37,8 +37,9 @@ class ChoreSchedule(BaseModel):
|
||||
default_minute: int = 0 # master deadline minute for 'days' mode
|
||||
|
||||
# mode='interval' fields
|
||||
interval_days: int = 2 # 2–7
|
||||
anchor_weekday: int = 0 # 0=Sun–6=Sat
|
||||
interval_days: int = 2 # 1–7
|
||||
anchor_date: str = "" # ISO date string e.g. "2026-02-25"; "" = use today
|
||||
interval_has_deadline: bool = True # False = "Anytime" (no deadline)
|
||||
interval_hour: int = 0
|
||||
interval_minute: int = 0
|
||||
|
||||
@@ -52,7 +53,8 @@ class ChoreSchedule(BaseModel):
|
||||
default_hour=d.get('default_hour', 8),
|
||||
default_minute=d.get('default_minute', 0),
|
||||
interval_days=d.get('interval_days', 2),
|
||||
anchor_weekday=d.get('anchor_weekday', 0),
|
||||
anchor_date=d.get('anchor_date', ''),
|
||||
interval_has_deadline=d.get('interval_has_deadline', True),
|
||||
interval_hour=d.get('interval_hour', 0),
|
||||
interval_minute=d.get('interval_minute', 0),
|
||||
id=d.get('id'),
|
||||
@@ -70,7 +72,8 @@ class ChoreSchedule(BaseModel):
|
||||
'default_hour': self.default_hour,
|
||||
'default_minute': self.default_minute,
|
||||
'interval_days': self.interval_days,
|
||||
'anchor_weekday': self.anchor_weekday,
|
||||
'anchor_date': self.anchor_date,
|
||||
'interval_has_deadline': self.interval_has_deadline,
|
||||
'interval_hour': self.interval_hour,
|
||||
'interval_minute': self.interval_minute,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user