All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m45s
- Implemented TimeSelector component for selecting time with AM/PM toggle and minute/hour increment/decrement functionality. - Created ScheduleModal component for scheduling chores with options for specific days or intervals. - Added utility functions for scheduling logic in scheduleUtils.ts. - Developed comprehensive tests for TimeSelector and scheduleUtils functions to ensure correct behavior.
30 lines
771 B
Python
30 lines
771 B
Python
from dataclasses import dataclass
|
|
from models.base import BaseModel
|
|
|
|
|
|
@dataclass
|
|
class TaskExtension(BaseModel):
|
|
child_id: str
|
|
task_id: str
|
|
date: str # ISO date string supplied by client, e.g. '2026-02-22'
|
|
|
|
@classmethod
|
|
def from_dict(cls, d: dict) -> 'TaskExtension':
|
|
return cls(
|
|
child_id=d.get('child_id'),
|
|
task_id=d.get('task_id'),
|
|
date=d.get('date'),
|
|
id=d.get('id'),
|
|
created_at=d.get('created_at'),
|
|
updated_at=d.get('updated_at'),
|
|
)
|
|
|
|
def to_dict(self) -> dict:
|
|
base = super().to_dict()
|
|
base.update({
|
|
'child_id': self.child_id,
|
|
'task_id': self.task_id,
|
|
'date': self.date,
|
|
})
|
|
return base
|