Skip to main content

Tenant Service — Sync Contract

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 16 Offline/Sync

1. Per-aggregate conflict policy

AggregateConflict policyRationale
Tenantserver_authoritativeLifecycle transitions are platform-admin operations; no client-side mutations.
TenantConfigurationserver_authoritativeConfig is set by admins; no offline client mutation.
HierarchyNodeserver_authoritativeOrg structure is admin-governed; changes are infrequent and must be centrally coordinated.
UserProfileserver_authoritativeProfile updates are admin-initiated; clinical users do not edit their own profile offline.
OrgMembershipserver_authoritativeMembership assignment is an administrative act.
RoleAssignmentserver_authoritativeRole changes are privileged operations.
AccessPolicyserver_authoritativePolicy definitions are platform-admin governed.

2. Offline client access

tenant-service data is not directly synced to offline clients. Downstream services (patient-chart, document) hold their own cached copies of the data they need (e.g., the user's effective permissions at a node). The authorization evaluate() endpoint requires connectivity.

The identity-service GET /api/v1/me/access-context result is the cacheable summary that offline clients may store locally for UI gating purposes. It does not authorize write operations while offline.

3. Event-driven propagation

All authoritative mutations emit domain events via the transactional outbox. Downstream consumers maintain their own projections. Stale projections are acceptable within NATS JetStream delivery guarantees (at-least-once, ordered per subject).