Proxy Activity Service
Component Detail
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.
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
Dependents (2)
Components that depend on this component
Related Data Entities (4)
Data entities managed by this component