Service Layer high complexity backendmobile
0
Dependencies
0
Dependents
6
Entities
0
Integrations

Description

Core business logic service managing all aspects of a user's multi-organization memberships. Handles fetching all affiliated organizations, setting the active context, validating membership state, and persisting active context in the BLoC session state.

Feature: Multi-Organization Membership Handling

membership-service

Responsibilities

  • Fetch all active memberships for a given user
  • Set and persist the active organization context in BLoC
  • Validate that a user belongs to a given organization before context switch
  • Handle membership status transitions (active, paused, expired)
  • Provide org context to downstream services during activity registration

Interfaces

getUserMemberships(userId)
setActiveContext(userId, organizationId)
getActiveContext(userId)
validateMembership(userId, organizationId)
getMembershipStatus(userId, organizationId)
getAllAffiliatedOrgs(userId)
getPrimaryMembership(userId)
updatePrimaryMembership(userId, organizationId)