All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m0s
- Add backend routines management with add, get, update, delete, and list functionalities. - Create models for Routine, RoutineItem, RoutineSchedule, and RoutineExtension. - Develop event types for routine confirmation and modification. - Implement frontend components for routine assignment, confirmation dialog, and routine management views. - Add unit tests for routine API and integration tests for routine CRUD flow. - Create end-to-end test plan for routines feature covering parent and child interactions.
33 lines
800 B
Python
33 lines
800 B
Python
from dataclasses import dataclass
|
|
from models.base import BaseModel
|
|
|
|
|
|
@dataclass
|
|
class RoutineItem(BaseModel):
|
|
routine_id: str
|
|
name: str
|
|
image_id: str | None = None
|
|
order: int = 0
|
|
|
|
@classmethod
|
|
def from_dict(cls, d: dict):
|
|
return cls(
|
|
routine_id=d.get('routine_id'),
|
|
name=d.get('name'),
|
|
image_id=d.get('image_id'),
|
|
order=d.get('order', 0),
|
|
id=d.get('id'),
|
|
created_at=d.get('created_at'),
|
|
updated_at=d.get('updated_at')
|
|
)
|
|
|
|
def to_dict(self):
|
|
base = super().to_dict()
|
|
base.update({
|
|
'routine_id': self.routine_id,
|
|
'name': self.name,
|
|
'image_id': self.image_id,
|
|
'order': self.order
|
|
})
|
|
return base
|