Data Layer medium complexity backendmobile
0
Dependencies
3
Dependents
4
Entities
0
Integrations

Description

Data access layer responsible for all CRUD operations on user-to-association membership records, backed by the user_organization_roles table. Provides local caching of membership lists for offline use and exposes query methods used by the Membership Service and Context Management Service.

Feature: Member Multi-Association Membership

association-membership-repository

Responsibilities

  • Query all associations and roles for a given user from user_organization_roles
  • Cache membership list locally for offline and performance optimization
  • Insert, update, and delete membership records
  • Resolve organization and local association details for each membership

Interfaces

findMembershipsByUserId(userId: String): Future<List<UserOrganizationRole>>
findMembershipByUserAndOrg(userId: String, associationId: String): Future<UserOrganizationRole?>
insertMembership(membership: UserOrganizationRole): Future<void>
deleteMembership(userId: String, associationId: String): Future<void>
countMemberships(userId: String): Future<int>
getMembershipWithDetails(userId: String): Future<List<AssociationMembershipDetail>>
invalidateCache(userId: String): void
syncFromRemote(userId: String): Future<void>