Implement family dataspace onboarding
This commit is contained in:
parent
af6d82038e
commit
531c2193a4
13 changed files with 1400 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ from user_engine.domain import (
|
|||
AuthorizationRequest,
|
||||
Catalog,
|
||||
ExternalIdentity,
|
||||
FamilyInvitation,
|
||||
Membership,
|
||||
OutboxEvent,
|
||||
ProfileScope,
|
||||
|
|
@ -44,6 +45,7 @@ class InMemoryUserEngineStore:
|
|||
applications: dict[str, Application] = field(default_factory=dict)
|
||||
bindings: dict[str, ApplicationBinding] = field(default_factory=dict)
|
||||
catalogs: dict[str, Catalog] = field(default_factory=dict)
|
||||
family_invitations: dict[str, FamilyInvitation] = field(default_factory=dict)
|
||||
profile_values: dict[
|
||||
tuple[str, str, ProfileScope, str | None], ProfileValue
|
||||
] = field(default_factory=dict)
|
||||
|
|
@ -82,6 +84,19 @@ class InMemoryUserEngineStore:
|
|||
def save_catalog(self, catalog: Catalog) -> None:
|
||||
self.catalogs[catalog.catalog_id] = catalog
|
||||
|
||||
def save_family_invitation(self, invitation: FamilyInvitation) -> None:
|
||||
self.family_invitations[invitation.invitation_id] = invitation
|
||||
|
||||
def family_invitation(self, invitation_id: str) -> FamilyInvitation | None:
|
||||
return self.family_invitations.get(invitation_id)
|
||||
|
||||
def family_invitations_for_user(self, user_id: str) -> tuple[FamilyInvitation, ...]:
|
||||
return tuple(
|
||||
invitation
|
||||
for invitation in self.family_invitations.values()
|
||||
if invitation.user_id == user_id
|
||||
)
|
||||
|
||||
def save_profile_value(self, value: ProfileValue) -> None:
|
||||
self.profile_values[
|
||||
(value.user_id, value.attribute_key, value.scope, value.scope_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue