Data Layer low complexity backend
0
Dependencies
1
Dependents
1
Entities
0
Integrations

Description

Manages persistent recurring activity templates used by coordinators for bulk registration. Templates store default activity type, duration, and description so coordinators avoid re-entering the same data for weekly recurring sessions.

Feature: Coordinator Proxy Registration for Contacts

recurring-template-repository

Summaries

The Recurring Activity Template Repository eliminates repetitive data entry for coordinators who run weekly or regular mentoring sessions. Instead of re-entering activity type, duration, and description every week, coordinators save a template once and reuse it indefinitely. This directly reduces administrative overhead, lowers the risk of data entry errors in official activity records, and improves coordinator satisfaction — making the platform more competitive against generic alternatives that require manual re-entry every session.

Low-complexity backend component with straightforward CRUD interfaces and no external dependencies, making it a low-risk deliverable suitable for early sprints. The primary coordination requirement is aligning the template data model with the bulk registration UI team so that pre-fill behaviour matches coordinator expectations. Scoping is clean: templates are organisation-scoped via getTemplatesByOrganization, so multi-tenancy is handled at the data layer. Testing should cover template hydration edge cases (deleted templates, updated templates mid-bulk-registration) to avoid silent failures in the bulk submission flow.

Backend data repository backed by Supabase. Templates store default activity_type, duration, and description fields and are scoped to an organisation via organizationId foreign key. getTemplatesByCoordinator and getTemplatesByOrganization are the primary read paths — index both coordinator_id and organization_id columns. getTemplateById is the hydration entry point called by the bulk registration service when pre-filling a form.

Implement soft-delete or versioning if templates can be updated while an active bulk session references them, to prevent mid-session data inconsistency. No cross-component dependencies simplify unit testing.

Responsibilities

  • CRUD operations for recurring activity templates
  • Fetch templates scoped to a coordinator's organization
  • Provide template hydration for bulk registration pre-fill

Interfaces

createTemplate(RecurringTemplate template)
getTemplatesByCoordinator(String coordinatorId)
getTemplatesByOrganization(String organizationId)
updateTemplate(String id, RecurringTemplate update)
deleteTemplate(String id)
getTemplateById(String id)

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/recurring-templates 7 endpoints
GET /api/v1/recurring-templates List recurring templates
GET /api/v1/recurring-templates/:id Get recurring template by ID
POST /api/v1/recurring-templates Create a new recurring activity template
PUT /api/v1/recurring-templates/:id Update a recurring template
DELETE /api/v1/recurring-templates/:id Delete a recurring template
GET /api/v1/recurring-templates/by-coordinator/:coordinator_id Get all templates for a specific coordinator
+1 more