Refactor MonitoringSetupPageComponent and MonitoringSetupService
Refactor
Related software requirement: ---
Related Epic ClickUp ID: ---
Affected app variants: HCP
Summary
Expand MonitoringSetupService
so it contains all the business logic necessary to set up a Monitoring on the HCP side and reduce MonitoringSetupPageComponent
to presentational logic and action handling. Idealy the service should inject all other services needed to set up monitoring and establish an interface to handle the setup from within the component without having additional logic there except presentation and handling of user events. This issue aims at decoupling the business logic from the component and allow changes later on without breaking the component.
Background
At the moment MonitoringSetupPageComponent
contains a mixture of presentational logic (like editName
and templateSelected
), event and user interaction handling, the business logic for setting up the monitoring, while MonitoringSetupService
does little more than holding data and initializing question lists. We'd like to keep the current functionality, but separate concerns between service and component, with the service handling the business logic and storing the data, while the component handles events and presentation. We also proposed some changes to the data model that necessitate reworking parts of the monitoring setup to better deal with questions being associated with categories, and would like these changes (and other possible changes in the future) to be contained to MonitoringSetupService
without changes in components - or at least only some small changes if not possible. The refactoring therefore should establish an interface for MonitoringSetupService
that is able to handle creating and changing a monitoring and can be treated as a black box by the services consuming it.
Acceptance Criteria
-
Monitoring should still work as it does now -
Service allows for creation and sharing of a Monitoring -
Service allows for adding, removing and editing of questions within categories -
Service allows for editing of reminder and base schedule -
Service allows for retrieval of Question collections filtered by category -
Service allows for the selection of a template -
Service can be reset -
Component does only handle events, actions and presentation logic (incl. exposing properties of the service to the template)