feat: add default_has_deadline to ChoreSchedule and update related components for deadline management
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Has been cancelled

This commit is contained in:
2026-02-27 10:42:43 -05:00
parent f5a752d873
commit 1777700cc8
8 changed files with 150 additions and 59 deletions

View File

@@ -60,6 +60,7 @@ def set_chore_schedule(child_id, task_id):
return jsonify({'error': 'day_configs must be a list', 'code': ErrorCodes.INVALID_VALUE}), 400
default_hour = data.get('default_hour', 8)
default_minute = data.get('default_minute', 0)
default_has_deadline = data.get('default_has_deadline', True)
schedule = ChoreSchedule(
child_id=child_id,
task_id=task_id,
@@ -67,6 +68,7 @@ def set_chore_schedule(child_id, task_id):
day_configs=day_configs,
default_hour=default_hour,
default_minute=default_minute,
default_has_deadline=default_has_deadline,
)
else:
interval_days = data.get('interval_days', 2)

View File

@@ -35,6 +35,7 @@ class ChoreSchedule(BaseModel):
day_configs: list = field(default_factory=list) # list of DayConfig dicts
default_hour: int = 8 # master deadline hour for 'days' mode
default_minute: int = 0 # master deadline minute for 'days' mode
default_has_deadline: bool = True # False = 'Anytime', no expiry for 'days' mode
# mode='interval' fields
interval_days: int = 2 # 17
@@ -52,6 +53,7 @@ class ChoreSchedule(BaseModel):
day_configs=d.get('day_configs', []),
default_hour=d.get('default_hour', 8),
default_minute=d.get('default_minute', 0),
default_has_deadline=d.get('default_has_deadline', True),
interval_days=d.get('interval_days', 2),
anchor_date=d.get('anchor_date', ''),
interval_has_deadline=d.get('interval_has_deadline', True),
@@ -71,6 +73,7 @@ class ChoreSchedule(BaseModel):
'day_configs': self.day_configs,
'default_hour': self.default_hour,
'default_minute': self.default_minute,
'default_has_deadline': self.default_has_deadline,
'interval_days': self.interval_days,
'anchor_date': self.anchor_date,
'interval_has_deadline': self.interval_has_deadline,