How Do I

Build a settings screen

Display effective preferences and expose only values the user can change.

Use the manager to list definitions and calculate effective preferences:

use NotificationCompass\ValueObjects\NotificationContext;

$preferences = $user->notificationPreferences();

$context = new NotificationContext('organization', $organizationId);
$values = $preferences->inspectPreferences($context);

For each definition and channel, use NotificationPreferenceInspection::enabled for the switch value, source to explain the decision, and isModifiable() or modifiable to decide whether the control is enabled. The entry also contains the complete definition, the channel, the mandatory flag, and the context policy mode when applicable. A mandatory or enforced result cannot be modified.

When a user submits a change, call enable, disable, or reset. Reset removes the explicit value and lets the resolver fall back to its next rule.