Class LaravelUi5\Sdk\Partners\OrgPartnerResolver

final
readonly
implements ScopeResolverInterface

Resolves the organization partner(s) an actor (a Person partner) currently represents, by walking the SDK partner graph:

actor (person) → sdk_partner_relationships (relationship_type = employed_by, is_primary, valid_from ≤ $at ≤ valid_until) → related_id (organization partner)

Named to match its host counterpart App\Onboarding\OrgPartnerResolver in pragmatiqu.io. It is a member of the ScopeResolverInterface family, so it returns an int[] — the load-bearing shape the {@see \LaravelUi5\Sdk\Odata\PartnerScopeApplier} applies as whereIn(keyColumn, ids), and the shape {@see \LaravelUi5\Sdk\Platform\SdkContext} hydrates into Partners. The single-?Partner view callers usually want lives on {@see \LaravelUi5\Sdk\Platform\SdkContext::primaryOrgPartner()}, not here — keeping the resolver inside the fail-closed int[] family.

One primary employer is the B2B invariant. Current data is 1:1 (one active primary employed_by per person). The hard guard that forbids a second is_primary=true row belongs in the editing UI (ui5-partners). This resolver employs the read-side soft guard: if it ever sees more than one active primary org, it logs a warning and still returns all of them, so scoping stays safe (the actor sees the union of their orgs' rows) while the anomaly is surfaced for cleanup.

Empty result means the actor has no active primary employment as of $at, which fails closed at the applier (no rows visible).

Default backing for #[ScopedToOrgActors]. Hosts with atypical employment semantics rebind this class in their service provider.

Methods