PrivacySetting
Purpose
Section titled “Purpose”A PrivacySetting records which Privacy Level applies to one specific type of a User’s data — their profile, match history, match details, or statistics — and, where that level is Privileged Access, which Groups are granted it. It is the technical mechanism behind the Privacy Levels principle already established conceptually: privacy is configured per data type, never per account as a whole.
Responsibilities
Section titled “Responsibilities”A PrivacySetting is responsible for:
- recording exactly one PrivacyLevel for exactly one DataType, for exactly one User;
- recording which Groups, if any, are granted Privileged Access when its level is PrivilegedAccess;
- being changeable only by the User it belongs to.
Not Responsible For
Section titled “Not Responsible For”A PrivacySetting is NOT responsible for:
- deciding whether a specific viewer can see a specific piece of data — that is an authorization check performed elsewhere, which reads PrivacySettings as input;
- Group membership itself — that belongs to Group;
- anything about the data it governs — a PrivacySetting has no knowledge of the Matches, statistics, or profile fields it applies to; it only names a DataType.
DataType
Section titled “DataType”A fixed set, for this model:
ProfileMatchHistoryMatchDetailsStatistics
This set is deliberately closed for now; extending it is a straightforward addition, not a structural change.
PrivacyLevel
Section titled “PrivacyLevel”Private— visible only to the owning User.PrivilegedAccess— visible to members of the PrivacySetting’s granted Groups, in addition to the owning User.Public— visible to anyone.
Invariants
Section titled “Invariants”- A User has at most one PrivacySetting per DataType.
- A DataType with no PrivacySetting is treated as
Privateby default — Stratastax does not need to create an explicit row for every DataType at registration. - Granted Groups are only meaningful when the PrivacyLevel is
PrivilegedAccess; a PrivacySetting atPrivateorPubliccarries no Groups. - Only the owning User can create, change, or remove their own PrivacySettings.
- A PrivacySetting may only reference Groups owned by that same User (see Group).
Lifecycle
Section titled “Lifecycle”A PrivacySetting is created or updated directly by its owning User — unilaterally, with no approval process, since it only governs the owner’s own data.
Evolution
Section titled “Evolution”A User may change the PrivacyLevel of a DataType, or add/remove Groups under PrivilegedAccess, at any time.
End State
Section titled “End State”A PrivacySetting is removed when its User is removed, or when its owner
resets that DataType back to the default (Private) by deleting the
explicit row.
Relationships
Section titled “Relationships”- PrivacySetting belongs to exactly one User;
- PrivacySetting references zero or more Groups (only when PrivilegedAccess).
Domain Events
Section titled “Domain Events”- PrivacyLevelChanged
This is a genuine domain event, unlike Game’s: something else in the system legitimately needs to react to it — for instance, previously visible data becoming hidden, or newly shared data becoming available to a Group’s members.
Aggregate Design
Section titled “Aggregate Design”PrivacySetting is a child entity within the User aggregate — consistent with UserIdentity. Its only consistency rule (“at most one setting per DataType”) is scoped entirely to a single User, so it needs no aggregate of its own.