Add TimeSelector and ScheduleModal components with tests
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m45s
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.
This commit is contained in:
25
backend/events/types/chore_schedule_modified.py
Normal file
25
backend/events/types/chore_schedule_modified.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class ChoreScheduleModified(Payload):
|
||||
OPERATION_SET = 'SET'
|
||||
OPERATION_DELETED = 'DELETED'
|
||||
|
||||
def __init__(self, child_id: str, task_id: str, operation: str):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'task_id': task_id,
|
||||
'operation': operation,
|
||||
})
|
||||
|
||||
@property
|
||||
def child_id(self) -> str:
|
||||
return self.get('child_id')
|
||||
|
||||
@property
|
||||
def task_id(self) -> str:
|
||||
return self.get('task_id')
|
||||
|
||||
@property
|
||||
def operation(self) -> str:
|
||||
return self.get('operation')
|
||||
17
backend/events/types/chore_time_extended.py
Normal file
17
backend/events/types/chore_time_extended.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class ChoreTimeExtended(Payload):
|
||||
def __init__(self, child_id: str, task_id: str):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'task_id': task_id,
|
||||
})
|
||||
|
||||
@property
|
||||
def child_id(self) -> str:
|
||||
return self.get('child_id')
|
||||
|
||||
@property
|
||||
def task_id(self) -> str:
|
||||
return self.get('task_id')
|
||||
@@ -23,3 +23,6 @@ class EventType(Enum):
|
||||
CHILD_OVERRIDE_DELETED = "child_override_deleted"
|
||||
|
||||
PROFILE_UPDATED = "profile_updated"
|
||||
|
||||
CHORE_SCHEDULE_MODIFIED = "chore_schedule_modified"
|
||||
CHORE_TIME_EXTENDED = "chore_time_extended"
|
||||
|
||||
Reference in New Issue
Block a user