Service Layer medium complexity mobilebackend
1
Dependencies
2
Dependents
4
Entities
0
Integrations

Description

Business logic service for submitting proxy activity records. It calls the backend API with an explicit on_behalf_of user ID, validates that the coordinator has management rights over the target peer mentor via the role guard, and queues the payload in the mutation outbox when offline.

Feature: Coordinator Proxy Reporting

proxy-activity-service

Sources & reasoning

The proxy submission requires dedicated service logic to attach on_behalf_of and submitter_id, enforce coordinator org-scope permission, and preserve the target user ID in the offline outbox. This cannot reuse the standard Activity Service without polluting its interface.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Build and POST the proxy activity payload with on_behalf_of and submitter_id fields
  • Validate the coordinator's management rights over the target peer mentor before submission
  • Queue proxy submissions in the mutation outbox with the target user ID preserved for offline sync
  • Return typed errors distinguishing permission failures from network failures
  • Ensure the resulting activity record is owned by the peer mentor, not the coordinator

Interfaces

submitProxyActivity(draft: ActivityDraft, onBehalfOf: String, coordinatorId: String) → Result<Activity>
fetchManagedMentorRoster(coordinatorId: String) → List<PeerMentorSummary>
validateProxyPermission(coordinatorId: String, mentorId: String) → bool
queueOfflineProxySubmission(draft: ActivityDraft, onBehalfOf: String) → void

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component