Skip to content

Analytics Service APIs - Refence implementation for Trigger Service #507

@NGrech

Description

@NGrech

Goal:
Create a minimal, testable reference implementation of the TriggerService to support core CRUD operations and simulate basic trigger behaviour (manual and cron-based). This service is primarily intended for integration and unit testing — not for production use

Tasks

  • Define basic schema and table for storing triggers (fields: UUID, studyId, workflowId, triggerType, config, active).
  • Implement a TriggerRepository interface
  • Implement SQLightTrigger repo
  • Implement a lightweight DBBackedTriggerService supporting:
    • createTrigger
    • getTrigger
    • updateTrigger
    • deleteTrigger
    • listTriggers
    • startTrigger / endTrigger (update lifecycle state only).
  • Add minimal logic to simulate trigger activation (e.g., basic cron matcher or flag to manually invoke).
  • Add unit tests to verify all methods behave as expected.

Acceptance Criteria

  • All methods defined in the TriggerService interface are implemented and tested.
  • The reference implementation supports both manual and cron-style triggers (basic simulation only).
  • Lifecycle methods (start, end) update the trigger state.
  • Example usage and JSON schema entries included for documentation/testing.

Metadata

Metadata

Assignees

Labels

featureNew functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions