feat: Implement routines feature with CRUD operations and child assignment
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m0s
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.
This commit is contained in:
15
backend/events/types/child_routine_confirmation.py
Normal file
15
backend/events/types/child_routine_confirmation.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class ChildRoutineConfirmation(Payload):
|
||||
OPERATION_PENDING = "PENDING"
|
||||
OPERATION_APPROVED = "APPROVED"
|
||||
OPERATION_REJECTED = "REJECTED"
|
||||
OPERATION_RESET = "RESET"
|
||||
|
||||
def __init__(self, child_id: str, routine_id: str, operation: str):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'routine_id': routine_id,
|
||||
'operation': operation
|
||||
})
|
||||
9
backend/events/types/child_routines_set.py
Normal file
9
backend/events/types/child_routines_set.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class ChildRoutinesSet(Payload):
|
||||
def __init__(self, child_id: str, routine_ids: list[str]):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'routine_ids': routine_ids
|
||||
})
|
||||
@@ -28,4 +28,10 @@ class EventType(Enum):
|
||||
CHORE_TIME_EXTENDED = "chore_time_extended"
|
||||
CHILD_CHORE_CONFIRMATION = "child_chore_confirmation"
|
||||
|
||||
ROUTINE_MODIFIED = "routine_modified"
|
||||
CHILD_ROUTINES_SET = "child_routines_set"
|
||||
ROUTINE_SCHEDULE_MODIFIED = "routine_schedule_modified"
|
||||
ROUTINE_TIME_EXTENDED = "routine_time_extended"
|
||||
CHILD_ROUTINE_CONFIRMATION = "child_routine_confirmation"
|
||||
|
||||
FORCE_LOGOUT = "force_logout"
|
||||
|
||||
13
backend/events/types/routine_modified.py
Normal file
13
backend/events/types/routine_modified.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class RoutineModified(Payload):
|
||||
OPERATION_ADD = "ADD"
|
||||
OPERATION_EDIT = "EDIT"
|
||||
OPERATION_DELETE = "DELETE"
|
||||
|
||||
def __init__(self, routine_id: str, operation: str):
|
||||
super().__init__({
|
||||
'routine_id': routine_id,
|
||||
'operation': operation
|
||||
})
|
||||
13
backend/events/types/routine_schedule_modified.py
Normal file
13
backend/events/types/routine_schedule_modified.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class RoutineScheduleModified(Payload):
|
||||
OPERATION_SET = 'SET'
|
||||
OPERATION_DELETED = 'DELETED'
|
||||
|
||||
def __init__(self, child_id: str, routine_id: str, operation: str):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'routine_id': routine_id,
|
||||
'operation': operation,
|
||||
})
|
||||
9
backend/events/types/routine_time_extended.py
Normal file
9
backend/events/types/routine_time_extended.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from events.types.payload import Payload
|
||||
|
||||
|
||||
class RoutineTimeExtended(Payload):
|
||||
def __init__(self, child_id: str, routine_id: str):
|
||||
super().__init__({
|
||||
'child_id': child_id,
|
||||
'routine_id': routine_id,
|
||||
})
|
||||
Reference in New Issue
Block a user