Service Layer high complexity mobilebackend
0
Dependencies
0
Dependents
5
Entities
0
Integrations

Description

Handles individual proxy submissions, enforcing role-based authorization at the service layer before inserting activity records with the peer mentor's user_id as the subject. Creates a delegation_grants record linking the acting coordinator to the submitted activity for full auditability, complementing Supabase RLS enforcement at the database layer.

Feature: Bulk Registration & Proxy Reporting

activity-delegation-service

Responsibilities

  • Verify acting user holds coordinator or admin role before allowing proxy insert
  • Submit activity record with target mentor's user_id as subject
  • Create delegation_grants record capturing coordinator identity and timestamp
  • Validate that target mentor is within coordinator's organizational scope

Interfaces

submitProxyRegistration(coordinatorId, mentorId, activityData)
checkDelegationAuthorization(coordinatorId, mentorId)
createDelegationGrant(coordinatorId, mentorId, activityId)
getDelegationHistory(coordinatorId)
getDelegationsForMentor(mentorId)