↑↓ to navigate Enter to open "…" all these words ANDOR to combine

Onboarding guide

17. ADC Conference - Domain Model & Module Contracts

What this chapter covers. This is the heart of the Atlanta Developers Conference application, the Conference bounded context, the largest and richest domain in MMCA.ADC. It models everything an organizer curates and an attendee browses: the Event (the conference itself, with its rooms, speaker roster, and venue details), the Session (a talk on the schedule), the Speaker, the Sponsor (the sold sponsorship and expo-booth record), the Partner (the community organization or venue host that supports the event without buying a package), the Activity (the party, coffee connect, or closing ceremony that is deliberately not a session), the Category/CategoryItem taxonomy (tracks, levels, session formats), the Question/answer machinery that captures structured metadata about events, sessions, and speakers, and the SessionAsset (the deck, handout, or external link published against a talk). Ten aggregate roots (one of them an AI scorecard), nine child entities, the static invariant classes that guard their business rules, the eighteen domain events every mutation raises, a pure domain service that coordinates the cross-aggregate cascade delete, and, in the module's MMCA.ADC.Conference.Shared project, the DTO contracts, the cross-module service interfaces the Engagement and Identity modules call, the integration events that keep the User-to-Speaker link and the engagement points ledger consistent across services, and the decision-support read models that power the organizer's session-selection dashboard. The detailed per-type sections follow; this overview shows how the pieces fit and how a single change flows through them.

This chapter is almost entirely an instantiation of the framework taught in groups 1 through 14, applied to a real, non-trivial domain. If a pattern here looks unfamiliar, it was introduced upstream and is only cross-referenced now: the Result pattern (G01), the AuditableAggregateRootEntity<TIdentifierType> entity hierarchy, the IdValueGeneratedAttribute marker, the IAuditedEntity change-history opt-in, the IReactivatable restore marker, and DomainEntityState (G02), the BaseDomainEvent / EntityChangedEvent<TIdentifierType> event bases and the outbox spine (G04), the INavigationPopulator<in TEntity> cross-container eager-loading extension point (G11), and the IModule composition system (G14). The lens this chapter most strongly embodies is [Rubric §4, Domain-Driven Design] (does the model mirror the business: aggregates, value objects, invariants, ubiquitous language?): this is the codebase's most complete DDD specimen, and it is worth reading slowly, because the same shapes repeat across every aggregate.

Two packages, one bounded context

The Conference context spans two of the module's projects, and the split is deliberate Clean Architecture ([Rubric §3, Clean Architecture]). MMCA.ADC.Conference.Domain holds the behavior-rich aggregates, their invariants, their domain events, and the domain service: the ring that knows nothing about EF Core, ASP.NET, or serialization. MMCA.ADC.Conference.Shared holds the contracts that cross boundaries: the DTOs returned by the API, the cross-module validation interfaces the Engagement module consumes (ISessionBookmarkValidationService and IEventLiveValidationService), the data-subject export interface the Identity module consumes (IUserConferenceExportService), the SpeakerLinkedToUser/SpeakerUnlinkedFromUser and SessionFeedbackSubmitted/EventFeedbackSubmitted integration events other modules subscribe to, and the feature-flag, permission, and status constants.

Read the reference direction carefully, because it is the opposite of what the names suggest: Shared is the module's bottom layer and Domain references it, not the other way round (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/MMCA.ADC.Conference.Domain.csproj:8-12). The project file records why: the Event aggregate exposes the QuestionModerationDefault enum, and that enum lives in Shared so the DTOs, the Blazor UI, and the Engagement module can use it without referencing Domain at all. It is the same direction MMCA.Common.Domain takes toward MMCA.Common.Shared (see primer §1). Shared depends on the two innermost framework packages, MMCA.Common.Shared and MMCA.Common.Domain, plus one build-time reference to MMCA.ADC.Identity.Shared for the RoleNames vocabulary the read audiences and the grant map name (.../MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.Shared.csproj:3-9). The project file records why that reference is not a coupling: every member of RoleNames is a const, so the compiled contract assembly carries no reference to Identity and the shared-layer fitness test stays green (MMCA.ADC.Conference.Shared.csproj:5-8). That small footprint is what lets other projects reference it: the module's own UI (.../MMCA.ADC.Conference.UI/MMCA.ADC.Conference.UI.csproj:15), Engagement's application and UI layers (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Application/MMCA.ADC.Engagement.Application.csproj:9, .../MMCA.ADC.Engagement.UI/MMCA.ADC.Engagement.UI.csproj:17), Identity's application layer and service host (MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Application/MMCA.ADC.Identity.Application.csproj:6, MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/MMCA.ADC.Identity.Service.csproj:56), and the MMCA.ADC.Conference.Contracts gRPC project that carries the cross-module interfaces between services (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/MMCA.ADC.Conference.Contracts.csproj:12).

The AssemblyReference/ClassReference pair in Domain (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/AssemblyReference.cs:5,11) is the conventional per-project anchor every layer in this repo ships: a static holder for the compiled Assembly and its simple name (AssemblyReference.cs:7-8) that reflection-based registration can name without hard-coding a string. Note for accuracy that the architecture-fitness map does not use it: it pins the Conference domain assembly through a real type instead, typeof(Conference.Domain.Events.Event).Assembly (MMCA.ADC/Tests/Architecture/MMCA.ADC.Architecture.Tests/AdcArchitectureMap.cs:36).

Ten aggregates and their ownership boundaries

An aggregate is a root entity plus the children it exclusively owns; invariants are enforced inside the boundary, and references across aggregates are by ID, never by object graph. Every root here derives from AuditableAggregateRootEntity<TIdentifierType>, so it inherits soft-delete, audit stamping, and the buffered DomainEvents collection:

  • Event (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:24) owns Room (the physical rooms), EventSpeaker (the speaker roster, a join to Speaker by ID), and EventQuestionAnswer (event-level structured answers). Its Id is database-generated (marked [IdValueGenerated], Event.cs:23), and it also carries the per-event live-layer moderation default (Event.cs:84), the published flag (Event.cs:78), the organizer contact email, sponsorship packet URL, and ticketing URL that drive the public pages (Event.cs:63,69,75, each of which the pages hide entirely when absent), and the Sessionize refresh stamp written by RecordSessionizeRefresh (Event.cs:87,90,354).
  • Session (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:22) owns SessionSpeaker, SessionCategoryItem, and SessionQuestionAnswer. Critically, a Session references its Event and Room by scalar FK (EventId at Session.cs:64, RoomId at Session.cs:67): they are separate aggregates, even though the model exposes Event/Room navigations (Session.cs:69-75, both [Navigation]-decorated and both private-setter, so the populator and query filtering can hydrate them) used only for read-side filtering, never to reach across the boundary and mutate. Session Ids are Sessionize-assigned, not database-generated (Session.cs:15), and Duration is a persisted whole-minute column rather than a property derived on every read (Session.cs:88): the sessions grid sorts on it, an ORDER BY needs a column, and neither dynamic LINQ nor the SQL Server provider can express the difference of two DateTime values, so SQL Server keeps it true as a stored computed column while the domain assigns the same value wherever the two bounds are set (Session.cs:77-87, computed by the private CalculateDuration at Session.cs:161-164 and assigned in both the state constructor and Update, Session.cs:139,293). An unsaved session therefore answers the duration question exactly as a loaded one does.
  • Speaker (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:29) owns SpeakerCategoryItem and SpeakerQuestionAnswer, holds an optional Email value object (Speaker.cs:42), and carries the cross-module LinkedUserId FK to an Identity User (Speaker.cs:69). Speaker Ids are Sessionize-assigned GUIDs, with a freshly generated GUID for organizer-created and seeded speakers (see the in-code note at Speaker.cs:169-172). It is also the one root here that implements IAnonymizable (Speaker.cs:29), and the scope is deliberately narrow (Speaker.cs:22-27): only the Organizer-visible Email, marked [Pii] so the audit trail stores it redacted (Speaker.cs:41), is personal data, while the name and biography are the published event programme and stay. Anonymize overwrites the email with a deleted-{Id}@anonymized.invalid placeholder, which is still a valid Email, unique per speaker, and on a reserved domain no registration can match, so the BR-207 email auto-link can never re-attach the profile to anyone; a speaker with no email or already carrying the placeholder is a no-op success (Speaker.cs:344-375).
  • Sponsor (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/Sponsor.cs:18) is a flat root belonging to exactly one event by scalar EventId (Sponsor.cs:45, with a private-setter [Navigation] Event for public visibility filtering at Sponsor.cs:48-49). It carries a SponsorTier that drives public placement, branding links, and the optional expo booth (IsExhibitor/BoothNumber, Sponsor.cs:52,58); its Id is database-generated (Sponsor.cs:17) because sponsors are sold, not imported from Sessionize. Moving a sponsor between events is deliberately not an update: Update omits the event entirely (Sponsor.cs:156-166).
  • Partner (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/Partner.cs:19) is the non-commercial counterpart to Sponsor: the community user group, meetup, or nonprofit, and the special partner such as the venue host, that supports an event without buying a sponsorship package (Partner.cs:12-17). It is flat like Sponsor, belongs to exactly one event by scalar EventId with a private-setter [Navigation] Event for public visibility filtering (Partner.cs:40,43-44), and takes a database-generated id (Partner.cs:18). Its PartnerType (Community = 0/Special = 1, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Partners/PartnerType.cs:12-19) is both the grouping and the display order of the public partners band, and Community holds the zero value on purpose: it is the common case and, unlike a sponsorship tier, carries no commercial weight, so an omitted type landing on it is harmless (PartnerType.cs:7-11). Sort orders partners within their type (Partner.cs:37). Moving a partner between events is a create plus a delete rather than an update, exactly as for Sponsor and Activity (Partner.cs:108,117-123), and the three lifecycle points each raise a PartnerChanged (Partner.cs:101,136,148).
  • Activity (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/Activity.cs:20) is the social and networking programme: the pre-conference party, the morning coffee connect, the after-party, the closing ceremony. It is deliberately not a session, and the type's own doc comment says why (Activity.cs:11-17): an activity has no room and no speakers, and it frequently happens at an external venue, so the venue travels on the activity itself (VenueName, VenueAddress, VenueUrl at Activity.cs:42,45,48) instead of being inherited from the event. Its Id is database-generated (Activity.cs:19) because activities are planned, not imported; it belongs to one event by scalar EventId with a private-setter [Navigation] for visibility filtering (Activity.cs:54,57-58); StartTime/EndTime are plain wall-clock DateTimes in the owning event's IANA zone, exactly like Session.StartsAt, with the zone kept on the event and never repeated per row (Activity.cs:28-36); and SortOrder breaks ties between activities starting at the same minute (Activity.cs:51). Like Sponsor, moving it between events is a create plus a delete rather than an update (Activity.cs:99,147).
  • Category (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/Category.cs:16) owns CategoryItem: the taxonomy roots ("Level", "Track", "Session format") and their selectable options. Its Id is database-generated too (Category.cs:15); Sessionize imports supply explicit IDs via IDENTITY_INSERT.
  • Question (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/Question.cs:14) is a flat aggregate (no children); its answers live on the other aggregates as *QuestionAnswer join entities, keyed by QuestionId. Its three free-text enum-like fields (QuestionEntity, QuestionType, QuestionSource, Question.cs:20,23,32) are validated against allow-lists rather than modeled as C# enums, so an unfamiliar Sessionize value fails validation instead of breaking deserialization.
  • SessionAsset (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/SessionAsset.cs:23) is one piece of material published against a session: an uploaded deck, handout, or archive, or a link to material hosted elsewhere, the two shapes distinguished by the SessionAssetKind enum (File = 0/Link = 1, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/SessionAssets/SessionAssetKind.cs:13-19) and sharing one aggregate because the public session page renders them as one ordered list (SessionAssetKind.cs:7-12). It is deliberately not a child collection of Session, and the type's own doc comment gives the reason (SessionAsset.cs:9-16): a session is imported from Sessionize and overwritten on every refresh, while assets are authored here and must survive that refresh untouched. It carries no navigation properties at all, because the read path needs none: the public list is a flat projection keyed by session id. Its Id is a server-minted GUID (SessionAsset.cs:301) rather than a database-generated integer, and the comment says why (SessionAsset.cs:17-21): the id is a path segment of the blob name, so a sequential value would let anyone who downloaded one asset walk the container. EventId is denormalized alongside SessionId (SessionAsset.cs:31,34) so the blob-name scope, the event-level cascade delete, and the published-event read filter never have to join through the session (SessionAsset.cs:26-30), and UploadedBySpeakerId (SessionAsset.cs:65) is provenance rather than authorization: who may edit an asset is decided by the session's current speaker list, so a co-speaker can fix a colleague's typo (SessionAsset.cs:60-64).
  • SessionAiScore (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionAiScore.cs:13) is an AI-generated scorecard for a session: an overall score plus six per-criteria scores, all decimal (SessionAiScore.cs:25-43), together with the model's reasoning and model identifier (SessionAiScore.cs:46-49), the reasoning truncated to a 4000-character cap (SessionAiScore.cs:19,125-126), and the dated version of the scoring prompt that produced it, so a number on the dashboard stays attributable to the exact reviewer brief behind it (SessionAiScore.cs:51-58). Each score is range-guarded to 1.0 through 10.0 by a private helper (SessionAiScore.cs:128-135) that the factory runs through Result.Combine (SessionAiScore.cs:96-103). The type has no mutator: it is stored one per session, and re-scoring deletes the stale row and writes its replacement inside one transaction (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/DecisionSupport/ScoreEventSessions/SessionScoringRunner.cs:149,169), and it is the persistence side of the decision-support feature described below. That a scorecard is modeled as its own aggregate, referencing the Session by scalar SessionId (SessionAiScore.cs:22) rather than nesting under it, is a clean aggregate-boundary call: scores have an independent lifecycle (computed asynchronously, re-run on demand) and should not be loaded every time a Session is read. It is also the one root here that raises no domain events: no other part of the system reacts to a score being written.

The nine child entities all derive from AuditableBaseEntity<TIdentifierType> rather than from the aggregate-root rung, because they have identity and audit but no independent lifecycle: they are reached, created, and deleted only through their root (Room.cs:15, EventSpeaker.cs:14, EventQuestionAnswer.cs:14, SessionSpeaker.cs:14, SessionCategoryItem.cs:14, SessionQuestionAnswer.cs:14, SpeakerCategoryItem.cs:14, SpeakerQuestionAnswer.cs:13, CategoryItem.cs:14). Five of them also implement IReactivatable: Room, EventSpeaker, SessionSpeaker, SessionCategoryItem, and SpeakerCategoryItem, exactly the five a Sessionize re-import can bring back from a soft delete, which is what the Restore* methods below act on.

Three of the roots opt into the framework's change-history trail by also implementing IAuditedEntity: Event (Event.cs:24), Session (Session.cs:22), and Speaker (Speaker.cs:29). The in-code rationale is worth reading (Event.cs:17-21, Session.cs:16-20, Speaker.cs:17-21): these three are written by organizers and overwritten by the Sessionize sync, and "which edit moved this, and was it a person or the importer" is a question that only a history answers. Sponsors, partners, activities, categories, and questions do not carry that cost.

The aggregate shape, taught once

Open any of the roots and you will see the same skeleton; this repetition is the point, and it is what makes the per-type sections that follow read quickly. The shape, using Event as the exemplar:

  1. Private-setter properties (Name { get; private set; }, Event.cs:27): state can only change through the aggregate's own methods, never by an outside caller assigning a property. This is encapsulation as a compile-time guarantee ([Rubric §4, Domain-Driven Design], [Rubric §1, SOLID]).
  2. Backing-field collections exposed as IReadOnlyCollection<T> (_rooms at Event.cs:92 becomes Rooms => _rooms.AsReadOnly() at Event.cs:96). Children can only be added, updated, or removed through AddRoom/UpdateRoom/RemoveRoom-style methods that enforce invariants (for example the duplicate-name rejection at Event.cs:716-733). Most collections are decorated [Navigation(IsCollection = true)] so the navigation-populator machinery (G11) eager-loads them, but two deliberately are not: Event.EventQuestionAnswers (Event.cs:104-116) and Session.SessionQuestionAnswers (Session.cs:98-109) opt out because those collections grow with attendance rather than with the schedule and were riding along on hot anonymous public reads that never render them; the session answers are also the one child collection here that is not public data (Session.cs:105-107). Handlers that genuinely need them pass an explicit includes: list. That is a [Rubric §12, Performance & Scalability] decision expressed as a deliberately absent attribute.
  3. A private EF Core constructor (Event.cs:119, for materialization) plus a private state constructor (Event.cs:125) used only by the factory.
  4. A static Create(...) factory returning Result<T> (Event.cs:174): it validates invariants via Result.Combine(...) before constructing anything (Event.cs:200-207), so an invalid aggregate is unrepresentable, then raises an Added domain event (Event.cs:230). The typeof(Event).TryResolveId(id, out var resolvedId, out var idError) call (Event.cs:209-210, assigned at Event.cs:226) reconciles database-generated IDs with explicitly supplied ones through the framework's EntityTypeExtensions: a generated type ignores a supplied id, a non-generated type requires one, and a missing required id comes back as an Invariant error rather than an exception (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:20-22,28-29). The policy is chosen by method name rather than re-spelled per factory: Activity uses the same TryResolveId as Event (Activity.cs:121), Category uses TryResolveImportedId, where a supplied id wins even for a generated type so an imported row keeps its external key (Category.cs:67-68, EntityTypeExtensions.cs:23-25), Speaker uses ResolveIdOrNewGuid, the client-assigned GUID case that never fails (Speaker.cs:172, EntityTypeExtensions.cs:30-31), and SessionAsset mints Guid.NewGuid() when no id is supplied (SessionAsset.cs:301). SessionAsset also splits the factory three ways: a general Create that takes the kind as a value for a deserializer or an import, plus the CreateLink and CreateFile overloads that name the kind and accept only the fields that kind carries (SessionAsset.cs:116,154,192, all three funnelling into one private helper whose Result.Combine runs the six invariant checks before anything is constructed, SessionAsset.cs:289-295).
  5. Mutator methods (Update at Event.cs:255, Publish/Unpublish at Event.cs:310,330, LinkUser/UnlinkUser on Speaker at Speaker.cs:303,326) that re-validate, mutate, and raise an Updated event. Lifecycle guards return failures rather than throwing: publishing an already published event yields the "Event.AlreadyPublished" invariant error (Event.cs:312-319).
  6. An overridden Delete() (Event.cs:367) that soft-deletes children first and the root last, combining all four results in one Result.Combine(...): DeleteChildren<T, TId>(...) for rooms, event speakers, and event answers, then base.Delete() (the soft-delete from G02) at Event.cs:373-376, with the Deleted event raised only when the whole combination succeeded (Event.cs:379). The in-code comment states the reason for that ordering (Event.cs:369-371): a failing child leaves the cascade reported as a failure instead of a half-applied delete whose earlier children and root were already flagged. Session does the same for its three child collections (Session.cs:339-342,345), Category for its items (Category.cs:112-113,116), Sponsor, Activity, and SessionAsset have nothing to cascade to and simply raise their Deleted events (Sponsor.cs:195-202, Activity.cs:183-191, SessionAsset.cs:265,270), and Speaker uses its override for a different job: clearing the cross-context link while deliberately leaving its junction children alive so the Sessionize import can reactivate them in place (Speaker.cs:262-294, the reasoning at Speaker.cs:267-271). Soft-delete is the default everywhere ([Rubric §8, Data Architecture]: the IsDeleted flag plus EF Core global query filters, never a hard DELETE; ADR-005).
  7. Restore methods for the Sessionize round-trip (RestoreRoom at Event.cs:499, RestoreEventSpeaker at Event.cs:609, RestoreSessionSpeaker and RestoreSessionCategoryItem at Session.cs:393,468, and RestoreSpeakerCategoryItem at Speaker.cs:421): a re-imported child that was previously soft-deleted is reactivated in place rather than re-inserted. A restore has to clear the same uniqueness bar as an add, which is why RestoreRoom re-runs the duplicate-name check before reactivating (Event.cs:523), and it first refuses any room owned by a different event (Event.cs:511): room ids come from a global Sessionize sequence, Room.EventId has no setter (Room.cs:48), and adding a foreign room to this collection would let EF relationship fixup silently move the row (the comment spelling that out sits at Event.cs:506-510).

Because the shape is identical, the child entities (Room, the *Speaker/*CategoryItem joins, the three *QuestionAnswer types) and their *Changed domain events are documented as sibling families in the sections that follow: taught once, then tabulated.

Invariants, business rules as testable units

Each aggregate has a co-located static invariant class, EventInvariants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventInvariants.cs:16), SessionInvariants, SpeakerInvariants, SponsorInvariants, PartnerInvariants, ActivityInvariants, CategoryInvariants, QuestionInvariants, and SessionAssetInvariants, whose methods each return a Result and are combined with Result.Combine(...) in the factory and mutators. They build on CommonInvariants (G02) for the generic string-not-empty and max-length checks (EventInvariants.cs:73-76) and add domain-specific rules.

They also carry the length constants, but note where those numbers actually originate: each invariant constant is an alias of a constant declared on the matching DTO in Conference.Shared (public const int NameMaxLength = EventDTO.NameMaxLength;, EventInvariants.cs:18-61, and the same pattern at SessionInvariants.cs:17-38, SpeakerInvariants.cs:18-51, SponsorInvariants.cs:16-34, PartnerInvariants.cs:16-25, ActivityInvariants.cs:16-28, CategoryInvariants.cs:18-24, QuestionInvariants.cs:17-26, and SessionAssetInvariants.cs:16-25). The DTO is the lowest layer the domain, the EF configuration, and the Blazor pages can all reach, so a field cap is declared once on EventDTO and consumed by the domain rule, the column constraint, and the input's character counter alike (EventInvariants.cs:11-14 records the reasoning). The answer-value caps follow the same rule: the event, session, and speaker invariants each alias one 4000-character constant declared on QuestionDTO (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Questions/QuestionDTO.cs:32, aliased at EventInvariants.cs:61, SessionInvariants.cs:38, SpeakerInvariants.cs:51). The one answer cap declared in Domain itself is the 2000-character text-answer limit on QuestionInvariants (QuestionInvariants.cs:29), which no DTO owns.

The domain-specific rules are where the ubiquitous language shows up. SessionInvariants holds the BR-91 service-session guard (SessionInvariants.cs:95), the BR-49 status-eligibility check whose failure code is "Session.StatusIneligible" (SessionInvariants.cs:110,113), the BR-122 zero-duration guard whose failure code is "Session.Duration.Invalid" (SessionInvariants.cs:150-158), and the reserved manual id range 999_999_000 through 999_999_999 for sessions that did not come from Sessionize (SessionInvariants.cs:45,48, mirrored for rooms at EventInvariants.cs:68,71 and for questions at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/QuestionInvariants.cs:70,73). QuestionInvariants validates the free-text enum-like fields against allow-lists (QuestionInvariants.cs:60,63,66, checked at :80,97,112), and the comparison is not uniform on purpose: entity and type are matched ordinally, so only the canonical casing passes, because consumers switch on the stored value case-sensitively (QuestionInvariants.cs:110-112), while the source is matched case-insensitively (QuestionInvariants.cs:133). For answers it dispatches on the question type (QuestionInvariants.cs:149): Rating must parse as an invariant-culture integer 1 through 5 (QuestionInvariants.cs:176), Text is capped at 2000 characters (QuestionInvariants.cs:29,190), and Email must parse as a System.Net.Mail.MailAddress (QuestionInvariants.cs:208). ActivityInvariants is the compact newcomer: name, venue name, venue address, and venue URL length checks plus a start-before-end time-range rule (ActivityInvariants.cs:36,48,58,78,89). PartnerInvariants is smaller still: a name presence-and-length rule plus optional-length rules for the logo and website URLs (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/PartnerInvariants.cs:33,45,56), which is three rules against the four caps it aliases, because DescriptionMaxLength (PartnerInvariants.cs:22) is carried for the layers downstream and has no matching domain check. SessionAssetInvariants is where the asset rules that are not lengths live: the URL has to be an absolute http or https URL, refused at the domain boundary rather than sanitized at each render site because it becomes a download link on an anonymous page ("SessionAsset.Url.NotAbsoluteHttp", MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/SessionAssetInvariants.cs:38-51,122-138); the blob name has to be present for a File and absent for a Link, which is the pairing that keeps a file row pointing at something the blob-delete path can find ("SessionAsset.BlobName.Required" / "SessionAsset.BlobName.NotAllowed", SessionAssetInvariants.cs:62-83); a stored size must be positive, because zero or negative means the upload pipeline handed the aggregate a value it never measured (SessionAssetInvariants.cs:103-110); and the display order cannot be negative, since the list renders ascending and a negative value would silently sort ahead of everything an organizer arranged (SessionAssetInvariants.cs:119-126). CategoryInvariants enforces case-insensitive uniqueness of an item name within its category (BR-138, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/CategoryInvariants.cs:61), and its in-code note explains why the exclusion parameter is nullable rather than defaulted: a database-generated CategoryItem id is 0 until the save, so a default exclusion would silently exempt every unsaved sibling (CategoryInvariants.cs:66-68). Centralizing each rule as a named, side-effect-free method is what makes the domain exhaustively unit-testable ([Rubric §14, Testability]), and the error codes ("Event.AlreadyPublished" at Event.cs:315, "Session.StatusIneligible" at SessionInvariants.cs:113) are the business vocabulary. The recurring // BR-NN comments are traceability links back to the business-requirements catalogue.

A nuance worth flagging: the Status field on Session is free text, imported verbatim from Sessionize (Session.cs:37), and SessionStatuses (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionStatuses.cs:15) is the constant catalogue of the recognized values (Accepted, Waitlisted, Accept_Queue, Nominated, Decline_Queue, Declined, at SessionStatuses.cs:18-33, enumerated for organizer filter dropdowns at SessionStatuses.cs:38) plus the IsEligible(...) rule. Read that rule carefully, because it is an allow-list, not a deny-list: only Accepted, or an unset status (organizer-created sessions never carry one), is eligible for public display, bookmarking, and feedback; every other value, known or unknown, is ineligible (BR-49, SessionStatuses.cs:49-57, with the reasoning at SessionStatuses.cs:9-14). Adding a constant to this class therefore does not make that status publicly visible, which is the safe default for a free-text field fed by an external system. Using const string values instead of a C# enum means an unrecognized Sessionize status does not break deserialization. The type lives in Shared rather than Domain so that the domain, the handlers, and the UI apply one BR-49 rule and one status vocabulary (SessionStatuses.cs:4-7): the domain's status-eligibility invariant calls it (SessionInvariants.cs:111), and so does the Engagement module's feedback page through its direct Conference.Shared reference (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.UI/Pages/Feedback/SessionFeedback.razor.cs:200, MMCA.ADC.Engagement.UI.csproj:12). The public calendar export reuses that rule rather than restating it: SessionCalendarExport (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionCalendarExport.cs:9) answers whether a session belongs in an ICS download, which requires both start and end set, not a service session, and SessionStatuses.IsEligible (SessionCalendarExport.cs:22-26, with a SessionDTO overload at :31-35). It too sits in Shared so the export handlers, through CalendarExportMapper (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/ExportCalendar/CalendarExportMapper.cs:26), and the public session page that decides whether to offer an add-to-calendar control (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Public/Sessions/PublicSessionDetail.razor:45) apply one predicate, so a page never offers a download the ics endpoint would answer with 404 (SessionCalendarExport.cs:3-8). The check is role-independent by design: the ICS document is a public-schedule artifact, so privileged callers get the same filtered export (SessionCalendarExport.cs:11-16). [Rubric §8, Data Architecture] (deliberate handling of externally sourced data).

Domain events and the outbox spine

Every state-changing method raises a domain event through the inherited AddDomainEvent(...), and the eighteen events come in two shapes with two different base types. The nine aggregate-level ones, EventChanged, SessionChanged, SpeakerChanged, CategoryChanged, QuestionChanged, SponsorChanged, PartnerChanged (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/DomainEvents/PartnerChanged.cs:12-16), ActivityChanged, and SessionAssetChanged, derive from EntityChangedEvent<TIdentifierType> and carry the DomainEntityState (Added/Updated/Deleted) plus a friendly label, and sometimes one extra correlating field: SessionChanged also carries the parent EventId (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/DomainEvents/SessionChanged.cs:13-18), and SessionAssetChanged carries the parent SessionId beside its own id and title (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/DomainEvents/SessionAssetChanged.cs:13-18, raised from the factory, Update, and Delete at SessionAsset.cs:304,258,270). The nine child-level ones, RoomChanged, EventSpeakerChanged, EventQuestionAnswerChanged, SessionSpeakerChanged, SessionCategoryItemChanged, SessionQuestionAnswerChanged, SpeakerCategoryItemChanged, SpeakerQuestionAnswerChanged, and CategoryItemChanged, derive from BaseDomainEvent instead, because a child change is not a change of that root's identity: they carry both the parent and child IDs (for example RoomChanged(state, Id, room.Id, room.Name) raised at Event.cs:461, declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/RoomChanged.cs:13-18) so a consumer can target the precise change. These are intra-module domain events: they ride the outbox (ADR-003) but are consumed inside Conference. They do not cross the wire to other services; that is the job of integration events, and only those carry an explicit EventNameAttribute wire name.

The flow is exactly the outbox spine from G04: a mutator buffers the event on the aggregate; on SaveChangesAsync the domain-event save-changes interceptor serializes it into an OutboxMessage row in the same transaction; dual dispatch then delivers it at least once. Nothing in this chapter's code does any dispatching; the aggregates only declare what happened, which is the Clean Architecture division of labor ([Rubric §6, CQRS & Event-Driven]). One domain detail matters for the cross-context link: Speaker.Delete() captures the previous LinkedUserId before clearing it (Speaker.cs:277,284), raises the Deleted SpeakerChanged event, and, when a user was linked, also raises the SpeakerUnlinkedFromUser integration event carrying that captured id (Speaker.cs:286-290), so Identity can clear its side even though the field is already nulled within Conference (BR-70) and the outbox captures the unlink atomically with the delete (Speaker.cs:262-266). SpeakerChanged itself therefore carries only the state, the speaker id, and the full name (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/DomainEvents/SpeakerChanged.cs:12-15). LinkUser and UnlinkUser follow the same rule, raising the link or unlink event beside their Updated event on the aggregate itself (Speaker.cs:315-316,339-340), so every link path rides the same save as the link (Speaker.cs:296-300).

The cross-aggregate cascade: a pure domain service

One business rule cannot live inside a single aggregate: deleting an Event must also delete every Session belonging to it (BR-127), every Sponsor sold against it, every Partner supporting it, every Activity planned for it, and every SessionAsset published under it, but sessions, sponsors, partners, activities, and session assets are separate aggregates (referenced by EventId, not owned). Putting a List<Session> inside Event would violate the aggregate boundary. The answer is a domain service, EventCascadeDeletionDomainService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventCascadeDeletionDomainService.cs:16), a static class with no interface and nothing to inject: a pure, infrastructure-free coordinator whose one method, CascadeDelete, takes the pre-fetched Event plus its already-loaded Session, Sponsor, Partner, Activity, and SessionAsset collections (EventCascadeDeletionDomainService.cs:31-37) and orchestrates the deletes: soft-delete each session first (BR-55 cascades to its children), then each sponsor, then each partner, then each activity, then each session asset, then the event itself (BR-72 cascades to rooms, event speakers, and event answers) (EventCascadeDeletionDomainService.cs:51-64, each step running through one private DeleteAll helper that returns the first failure it meets, :68-78). The ordering is what makes the failure path safe: the first child that refuses to delete short-circuits the cascade and returns its own failure unchanged, so the event is never deleted and the caller (which saves only on success) discards the aborted in-memory mutations rather than persisting a half-deleted graph (EventCascadeDeletionDomainService.cs:39-41,60-61). Sponsors, partners, and activities share one reason for being in the cascade, recorded above the calls: each is its own aggregate rooted on the event, and leaving one behind would orphan rows the public pages still read (EventCascadeDeletionDomainService.cs:43-45). Session assets are deleted here rather than through the per-session cascade, and the comment says why: they hang off the event by the denormalized EventId their blob names are scoped by, so the caller loads them once for the whole event, and the blob behind each file row is removed afterwards by the caller's scheduled delete command (EventCascadeDeletionDomainService.cs:47-50). This is [Rubric §4, Domain-Driven Design]'s textbook "domain service for behavior that spans aggregates and belongs to no single one," and [Rubric §3, Clean Architecture]'s purity discipline: the service does no I/O; the application layer fetches the aggregates and saves them. It is the highest-level type in the chapter precisely because it depends on six aggregates at once.

Read models and the AI decision-support feature

The largest cluster in Conference.Shared is the DTO layer, the wire contracts that decouple the API from the domain entities ([Rubric §9, API & Contract Design]; ADR-001 chose manual/Mapperly mapping over reflection-based AutoMapper). Most are straightforward projections: EventDTO, SessionDTO, SpeakerDTO, SponsorDTO, PartnerDTO, ActivityDTO, ConferenceCategoryDTO, CategoryItemDTO, QuestionDTO, RoomDTO, SessionAssetDTO, and the per-child join DTOs (EventSpeakerDTO, SessionSpeakerDTO, SessionCategoryItemDTO, SpeakerCategoryItemDTO, and the three *QuestionAnswerDTO records: EventQuestionAnswerDTO, SessionQuestionAnswerDTO, SpeakerQuestionAnswerDTO), plus the speaker-facing feedback shapes SessionFeedbackDTO with its RatingQuestionSummary and TextQuestionResponses members (BR-210, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SessionFeedbackDTO.cs:6,22,38). They carry the entity's Id via the framework's IBaseDTO<TIdentifierType> contract and required init-only properties: read contracts, immutable after construction. Nine of them also implement IConcurrencyAware and round-trip the RowVersion token (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventDTO.cs:16,52, and the same pair on Sessions/SessionDTO.cs:15,46, Speakers/SpeakerDTO.cs:18,58, Sponsors/SponsorDTO.cs:15,42, Partners/PartnerDTO.cs:15,33, Activities/ActivityDTO.cs:15,36, Questions/QuestionDTO.cs:14,32, Categories/ConferenceCategoryDTO.cs:14,26, and SessionAssets/SessionAssetDTO.cs:15,33). The client sends that token straight back in the If-Match header rather than in a body field: the publish and unpublish endpoints are marked SupportsIfMatchAttribute and read the required token from the header before building their command (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/EventLifecycleController.cs:53,61,86,94), so a transition decided against a stale view surfaces as a conflict instead of applying silently, and a request with no If-Match at all is refused outright (ADR-035). Alongside those sit the small task-shaped contracts: LinkUserRequest (the manual speaker-to-user link body, BR-209, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/LinkUserRequest.cs:6), RefreshFromSessionizeResultDTO (per-entity synced counts, the BR-136 skipped-soft-deleted count, and non-fatal warnings, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/RefreshFromSessionizeResultDTO.cs:7,28,31), with the one refresh failure a caller branches on named in EventErrorCodes ("Event.Sessionize.Unavailable", which the refresh endpoint answers with 502, declared once so the emitting handler and the mapping controller cannot drift apart without failing the build, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventErrorCodes.cs:3-14), and the glanceable NowNextDTO/NowNextSessionDTO snapshot behind the public now-next endpoint (the Android home-screen widget payload, carrying both event-local wall clock and UTC instants, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/NowNextDTO.cs:14,29). Beside SessionAssetDTO sits SessionAssetLimits (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/SessionAssets/SessionAssetLimits.cs:8), the upload policy declared once so the API transport cap, the command validator, the content sniffer, and the Blazor upload control all state the same numbers: 50 MB per file (SessionAssetLimits.cs:11), a multipart request cap of that plus 64 KB of headroom for the boundary and part headers, without which a file at exactly the limit is rejected by Kestrel with a bare 413 before the friendly SessionAsset.InvalidUpload check ever runs (SessionAssetLimits.cs:13-20), at most ten live assets per session (SessionAssetLimits.cs:27), and a seven-entry extension allow-list (.pdf, .pptx, .docx, .xlsx, .zip, .md, .txt, SessionAssetLimits.cs:34-43), paired one-for-one with a list of MIME types (SessionAssetLimits.cs:50-59) because the MAUI Android BlazorWebView hands the accept attribute to the system picker as MIME types, where an extension matches nothing (SessionAssetLimits.cs:45-49). The upload control's accept value is therefore both lists joined (FileInputAccept, SessionAssetLimits.cs:71-72), so every picker offers only what the server takes, while the extensions-only AcceptAttribute (SessionAssetLimits.cs:64) is what the refusal messages quote. The extension is explicitly only half the gate: the framework's DocumentContentSniffer also reads the real bytes, so a renamed executable is refused even though its extension is on the list (SessionAssetLimits.cs:29-33).

SpeakerPhotoSettings (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerPhotoSettings.cs:9) is the same kind of declared-once policy for a different risk: the image hosts a speaker profile picture may point at. The picture renders in every visitor's browser and in the mobile app, so an arbitrary host would let whoever edits a speaker make every visitor's client call a server of their choosing (SpeakerPhotoSettings.cs:3-8, [Rubric §11, Security]). It binds from the Conference section (SpeakerPhotoSettings.cs:12) and holds the configured SpeakerPhotoAllowedHosts, matched exactly and case-insensitively, with an empty list falling back to DefaultAllowedHosts, the Sessionize image host the speaker import brings pictures from (SpeakerPhotoSettings.cs:14-25), plus a StorageServiceUri whose host is always allowed (SpeakerPhotoSettings.cs:27-32). The Conference service host binds it and fills that storage endpoint from FileStorage:ServiceUri, deliberately without ValidateOnStart because a missing section is the safe default (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:296-306). The rule that reads it is the application layer's SpeakerPhotoHostPolicy, which narrows the domain's https rule to those hosts on every write path that sets a new picture (create, update, Sessionize import) and never re-judges a picture an update leaves unchanged (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/Validation/SpeakerPhotoHostPolicy.cs:8-16,25).

A distinct and more interesting subgroup is the DecisionSupport namespace: read models built purely to help an organizer curate a conference. SessionSelectionDashboardDTO (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionSelectionDashboardDTO.cs:8) is the composite; for one event it carries the total, accepted, accept-queue, pending, and declined counts (SessionSelectionDashboardDTO.cs:17-29), a CategoryDistributionDTO (how sessions spread across tracks and levels, itself built from CategoryGroupDistribution and CategoryItemDistribution), a SpeakerSessionOverlapDTO (speakers with multiple submissions, via MultiSessionSpeaker and SpeakerSessionSummary), per-tier SpeakerLocalitySummary counts (SessionSelectionDashboardDTO.cs:38,45), and a list of SessionAiScoreDTO (SessionSelectionDashboardDTO.cs:41). The locality breakdown is the Atlanta-versus-elsewhere signal behind the local-speaker preference, and it is derived from a locality category in the taxonomy rather than from a field on Speaker: the dashboard handler resolves each speaker's tier through the SpeakerLocalityHelper lookup (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/DecisionSupport/GetSessionSelectionDashboard/GetSessionSelectionDashboardHandler.cs:78-79,279). The AI scores are produced by a scoring service in Conference.Infrastructure that calls the model through the framework's governed IChatClient rather than a hand-built HttpClient (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Sessions/Scoring/SessionScoringService.cs:14-18,48, outside this chapter) and persisted as the SessionAiScore aggregate; ScoreEventSessionsResultDTO reports a batch run's scored and failed counts (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionAiScoreDTO.cs:68-75).

The whole organizer workflow is guarded by the conference:session-selection:manage capability permission catalogued in ConferencePermissions (ConferencePermissions.cs:30), applied once at the controller level (SessionSelectionController.cs:31); access is a permission question, not a feature-flag one. The module carries two flags, both on ConferenceFeatures. The first, SessionizeIntegration (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/ConferenceFeatures.cs:23), gates only the Sessionize external sync that seeds the raw session data this dashboard then analyzes: the RefreshFromSessionizeCommand implements IFeatureGated and returns the flag name from its FeatureName property (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RefreshFromSessionize/RefreshFromSessionizeCommand.cs:12,18), so the decorator pipeline short-circuits it when the flag is off ([Rubric §12, Performance & Scalability Concerns], ADR-031). The flag is declared Permanent with an owning team (ConferenceFeatures.cs:22), and its own doc comment says why that matters: it is a shipped kill switch over a live external dependency, kept so an organizer can shed the Sessionize call during a provider incident, not a rollout toggle with a removal date (ConferenceFeatures.cs:16-20). The second, SessionScoring, is declared the same way (ConferenceFeatures.cs:37-38) and gates only the paid AI scoring pass, one model call per session (ConferenceFeatures.cs:31-34): the ScoreEventSessionsInternalCommand is IFeatureGated on it (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/DecisionSupport/ScoreEventSessions/ScoreEventSessionsInternalCommand.cs:37,47), and because the organizer trigger only schedules that command, the endpoint also carries [FeatureGate] so a switched-off pass answers 404 up front instead of 202 for work about to be refused (SessionSelectionController.cs:68-84). The dashboard handler is not flag-gated, so the dashboard and any scores already stored stay readable with the scoring flag off (ConferenceFeatures.cs:28-29).

The Sessionize code that sync runs against has its own single definition, SessionizeCodeFormat (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/SessionizeCodeFormat.cs:27), and the charset it enforces is a security control rather than a cosmetic one ([Rubric §11, Security]). The Sessionize client builds a relative URI from the stored code and resolves it against the https://sessionize.com/api/v2/ base address, and RFC 3986 resolution reads a value such as //attacker.example/x as a network-path reference: the outbound request would leave for a foreign host and its JSON would be imported as speakers, sessions, and rooms. Restricting the code to ASCII letters, digits, underscore, and hyphen, one to 64 characters (SessionizeCodeFormat.cs:32,43), removes every character that can change the authority, the scheme, or the path of the resolved URI (SessionizeCodeFormat.cs:12-21). Two details in that one line of regex are deliberate: the pattern is anchored with \A and \z rather than ^ and $, because $ also matches before a trailing newline and would let "adc2026\n" through the charset (SessionizeCodeFormat.cs:38-42), and the matcher is a source-generated [GeneratedRegex] with a 1000 ms match timeout (SessionizeCodeFormat.cs:54). It lives in Shared because two layers must agree on it: the Application request validators reject a bad code at the boundary, and the Infrastructure Sessionize HTTP client re-checks the stored value before composing a request URI from it (SessionizeCodeFormat.cs:6-11).

Authorization vocabulary and current-event selection

Two more Shared helpers deserve a mention because they encode policy the whole module relies on. ConferencePermissions (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferencePermissions.cs:9) is the catalogue of the module's twelve capability permissions (conference:events:manage, conference:sessions:manage, conference:sponsors:manage, conference:partners:manage, conference:activities:manage, conference:session-assets:manage, conference:speakers:link, and so on, ConferencePermissions.cs:12-55, the partners capability at ConferencePermissions.cs:36), the stable string identifiers endpoints require via HasPermissionAttribute rather than by role name. The All and ContentManagement subsets (ConferencePermissions.cs:58,79) let a role grant an entire capability set or the narrower catalog-curation slice (sessions, speakers, sponsors, partners, activities, session assets, and the category taxonomy, ConferencePermissions.cs:81-87) at once, a distinction capability checks express centrally and role checks cannot. The speaker-link capability is the deliberate exception to that slice: linking an application user to a speaker (BR-209) grants a speaker identity, the claim that unlocks raw session feedback, poll management, and question moderation, so it is Organizer-only and kept out of ContentManagement even though a content editor curates speaker records (ConferencePermissions.cs:49-55). The session-asset capability is the clearest example of the model's limit and is documented as such on the constant itself (ConferencePermissions.cs:41-46): a speaker needs no capability at all to manage the materials of a session they present, because the handlers accept them on the strength of the session's own speaker list, and the capability exists for the organizer or content editor doing the same for a session they do not present. This is the permission-based authorization story ([Rubric §11, Security], ADR-020), decided by the role-to-permission grants rather than scattered across controllers, and those grants have a named home: ConferencePermissionGrants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferencePermissionGrants.cs:27) is a two-line Apply(PermissionRegistryBuilder) that grants All, plus the framework capability AdministrationPermissions.ManageFeatures, to RoleNames.Organizer and ContentManagement to RoleNames.ContentEditor (ConferencePermissionGrants.cs:49-55). It is a named map rather than a lambda inside the module registration because two hosts apply the same map: the Conference service applies it through AddModuleConferenceAPI to gate its own endpoints, and the token-minting Identity host applies it so the access token it signs carries a permission claim per Conference capability the caller's role holds. A service that does not own the grant map reads the claim instead of the registry, so a token minted without these grants would deny in one process what the other allows (ConferencePermissionGrants.cs:10-18). It sits in Shared rather than in a host project because a grant map is a statement about the application's vocabulary, not about one host's composition, and Shared is the only layer both hosts may reference; it can name Identity's RoleNames without breaking the contract-purity fitness test because every member of that type is a const and so leaves no reference in the compiled contract assembly (ConferencePermissionGrants.cs:19-25). Beside it sits ConferenceReadAudience (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferenceReadAudience.cs:31), the answer to the other question a caller raises, not "may I change this" but "how much of the catalog may I see": exactly two audiences exist, the privileged readers (RoleNames.Organizer and .ContentEditor, ConferenceReadAudience.cs:34-38) and everyone else, and naming them once is what keeps the output-cache bypass list and the API-layer visibility checks from ever disagreeing. A third, partially-privileged audience would need its own cache key, which is why the type's own remarks tell you to check the cache policies before extending the list (ConferenceReadAudience.cs:17-21).

CurrentEventSelector (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/CurrentEventSelector.cs:13) is the pure, generic helper every landing surface uses to pick which published event to feature: the event live now (soonest to end), else the next upcoming (soonest to start), else the most recently ended (CurrentEventSelector.cs:50-64). It shares the exact live-window math the backend enforces: StartDate at 00:00 local through EndDate + 1 day at 00:00 local (exclusive), converted from the event's IANA time zone to UTC (CurrentEventSelector.cs:77-87). There is no unknown-zone fallback and the code says why: EventInvariants.EnsureTimeZoneIsValid guards every write path, so the id always resolves (CurrentEventSelector.cs:67-71). One subtlety earns its own method: both window boundaries land on local midnight, which does not exist in zones that spring forward at 00:00, so ToUtc shifts an invalid wall-clock time forward by an hour rather than letting TimeZoneInfo.ConvertTimeToUtc throw (CurrentEventSelector.cs:100-111, the shift itself at :92-95). Because the selector is generic over the event model, each consumer passes its own DTO plus accessor delegates, so the selection rule lives in one tested place rather than being re-derived per surface; CurrentEventDefaults (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/CurrentEventDefaults.cs:8,17-23) is the thin wrapper that binds those delegates for the common EventDTO shape.

Crossing the module boundary: contracts, gRPC adapters, and integration events

Conference does not live alone. Four connection points join it to other modules, and all live in Conference.Shared so neither side reaches into the other's domain ([Rubric §7, Microservices Readiness], [Rubric §3, Clean Architecture]):

  • Synchronous bookmark validation (inbound). The Engagement module needs to validate that a session is bookmarkable (exists, not a service session per BR-91, eligible status per BR-49) and to enumerate a session's IDs by event (BR-58). It depends on the ISessionBookmarkValidationService interface (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/ISessionBookmarkValidationService.cs:11,20,31), which is marked ServiceContractAttribute (ISessionBookmarkValidationService.cs:10) so the contract-purity fitness tests hold it to entity-free, extraction-safe signatures. It is implemented in Conference.Application in process, or by a gRPC adapter when the modules run as separate services (ADR-007). There is no null-object fallback for a host without Conference: the in-process implementation is registered with TryAdd (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/DependencyInjection.cs:116), and an extracted host that never discovers the Conference module calls AddConferenceSessionValidationClient, which Replaces the registration with the gRPC adapter so that adapter is the only one present (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:26-42). The module class itself is accordingly bare: an IModule whose Register calls AddConferenceModule and nothing else, its summary noting that the cross-module contracts reach the other services over gRPC (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/ConferenceModule.cs:8-20).

  • Synchronous live-layer validation (inbound). The Engagement conference-day live layer asks Conference five questions, and the five members of IEventLiveValidationService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/IEventLiveValidationService.cs:14, also a [ServiceContract] at :12) are exactly those questions: is this event published and inside its live window (EventLiveInfo, IEventLiveValidationService.cs:24); for a session, who are the assigned speakers (BR-236), is it a plenum session, and what is the event's question moderation default (SessionLiveInfo, IEventLiveValidationService.cs:35); for a sponsor scanned from a printed booth QR code, does it exist and belong to a published event (SponsorLiveInfo, IEventLiveValidationService.cs:46); which session is a given room hosting right now (RoomSessionInfo, IEventLiveValidationService.cs:67-71), so a check-in never has to trust a client-supplied session id; and which of a set of candidate sessions share a time slot with a reference session (GetOverlappingSessionIdsAsync, IEventLiveValidationService.cs:91-94), compared as half-open [StartsAt, EndsAt) windows so back-to-back sessions do not overlap, with unknown candidates ignored and an unscheduled session overlapping nothing (IEventLiveValidationService.cs:73-82). Each returns a snapshot record or a set of ids, never a Conference domain entity. The policy line falls the same way on the last two: what an overlap means (for example one room check-in per attendee per time slot) is the calling module's rule, and Conference only answers the schedule question (IEventLiveValidationService.cs:79-81). Likewise the check-in grace window travels in the request as a parameter rather than living in Conference config, because how early a session counts as current is check-in policy and Conference only answers the schedule question (IEventLiveValidationService.cs:53-56, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomSessionInfo.cs:10-14). The room question also carries the code the scanned room QR held (checkInCode, IEventLiveValidationService.cs:59-63,69), so a room id read from the anonymous public room list is not enough to record a check-in. The secret lives on the Room child as a private-setter CheckInCode that no public read exposes (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Room.cs:35-41); an organizer issues or replaces it through the root, Event.RotateRoomCheckInCode (Event.cs:474-481), which delegates to the internal Room.RotateCheckInCode that mints 16 random bytes as 32 lower-case hex characters (Room.cs:189-193) and deliberately raises no domain event because the code is in no read model or cached response (Event.cs:466-470). Room.AcceptsCheckInCode is the rule: a room with no code yet accepts every request, a wrong code is always refused, an absent code is refused only when enforcement is on, and the comparison is CryptographicOperations.FixedTimeEquals so it takes the same time whatever the input (Room.cs:162-182). Enforcement is the RoomCheckInSettings switch RequireCode, bound from the Conference:RoomCheckIn section and off by default so the already-installed mobile build, which sends no code, keeps checking in until the release that carries the scanned code is adopted (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomCheckInSettings.cs:7-20). The organizer read and rotate endpoints return the code as a RoomCheckInCodeDTO, never as part of the anonymous RoomDTO; it carries the room id, the code (null when none is issued), whether RequireCode is on so the organizer page can say which mode is live, a 64-character CodeMaxLength, and the "Room.CheckInCodeRejected" error code a refused lookup answers with so the check-in page can tell the attendee to scan the code at the door (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomCheckInCodeDTO.cs:3-37). EventLiveInfo also carries the event's Name and StartDate as optional trailing members, read by Engagement's ticket-holder invites (BR-270) for the email subject and body and defaulted so a payload from a peer that predates them still reads (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/EventLiveInfo.cs:10-27), and the interface's own summary names a second consumer beside Engagement: the Notification service's live-channel join gate (IEventLiveValidationService.cs:6-11). The moderation default is the QuestionModerationDefault enum (Pending = 0/Approved = 1, BR-233, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/QuestionModerationDefault.cs:7-13) carried on the Event (Event.cs:84, defaulted to Pending in both Create and Update, Event.cs:185,265). As with bookmark validation there is no disabled stub: the in-process implementation is a TryAdd registration (.../MMCA.ADC.Conference.Application/DependencyInjection.cs:129), and the extracted Engagement and Notification hosts, which never discover the Conference module, register the gRPC adapter through AddConferenceEventLiveValidationClient as the only implementation (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:53-69), so the live-layer checks always run against Conference rather than being skipped.

  • Synchronous data-subject export (inbound). The Identity module assembles a user's cross-service personal-data export (PRIVACY.md section 12, IUserConferenceExportService.cs:6-8), and the Conference share of it is the feedback the user wrote. IUserConferenceExportService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Exports/IUserConferenceExportService.cs:14, a [ServiceContract] at :13) has one member, GetUserConferenceExportAsync (IUserConferenceExportService.cs:24), and its doc comment fixes the scope: only answers to attendee-feedback questions (QuestionSource == "User") count, because a Sessionize-imported answer is programme data rather than the user's (IUserConferenceExportService.cs:16-20). It returns a UserConferenceExportDTO (.../Exports/UserConferenceExportDTO.cs:8) holding two lists, each defaulting to empty (UserConferenceExportDTO.cs:11,14), of UserConferenceSessionAnswerExportDTO and UserConferenceEventAnswerExportDTO rows (.../Exports/UserConferenceSessionAnswerExportDTO.cs:7, .../Exports/UserConferenceEventAnswerExportDTO.cs:7): the question id, the session or event id, the answer value in full (it is the user's own text or rating), and the UTC submission time (UserConferenceSessionAnswerExportDTO.cs:10-19, UserConferenceEventAnswerExportDTO.cs:10-19). Soft-deleted (withdrawn or already erased) answers are excluded (UserConferenceExportDTO.cs:3-7). The in-process implementation lives in Conference.Application (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Exports/UserConferenceExportService.cs:28, registered with TryAddScoped at .../MMCA.ADC.Conference.Application/DependencyInjection.cs:133), a gRPC adapter replaces it outside the Conference service (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:96), and the consumer is Identity's ConferenceUserDataExportSection, an IUserDataExportSection (MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Application/Users/UseCases/ExportUserData/ConferenceUserDataExportSection.cs:19-20). That section deliberately does not catch transport failures: the export handler wraps every section, so an unreachable Conference peer degrades only this section to unavailable instead of failing the whole export (ConferenceUserDataExportSection.cs:12-15). That per-section degradation, not an empty-document stub, is the answer when the Conference peer is unreachable (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:80-86).

  • Asynchronous notifications (outbound). Two families of integration event leave the module. When Conference links or unlinks a Speaker to or from an Identity User (the manual link command, or the automatic email-match triggered by Identity's UserRegistered event), it publishes SpeakerLinkedToUser / SpeakerUnlinkedFromUser (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/IntegrationEvents/SpeakerLinkedToUser.cs:17 and .../IntegrationEvents/SpeakerUnlinkedFromUser.cs:19), records extending BaseIntegrationEvent and carrying just the two identifiers. Identity subscribes and sets or clears User.LinkedSpeakerId, so the next JWT refresh carries the speaker_id claim (BR-209). When an attendee submits feedback, the answer handlers raise SessionFeedbackSubmitted / EventFeedbackSubmitted (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/IntegrationEvents/SessionFeedbackSubmitted.cs:21, .../Events/IntegrationEvents/EventFeedbackSubmitted.cs:20), which Engagement consumes to award points. All four declare their wire name explicitly with EventNameAttribute, versioned ("Conference.SpeakerLinkedToUser.v1" at SpeakerLinkedToUser.cs:16, "Conference.SessionFeedbackSubmitted.v1" at SessionFeedbackSubmitted.cs:20), so a rename of the C# type cannot silently break a subscriber. Two details in the two feedback records are load-bearing: they are raised on the create path only, never on the BR-107 update path of the feedback upsert, and the consumer is independently idempotent because one submitted form writes one row per question and therefore raises the event once per new answer (SessionFeedbackSubmitted.cs:9-14). They are also added to the aggregate pre-save with AddDomainEvent, so the outbox captures them atomically with the answer in the same SaveChangesAsync (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/AddSessionQuestionAnswer/AddSessionQuestionAnswerHandler.cs:124). All four are the eventually consistent replacement for what would otherwise be direct cross-module service calls: the links and the points ledger survive the service split because they travel as events over the broker (ADR-006/ADR-008).

End-to-end: one organizer action

To see the chapter cooperate, follow an organizer renaming a room on an event. The application handler loads the Event aggregate (with its Rooms hydrated by the navigation populator), calls event.UpdateRoom(...) (Event.cs:437), which routes through the private GetRoomOrNotFound helper (Event.cs:449, implemented at Event.cs:735-738 and delegating to the framework's GetChildOrNotFound, so a missing or soft-deleted room comes back as a NotFound Result rather than an exception), re-checks the case-insensitive room-name uniqueness rule that mirrors the database index (Event.cs:453, implemented at Event.cs:716-733), delegates to the child's own Room.Update(...) (which validates its invariants, Event.cs:457), and on success raises a RoomChanged Updated event (Event.cs:461). The handler calls SaveChangesAsync; the interceptor writes the RoomChanged to the outbox in the same transaction. The command itself is a plain record that declares no ICacheInvalidating marker (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/UpdateRoom/UpdateRoomCommand.cs:15-24); its trailing RowVersion is the room's concurrency token from If-Match, stamped on the tracked room rather than on the event because the room is the child being edited (UpdateRoomCommand.cs:14). With no marker, the decorator pipeline evicts no query-cache prefix for it; read freshness is handled at the HTTP layer, where the controller's class-level [EvictOutputCache(...)] attribute names the rooms, sessions and events tags (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/RoomsController.cs:103). The HTTP output cache in front of those reads has its own single vocabulary, ConferenceCacheTags (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Caching/ConferenceCacheTags.cs:15): the per-aggregate tags ("conference:events", "conference:rooms", and so on, ConferenceCacheTags.cs:20-45) and the named policies the service host registers and the read controllers name (ConferenceCacheTags.cs:47-78), declared once because a policy and an eviction that spell a tag differently fail silently, leaving the stale entry to live out its TTL (ConferenceCacheTags.cs:3-8). Every policy also attaches the broad "conference" tag, and no write evicts it: each write evicts only the specific tags whose reads embed what it changed, because a root flush would empty the whole public read surface onto the database (ConferenceCacheTags.cs:9-14). No exception was thrown on the expected not-found path, no child was mutated from outside its aggregate, no event was hand-dispatched, and the same code path would behave identically whether Conference runs in the monolith or as its own service, which is exactly the property the framework groups (G01 through G14) exist to provide, here made concrete in a domain you can reason about. For the why behind each design choice, ADR-001 (manual mapping), ADR-002 (navigation populators), ADR-003 (outbox), ADR-005 (soft-delete versus erasure), ADR-006/ADR-007/ADR-008 (database-per-service, gRPC extraction, service topology), ADR-020 (permission-based authorization), ADR-031 (feature flags), and ADR-035 (optimistic concurrency) are the primary references; the business rules themselves are catalogued in ADC's specifications guide.

AssemblyReference, ClassReference

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/AssemblyReference.cs:5 · Level 0 · class (static) + class

  • What it is: the two assembly-marker types that give typeof()-based assembly scanning a stable handle on the MMCA.ADC.Conference.Domain assembly. No behavior, no state beyond the reflection handle.
Type File:Line Notes (what differs)
AssemblyReference MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/AssemblyReference.cs:5 static class exposing Assembly (typeof(AssemblyReference).Assembly, line 7) and AssemblyName (line 8, Assembly.GetName().Name ?? string.Empty)
ClassReference MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/AssemblyReference.cs:11 a one-line empty public class ClassReference { }, a handle for APIs that want a type rather than an Assembly
  • Depends on: nothing first-party; only System.Reflection (AssemblyReference.cs:1).
  • Concept introduced, the assembly-marker pattern. [Rubric §2, Design Patterns] (assesses whether the patterns in use are idiomatic and solve a real problem): instead of hard-coding an assembly-name string, a scanner takes a typeof(...) from a type it knows lives in the target assembly, so renaming the assembly cannot silently break discovery. Every layer of every ADC module ships this same pair (see the sibling pairs in group-18 Conference.Application, group-19 Conference.Infrastructure, and group-20 Conference.API), so registration and discovery code reads the same way in every project. MMCA.Common ships the same pair in its own layers (for example MMCA.Common/Source/Presentation/MMCA.Common.API/AssemblyReference.cs:8,20), and its doc comment there records the split explicitly: ClassReference is the marker for the case where a type reference is needed for assembly scanning rather than an assembly reference (MMCA.Common/Source/Presentation/MMCA.Common.API/AssemblyReference.cs:17-19).
  • Walkthrough: AssemblyReference.Assembly (AssemblyReference.cs:7) is a public static readonly Assembly; AssemblyName (AssemblyReference.cs:8) is its short name, falling back to string.Empty when reflection returns null. ClassReference (AssemblyReference.cs:11) has no members at all.
  • Why it's built this way: a typeof() handle is refactor-safe where a magic string is not, and a non-static ClassReference can be passed where a static class cannot. A C# static type is not a legal generic type argument, so a generic scanning API such as services.ScanModuleApplicationServices<ClassReference>() (used by the Application-layer sibling at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/DependencyInjection.cs:141) needs the non-static form.
  • Where it's used: the Domain pair has no call site in MMCA.ADC/Source today. The layer pairs that are actually consumed are the Application one (Conference.Application/DependencyInjection.cs:130) and the framework's own (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:142, MMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.cs:70). The Domain pair exists so the layer-parallel convention holds across all five layers of the module.
  • Caveats / not-in-source: whether the convention is enforced (an architecture fitness rule requiring one pair per project) is not visible from these files; no test in MMCA.ADC/Tests references either type.

ConferenceCacheTags

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Caching · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Caching/ConferenceCacheTags.cs:15 · Level 0 · class (static)

  • What it is: the Conference module's output-cache vocabulary in one place: the named policies the service host registers and the read controllers name, and the tags those policies attach and the write controllers evict (class doc comment, ConferenceCacheTags.cs:3-8). Ten tag constants and eleven policy-name constants, all public const string, no behavior.
  • Depends on: nothing (no using at all, ConferenceCacheTags.cs:1).
  • Concept introduced, the shared cache-tag catalog as a correctness contract. [Rubric §12, Performance & Scalability] (assesses whether caching is deliberate, invalidated correctly, and bounded): tag-based output caching has a quiet failure mode that the doc comment names directly. A policy and an eviction that spell a tag differently fail silently, because the stale entry simply lives out its TTL (ConferenceCacheTags.cs:6-7); no exception, no log line. Declaring every tag and policy name once, and making both sides read the constant, turns that silent drift into a compile error. The mechanism itself (the policies, [EvictOutputCache], the public-endpoint policy that caches despite an Authorization header) is framework infrastructure taught in G12 (EvictOutputCacheAttribute, PublicEndpointOutputCachePolicy) and decided in ADR-026 and ADR-040; this type is ADC's consumer-side catalog.
  • Walkthrough
    • Tags: the broad Conference = "conference" (ConferenceCacheTags.cs:18), then one per read family in the conference:{resource} shape: Events (:21), Sessions (:24, which also covers reads that embed session data), Speakers (:27), Rooms (:30), Categories (:33), Questions (:36), Sponsors (:39), Partners (:42), and Activities (:45).
    • Policy names: one public policy per read family, EventsPolicy = "EventsCache" (:48) through ActivitiesPolicy = "ActivitiesCache" (:72), and two short-lived ones, NowNextPolicy (:75) for the now-next snapshot and BookmarkCountsPolicy (:78) for the per-session bookmark counts. There is no policy on the built-in default semantics: every name in the catalog backs an ADR-040 public-endpoint policy, and the permission-gated SessionSelectionController carries no output-cache attribute at all.
  • Why it's built this way: the remarks (ConferenceCacheTags.cs:9-14) record the eviction discipline. Every policy attaches the broad Conference tag, so every Conference read can be dropped at once, but no write evicts it: each write evicts exactly the specific tags whose cached reads embed data it changed (visibility included, so a publish evicts every event-scoped tag), because a root flush would empty the whole public read surface onto the database at once.
  • Where it's used
    • Registration: the Conference service host registers every policy inside ConfigureOutputCache (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:142-215), each tagged with the broad Conference tag plus its family tag. The family policies use AddPublicEndpointPolicy with a 5-minute TTL and the privileged-reader bypass list from ConferenceReadAudience (Program.cs:172-173, Program.cs:191-197); SessionsPolicy is registered as an explicit PublicEndpointOutputCachePolicy so it can additionally bypass callers holding ConferencePermissions.SessionAssetsManage, because SessionAssetsController's GET answers such a caller with the materials of sessions the public cannot see (Program.cs:179-190). NowNextPolicy takes a 60-second TTL and no bypass list, since its payload is published data identical for every role (Program.cs:198-200), and BookmarkCountsPolicy a 60-second TTL with the bypass list, tagged Sessions (Program.cs:214).
    • Eviction: write endpoints name the tags in [EvictOutputCache(...)]; for example EventLifecycleController evicts Events, Sessions, Speakers, Rooms, Sponsors, Partners, and Activities on publish (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/EventLifecycleController.cs:61-68), and Events, Sessions, Speakers, Categories, Rooms, and Questions on a Sessionize refresh (EventLifecycleController.cs:127-133). Writes that never pass through a controller reach the cache by publishing OutputCacheEvictionRequested, which the host's AddOutputCacheEvictionHandler evicts on arrival, with the TTLs as the backstop for a message that never lands (Program.cs:157-163, registered at Program.cs:259).
    • Reads: the Conference read controllers name the policy constants on their GET actions (the usage scan lists EventsController, CategoryItemsController, ConferenceCategoriesController, ActivitiesController, EventSpeakersController, RoomsController, PartnersController, QuestionsController, SessionAssetsController, SessionCategoryItemsController, and others).
  • Caveats / not-in-source: the constants guarantee only that both sides spell a tag the same way; whether every write evicts every tag its change touches is a per-endpoint judgment the type cannot enforce.

ConferencePermissions

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Authorization · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferencePermissions.cs:9 · Level 0 · class (static)

  • What it is: the Conference module's capability permission catalog: the stable string identifiers its endpoints require through [HasPermission(...)] instead of role names. Eleven manage capabilities, one link capability, plus two curated groupings of them.
  • Depends on: nothing first-party.
  • Concept reinforced, capability permissions over role names (the consumer side). [Rubric §11, Security] (assesses whether authorization is expressed as fine-grained capabilities rather than coarse role checks scattered through controllers). This is ADC's use of the framework mechanism taught in G08 (IPermissionRegistry, HasPermissionAttribute) and decided in ADR-020. The class doc comment (ConferencePermissions.cs:3-8) states the two properties that make the catalog work: who-can-do-what is decided by the role-to-permission grants declared in the module's registration rather than by controller attributes, and the values are deliberately stable strings because they may end up inside tokens or logs.
  • Walkthrough
    • Ten public const string capabilities named EventsManage = conference:events:manage (ConferencePermissions.cs:12), SessionsManage (:15), SpeakersManage (:18), RoomsManage (:21), CategoriesManage (:24), QuestionsManage (:27), SessionSelectionManage = conference:session-selection:manage (:30), SponsorsManage = conference:sponsors:manage (:33), PartnersManage = conference:partners:manage (:36), and ActivitiesManage = conference:activities:manage (:39), plus an eleventh added under ADR-123, SessionAssetsManage = conference:session-assets:manage (:47). A twelfth, SpeakersLink = conference:speakers:link (:55), is the one non-manage verb: its doc comment (:49-54) explains that linking the application user behind a speaker (BR-209) grants a speaker identity (the linked user then carries the speaker claim that unlocks raw session feedback, poll management and question moderation), so it is Organizer-only and deliberately absent from ContentManagement. The {module}:{resource}:{verb} shape keeps the namespace collision-free across modules. SessionAssetsManage's doc comment (:41-46) states the asymmetry that makes it necessary: a speaker needs no capability to manage the materials of a session they present, because the handlers accept them on the strength of the session's own speaker list, and this capability is what lets an organizer or content editor do the same for a session they do not present.
    • All (ConferencePermissions.cs:58-72): an IReadOnlyList<string> collection expression naming all twelve, for granting the entire capability set to a role in one line.
    • ContentManagement (ConferencePermissions.cs:79-88): the catalog-curation subset, SessionsManage + SpeakersManage + CategoriesManage + SponsorsManage + PartnersManage + ActivitiesManage + SessionAssetsManage. Its doc comment (ConferencePermissions.cs:74-78) is the load-bearing part: a content-editor role holds these but not event structure, rooms, questions, session selection, or speaker-account linking, a distinction that capability checks express centrally and role checks cannot.
  • Why it's built this way: a per-module catalog keeps each module's capability vocabulary self-contained (the Conference module can add a capability without touching Identity), and pairing the constants with named subsets makes the grants read declaratively at the registration site instead of as a hand-maintained string list. Adding a capability is then a two-line change: the constant, and its entry in whichever subsets should carry it, exactly the shape SessionAssetsManage followed when session assets shipped.
  • Where it's used: every Conference controller's [HasPermission(...)] attributes, and the role-to-permission grants applied by ConferencePermissionGrants: Organizer receives [.. ConferencePermissions.All] and ContentEditor receives [.. ConferencePermissions.ContentManagement], all through RoleNames.

EventErrorCodes

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventErrorCodes.cs:7 · Level 0 · class (static)

  • What it is: the catalog of event error codes a caller branches on. Today it holds one constant, SessionizeUnavailable = "Event.Sessionize.Unavailable" (EventErrorCodes.cs:14), the code for "the Sessionize feed could not be obtained" (the API is unreachable, or the feed is unreadable or over the size ceiling). It is raised as an Error.Unavailable, so the refresh endpoint answers 503 through the framework's failure mapping (EventErrorCodes.cs:9-13).
  • Depends on: nothing.
  • Concept introduced, the shared error-code constant across the layers that emit and check it. [Rubric §15, Best Practices & Code Quality] (a fact written once, reused everywhere it is checked) and [Rubric §9, API & Contract Design] (status codes that tell the caller what actually happened): the status comes from the error type (Unavailable, answered as 503), while the code is the stable, machine-readable identity of which failure happened, the thing a caller or a test branches on. The class doc comment states why the code is a shared constant rather than a literal on each side: a rename on one side then fails the build on the other (EventErrorCodes.cs:3-6).
  • Walkthrough: one public const string (EventErrorCodes.cs:14) with a dotted Event.Sessionize.Unavailable value; the class is the home for any further event code a caller has to branch on.
  • Why it's built this way: an upstream outage is not the caller's fault and not a server bug in ADC, so 503 Service Unavailable is the honest answer, and it lets the organizer UI tell "Sessionize is down, try later" apart from a validation failure or a throttled refresh (BR-63), which the same base mapping answers as 429 with a Retry-After header (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/EventLifecycleController.cs:119-123). Because the status follows the error type, the outage answer gets the same localized, structured ProblemDetails as every other failure, and a constant code rather than a message string keeps the failure identifiable while the message text varies (the handler emits two different messages under the same code).
  • Where it's used: emitted as Error.Unavailable by RefreshFromSessionizeHandler when the Sessionize call fails or the feed is unparseable (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RefreshFromSessionize/RefreshFromSessionizeHandler.cs:127-131) and by SessionizeService when the feed exceeds its size ceiling (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Events/Sessionize/SessionizeService.cs:87-89). EventLifecycleController.RefreshAsync does not read the code: it sends every failure through HandleFailure (EventLifecycleController.cs:142). Pinned by RefreshFromSessionizeHandlerTests, SessionizeServiceSizeCeilingTests, and EventLifecycleControllerTests in MMCA.ADC/Tests/Modules/Conference.
  • Caveats / not-in-source: the class doc comment still describes a controller "that maps them to a status code" (EventErrorCodes.cs:4-5), but in source the status is mapped by error type and no production code outside the two emitters reads the constant.

RefreshFromSessionizeResultDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/RefreshFromSessionizeResultDTO.cs:7 · Level 0 · record (sealed)

  • What it is: the response DTO for the Sessionize refresh endpoint (POST /Events/{id}/refresh, UC-6). It reports per-entity sync counts plus a list of non-fatal warnings, so an organizer can confirm what was actually imported.
  • Depends on: nothing first-party (BCL only).
  • Concept introduced, the informative mutation response. [Rubric §9, API & Contract Design] (assesses stable, useful response contracts): rather than returning 204 No Content for a bulk sync, the endpoint returns counts so the caller can verify that the expected number of sessions, speakers, and categories landed. This is the read-back shape of a bulk write. [Rubric §13, Observability & Operability] also applies in the small: the Warnings list turns silent partial-import oddities into something an operator can read off the response.
  • Walkthrough: eight required init properties (RefreshFromSessionizeResultDTO.cs:10-31). Six are int counts, CategoriesSynced (line 10), CategoryItemsSynced (line 13), RoomsSynced (line 16), QuestionsSynced (line 19), SpeakersSynced (line 22), and SessionsSynced (line 25). SkippedSoftDeleted (line 28) counts entities that a sync re-encountered but did not restore because the app had soft-deleted them (BR-136). Warnings (line 31) is an IReadOnlyList<string> of non-fatal issues such as a duration violation or a date-range mismatch. Every property is required, so a partial or forgotten field cannot be constructed.
  • Why it's built this way: SkippedSoftDeleted is surfaced explicitly because an organizer who soft-deleted a session and then re-ran a sync would otherwise be puzzled why the count does not match Sessionize. The handler even folds that count into the warning list when it is non-zero (RefreshFromSessionizeHandler.cs:203-206).
  • Where it's used: built by the RefreshFromSessionizeCommand handler, which reads the per-strategy SessionizeSyncResult values and the shared sync context into it (RefreshFromSessionizeHandler.cs:216-226), with an all-zero instance returned when Sessionize sends an empty response (RefreshFromSessionizeHandler.cs:151-161). Returned by EventLifecycleController.RefreshAsync (EventLifecycleController.cs:134, whose [Idempotent] attribute replays the first response for a retried Idempotency-Key rather than starting a second import, EventLifecycleController.cs:126) and surfaced to the organizer UI through EventService.RefreshFromSessionizeAsync (EventService.cs:87-96), which the EventDetail page holds as _refreshResult (EventDetail.razor.cs:89, assigned at :254).

SessionizeCodeFormat

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/SessionizeCodeFormat.cs:27 · Level 0 · class (static partial)

  • What it is: the single validator for a Sessionize event code, a short string an organizer types into EventDTO.SessionizeCode to link an ADC event to the matching event in Sessionize for import.
  • Depends on: nothing first-party (BCL Regex/GeneratedRegex only).
  • Concept introduced, the shared shape validator behind a generated regex. [Rubric §15, Best Practices & Code Quality] (a fact written once, reused everywhere a code is checked): MaxLength and Pattern are the two constants that define "well-formed", and IsValid is the one place that applies them, so Conference.Application's command validation and the Sessionize import service both call the same check instead of each re-deriving the regex. [Rubric §12, Performance & Scalability] also applies narrowly: [GeneratedRegex] (SessionizeCodeFormat.cs:52) compiles the pattern at build time rather than at first use.
  • Walkthrough
    • MaxLength = 64 (SessionizeCodeFormat.cs:30), kept in step by hand with the literal repetition count inside Pattern, because a regex attribute argument has to be a compile-time literal and cannot reference the constant; SessionizeCodeFormatTests pins the two together (remarks, SessionizeCodeFormat.cs:28-29).
    • Pattern = @"\A[A-Za-z0-9_-]{1,64}\z" (SessionizeCodeFormat.cs:41): one to 64 ASCII letters, digits, underscores or hyphens. Anchored with \A/\z rather than ^/$ on purpose, $ also matches immediately before a trailing newline, so the conventional anchors would let a string like "adc2026\n" through and admit a whitespace character (remarks, SessionizeCodeFormat.cs:36-40).
    • IsValid(string? sessionizeCode) (SessionizeCodeFormat.cs:49-50), a [NotNullWhen(true)]-annotated bool method: null is never well formed, and callers that treat an absent code as "no import configured" test for that separately (param doc, SessionizeCodeFormat.cs:46-47).
    • Matcher (SessionizeCodeFormat.cs:52-53): a private GeneratedRegex property with RegexOptions.CultureInvariant and a 1000ms match timeout.
  • Why it's built this way: generating the regex at compile time and capping the match timeout keeps a hostile or malformed input from degrading into pathological backtracking, while the \A/\z anchor choice closes the trailing-newline gap that ^/$ would leave open.
  • Where it's used: called from EventSessionizeCodeRules<T> (EventValidationRules.cs:191,194, Conference.Application) to validate a submitted SessionizeCode and from SessionizeService (Conference.Infrastructure) during import.

EventQuestionAnswerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventQuestionAnswerDTO.cs:9 · Level 1 · record (class)

  • What it is: the read/write DTO for one event-level question answer, linking an event to a metadata question with the answer text a speaker or organizer supplied. It is one of the three child-collection DTOs that EventDTO composes.
  • Depends on: IBaseDTO<TIdentifierType> (EventQuestionAnswerDTO.cs:1,9), closed over EventQuestionAnswerIdentifierType; the foreign-key fields use the EventIdentifierType and QuestionIdentifierType aliases.
  • Concept introduced, the child-collection DTO. The DTO shape and the IBaseDTO<TIdentifierType> contract were taught in group-12; this is the family of child DTOs that an aggregate DTO composes. [Rubric §9, API & Contract Design] (DTOs decoupled from domain entities, stable contracts): this record is the wire shape clients see, and the EventQuestionAnswer join entity never crosses the boundary. Cross-aggregate references appear as scalar foreign keys (QuestionId), never nested objects, consistent with database-per-service (ADR-006), where the related aggregate may live in a different database.
  • Walkthrough: four required init properties (EventQuestionAnswerDTO.cs:12-21), Id (the strong id alias, line 12), EventId (foreign key to the parent event, line 15), QuestionId (foreign key to the question, line 18), and AnswerValue (the answer text, line 21). Being a record class with all-required members, it cannot be partially constructed and is immutable after creation.
  • Why it's built this way: modelling the join as a flat DTO with scalar foreign keys keeps the contract stable and portable across a process boundary, and it is the same shape the sibling child DTOs use.
  • Where it's used: nested in EventDTO.EventQuestionAnswers (EventDTO.cs:109); mapped from the EventQuestionAnswer entity by EventQuestionAnswerDTOMapper (group-18).

EventSpeakerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventSpeakerDTO.cs:8 · Level 1 · record (class)

  • What it is: the thinnest of the event child DTOs, the many-to-many join row between an event and a speaker.
  • Depends on: IBaseDTO<TIdentifierType> (EventSpeakerDTO.cs:1,8) closed over EventSpeakerIdentifierType; the foreign keys use EventIdentifierType and SpeakerIdentifierType.
  • Concept: the same child-collection DTO shape introduced on EventQuestionAnswerDTO, a flat record class with required init members and scalar foreign keys. [Rubric §9, API & Contract Design].
  • Walkthrough: three required init properties (EventSpeakerDTO.cs:11-17), Id (line 11), EventId (foreign key to the parent event, line 14), and SpeakerId (foreign key to the speaker, line 17). Nothing else: this row exists only to associate an Event with a Speaker.
  • Where it's used: nested in EventDTO.EventSpeakers (EventDTO.cs:106); mapped from the EventSpeaker entity by EventSpeakerDTOMapper (group-18).

EventDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/EventDTO.cs:16 · Level 2 · record (class)

  • What it is: the aggregate DTO for a conference event, the full wire shape a client reads or writes for the Event aggregate. It composes the three child collections (rooms, speaker associations, question answers) alongside the event's own scalar fields, its concurrency token, and the ten field-length constants the rest of the stack reads.
  • Depends on: IBaseDTO<TIdentifierType> and IConcurrencyAware (both implemented, EventDTO.cs:3,16); composes RoomDTO, EventSpeakerDTO, and EventQuestionAnswerDTO; carries QuestionModerationDefault.
  • Concept introduced, the aggregate DTO and the optimistic-concurrency round-trip on the wire. [Rubric §9, API & Contract Design] (aggregate DTOs compose child DTOs so a UI gets everything it needs in one call; mapping is manual or Mapperly-generated per ADR-001): EventDTO is the Level-2 composite that bundles the Level-1 children. [Rubric §8, Data Architecture] (optimistic concurrency): implementing IConcurrencyAware means the DTO round-trips the EF RowVersion token (EventDTO.cs:52), so an update form can detect a concurrent edit instead of silently overwriting one. The body-less publish and unpublish transitions carry the same token in an If-Match header rather than a body, which is why there is no transition request record here: EventLifecycleController.PublishAsync reads it via SupportsIfMatchAttribute.RequiredToken and answers a missing header with 428 and a stale token with 412 (EventLifecycleController.cs:57-72, :90-105).
  • Walkthrough
    • Length constants (EventDTO.cs:19-46): NameMaxLength = 500 (line 17), DescriptionMaxLength = 4000 (line 20), TimeZoneMaxLength = 100 (line 23), SessionizeCodeMaxLength = 100 (line 26), VenueAddressMaxLength = 500 (line 29), VenueMapUrlMaxLength = 2000 (line 32), WiFiInfoMaxLength = 500 (line 35), OrganizerContactEmailMaxLength = 255 (line 38), SponsorshipPacketUrlMaxLength = 2000 (line 41), and TicketingUrlMaxLength = 2000 (line 44).
    • Identity and concurrency: Id (required, EventDTO.cs:49) and RowVersion, a non-nullable byte[] defaulting to [] (EventDTO.cs:52), so a freshly constructed DTO carries an empty token rather than a null one.
    • Required core: Name (line 53), StartDate and EndDate (both DateOnly, lines 59 and 62), and TimeZone (line 65, the IANA id used to compute the live window).
    • Optional scalars: Description (line 56), SessionizeCode (line 68), VenueAddress (line 71), VenueMapUrl (line 74), WiFiInfo (line 77), OrganizerContactEmail (line 80, the contact published to attendees), SponsorshipPacketUrl (line 83, the published sponsorship packet for this edition), and TicketingUrl (line 86, where attendees buy tickets), all string?; plus IsPublished (line 89) and QuestionModerationDefault (line 92, BR-233).
    • Sessionize refresh audit: LastSessionizeRefreshOn (DateTime?, line 95) and LastSessionizeRefreshBy (string?, line 98), so the UI can show when the last import ran and who ran it.
    • Child collections (EventDTO.cs:103-109): Rooms, EventSpeakers, and EventQuestionAnswers, each an IReadOnlyCollection<> of the matching child DTO, each defaulting to an empty collection (= []) so an event with no children is safe to render.
  • Why it's built this way: composing the children inline lets a single GET /Events/{id} return the whole event graph without follow-up calls, and defaulting the collections to [] avoids null checks in the UI. The IConcurrencyAware token is the write-path guard that turns a lost update into a conflict instead of a silent overwrite. The constants live on the DTO for the reason its doc comment gives (EventDTO.cs:10-14): it is the lowest layer the domain, EF configuration, and Blazor pages can all reach.
  • Where it's used: produced by EventDTOMapper (group-18); it is the DTO type parameter of EventsController itself (EventsController.cs:45-54), so every inherited GetAll/GetById/Create action speaks it, and the same type parameter drives the UI's EntityServiceBase in EventService (EventService.cs:15-17). It is the concrete event model that CurrentEventDefaults binds CurrentEventSelector to. Its constants are re-exported by EventInvariants (EventInvariants.cs:19-46) and bound by the UI's EventFormModel [MaxLength] attributes (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Events/EventFormModel.cs:45-94) and the EventFormFields input counters (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Events/EventFormFields.razor:21, :28).

ConferencePermissionGrants

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Authorization · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferencePermissionGrants.cs:27 · Level 3 · class (static)

  • What it is: the Conference module's registration-side counterpart to ConferencePermissions: the one place that applies the catalog to roles by calling permissions.Grant(...) against a PermissionRegistryBuilder (G08).
  • Depends on: ConferencePermissions; RoleNames from the Identity module's Shared project (MMCA.ADC.Identity.Shared.Authorization, ConferencePermissionGrants.cs:1); and PermissionRegistryBuilder plus AdministrationPermissions from MMCA.Common.Shared.Auth.Permissions (ConferencePermissionGrants.cs:2, G08).
  • Concept reinforced, the grant list as the one place role and capability meet. [Rubric §11, Security]. Apply(PermissionRegistryBuilder permissions) (ConferencePermissionGrants.cs:49) is a single method with two grant lines: Organizer gets [.. ConferencePermissions.All, AdministrationPermissions.ManageFeatures] (:53) and ContentEditor gets [.. ConferencePermissions.ContentManagement] (:54). Attendees hold no Conference capability at all, so attendee-facing endpoints are authenticated-only, a plain [Authorize] carrying no capability, as the summary comment states (:31-32).
  • Walkthrough: the remarks (ConferencePermissionGrants.cs:34-47) call out why the ContentEditor row is the one that earns the pattern its keep: the distinction between "can edit the catalog" and "can manage everything" lives in this one grant rather than scattered across per-endpoint [Authorize(Roles = ...)] lists, and since ADR-123 ConferencePermissions.ContentManagement also carries SessionAssetsManage (:37-38), so a content editor can manage any session's materials without a separate grant. A speaker needs no grant at all: the handlers accept them on the strength of the session's own speaker list, data no role-to-permission table can express (:39-40). The second remarks paragraph (:41-46) explains the extra Organizer entry: AdministrationPermissions.ManageFeatures is the gate on this service's feature-flag administration (ADR-031). It is named in the grant rather than folded into ConferencePermissions.All because it is the framework's constant, not ADC's, and ContentEditor never holds it, because flipping a kill switch is an operator decision.
  • Why it's built this way: the class doc comment (ConferencePermissionGrants.cs:6-26) records the reason the map is a named type rather than a lambda inline in registration: two hosts apply the identical grants, Conference.Service to gate its own [HasPermission(...)] endpoints, and the token-minting Identity host so the access token it signs carries a permission claim per capability the caller's role holds. It lives in Shared because a grant map is a statement about the application's vocabulary, not one host's composition, and Shared is the only layer both hosts may reference; SharedLayerTests stays green despite the Identity reference because every RoleNames member is a const and leaves no reference in the compiled contract assembly (:20-24). ArgumentNullException.ThrowIfNull(permissions) (:51) fails fast if registration order ever changes and this method runs before the builder exists.
  • Where it's used: called from the Conference API's DependencyInjection during module registration and by the Identity host's token-minting path; the Conference AdminFeatureFlagsController points at this grant as the reason ManageFeatures reaches Organizer and never ContentEditor (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/FeatureFlags/AdminFeatureFlagsController.cs:17). The sibling modules follow the identical shape, EngagementPermissionGrants and NotificationPermissionGrants, and the Identity service's TokenPermissionGrants composes across all of them when minting a token.

ConferenceReadAudience

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Authorization · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Authorization/ConferenceReadAudience.cs:31 · Level 1 · class (static)

  • What it is: the Conference module's read-audience catalog. One member, PrivilegedRoles, names the two roles that read the whole catalog: RoleNames.Organizer and RoleNames.ContentEditor (ConferenceReadAudience.cs:34-38). Everyone else (attendees, speakers, anonymous visitors) sees the public projection: accepted-or-unset sessions (BR-49), published events (BR-108), and their speakers (BR-239), exactly as the class doc comment states (ConferenceReadAudience.cs:5-9).

  • Depends on: RoleNames from MMCA.Common.Shared.Auth (ConferenceReadAudience.cs:1), and nothing else. That is why it can live in Shared and be referenced from the Blazor UI as easily as from the service host.

  • Concept introduced, the read audience as a thing distinct from the capability permission. [Rubric §11, Security] (assesses fine-grained, data-scoped authorization rather than scattered coarse role checks). Two different questions get asked in this module, and this type answers only the second:

    • "May this caller change X?" is a capability question, answered by ConferencePermissions and enforced per endpoint with [HasPermission(...)].
    • "How much of the catalog may this caller see?" is a read-audience question. It cannot be a per-endpoint attribute, because the answer changes the rows rather than the verdict: the same anonymous-allowed GET must return a narrower list. So the audience is declared once, here, and every read path compares against it.

    The API-layer helper that wraps it spells the boundary out in its doc comment: the check is about read visibility, not authorization, and mutations stay gated by capability permissions that a role check must never stand in for (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Authorization/CurrentUserServiceExtensions.cs:18-27). [Rubric §12, Performance & Scalability] applies for a less obvious reason: the same list drives the output-cache bypass introduced by ADR-040, so this audience definition doubles as a cache-correctness invariant (see Where it's used).

  • Walkthrough: one member. PrivilegedRoles (ConferenceReadAudience.cs:34-38) is a static IReadOnlyList<string> initialized with a collection expression of the two role-name constants. There are no methods and no state; callers do the matching themselves with Any(...IsInRole).

  • Why it's built this way: the remarks (ConferenceReadAudience.cs:10-21) name the exact failure a single declaration prevents. The output-cache bypass list and the API-layer visibility checks must name the same roles; if the two lists drifted apart, a privileged caller's everything-inclusive response would land in a shared public cache entry and then be served to anonymous visitors. Declaring the audience once makes that drift impossible instead of merely unlikely. The second paragraph records what keeps the list at exactly two entries: a third, partially privileged audience would need its own cache key, so extending this list means revisiting the cache policies in the Conference service first.

  • Where it's used: three layers, one definition.

    • The Conference service host spreads it into adminBypassRoles (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:172) and hands that array to ten named output-cache policies (Program.cs:173-214: EventsCache, SessionsCache, SpeakersCache, RoomsCache, CategoriesCache, QuestionsCache, SponsorsCache, PartnersCache, ActivitiesCache, BookmarkCountsCache). The comment directly above states the single-source-of-truth rule and its consequence: if the two lists ever named different roles, a privileged payload would be cached and served to the public (Program.cs:169-171). One policy deliberately takes no bypass list, NowNextCache (Program.cs:200), because its payload is identical for every role.
    • The API layer wraps it as the ICurrentUserService extension IsPrivilegedConferenceReader() (CurrentUserServiceExtensions.cs:26-27), which the controllers use to decide whether to apply a public filter specification at all: EventsController picks null or a PublishedEventSpecification from it (.../Controllers/EventsController.cs:75, with a second guard at :141), and SessionsController (:60), SpeakersController (:65), SponsorsController (:52), ActivitiesController (:52), RoomsController (:104), SessionSpeakersController (:59), SessionCategoryItemsController (:59), SpeakerCategoryItemsController (:59), and EventSpeakersController (:58) each expose it as a private IsPrivileged property.
    • The Blazor UI reads it directly when sizing its filters and detail views: .../MMCA.ADC.Conference.UI/Pages/Public/PublicSessionList.razor.cs:121, .../PublicSpeakerList.razor.cs:101, .../PublicEventList.razor.cs:77, .../PublicEventDetail.razor.cs:64, and .../PublicSpeakerDetail.razor.cs:205.

    The rows themselves are narrowed one layer up by PublicConferenceVisibility and the public filter specifications built on it (G18).

  • Caveats / not-in-source: case-insensitive role comparison is a property of ICurrentUserService.IsInRole, not of this type. Whether a given JWT actually carries one of these roles is decided by the Identity module and is not visible from this file.


CurrentEventSelector

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/CurrentEventSelector.cs:13 · Level 8 · class (static)

  • What it is: a static, generic helper that picks which event a landing surface should feature (live now, else the next upcoming, else the most recently ended) using the same live-window math the backend enforces. It also owns the window's opening time, DayOneStartLocalTime (08:00 local), and exposes the window computation and the DST-safe local-to-UTC conversion as public methods.
  • Depends on: nothing first-party (BCL TimeZoneInfo, DateOnly/DateTime, LINQ). It is generic over the caller's event model via accessor delegates.
  • Concept introduced, the shared selection algorithm parameterized by accessors. [Rubric §34, Architecture Governance & Documentation] and [Rubric §1, SOLID] (one algorithm serving many callers without a shared base type): several surfaces need "which event is current", the ADC home page, the Engagement live-event service, the Conference list pages, and two server-side handlers, and they do not all hold the same event model (the home page deserializes its own anonymous-endpoint shape). Rather than duplicate the classify-and-rank logic, SelectCurrentOrNext<TEvent> takes Func<TEvent, ...> accessors for start date, end date, and time-zone id, so it works over any shape without coupling to a concrete type. [Rubric §27, Internationalization] also applies: the window math is computed per the event's IANA time zone, never per server local time.
  • Walkthrough
    • DayOneStartLocalTime (CurrentEventSelector.cs:22), a static readonly TimeOnly of 08:00: the local wall-clock time the live window opens on the event's first day, chosen as the earliest on-site live activity (the registration desk). Its doc comment records the point of declaring it once: every surface reads the window from GetLiveWindowUtc, so the home countdown, the event pickers, the now-next snapshot, the MCP reader, and the server live gate (polls, questions, check-ins) all open at the same instant (CurrentEventSelector.cs:15-21).
    • SelectCurrentOrNext<TEvent>(events, startDate, endDate, timeZoneId, utcNow) (CurrentEventSelector.cs:34-65, constrained where TEvent : class): projects each event to its (StartUtc, EndUtc) window via GetLiveWindowUtc (CurrentEventSelector.cs:42-48), then applies the preference order. Live events (StartUtc <= utcNow && utcNow < EndUtc) ordered by soonest to end (CurrentEventSelector.cs:50-54), else upcoming events (StartUtc > utcNow) ordered by soonest to start (CurrentEventSelector.cs:56-60), else the most recently ended event (OrderByDescending(EndUtc), CurrentEventSelector.cs:64). Returns null when events is empty. Ties resolve by input order because LINQ's OrderBy is a stable sort (doc comment, CurrentEventSelector.cs:11).
    • GetLiveWindowUtc(startDate, endDate, timeZoneId) (CurrentEventSelector.cs:77-87): computes startLocal as StartDate at DayOneStartLocalTime, 08:00 (CurrentEventSelector.cs:82), and endLocal as EndDate + 1 day at 00:00 (CurrentEventSelector.cs:83), resolves the zone with TimeZoneInfo.FindSystemTimeZoneById (CurrentEventSelector.cs:85) and converts both through ToUtc (CurrentEventSelector.cs:86). There is no catch around the zone lookup: the doc comment states the id always resolves because EventInvariants.EnsureTimeZoneIsValid guards every write path (CurrentEventSelector.cs:67-71, and the guard itself at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventInvariants.cs:130-143), so an unresolvable id is a data defect that must surface rather than be silently absorbed. The returned tuple names its second element EndExclusiveUtc (CurrentEventSelector.cs:77), a reminder that the end bound is exclusive.
    • ToUtc(localWallClock, timeZone) (CurrentEventSelector.cs:100-111): the DST guard. The window end lands on local midnight, which is inside the spring-forward gap in zones that transition at 00:00 (the doc comment names America/Santiago and Asia/Beirut, CurrentEventSelector.cs:89-96); that wall time never existed, so a raw TimeZoneInfo.ConvertTimeToUtc would throw. The method null-guards the zone (CurrentEventSelector.cs:102), re-kinds the input as Unspecified (CurrentEventSelector.cs:104), and shifts an invalid time forward by one hour into the hour that did exist (CurrentEventSelector.cs:105-108) before converting (CurrentEventSelector.cs:110). Ambiguous (fall-back) times resolve to the zone's standard offset, which is ConvertTimeToUtc's own behavior.
  • Why it's built this way: the accessor-delegate design lets one vetted implementation of the "current event" rule serve every surface, so the home page, the live layer, and the list-page default filter can never disagree about which event is featured. Colocating GetLiveWindowUtc and its opening time here keeps the window definition identical to the one EventLiveInfo advertises (the class doc comment points at that record, CurrentEventSelector.cs:7, and that record's doc comment points back at DayOneStartLocalTime, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/EventLiveInfo.cs:7). The home page's countdown reads its window from GetLiveWindowUtc rather than converting the boundaries itself, so it opens at the same instant as the server live gate (ADCHome.razor.cs:342-345). ToUtc stays public, but in ADC source its only caller is GetLiveWindowUtc itself; its doc comment notes that the calendar export and the reminder planner apply the same shift rule (CurrentEventSelector.cs:93-94).
  • Where it's used: the Conference ADCHome page (ADCHome.razor.cs:216 for the selection, ADCHome.razor.cs:345 for the window); the shared EventFilteredListPageBase, which resolves the default event filter once for every list page that derives from it (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Common/EventFilteredListPageBase.cs:192-200); the pages that call it directly, PublicActivityList (PublicActivityList.razor.cs:80), PublicEventList (PublicEventList.razor.cs:90), PublicSponsorList (PublicSponsorList.razor.cs:79), SpeakerDashboard (SpeakerDashboard.razor.cs:236), and SessionSelectionDashboard (SessionSelectionDashboard.razor.cs:96); the UI wrapper EventInfoDefaults, which binds the accessors for the EventInfo lookup shape (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Services/Events/EventInfoDefaults.cs:20-30) and serves the create pages ActivityCreate (ActivityCreate.razor.cs:56), PartnerCreate (PartnerCreate.razor.cs:55), RoomCreate (RoomCreate.razor.cs:54), SessionCreate (SessionCreate.razor.cs:74), and SponsorCreate (SponsorCreate.razor.cs:55); PublicSessionDetail, which reads the window directly (PublicSessionDetail.razor.cs:309); the Engagement LiveEventService, which uses both SelectCurrentOrNext and GetLiveWindowUtc (LiveEventService.cs:30, LiveEventService.cs:75); and server-side by GetNowNextHandler, which resolves the current event and its window for the Now/Next query (GetNowNextHandler.cs:109, GetNowNextHandler.cs:76), by ConferenceMcpReader for its live window (ConferenceMcpReader.cs:351), and by EventLiveValidationService itself, which delegates rather than repeating the math (EventLiveValidationService.cs:295). Callers holding an EventDTO usually go through the CurrentEventDefaults wrapper instead.

CurrentEventDefaults

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/CurrentEventDefaults.cs:8 · Level 9 · class (static)

  • What it is: a thin convenience wrapper over CurrentEventSelector specialized to the EventDTO shape, so the pages and services that already work with EventDTO do not repeat the same accessor lambdas.
  • Depends on: CurrentEventSelector, EventDTO.
  • Concept, the type-specialized wrapper (DRY over the generic helper). [Rubric §15, Best Practices & Code Quality]: the generic CurrentEventSelector.SelectCurrentOrNext<TEvent> needs three accessor delegates on every call. Since many callers pass EventDTO, this wrapper binds those lambdas once, so a call site shrinks to SelectCurrentOrNext(events, utcNow).
  • Walkthrough: one method, SelectCurrentOrNext(IEnumerable<EventDTO> events, DateTime utcNow) (CurrentEventDefaults.cs:17), which forwards to CurrentEventSelector.SelectCurrentOrNext with the three EventDTO accessors e => e.StartDate, e => e.EndDate, e => e.TimeZone (CurrentEventDefaults.cs:18-23) and returns the selected EventDTO? (null when the input is empty). No other logic: all the ranking lives in the generic helper. The doc comment notes that callers pass the role-appropriate candidate set (CurrentEventDefaults.cs:14), so filtering to published events stays the caller's job.
  • Why it's built this way: keeping the EventDTO accessors in one place means renaming an EventDTO date or time-zone property is a single edit here, not a change scattered across every page that defaults an event filter.
  • Where it's used: PublicSessionEventCatalog, which sets the public session list's default selected event id (PublicSessionEventCatalog.cs:173), PublicSpeakerDetail (PublicSpeakerDetail.razor.cs:256), and server-side ConferenceMcpReader (ConferenceMcpReader.cs:374). Callers passing a non-EventDTO model call the generic CurrentEventSelector directly.

EventLiveInfo

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.Live · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/EventLiveInfo.cs:22 · Level 0 · record (sealed)

  • What it is: an immutable snapshot of one event's live-window facts: whether the event is published, and the UTC start and (exclusive) end of its live window, plus two optional display facts (the event's name and first day). It is what the Engagement live layer reads to decide "is this conference happening right now" without ever touching Conference's Event aggregate.
  • Depends on: nothing first-party (BCL bool/DateTime/DateOnly/string only).
  • Concept introduced, the cross-module live-window snapshot. [Rubric §7, Microservices Readiness] (assesses whether a module exposes a small, stable contract instead of leaking its internal entities across a boundary): rather than shipping the whole Event entity to another module (or, after extraction, another process), Conference does the time-zone arithmetic once, server-side, and hands back plain values. The consumer then compares them against DateTime.UtcNow with no time-zone logic of its own (doc comment, EventLiveInfo.cs:3-9). The window is derived from the event's StartDate/EndDate and its IANA time zone: start is StartDate at 00:00 local, end (exclusive) is EndDate + 1 day at 00:00 local, both converted to UTC. [Rubric §9, API & Contract Design] (a narrow, purpose-built contract) also applies: this record carries what a consumer needs to gate a live feature, plus the two display facts the ticket-invite email needs, and nothing more.
  • Walkthrough: a positional sealed record (EventLiveInfo.cs:22-27) with three required parameters, IsPublished (bool), LiveWindowStartUtc and LiveWindowEndUtc (both DateTime, the end being exclusive per the param docs on EventLiveInfo.cs:17-19), followed by two optional ones: Name (string, defaulting to "") and StartDate (DateOnly, the event's first day in its own time zone, defaulting to default) (EventLiveInfo.cs:26-27, param docs :19-20). The doc comment explains why those two are optional and last: they are display facts read by Engagement's ticket-holder invites (BR-270) for the email subject and body, and a payload from a peer that predates them reads as the empty name and the default date, which a consumer that needs them treats as unavailable (EventLiveInfo.cs:10-15). There is no behavior: the type is a pure value carrier, and being a record it gets structural equality for free.
  • Why it's built this way: keeping the "when is an event live" definition in the owning module and putting only UTC instants on the wire means the rule lives in exactly one place, and the contract itself is time-zone-free. Consumers cannot drift from the canonical window because they never recompute it.
  • Where it's used: produced by the real EventLiveValidationService (Conference.Application) behind IEventLiveValidationService.GetEventLiveInfoAsync (EventLiveValidationService.cs:34, built at :52-57 with the event's Name and StartDate filled in), and across the process boundary by the EventLiveValidationServiceGrpcAdapter (EventLiveValidationServiceGrpcAdapter.cs:33-66, which carries the name and start date over the wire at :58-63). SendTicketInvitesHandler is the reader of the display facts: it fails when the name is blank or the start date is the default (SendTicketInvitesHandler.cs:95-101) and passes info.Name and info.StartDate to the invitation announcer (SendTicketInvitesHandler.cs:146). It is consumed by the Engagement event-wide LivePoll paths: CreateLivePollHandler reads IsPublished for an event-wide poll to enforce BR-222 (CreateLivePollHandler.cs:95-105), and OpenLivePollHandler reads the two window bounds for an event-wide poll (OpenLivePollHandler.cs:68-73). The Engagement check-in path uses it too: CheckInProcessor fetches it for an event-scope check-in and rejects an unpublished event (CheckInProcessor.cs:201-205).

PartnerType

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Partners · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Partners/PartnerType.cs:12 · Level 0 · enum

  • What it is: a two-value enum classifying a Partner as a Community partner (a user group, meetup, or nonprofit supporting the event) or a Special partner (the venue host or a similarly distinguished partner shown in its own group).
  • Depends on: nothing first-party.
  • Concept introduced, the numeric value doubling as display order. [Rubric §9, API & Contract Design] (a small, purpose-built enum rather than a bare bool or free-text string): the doc comment states the numbers are not arbitrary, they are the display order of the public partners band, community first, then special (PartnerType.cs:3-5). Community is deliberately the zero value: it is the common case and, unlike a sponsorship tier, carries no commercial weight, so an omitted type landing on it is harmless (remarks, PartnerType.cs:7-10).
  • Walkthrough: two explicitly numbered members, Community = 0 (PartnerType.cs:15) and Special = 1 (PartnerType.cs:18). Explicit numbering keeps the wire meaning and the display order stable if the members are ever reordered in source.
  • Why it's built this way: making the enum's numeric order the sort key means a consumer that groups by PartnerType and orders ascending gets the correct display order for free, with no separate lookup table to keep in sync.
  • Where it's used: carried on Partner.PartnerType (Partner.cs:25, set in both create and reconstitute constructors, Partner.cs:51,59,82,119,130) and on PartnerDTO.PartnerType. Seeded by ConferenceModuleDbSeeder's sample partners, two Community and one Special (ConferenceModuleDbSeeder.cs:472-477). Read by the ADC home page's partner band: ADCHome groups the fetched partners by PartnerType, orders the groups ascending so Community renders first, and orders each group by Sort then Name (ADCHome.razor.cs:311-318). Exercised across the full CRUD test surface for Partner (domain, application, API, and UI test projects for creation, update, and validation).

QuestionModerationDefault

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.Live · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/QuestionModerationDefault.cs:7 · Level 0 · enum

  • What it is: a two-value enum naming the initial status a newly submitted attendee question receives for an event's live Q&A (BR-233): Pending (queued for a moderator) or Approved (visible immediately, moderated after the fact).
  • Depends on: nothing first-party.
  • Concept introduced, the per-event moderation policy knob. [Rubric §6, CQRS & Event-Driven] (assesses whether the data crossing a boundary carries enough context to be acted on without extra lookups): this small enum is the vocabulary the Engagement live layer reads to decide whether a freshly submitted SessionQuestion starts hidden or visible. Making it a two-value enum rather than a bare bool leaves room for future moderation modes and reads self-documentingly at the call site.
  • Walkthrough: two explicitly numbered members, Pending = 0 (QuestionModerationDefault.cs:10, the safe default: an unset or zero value means "hold for review") and Approved = 1 (QuestionModerationDefault.cs:13). Explicit numbering keeps the wire meaning stable if the members are ever reordered.
  • Why it's built this way: Pending = 0 makes the conservative choice the default value. An event that never set a moderation preference holds new questions for review rather than publishing them unmoderated.
  • Where it's used: carried on EventDTO.QuestionModerationDefault (EventDTO.cs:94) and inside SessionLiveInfo (SessionLiveInfo.cs:24), so the live layer learns the owning event's policy in the same call that fetches session facts. Consumed by the Engagement SubmitQuestionHandler, which maps Approved to QuestionStatus.Approved and everything else to QuestionStatus.Pending when creating the question (SubmitQuestionHandler.cs:176-178).

SponsorLiveInfo

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.Live · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/SponsorLiveInfo.cs:12 · Level 0 · record (sealed)

  • What it is: a sponsor's live-layer facts for the booth-visit flow: the owning event's id and published flag, plus the sponsor's display name.
  • Depends on: the EventIdentifierType alias; BCL otherwise. No first-party types.
  • Concept: the same server-resolved cross-module snapshot RoomSessionInfo introduces, applied to a Sponsor. [Rubric §7, Microservices Readiness]: Engagement never references the Sponsor entity; it asks Conference three questions and gets three values. [Rubric §11, Security]: because the QR is printed, the server must confirm the sponsor still exists and its event is published before recording anything, and the soft-delete query filter means a pulled sponsor answers exactly like one that never existed, so an old printed QR simply stops working (EventLiveValidationService.cs:122-135).
  • Walkthrough: a positional sealed record with three parameters (SponsorLiveInfo.cs:12-15), EventId (line 13), IsPublished (line 14), and SponsorName (line 15, carried so a consumer can render a confirmation without a second cross-module call, per the doc comment SponsorLiveInfo.cs:3-8).
  • Why it's built this way: the booth-visit write needs the owning event for scoping, the published flag for the gate, and the name for the confirmation screen. Returning all three in one record keeps the scan path to a single round-trip.
  • Where it's used: produced by EventLiveValidationService.GetSponsorLiveInfoAsync (EventLiveValidationService.cs:118-153, which looks the sponsor up, then its owning event, and returns NotFound for either miss), served over gRPC via the GetSponsorLiveInfo rpc (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/Protos/event_live_validation.proto:40) and its adapter (EventLiveValidationServiceGrpcAdapter.cs:124). Consumed by the Engagement RecordSponsorVisitHandler, which propagates a lookup failure unchanged (RecordSponsorVisitHandler.cs:75-76), rejects an unpublished event (RecordSponsorVisitHandler.cs:78-79), scopes the check-in row to the returned EventId (RecordSponsorVisitHandler.cs:90), and echoes SponsorName on the response whether the visit is new or a replay (RecordSponsorVisitHandler.cs:105).

UserConferenceEventAnswerExportDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Exports · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Exports/UserConferenceEventAnswerExportDTO.cs:7 · Level 0 · record (sealed class)

  • What it is: one event-level feedback answer a user authored, shaped for the data-subject export: which question, which event, the answer text, and when it was submitted.
  • Depends on: nothing first-party beyond the QuestionIdentifierType and EventIdentifierType aliases.
  • Walkthrough: a sealed record class with four required init-only members: QuestionId (UserConferenceEventAnswerExportDTO.cs:10), EventId (:13), AnswerValue (string, :16), and CreatedOn (DateTime, UTC, :19). No behavior; it is a pure value carrier.
  • Why it's built this way: the export carries ids and the user's own text only, never the EventQuestionAnswer entity, so the document can cross the gRPC boundary and be serialized into the user's download without leaking domain types. Its session twin is UserConferenceSessionAnswerExportDTO.
  • Where it's used: collected into UserConferenceExportDTO.EventFeedbackAnswers and built by UserConferenceExportService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Exports/UserConferenceExportService.cs:65-75, projected in SQL from the user's own event answers); mapped across the process boundary by UserConferenceExportServiceGrpcAdapter.

UserConferenceSessionAnswerExportDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Exports · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Exports/UserConferenceSessionAnswerExportDTO.cs:7 · Level 0 · record (sealed class)

  • What it is: one session-level feedback answer a user authored, shaped for the data-subject export: question, session, answer text, and submission time.
  • Depends on: nothing first-party beyond the QuestionIdentifierType and SessionIdentifierType aliases.
  • Walkthrough: a sealed record class with four required init-only members: QuestionId (UserConferenceSessionAnswerExportDTO.cs:10), SessionId (:13), AnswerValue (string, :16), and CreatedOn (DateTime, UTC, :19). It differs from UserConferenceEventAnswerExportDTO only in the parent id.
  • Why it's built this way: keeping the session and event answers as two separate record types keeps each id strongly typed (SessionIdentifierType versus EventIdentifierType) instead of one generic "target id" that could be confused.
  • Where it's used: collected into UserConferenceExportDTO.SessionFeedbackAnswers and populated by UserConferenceExportService from the user's own non-deleted session answers (UserConferenceExportService.cs:51-61).

RoomCheckInCodeDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Rooms · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomCheckInCodeDTO.cs:15 · Level 0 · record (sealed)

  • What it is: the organizer-only view of a room's self check-in code: which room, its current code, and whether the server currently accepts only that code. It also declares the code's length cap and the error code a rejected lookup answers with. Every room is issued a code when it is created, and the rooms that predate that were backfilled once (doc comment, RoomCheckInCodeDTO.cs:9-12).
  • Depends on: RoomCheckInSettings, whose RequireCode flag CodeRequired reports (RoomCheckInCodeDTO.cs:34); the RoomIdentifierType alias; BCL otherwise.
  • Concept introduced, the secret kept off the public read. [Rubric §11, Security] (assesses whether sensitive data is exposed only to callers entitled to it): the code printed on the room's QR is the attendee's proof of presence, so it is not a field on RoomDTO. The room reads are anonymous, and RoomDTOMapper leaves the code out on purpose ([MapperIgnoreSource(nameof(Room.CheckInCode))], MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/DTOs/RoomDTOMapper.cs:21-26); this separate record is served only by the permission-guarded organizer endpoint. [Rubric §15, Best Practices & Code Quality] also applies: like RoomDTO, the *.Shared record is the single home for the constants the API, Infrastructure and the Engagement module all read.
  • Walkthrough
    • CodeMaxLength = 64 (RoomCheckInCodeDTO.cs:18): the column and request cap; the issued codes are 32 hex characters, so the cap leaves headroom (doc comment, RoomCheckInCodeDTO.cs:17).
    • RejectedErrorCode = "Room.CheckInCodeRejected" (RoomCheckInCodeDTO.cs:24): the validation error code a room lookup answers with when the presented code is refused, so the check-in page can tell the attendee to scan the code at the door (RoomCheckInCodeDTO.cs:20-23). A wrong code is always refused (issuing another invalidates the previous print); a check-in that presents no code, or one against a room that has no code, is refused only while CodeRequired is on (doc comment, RoomCheckInCodeDTO.cs:9-12, enforced by Room.AcceptsCheckInCode, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Room.cs:174-182).
    • RoomId (RoomCheckInCodeDTO.cs:27), required.
    • Code (RoomCheckInCodeDTO.cs:30): nullable; null only for a room written outside the domain, since the domain issues one at creation (RoomCheckInCodeDTO.cs:29).
    • CodeRequired (RoomCheckInCodeDTO.cs:37): mirrors RoomCheckInSettings.RequireCode, whether the server accepts only a room's current code, so the organizer page can say which mode is on. While it is false, only a wrong code is refused (RoomCheckInCodeDTO.cs:32-36).
  • Why it's built this way: a dedicated record (instead of a nullable Code on RoomDTO) makes it structurally impossible for the anonymous, output-cached room reads to leak the code. Carrying RejectedErrorCode as a shared constant lets Engagement recognize the refusal by code across the module boundary rather than by message text.
  • Where it's used: built by GetRoomCheckInCodeHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/GetRoomCheckInCode/GetRoomCheckInCodeHandler.cs:38-43) and RotateRoomCheckInCodeHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RotateRoomCheckInCode/RotateRoomCheckInCodeHandler.cs:55-59); returned by RoomCheckInCodesController's GET and POST Rooms/{id}/check-in-code, both behind ConferencePermissions.RoomsManage (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/RoomCheckInCodesController.cs:25, :37-38, :61); fetched by the UI through IRoomUIService and RoomService (RoomService.cs:51-57) for the RoomDetail page. CodeMaxLength sizes the column in RoomConfiguration (RoomConfiguration.cs:45) and the request cap in the Engagement RoomCheckInRequestValidator (RoomCheckInRequestValidator.cs:20-21). RejectedErrorCode is raised by EventLiveValidationService (EventLiveValidationService.cs:332-335), documented on IEventLiveValidationService (IEventLiveValidationService.cs:61), and matched by RecordRoomCheckInHandler (RecordRoomCheckInHandler.cs:162) to answer with its own "scan the code" error.

RoomCheckInSettings

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Rooms · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomCheckInSettings.cs:7 · Level 0 · class (sealed)

  • What it is: the options class for the room self check-in policy, bound from the Conference:RoomCheckIn configuration section. It holds one switch: whether a room check-in must present the room's current code.
  • Depends on: nothing first-party; bound through the .NET options pattern (IOptions<T>).
  • Concept introduced, a staged security switch with a safe default. [Rubric §11, Security] (assesses whether controls are enforced server-side) and [Rubric §29, Resilience & Business Continuity] (assesses whether a change can roll out without breaking live users): the mobile build already installed sends no code, so requiring one immediately would lock those attendees out. With RequireCode off, a check-in with the right code or no code is accepted and only a wrong one is refused; turning it on once the mobile release that carries the scanned code is adopted and the room QR codes are reprinted makes only a room's current code acceptable, and a room without a code then accepts nothing (doc comment, RoomCheckInSettings.cs:12-19), so enforcement has no bypass (Room.AcceptsCheckInCode, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Room.cs:174-177). [Rubric §17, DevOps] applies in how it is bound: deliberately without ValidateOnStart, so a missing section keeps the default rather than refusing to boot, the documented exception to the fail-fast contract (ADR-070).
  • Walkthrough
    • SectionName = "Conference:RoomCheckIn" (RoomCheckInSettings.cs:10).
    • RequireCode (RoomCheckInSettings.cs:20): bool, init-only, false by default.
  • Why it's built this way: the flag lives in configuration rather than code so the enforcement can be tightened at the moment mobile adoption and the reprinted room QR codes allow, without a deploy, and its default is the non-breaking mode.
  • Where it's used: bound in the Conference service host (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:293-294, reason at :311-313). Injected as IOptions<RoomCheckInSettings> into EventLiveValidationService (EventLiveValidationService.cs:31), which passes RequireCode to Room.AcceptsCheckInCode (EventLiveValidationService.cs:332), and into GetRoomCheckInCodeHandler (GetRoomCheckInCodeHandler.cs:15, :42) and RotateRoomCheckInCodeHandler (RotateRoomCheckInCodeHandler.cs:18, :59), which echo it as RoomCheckInCodeDTO.CodeRequired.
  • Caveats / not-in-source: the only Bind call found under MMCA.ADC/Source is the Conference service's Program.cs; whether another host composition binds the section is not determinable from the files read here (an unbound IOptions<T> yields the false default).

RoomSessionInfo

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Rooms · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomSessionInfo.cs:20 · Level 0 · record (sealed)

  • What it is: the answer to "which session is this room hosting right now": the resolved session id and title, the owning event, and that event's published flag. It is what the Engagement room check-in flow gets back when an attendee scans a printed room QR.
  • Depends on: the SessionIdentifierType and EventIdentifierType aliases; BCL otherwise. No first-party types.
  • Concept introduced, the server-resolved target (never trust a client-supplied id). [Rubric §11, Security] (assesses whether authorization-relevant inputs are decided server-side): the attendee's device sends a room id, not a session id, and Conference resolves which session that room is hosting at the call instant. A tampered QR therefore cannot record a check-in against an arbitrary session. [Rubric §9, API & Contract Design] also applies in a subtle way: SessionTitle rides along so the caller can render a confirmation without a second cross-module call, and the grace window travels in the request rather than living on this record, because "how early does a scan count" is check-in policy owned by Engagement, not schedule data owned by Conference (doc comment, RoomSessionInfo.cs:10-14, and the same split restated on the interface, IEventLiveValidationService.cs:53-56).
  • Walkthrough: a positional sealed record with four parameters (RoomSessionInfo.cs:20-24), SessionId (the session the room is hosting at the query instant, line 19), SessionTitle (line 20), EventId (the owning event, line 21), and IsPublished (line 22). No behavior.
  • Why it's built this way: bundling the title and the published flag with the id keeps the door-scan path to a single cross-module round-trip, and keeping the grace window out of the record preserves the boundary: Conference answers the schedule question, Engagement decides the policy.
  • Where it's used: produced by EventLiveValidationService.GetCurrentRoomSessionInfoAsync (EventLiveValidationService.cs:157), which excludes unscheduled sessions (EventLiveValidationService.cs:170-182), resolves the event's zone without a fallback (EventLiveValidationService.cs:201-205), converts session wall-clock times through CalendarExportMapper.ToUtc (EventLiveValidationService.cs:210-218), and prefers an in-progress session over an upcoming one inside the grace window (EventLiveValidationService.cs:222-229) before building the record (EventLiveValidationService.cs:237-241). Carried over the wire by EventLiveValidationServiceGrpcAdapter (EventLiveValidationServiceGrpcAdapter.cs:152) against the GetCurrentRoomSessionInfo rpc (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/Protos/event_live_validation.proto:47). Consumed by the Engagement RecordRoomCheckInHandler, which passes the configured grace window (RecordRoomCheckInHandler.cs:84-86, from CheckInSettings.RoomCheckInGraceMinutes, default 15, MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Shared/CheckIns/CheckInSettings.cs:21), collapses a NotFound into a generic "no session is starting here" message so room ids do not leak while still propagating transport failures unchanged (RecordRoomCheckInHandler.cs:76-86, :98-102), rejects an unpublished event (RecordRoomCheckInHandler.cs:90-91), and uses the resolved SessionId/SessionTitle for the check-in row and its response (RecordRoomCheckInHandler.cs:93, :91-92).

PartnerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Partners · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Partners/PartnerDTO.cs:15 · Level 1 · record (class)

  • What it is: the wire DTO for a Partner, the community organization or special partner shown in the ADC home page's public partners band.
  • Depends on: IBaseDTO<TIdentifierType> and IConcurrencyAware (both implemented, PartnerDTO.cs:15), closed over PartnerIdentifierType; PartnerType (PartnerDTO.cs:39); the EventIdentifierType alias for its foreign key (PartnerDTO.cs:54).
  • Concept: the same aggregate-DTO shape EventDTO uses at a smaller scale, length constants and a concurrency token living on the DTO because, per its own doc comment, it is the lowest layer the domain invariants, EF configuration, and UI can all reach (PartnerDTO.cs:9-12). [Rubric §9, API & Contract Design] (a stable, purpose-built contract) and [Rubric §8, Data Architecture] (IConcurrencyAware round-trips the EF RowVersion token so a concurrent edit is detected instead of silently overwritten).
  • Walkthrough: four length constants, NameMaxLength = 200 (PartnerDTO.cs:18), LogoUrlMaxLength = 2000 (PartnerDTO.cs:21), DescriptionMaxLength = 2000 (PartnerDTO.cs:24), and WebsiteUrlMaxLength = 2000 (PartnerDTO.cs:27); identity and concurrency, Id (required, PartnerDTO.cs:30) and RowVersion (byte[] defaulting to [], PartnerDTO.cs:33); Name (required string, PartnerDTO.cs:36) and PartnerType (PartnerDTO.cs:39); optional scalars LogoUrl, Description, and WebsiteUrl (all string?, PartnerDTO.cs:42,45,48); Sort (int, the display order within the partner's type group, PartnerDTO.cs:51); and EventId (required, the owning event's foreign key, PartnerDTO.cs:54), so neither the mapper nor a test fixture can build a partner DTO without naming its event.
  • Why it's built this way: keeping the four length constants on the DTO rather than duplicating them in the domain lets PartnerInvariants re-export them by reference (NameMaxLength = PartnerDTO.NameMaxLength and the same pattern for the other three, PartnerInvariants.cs:16,19,22,25) instead of restating the numbers, so the UI, the domain guard, and the EF configuration all read one source of truth.
  • Where it's used: mapped from Partner by the Mapperly-generated PartnerDTOMapper.MapToDTO (PartnerDTOMapper.cs:17, per ADR-001); it is the DTO type parameter of CreatePartnerHandler (CreatePartnerHandler.cs:17-22, built over CreateEntityHandlerBase<PartnerCreateRequest, Partner, PartnerIdentifierType, PartnerDTO>) and of PartnersController, so its inherited GetAll/GetById/Create/paged/lookup/export actions all speak it (PartnersController.cs:38-41,86-162). Read by the ADC home page's partner band, grouped and sorted client-side (ADCHome.razor.cs:311-318), and bound by the UI's PartnerFormModel/PartnerEditModel.

SessionLiveInfo

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.Live · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/SessionLiveInfo.cs:17 · Level 1 · record (sealed)

  • What it is: the session-level counterpart to EventLiveInfo, a snapshot of everything the live layer needs to gate a single session's polls and Q&A: the owning event's id, published flag and live window, the session's assigned speaker ids, whether the session is a plenum (whole-conference) session, and the event's question-moderation default.
  • Depends on: QuestionModerationDefault (a parameter, SessionLiveInfo.cs:24); the EventIdentifierType and SpeakerIdentifierType aliases. BCL otherwise.
  • Concept introduced, the enriched cross-module session snapshot. [Rubric §7, Microservices Readiness] (a single, sufficient contract crossing the boundary): the Engagement live layer must answer several questions before it lets someone open a poll or moderate a question. Is the event published and live? Who are the session's speakers, so it can grant them moderation rights (BR-236)? Is it a plenum session? What is the default status for new questions (BR-233)? Rather than force several separate cross-service calls, Conference bundles all of it into one record returned by GetSessionLiveInfoAsync. [Rubric §12, Performance & Scalability] (one round-trip instead of many) is the payoff of that bundling.
  • Walkthrough: a positional sealed record with seven parameters (SessionLiveInfo.cs:17-24), EventId (the owning event, line 18), IsPublished (line 19), LiveWindowStartUtc and LiveWindowEndUtc (lines 20-21, same live-window semantics as EventLiveInfo), SpeakerIds (IReadOnlyCollection<SpeakerIdentifierType>, the session's non-deleted assigned speakers, line 22), IsPlenumSession (line 23), and QuestionModerationDefault (line 24). No behavior: a pure value carrier.
  • Why it's built this way: the producer already loads the session and its owning event to compute the window, so it enriches the same result with the speaker set, plenum flag, and moderation default instead of making the consumer chase those separately. That keeps the speaker-rights and moderation decisions on data the owning module vouches for.
  • Where it's used: produced by EventLiveValidationService.GetSessionLiveInfoAsync (EventLiveValidationService.cs:62, built at :93, and it also enforces the eligibility rules BR-49/BR-91) and by its gRPC adapter (EventLiveValidationServiceGrpcAdapter.cs:69). Consumed by every Engagement live-layer entry point: CreateLivePollHandler (CreateLivePollHandler.cs:66-89, fetched through LiveScopeGate at :73, including the "session belongs to this event" check, CreateLivePollHandler.cs:77-84), OpenLivePollHandler (OpenLivePollHandler.cs:48-58), CloseLivePollHandler (CloseLivePollHandler.cs:46), SubmitQuestionHandler (SubmitQuestionHandler.cs:79, the live-window gate at :90, the moderation default at :176-178), ModerateQuestionHandler (ModerateQuestionHandler.cs:61), and GetModerationQueueHandler (GetModerationQueueHandler.cs:33). The speaker set is what LivePollAuthorization checks the caller against (CreateLivePollHandler.cs:86-87). The Engagement check-in path uses it too, for a session-scope check-in (CheckInProcessor.cs:191-195).

UserConferenceExportDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Exports · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Exports/UserConferenceExportDTO.cs:8 · Level 1 · record (sealed class)

  • What it is: the Conference module's half of the cross-service data-subject export: the feedback answers a user authored, split into session answers and event answers.
  • Depends on: UserConferenceSessionAnswerExportDTO and UserConferenceEventAnswerExportDTO.
  • Walkthrough: a sealed record class with two init-only collections, SessionFeedbackAnswers (UserConferenceExportDTO.cs:11) and EventFeedbackAnswers (:14), both IReadOnlyList<> defaulting to []. The empty defaults mean new UserConferenceExportDTO() is a valid "nothing to export" document.
  • Why it's built this way: the empty default is what the real service returns when no attendee-feedback question exists (UserConferenceExportService.cs:44-47), so a caller never null-checks.
  • Where it's used: returned by IUserConferenceExportService, built by UserConferenceExportService, and consumed by Identity's ConferenceUserDataExportSection.

RoomDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Rooms · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomDTO.cs:13 · Level 1 · record (class)

  • What it is: the richest of the event child DTOs, a conference room within an event's venue, with display and accessibility metadata. It also declares the four room field-length caps that the rest of the stack reads.
  • Depends on: IBaseDTO<TIdentifierType> closed over RoomIdentifierType and IConcurrencyAware (both from MMCA.Common.Shared.DTOs, RoomDTO.cs:1,13); the foreign key uses EventIdentifierType.
  • Concept introduced, the DTO as the lowest common home for a shared constant. The child-DTO shape itself is the one EventQuestionAnswerDTO introduces; what is new here is that the DTO owns the length constants. [Rubric §15, Best Practices & Code Quality] (assesses whether a fact is written once): the domain invariants sit in Conference.Domain, the EF configuration in Conference.Infrastructure, and the form model in Conference.UI, and none of those three can reference the other two. The *.Shared project is the only assembly all of them already depend on, so the caps live on the DTO and everyone re-exports rather than re-types them (doc comment, RoomDTO.cs:6-11). [Rubric §21, Accessibility] is worth naming too, because accessibility data is modelled as first-class room data (AccessibilityInfo, RoomDTO.cs:49) rather than being buried in a free-text description. [Rubric §8, Data Architecture] applies as well: IConcurrencyAware round-trips the room's own EF RowVersion token, so a concurrent edit to the same room is detected instead of silently overwritten (ADR-035).
  • Walkthrough
    • Length constants (RoomDTO.cs:16-25): NameMaxLength = 255 (line 16), FloorMaxLength = 100 (line 19), LocationMaxLength = 255 (line 22), AccessibilityInfoMaxLength = 500 (line 25).
    • Three required members, Id (RoomDTO.cs:28), Name (RoomDTO.cs:34), and EventId (RoomDTO.cs:52, the parent foreign key).
    • RowVersion (byte[], defaulting to [], RoomDTO.cs:31): the concurrency token IConcurrencyAware requires.
    • Sort (RoomDTO.cs:37) is a plain int display order that defaults to zero. Four optional members follow, Capacity (int?, line 40), Floor (string?, line 43), Location (string?, line 46), and AccessibilityInfo (string?, line 49), each null when absent.
    • EventName (string?, RoomDTO.cs:63, declared last in the file): the parent event's name, flattened from the Event navigation. It exists purely for sorting, the room grid orders by event name, and the query service maps this field to the Event.Name entity path so the database does the ordering rather than the client (doc comment, RoomDTO.cs:54-62). It is populated only when the read asks for FK navigations (includeFKs=true), which list reads do not, so a UI that needs to display the event name resolves it from its own lookup instead of relying on this field.
  • Why it's built this way: a room imported from Sessionize often has nothing beyond a name and a sort order, so everything past those is nullable. Making EventId required keeps a room from existing on the wire without an owning event. The constants live here so the same number reaches the database column, the domain guard, and the input counter from one declaration. EventName is opt-in rather than always-populated because most reads (list pages) do not need it, and always joining the event just to flatten a name would be a needless query cost on the common path. The token is the room's own rather than the parent event's because a room is a child of the event: the update stamps the stated version on the tracked room, not on the event.
  • Where it's used: nested in EventDTO.Rooms (EventDTO.cs:103); mapped from the Room entity by RoomDTOMapper (group-18). The constants are re-exported by EventInvariants as RoomNameMaxLength, RoomFloorMaxLength, RoomLocationMaxLength, and RoomAccessibilityInfoMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventInvariants.cs:48-58), which the guard itself uses (EventInvariants.cs:183) and which RoomConfiguration turns into EF HasMaxLength calls (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Events/RoomConfiguration.cs:21, :30); the UI reads them straight off the DTO in RoomFormModel (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Rooms/RoomFormModel.cs:35, :45, :49, :53). EventName is what the room grid (RoomList) sorts and displays by. RowVersion is carried by the UI's RoomEditModel (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Rooms/RoomEditModel.cs:41), stated by the caller in the If-Match header of the room update on RoomsController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Events/RoomsController.cs:247), and stamped on the tracked room by UpdateRoomHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/UpdateRoom/UpdateRoomHandler.cs:40, rationale on UpdateRoomCommand.cs:14).

IUserConferenceExportService

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Exports · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Exports/IUserConferenceExportService.cs:14 · Level 2 · interface

  • What it is: the owned cross-module contract through which Identity's data-subject export asks Conference for the feedback answers a user authored, without referencing any Conference entity.
  • Depends on: UserConferenceExportDTO and the UserIdentifierType alias.
  • Concept introduced, the same owned-interface boundary applied to an export. [Rubric §7, Microservices Readiness]: it follows the pattern described under IEventLiveValidationService: the interface lives in Conference's *.Shared, the real implementation is injected when Conference is in-process, and a gRPC adapter satisfies it after extraction.
  • Walkthrough: one method, GetUserConferenceExportAsync(UserIdentifierType userId, CancellationToken) (IUserConferenceExportService.cs:24), returning a Task<UserConferenceExportDTO> (not a Result). Per the doc comment it returns only answers to attendee-feedback questions (QuestionSource == "User"); Sessionize-imported answers are programme data and are never included (IUserConferenceExportService.cs:16-19).
  • Why it's built this way: the implementation applies that rule by loading the User-sourced question ids first (UserConferenceExportService.cs:35-42) and then querying each answer table on CreatedBy == userId and those question ids (UserConferenceExportService.cs:59, :73), with the answers' own soft-delete query filter left on, so withdrawn or already-erased answers, and the answers of a deleted session or event, are not exported as active personal data (UserConferenceExportService.cs:18-20).
  • Where it's used: implemented by UserConferenceExportService, registered with TryAddScoped (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/DependencyInjection.cs:133); served over gRPC by UserConferenceExportGrpcService and consumed via UserConferenceExportServiceGrpcAdapter, wired by a Replace in the Conference.Contracts client registration (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:96). Identity's ConferenceUserDataExportSection takes it by constructor (MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Application/Users/UseCases/ExportUserData/ConferenceUserDataExportSection.cs:19). ADR-076 covers the data-subject export.

IEventLiveValidationService

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.Live · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/Live/IEventLiveValidationService.cs:14 · Level 3 · interface

  • What it is: the cross-module service contract the Engagement module (live polls, session Q&A, check-ins, sponsor visits, ticket invites) and the Notification service's live-channel join gate call to validate an event's, a session's, a sponsor's, or a room's live-layer facts, returning small snapshot records without the caller ever referencing a Conference domain entity (doc comment, IEventLiveValidationService.cs:6-12).
  • Depends on: Result and ServiceContractAttribute (both via MMCA.Common.Shared.Abstractions, IEventLiveValidationService.cs:2); EventLiveInfo, SessionLiveInfo, SponsorLiveInfo, and RoomSessionInfo; RoomCheckInCodeDTO (named by the room method's doc comment, via MMCA.ADC.Conference.Shared.Rooms, IEventLiveValidationService.cs:1); the EventIdentifierType, SessionIdentifierType, SponsorIdentifierType, and RoomIdentifierType aliases.
  • Concept introduced, the owned-interface cross-module boundary. [Rubric §7, Microservices Readiness] (assesses boundaries that survive extraction into separate processes) and [Rubric §3, Clean Architecture] (a module depends on an interface it can consume, not on another module's internals): the interface lives in Conference's *.Shared project, so the module that owns the data publishes the contract, and it is defined in terms of ids and small DTOs only. When both modules run in one host, the real Conference.Application implementation is injected directly; after extraction, the same interface is satisfied by a gRPC adapter. Engagement's code does not change either way. This is the same pattern the module uses for ISessionBookmarkValidationService. The [ServiceContract] marker on IEventLiveValidationService.cs:13 opts the type into the architecture-fitness rules that guard the contract surface (ADR-015).
  • Walkthrough: five methods, all returning Task<Result<...>> with a trailing CancellationToken.
    • GetEventLiveInfoAsync (IEventLiveValidationService.cs:24): returns the event's published flag and live window, or a NotFound failure when the event does not exist. Consumers layer their own rules on top (draft creation requires published; opening a poll requires now to be inside the window), as stated in the doc comment (IEventLiveValidationService.cs:16-20).
    • GetSessionLiveInfoAsync (IEventLiveValidationService.cs:35): returns a session's live facts (the owning event's window plus speakers, plenum flag, and moderation default), or a failure when the session does not exist, is a service session (BR-91), or has an ineligible status (BR-49), per the doc comment (IEventLiveValidationService.cs:26-30).
    • GetSponsorLiveInfoAsync (IEventLiveValidationService.cs:46): returns the sponsor's owning event id, that event's published flag, and the sponsor name, or a NotFound failure. The doc comment names the caller: the booth-visit flow where an attendee scans a printed deep-link QR and the server must confirm the sponsor exists and belongs to a published event before recording anything (IEventLiveValidationService.cs:37-41).
    • GetCurrentRoomSessionInfoAsync (IEventLiveValidationService.cs:67-71): resolves which session a room is hosting at the call instant "so a consumer never has to trust a client-supplied session id". A session qualifies when the instant falls inside [StartsAt - graceMinutes, EndsAt); an in-progress session wins over an upcoming one, and the earliest upcoming one wins among several (IEventLiveValidationService.cs:49-52). graceMinutes is a parameter, not a Conference setting, because it is check-in policy: Conference only answers the schedule question (IEventLiveValidationService.cs:53-56). The checkInCode parameter (string?, IEventLiveValidationService.cs:69) carries the code the scanned room QR held, if any: a room that has a check-in code answers a missing or wrong one with a Validation failure coded RoomCheckInCodeDTO.RejectedErrorCode, and a room with no code yet accepts the request without one (param doc, IEventLiveValidationService.cs:59-63).
    • GetOverlappingSessionIdsAsync (IEventLiveValidationService.cs:91-94): given a reference sessionId and a set of candidateSessionIds, returns the subset whose scheduled [StartsAt, EndsAt) window intersects the reference session's. The windows are half-open, so back-to-back sessions do not overlap; unknown candidate ids are ignored, a session with no scheduled start or end overlaps nothing, and a missing reference session yields NotFound (IEventLiveValidationService.cs:73-90). As with the room method, what an overlap means (for example one room check-in per time slot) is the caller's policy.
  • Why it's built this way: returning Result rather than throwing lets the consumer branch on NotFound and eligibility failures as ordinary control flow. Keeping the contract in *.Shared, expressed in ids and DTOs only, is what makes Conference extractable without breaking Engagement. Passing the grace window in rather than reading it from Conference config keeps policy on the consuming side of the boundary.
  • Where it's used: implemented in-process by EventLiveValidationService (Conference.Application, group-18), served over gRPC by EventLiveValidationGrpcService and consumed across the boundary via EventLiveValidationServiceGrpcAdapter. A host wires the remote path with AddConferenceEventLiveValidationClient(), which Replaces whatever registration is already in the container rather than TryAdding behind it (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/DependencyInjection.cs:64-70). Injected into the Engagement live-layer handlers (group-23) and into the check-in handlers RecordRoomCheckInHandler (RecordRoomCheckInHandler.cs:51, which forwards the command's CheckInCode and its configured grace minutes to the room method at :75), RecordSponsorVisitHandler (RecordSponsorVisitHandler.cs:41), ManualCheckInHandler (ManualCheckInHandler.cs:21), CheckInAttendeeHandler (CheckInAttendeeHandler.cs:23), and CheckInProcessor (CheckInProcessor.cs:131, :162). SendTicketInvitesHandler takes it by constructor to read the event's name and start date for the invite email (SendTicketInvitesHandler.cs:35, :91), and outside Engagement the Notification service's LiveChannelJoinAuthorizer takes it to gate a live-channel join on a published event or an eligible session (LiveChannelJoinAuthorizer.cs:26-27, :44).

SessionAssetKind

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.SessionAssets · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/SessionAssets/SessionAssetKind.cs:13 · Level 0 · enum

  • What it is: the two-state discriminator for a session asset: an uploaded file stored in the conference blob container, or a link to material hosted elsewhere.
  • Depends on: nothing first-party; BCL only.
  • Concept introduced, the explicit kind discriminator. [Rubric §9, API & Contract Design] (assesses whether a contract states its shape rather than making a caller infer it). File (0) and Link (1) are named on the enum itself (SessionAssetKind.cs:13-20), so a caller branches on Kind directly instead of inferring "this is a file" from which nullable fields happen to be populated on SessionAssetDTO.
  • Walkthrough: two members. File = 0 (SessionAssetKind.cs:15) marks a row with BlobName, ContentType and SizeBytes populated; Link = 1 (SessionAssetKind.cs:18) marks a row that carries only a Url.
  • Why it's built this way: an explicit enum keeps the file-vs-link distinction a single named fact the domain guard, the DTO mapper and the UI panel all read the same way, rather than each layer re-deriving it from nullability.
  • Where it's used: the Kind property on SessionAssetDTO (SessionAssetDTO.cs:42) and on the SessionAsset domain entity; branched on by SessionAssetInvariants and by the upload/link-add use cases and the UI's SessionAssetsDownloadList/SessionAssetsPanel pages. Introduced with speaker session assets (ADR-123).

SessionAssetLimits

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.SessionAssets · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/SessionAssets/SessionAssetLimits.cs:8 · Level 0 · class (static)

  • What it is: the single static home for every numeric and shape limit governing session asset uploads: the max file size, the max request body size, the max assets per session, the allowed file extensions, their MIME types, and the accept attribute strings built from them.
  • Depends on: nothing first-party; BCL only (IReadOnlyList<string>, LINQ Concat).
  • Concept introduced, one set of limits for three enforcement points. [Rubric §15, Best Practices & Code Quality] (assesses whether one fact lives in one place). MaxFileBytes (50 MB, SessionAssetLimits.cs:11), MaxAssetsPerSession (10, SessionAssetLimits.cs:27) and AllowedFileExtensions (SessionAssetLimits.cs:34-43) are declared once here and read by the command validator, the access service and the API controller, rather than each layer hard-coding its own copy. The doc comment on AllowedFileExtensions notes the extension check is only half the gate: the framework's DocumentContentSniffer also reads the real bytes, so a renamed executable is refused even though its extension is on the allow-list (SessionAssetLimits.cs:29-33).
  • Walkthrough: seven members (SessionAssetLimits.cs:11-72).
    • MaxFileBytes = 50 * 1024 * 1024 (SessionAssetLimits.cs:11): the accepted upload size.
    • MaxRequestBytes = MaxFileBytes + 64 * 1024 (SessionAssetLimits.cs:20): the transport-level cap on the whole multipart body. It adds 64 KB of headroom over MaxFileBytes for the multipart boundary lines and the part's Content-Disposition/Content-Type headers; without it, a file at exactly MaxFileBytes is rejected by Kestrel with a bare 413 before the friendlier SessionAsset.InvalidUpload check ever runs (SessionAssetLimits.cs:13-19). The file itself still tops out at MaxFileBytes via that domain check and the command validator.
    • MaxAssetsPerSession = 10 (SessionAssetLimits.cs:27): the cap on live assets per session, sized so a speaker publishing a deck, a handout, a repository link and a recording link sits well inside it while the public page stays bounded.
    • AllowedFileExtensions (SessionAssetLimits.cs:34-43): a lower-case, dot-prefixed list (.pdf, .pptx, .docx, .xlsx, .zip, .md, .txt).
    • AllowedMimeTypes (SessionAssetLimits.cs:50-59): one MIME type per extension (application/pdf, the three OpenXML types, application/zip, text/markdown, text/plain). The MAUI Android BlazorWebView hands an accept attribute to the system picker as MIME types, where an extension matches nothing (SessionAssetLimits.cs:45-49).
    • AcceptAttribute = string.Join(',', AllowedFileExtensions) (SessionAssetLimits.cs:64): the allow-list as a comma-separated extension list, used in the refusal messages (SessionAssetLimits.cs:61-63).
    • FileInputAccept = string.Join(',', AllowedFileExtensions.Concat(AllowedMimeTypes)) (SessionAssetLimits.cs:71-72): the upload control's accept value, extensions for desktop browsers plus MIME types for the Android picker, so every picker only offers formats the server will accept (SessionAssetLimits.cs:66-70).
  • Why it's built this way: expressing MaxRequestBytes as MaxFileBytes + 64 * 1024 (rather than a second independent constant) keeps the transport cap tied to the domain cap by construction, so raising MaxFileBytes cannot silently leave the transport limit too tight.
  • Where it's used: read by UploadSessionAssetCommandValidator and SessionAssetsController (both 4 references), SessionAssetAccessService, UploadSessionAssetCommand, SessionAssetValidationRules, the UI's SessionAssetsPanel.razor.cs and SessionAssetService, and wired into request-size limits on the Gateway's Program.cs. Introduced with speaker session assets (ADR-123).

NowNextSessionDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/NowNextDTO.cs:29 · Level 0 · record

  • What it is: one session row inside the "happening now / up next" snapshot. It carries just enough to render and deep-link a glanceable session tile: identity, title, room, and the start/end pair in both event-local wall clock and UTC.
  • Depends on: nothing first-party (the SessionIdentifierType alias resolves through the solution-wide global using set up in Directory.Build.props); BCL only (DateTime, DateTimeOffset). This is an identity-less read projection, not a persisted-entity DTO, so unlike its neighbours in this folder it does not implement IBaseDTO<TIdentifierType>.
  • Concept introduced, the dual-clock read model. [Rubric §9, API & Contract Design] (assesses whether a contract hands each consumer the shape it needs without post-processing). This DTO ships each boundary time twice: StartsAtLocal/EndsAtLocal as DateTime wall clock in the event's time zone (NowNextDTO.cs:33-34) for a badge or widget that just prints the string, and StartsAtUtc/EndsAtUtc as DateTimeOffset (NowNextDTO.cs:35-36) for a caller doing its own time math. The doc comment on the parent states the split rationale (NowNextDTO.cs:6-7). [Rubric §12, Performance & Scalability]: precomputing both forms server-side keeps a mobile or widget client free of time-zone conversion, and the producing handler resolves the zone exactly once per request (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/NowNext/GetNowNextHandler.cs:54).
  • Walkthrough: a positional sealed record with seven parameters (NowNextDTO.cs:29-36): SessionId (the deep-link target), Title, a nullable RoomName that is null when the session has no room assigned (NowNextDTO.cs:32), then the two local DateTimes and the two UTC DateTimeOffsets. There is no Create factory: this is a read-side projection assembled from an already-valid aggregate by GetNowNextHandler, not a domain value object that must guard its own invariants.
  • Why it's built this way: a positional record gives structural equality and immutability with no boilerplate, which is all a read model needs. It is the row element of NowNextDTO rather than a standalone contract, so it lives in that same file (ADR-042 Wave 8, cited in the doc comment at NowNextDTO.cs:4).
  • Where it's used: nested as the Now and Next lists on NowNextDTO; each row is built by the handler's private ToRow projection over a Session aggregate (GetNowNextHandler.cs:81), then served on the anonymous now-next endpoints of EventsController (EventsController.cs:124-133,140-147).

SessionStatuses

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionStatuses.cs:15 · Level 0 · class (static)

  • What it is: the catalog of the six recognized Sessionize session-status strings, plus the predicate IsEligible() that decides public display, attendee bookmarking, and post-session feedback (BR-49). Session.Status is a free-text field imported from Sessionize; this class is the one place in the module that gives those strings behavioral meaning. It lives in Shared so the domain, the handlers and the UI apply one BR-49 rule and one status vocabulary (SessionStatuses.cs:3-8).
  • Depends on: nothing first-party (only StringComparison from the BCL).
  • Concept introduced, the allow-list over external free text. [Rubric §4, Domain-Driven Design] (assesses whether the model mirrors the business and speaks its language) and [Rubric §8, Data Architecture] (assesses deliberate handling of externally-sourced data). Two design choices are worth reading carefully:
    • const string, not a C# enum. Sessionize can return a status this list has never seen. String constants mean an unknown value simply fails to match; a deserialization-bound enum would have to decide what to do with it.
    • Visibility is an allow-list decided centrally, not a per-constant flag. The remarks (SessionStatuses.cs:9-14) say so outright: a status is publicly visible only if it is Accepted or unset, so adding a constant here does not make it publicly visible. That is the safe default for a field fed by an external system: the failure mode of a new Sessionize status is "not shown yet", not "leaked".
  • Walkthrough
    • Six const string values: Accepted (SessionStatuses.cs:18), Waitlisted (:21), AcceptQueue = "Accept_Queue" (:24), Nominated (:27), DeclineQueue = "Decline_Queue" (:30), Declined (:33). Note that two of the literal values carry an underscore the C# identifier does not.
    • AllKnownStatuses (SessionStatuses.cs:38-46): a static readonly IReadOnlyList<string> collection expression of all six, so organizer filter dropdowns do not re-list the constants by hand.
    • IsEligible(string? status) (SessionStatuses.cs:55-57): returns true when status is null or equals Accepted case-insensitively (StringComparison.OrdinalIgnoreCase). Everything else is ineligible, known and unknown alike. The null branch is not an oversight: the organizer create form sends no status, as the doc comment (SessionStatuses.cs:48-54) records.
  • Why it's built this way: keeping the eligibility predicate in Shared, the lowest layer the domain, the handlers and the UI can all reach, means every consumer applies the identical definition, and tightening the rule is a one-line edit here rather than a search across layers.
  • Where it's used: SessionInvariants.EnsureStatusIsEligible (SessionInvariants.cs:111); the calendar-export filter SessionCalendarExport.IsExportable (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionCalendarExport.cs:26), which CalendarExportMapper calls (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/ExportCalendar/CalendarExportMapper.cs:26); the session-asset access check (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/SessionAssets/SessionAssetAccessService.cs:123); the organizer session-selection dashboard's status bucketing (GetSessionSelectionDashboardHandler, .../DecisionSupport/GetSessionSelectionDashboard/GetSessionSelectionDashboardHandler.cs:83-87,229,285-288,314-325), whose private category-distribution, speaker-overlap and locality passes are the only decision-support code that buckets by these constants, all G18. The public UI calls IsEligible directly too (.../MMCA.ADC.Conference.UI/Pages/Public/Sessions/PublicSessionDetail.razor.cs:98, .../PublicSessionListView.razor.cs:128).
  • Caveats / not-in-source: one consumer deliberately does not call IsEligible. PublicSessionStatusSpecification restates the same rule as an expression tree, s => s.Status == null || s.Status == SessionStatuses.Accepted (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/Specifications/PublicSessionStatusSpecification.cs:25), because a method call cannot be translated to SQL; its own doc comment (:17) records the reason. The two definitions are kept in sync by hand.

SessionAssetDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.SessionAssets · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/SessionAssets/SessionAssetDTO.cs:15 · Level 1 · record

  • What it is: the read-side DTO for one session asset row: identity and concurrency token, the FKs to the owning event and session, the SessionAssetKind discriminator, title and URL, the file-only metadata (blob name, content type, size), a display sort order, and the uploading speaker.
  • Depends on: IBaseDTO<TIdentifierType> and IConcurrencyAware, the two contracts it implements (SessionAssetDTO.cs:15); SessionAssetKind for the Kind property; the SessionAssetIdentifierType, EventIdentifierType, SessionIdentifierType and SpeakerIdentifierType aliases.
  • Concept introduced, the DTO as the single source of the asset field caps. [Rubric §15, Best Practices & Code Quality] (assesses whether one fact lives in one place), the same pattern SessionDTO uses for its own fields. Four const int caps at the top of this type (SessionAssetDTO.cs:18-27) are the only declaration of the asset field lengths: TitleMaxLength 200, UrlMaxLength 2000 (matching the other URL columns in the module), BlobNameMaxLength 500 and ContentTypeMaxLength 100 (both files-only).
  • Concept, the concurrency-aware read contract. [Rubric §9, API & Contract Design] and [Rubric §8, Data Architecture], mirroring SessionDTO: beyond IBaseDTO's Id, this DTO implements IConcurrencyAware and round-trips the EF RowVersion token (SessionAssetDTO.cs:33) as the response ETag.
  • Walkthrough
    • Field caps (SessionAssetDTO.cs:18-27): the four const int values described above.
    • Identity and concurrency: Id (SessionAssetDTO.cs:30, required) and RowVersion (SessionAssetDTO.cs:33).
    • Foreign keys: EventId (SessionAssetDTO.cs:36) and SessionId (SessionAssetDTO.cs:39), both required, so an asset cannot be constructed on the wire without its owning event and session.
    • Kind (SessionAssetDTO.cs:42): the SessionAssetKind discriminator.
    • Title and Url (SessionAssetDTO.cs:45-48), both required.
    • File-only metadata, all nullable and unset for a Link row: BlobName (SessionAssetDTO.cs:51), ContentType (SessionAssetDTO.cs:54) and SizeBytes (SessionAssetDTO.cs:57).
    • SortOrder (SessionAssetDTO.cs:60): the display order within the session's asset list.
    • UploadedBySpeakerId (SessionAssetDTO.cs:66): nullable; null when an organizer added the asset on the session's behalf rather than the speaker.
  • Why it's built this way: keeping the file-only fields nullable rather than splitting the DTO into a FileAsset/LinkAsset pair lets both kinds share one wire contract and one child collection, with SessionAssetKind as the single flag callers branch on. Manual DTO shaping (ADR-001) keeps the contract explicit and decoupled from the EF entity.
  • Where it's used: produced by SessionAssetDTOMapper and read by SessionAssetInvariants, SessionAssetAccessService, UploadSessionAssetHandler, AddSessionAssetLinkHandler and GetSessionAssetsHandler; exposed by SessionAssetsController and consumed by the UI's SessionAssetsPanel.razor.cs and SessionAssetService.

NowNextDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/NowNextDTO.cs:14 · Level 1 · record

  • What it is: the "happening now / up next" snapshot for a single event: which sessions are running at the query instant and which start next, plus whether the event is currently live.
  • Depends on: NowNextSessionDTO (Level 0, the row type); the EventIdentifierType alias; BCL (IReadOnlyList<T>).
  • Concept introduced, the composed glanceable read model. [Rubric §9, API & Contract Design] (assesses purpose-built read contracts over exposing raw entities). Rather than make a widget page the full session list and filter client-side, this DTO is the entire payload of the now-next endpoint: one event's identity plus two pre-filtered session batches. [Rubric §5, Vertical Slice]: the snapshot is shaped by exactly one query's needs and is not reused across unrelated screens, which is why it lives beside the slice that produces it rather than in a shared "models" bucket.
  • Walkthrough: a positional sealed record with five parameters (NowNextDTO.cs:14-19).
    • EventId and EventName name the featured event (NowNextDTO.cs:15-16); the handler fills them from the selected Event aggregate (GetNowNextHandler.cs:79).
    • IsLive (NowNextDTO.cs:17) is true when the event's live window contains the query instant. The window itself is computed by CurrentEventSelector and compared against TimeProvider's UTC now (GetNowNextHandler.cs:76-77), so the flag is deterministic under test.
    • Now (NowNextDTO.cs:18) holds the sessions whose UTC window brackets the query instant, ordered by start then room name (GetNowNextHandler.cs:60-64); it is empty outside session hours.
    • Next (NowNextDTO.cs:19) holds the batch sharing the earliest future start, so parallel tracks surface together instead of one arbitrary winner (GetNowNextHandler.cs:67-74, and the doc comment at NowNextDTO.cs:13). Both batches are IReadOnlyList<NowNextSessionDTO>, so the shape is a fixed, ordered projection the caller cannot mutate.
  • Why it's built this way: batching Next as a list rather than a single session is the modelling decision that makes the widget correct on a multi-track schedule. Local-plus-UTC times live on the row type, keeping this envelope thin. The endpoint is [AllowAnonymous] and output-cached under the NowNextCache policy (EventsController.cs:161-163) because the payload is public and changes with the clock, which is the [Rubric §12, Performance & Scalability] lever for a widget that polls.
  • Where it's used: returned as Result<NowNextDTO> by GetNowNextHandler (GetNowNextHandler.cs:25) for GetNowNextQuery; exposed by EventsController both per event (GET {id}/now-next, EventsController.cs:127) and in the id-less "current event" form the home-screen widget calls (GET now-next, EventsController.cs:142). Both NowNextWidgetProvider and Engagement's INowNextService deliberately mirror this wire shape locally instead of referencing the type, so neither takes a project reference on Conference.

SessionCategoryItemDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionCategoryItemDTO.cs:8 · Level 1 · record

  • What it is: the DTO for one row of the many-to-many join between a session and a category item (the topic, format, level and similar tag taxonomies).
  • Depends on: IBaseDTO<TIdentifierType> (SessionCategoryItemDTO.cs:1,8); the SessionCategoryItemIdentifierType, SessionIdentifierType and CategoryItemIdentifierType aliases.
  • Concept introduced, the join-row DTO. [Rubric §9, API & Contract Design] (assesses contracts that mirror the relational model without leaking EF entities). This is the read-side twin of the SessionCategoryItem link entity: it carries its own surface Id plus the two foreign keys that define the association, and nothing else. [Rubric §8, Data Architecture]: a join with its own identity, rather than a bare composite key, is what lets the association be addressed, created and deleted as a resource in its own right.
  • Walkthrough: a record class implementing IBaseDTO<TIdentifierType> with three required init members (SessionCategoryItemDTO.cs:11-17): Id (the join row's own key), SessionId (FK to the parent session) and CategoryItemId (FK to the category item). required forces every member to be set at construction, init freezes them afterwards. It shares its exact shape with SessionSpeakerDTO, where the family walkthrough lives.
  • Why it's built this way: a hand-declared record keeps the wire contract explicit and decoupled from the EF link entity (ADR-001 manual DTO mapping).
  • Where it's used: nested as SessionCategoryItems on SessionDTO (SessionDTO.cs:121); produced by SessionDTOMapper and filled on demand by navigation populators (ADR-002); it is also the request and response shape of AddSessionCategoryItemHandler and SessionCategoryItemsController.

SessionQuestionAnswerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionQuestionAnswerDTO.cs:9 · Level 1 · record

  • What it is: the DTO linking a session to a question together with the speaker's answer value: the read-side row for one per-session questionnaire response.
  • Depends on: IBaseDTO<TIdentifierType> (SessionQuestionAnswerDTO.cs:1,9); the SessionQuestionAnswerIdentifierType, SessionIdentifierType and QuestionIdentifierType aliases.
  • Concept: the join-row DTO with a payload column, a variant of the shape introduced by SessionCategoryItemDTO. Unlike the two pure two-FK joins, this one also carries an attribute of the relationship. [Rubric §9, API & Contract Design]: the answer belongs to the pairing of session and question, not to either side alone, so the join row is the only honest place to put it.
  • Walkthrough: a record class implementing IBaseDTO<TIdentifierType> with four required init members (SessionQuestionAnswerDTO.cs:12-21): Id, SessionId (FK to the parent session), QuestionId (FK to the Question) and the distinguishing AnswerValue string (SessionQuestionAnswerDTO.cs:21). That extra column is the only structural difference from the two pure join DTOs, and note it is required: an answer row with no answer cannot be constructed.
  • Why it's built this way: modelling the answer as a first-class join row (identity plus the answer value) lets the session own a replaceable collection of answers, and lets the wire contract stay independent of the EF link entity (ADR-001).
  • Where it's used: nested as SessionQuestionAnswers on SessionDTO (SessionDTO.cs:118); produced by SessionDTOMapper and navigation populators (ADR-002); carried by AddSessionQuestionAnswerHandler, its batch sibling BatchAddSessionQuestionAnswersHandler (the import path, which writes many answers per session in one command) and SessionQuestionAnswersController.

SessionSpeakerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionSpeakerDTO.cs:8 · Level 1 · record

  • What it is: the DTO for one row of the many-to-many join between a session and a speaker.

  • Depends on: IBaseDTO<TIdentifierType> (SessionSpeakerDTO.cs:1,8); the SessionSpeakerIdentifierType, SessionIdentifierType and SpeakerIdentifierType aliases.

  • Concept: identical in shape to SessionCategoryItemDTO, the canonical two-FK join-row DTO. Both carry their own Id plus the two association foreign keys and nothing else.

  • Walkthrough: a record class implementing IBaseDTO<TIdentifierType> with three required init members (SessionSpeakerDTO.cs:11-17): Id (join row key), SessionId (FK to the parent session) and SpeakerId (FK to the Speaker). The three join DTOs in this Sessions folder form a near-identical family, an {Id, parent FK, target FK} triple per join table, with one of them adding a payload field:

    Type File:Line Notes (what differs)
    SessionSpeakerDTO MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionSpeakerDTO.cs:8 Target FK is SpeakerId (:17).
    SessionCategoryItemDTO MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionCategoryItemDTO.cs:8 Target FK is CategoryItemId (:17).
    SessionQuestionAnswerDTO MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionQuestionAnswerDTO.cs:9 Target FK is QuestionId (:18), plus a required AnswerValue string (:21).
  • Why it's built this way: giving each join its own surface DTO, rather than exposing a raw composite key, keeps the child collections on SessionDTO addressable row by row and lets the contract stay independent of the EF link entities (ADR-001).

  • Where it's used: nested as SessionSpeakers on SessionDTO (SessionDTO.cs:115); produced by SessionDTOMapper and navigation populators (ADR-002); written by AddSessionSpeakerHandler and exposed by SessionSpeakersController. Because the collection defaults to empty (see SessionDTO), a list query whose populator does not include this navigation returns sessions with no speakers rather than an error, so this is the collection to check first when a session list renders without speaker names.

SessionDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionDTO.cs:15 · Level 2 · record

  • What it is: the full read-side contract for a conference session: the field-length constants, the scalar fields (title, schedule, status flags, media URLs), the foreign keys to event and room, and the three child collections (speakers, question answers, category items).
  • Depends on: IBaseDTO<TIdentifierType> and IConcurrencyAware, the two contracts it implements (SessionDTO.cs:1,15); its three child DTOs SessionSpeakerDTO, SessionQuestionAnswerDTO and SessionCategoryItemDTO; the SessionIdentifierType, EventIdentifierType and RoomIdentifierType aliases.
  • Concept introduced, the DTO as the single source of the field caps. [Rubric §15, Best Practices & Code Quality] (assesses whether one fact lives in one place). The seven const int caps at the top of this type (SessionDTO.cs:18-40) are the only declaration of the session field lengths in the system: TitleMaxLength 500, DescriptionMaxLength 8000, StatusMaxLength 100, AccessibilityInfoMaxLength 500, ResourceLinksMaxLength 2000, LiveUrlMaxLength 2000, RecordingUrlMaxLength 2000. DescriptionMaxLength is 8000 because Sessionize imposes no fixed cap of its own and a refresh drops any session the domain refuses, so the constant sits well above the longest proposal seen so far (4055 chars) (SessionDTO.cs:20-25). The doc comment explains the placement (SessionDTO.cs:8-13): Shared is the lowest layer that Domain, Infrastructure and UI can all reach, so the caps sit here and every other layer consumes them. SessionInvariants re-exports them as its own constants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionInvariants.cs:17,20,23,32), which is what the domain guards, the EF configuration and the validators then read, while the UI form binds them straight off this type (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Sessions/SessionFormModel.cs:54,58,62). One edit here moves the database column, the domain guard and the client-side MaxLength together.
  • Concept, the concurrency-aware read contract. [Rubric §9, API & Contract Design] and [Rubric §8, Data Architecture]. Beyond IBaseDTO's Id, this DTO implements IConcurrencyAware, so it round-trips the EF RowVersion token (SessionDTO.cs:46). The API renders that token as the response ETag, and a client echoes it in If-Match on its next write; a write that states no precondition is refused with 428 Precondition Required rather than falling back to last-write-wins (the contract's own remarks, MMCA.Common/Source/Core/MMCA.Common.Shared/DTOs/IConcurrencyAware.cs:9-14). The CA1819 ("properties should not return arrays") waiver lives once on the interface member in MMCA.Common (IConcurrencyAware.cs:18), not on each implementing DTO.
  • Walkthrough
    • Field caps (SessionDTO.cs:18-40): the seven const int values described above.
    • Identity and concurrency: Id (SessionDTO.cs:43) and RowVersion, a non-nullable byte[] defaulting to the empty collection literal [] (SessionDTO.cs:46), satisfy the two implemented contracts.
    • Scalars (SessionDTO.cs:49-94): a required Title, an optional Description, an optional StartsAt/EndsAt pair (SessionDTO.cs:54-64) carried as the event-local wall clock, the time attendees read in the event time zone (EventDTO.TimeZone), with no UTC offset, a free-text Status (Accepted, Declined, Waitlisted, Nominated), four bool flags (IsInformed, IsConfirmed, IsServiceSession, IsPlenumSession, SessionDTO.cs:70-79), two URL strings kept as string (LiveUrl, RecordingUrl, SessionDTO.cs:82,85), plus AccessibilityInfo, ResourceLinks and a nullable Duration in minutes.
    • Foreign keys: a required EventId (SessionDTO.cs:97, every session belongs to an event) and an optional RoomId (SessionDTO.cs:100, a session may not yet be placed in a room).
    • RoomName (SessionDTO.cs:112): a nullable, flattened copy of the assigned room's name. It exists for sorting: the session grids order by room name rather than the integer RoomId, and the query service maps this field to the Room.Name entity path so the database does the ordering (SessionDTO.cs:102-111). It is only populated when the read asks for FK navigations (includeFKs=true), which list reads do not, so a UI that displays the room name resolves it from its own lookup instead.
    • Child collections (SessionDTO.cs:115-121): SessionSpeakers, SessionQuestionAnswers and SessionCategoryItems, each an IReadOnlyCollection<...> defaulted to [].
  • Why it's built this way: defaulting each child collection to [] means a query that does not run the matching populator returns an empty collection instead of a null reference, so callers never null-check a navigation. The trade-off is that "not populated" and "genuinely empty" are indistinguishable on the wire, which is why a missing populator shows up as absent data rather than as an error; RoomName carries the same trade-off outside includeFKs=true reads. Manual DTO shaping (ADR-001) keeps the contract explicit; navigation populators (ADR-002) fill the child collections per query.
  • Where it's used: mapped from the Session aggregate by SessionDTOMapper, returned by the session read endpoints on SessionsController, and consumed by the Conference UI session pages through SessionFormModel.
  • Caveats / not-in-source: Status is a free-text string, not a closed enum, and this DTO does not itself constrain the allowed values; the eligibility rule lives in SessionStatuses (SessionStatuses.IsEligible), which the domain applies through SessionInvariants (SessionInvariants.EnsureStatusIsEligible).

SessionCalendarExport

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionCalendarExport.cs:9 · Level 3 · class (static)

  • What it is: the single rule for whether a session can appear in a public calendar (ICS) export (SessionCalendarExport.cs:3-8). It is a static class with two IsExportable overloads and no state.
  • Depends on: SessionStatuses (for IsEligible) and SessionDTO (for the DTO overload).
  • Concept introduced, one predicate in the shared contract layer. [Rubric §4, Domain-Driven Design] (assesses whether a business rule has one authoritative home). The class lives in Shared, not in Application, so the export handlers and the UI apply the identical test. The doc comment (SessionCalendarExport.cs:4-7) states the consequence: a page never offers an Add to calendar control for a download that Sessions/{id}/ics would answer with 404.
  • Walkthrough
    • IsExportable(DateTime? startsAt, DateTime? endsAt, bool isServiceSession, string? status) (SessionCalendarExport.cs:22-26): true only when both startsAt and endsAt are set, the session is not a service session (break, lunch and similar), and SessionStatuses.IsEligible(status) holds (BR-49). The doc comment (:11-16) notes it is role-independent by design: the ICS document is a public-schedule artifact, so privileged callers get the same filtered export.
    • IsExportable(SessionDTO session) (SessionCalendarExport.cs:31-35): guards with ArgumentNullException.ThrowIfNull, then forwards StartsAt, EndsAt, IsServiceSession and Status to the primitive overload, so callers that hold a DTO and callers that hold raw fields cannot diverge.
  • Why it's built this way: the primitive overload exists so server-side code that has not materialized a SessionDTO can still call the same rule, while the DTO overload serves the UI and the handlers that already have one.
  • Where it's used: CalendarExportMapper delegates to it (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/ExportCalendar/CalendarExportMapper.cs:22,26), and the export and Now/Next handlers filter with CalendarExportMapper.IsExportable (.../ExportCalendar/ExportEventCalendarHandler.cs:45, .../NowNext/GetNowNextHandler.cs:48), all G18.
  • Caveats / not-in-source: the second consumer named in the usage scan (the UI side that decides whether to show the control) was not confirmed from source here; the claim rests on the class doc comment (SessionCalendarExport.cs:5-6).

ISessionBookmarkValidationService

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/ISessionBookmarkValidationService.cs:11 · Level 3 · interface

  • What it is: the cross-module service contract the Engagement module calls to check whether a session may be bookmarked, and to list a given event's session ids, without referencing Conference domain entities directly.
  • Depends on: Result and ServiceContractAttribute, both from MMCA.Common.Shared.Abstractions (ISessionBookmarkValidationService.cs:1,10); the SessionIdentifierType and EventIdentifierType aliases.
  • Concept introduced, the cross-module boundary interface. [Rubric §7, Microservices Readiness] (assesses whether module coupling flows through an abstraction that can be re-satisfied over a wire once the modules split into separate services). The doc comment states the arrangement (ISessionBookmarkValidationService.cs:5-9): the interface is declared in the owning module's Shared project and implemented in Conference.Application, so Engagement depends only on the abstraction. When both modules run in one process, DI binds the real implementation; when Engagement runs as its own service, the same interface is satisfied by a gRPC adapter (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Contracts/SessionBookmarkValidationServiceGrpcAdapter.cs:29).
  • Concept, the [ServiceContract] marker. [Rubric §34, Architecture Governance & Documentation]. The attribute on line 10 is not runtime behavior: it marks this interface as part of a published wire surface, and the ServiceContractPurityTestsBase fitness rule scans every mapped assembly for types carrying it and fails the build if a contract type reaches back into the producing service's Domain, Application or Infrastructure layer (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/ServiceContractAttribute.cs:3-14). The marker is what turns "please keep this interface pure" into an enforced rule (ADR-007).
  • Walkthrough: two async members, both taking CancellationToken as the final parameter per the codebase convention.
    • ValidateSessionForBookmarkAsync(SessionIdentifierType, CancellationToken) (ISessionBookmarkValidationService.cs:20) returns Task<Result> and, per its doc comment (ISessionBookmarkValidationService.cs:13-16), checks that the session exists, is not a service session (BR-91) and has an eligible status (BR-49). The in-process implementation delegates both checks to SessionInvariants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/SessionBookmarkValidationService.cs:33,38), so the module boundary and the aggregate enforce the same rule text.
    • GetSessionIdsByEventAsync(EventIdentifierType, CancellationToken) (ISessionBookmarkValidationService.cs:31) returns Task<Result<IReadOnlyCollection<SessionIdentifierType>>>: the ids of every session in an event, used by Engagement for event-scoped bookmark filtering (BR-58). Note that the collection is wrapped in a Result, which the doc comment justifies (ISessionBookmarkValidationService.cs:28-30): once this call can cross a gRPC boundary, "Conference is unreachable" is a distinct outcome from "this event has no sessions", and an empty list must not silently stand in for an outage.
  • Why it's built this way: returning Result instead of throwing lets Engagement fold a validation failure into its own command result; keeping the interface in Shared (not Application) is what allows the gRPC adapter to be substituted without Engagement ever seeing Conference internals (ADR-007 gRPC extraction, ADR-008 service topology).
  • Where it's used: injected into Engagement's CreateBookmarkHandler and GetUserBookmarksHandler. Two implementations satisfy it depending on topology: the in-process SessionBookmarkValidationService and the wire-crossing SessionBookmarkValidationServiceGrpcAdapter. The Conference service exposes the server side of it over gRPC in SessionBookmarksGrpcService.

CategoryItemDistribution

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/CategoryDistributionDTO.cs:27 · Level 0 · record (sealed)

  • What it is: the submission breakdown for a single category item (for example "Cloud", or "300 - Intermediate"): how many sessions tagged with that item were submitted, and how many landed in each status bucket. It is the innermost leaf of the category-balance analysis an organizer reads while selecting sessions.
  • Depends on: CategoryItemIdentifierType (the module id alias, a solution-wide global using, so no first-party link, see the primer on strongly-typed identifier aliases). No first-party type references beyond the alias.
  • Concept introduced, the decision-support read model. [Rubric §6, CQRS & Event-Driven] (assesses read models shaped for the query rather than the write schema) and [Rubric §12, Performance & Scalability] (assesses computing aggregates server-side instead of shipping raw rows). This unit is a family of pure analytics DTOs that back the organizer's session-selection dashboard. Unlike the entity-mirroring DTOs elsewhere in this chapter (for example SessionDTO), none of them implement IBaseDTO: they carry no Id, are never persisted, and are not addressable resources. They are the output of read-side query handlers that fold hundreds of session rows into counts and scores the UI can render directly. CategoryItemDistribution is the leaf of that fold: one row per category item, pre-counted.
  • Walkthrough: six required init members (CategoryDistributionDTO.cs:30-45). CategoryItemId and CategoryItemName identify the item; then four counts, TotalSubmitted (excludes declined, line 36), AcceptedCount (status "Accepted" or null, line 39), AcceptQueueCount (status "Accept_Queue", line 42), and PendingCount (line 45: every non-declined status other than accepted and "Accept_Queue", so Nominated, Waitlisted, "Decline_Queue" or an unrecognized value). Pending is therefore the catch-all bucket for any non-declined status the other two do not claim. Every field is required, so a distribution row is never half-populated. The status vocabulary is the same loose Sessionize-sourced set that SessionDTO.Status carries; the counts are bucketed by the query handler, not by the record.
  • Why it's built this way: pushing the count-by-status math into the handler and shipping just the totals keeps the dashboard client dumb and cheap, an organizer viewing category balance across a whole event never fetches individual sessions.
  • Where it's used: nested as the Items collection on CategoryGroupDistribution; built inside the private BuildCategoryGroups step of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:164, :180), ultimately surfaced through SessionSelectionController.

ScoreEventSessionsResultDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionAiScoreDTO.cs:68 · Level 0 · record (sealed)

  • What it is: the tiny outcome payload of a batch AI scoring operation: how many of an event's sessions were scored and how many failed. It is the response body a caller gets back after asking the system to score an event's sessions.
  • Depends on: nothing first-party. Two int counts only.
  • Concept reinforced, the command result DTO. [Rubric §9, API & Contract Design] (a write operation returns a small, honest summary of what it did). Unlike the query read models around it, this is the result of an action (scoring), not a projection of data. It reports partial success explicitly: scoring hundreds of sessions against an external AI model is expected to have some failures, so the contract carries both a success count and a failure count rather than an all-or-nothing boolean.
  • Walkthrough: two required init members (SessionAiScoreDTO.cs:71-74), SessionsScored and SessionsFailed. That is the whole record; there is no aggregate id because a batch score spans an entire event.
  • Why it's built this way: separating scored from failed lets the organizer UI show "48 scored, 2 failed" and offer a retry, rather than hiding partial progress behind a single flag.
  • Where it's used: returned by ScoreEventSessionsHandler in Conference.Application; the individual scores it writes are read back as SessionAiScoreDTO rows.

[Rubric §16, AI-Native Application Architecture] applies: this type is part of the AI session-scoring feature (a model call behind a port, versioned prompt and model, an evaluation gate, metered spend; ADR-111).

SessionAiScoreDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionAiScoreDTO.cs:6 · Level 0 · record (sealed)

  • What it is: the richest leaf in this family: the AI-generated score for one session, bundled with enough display context (title, status, speaker localities, categories, level) that a dashboard row is self-contained. It is what the organizer sees when the AI has ranked an event's submissions.
  • Depends on: SessionIdentifierType alias (no first-party link). All other members are primitives, string, DateTime, or IReadOnlyList<string>.
  • Concept introduced, the self-contained scored row. [Rubric §12, Performance & Scalability] (assesses shaping the payload so the client does no secondary lookups) and [Rubric §9, API & Contract Design]. The interesting move is that the score does not travel alone: alongside the numbers it carries SpeakerLocalities, SessionCategories, and SessionLevel (lines 56-62), so the organizer dashboard can print a complete, sortable row for each session without an N+1 fetch back to the Session, Speaker, or Category aggregates. [Rubric §13, Observability & Operability]: the record also records how the number was produced, ModelUsed (line 39), PromptVersion (line 47), and ScoredOn (line 50), so a score is auditable, comparable against another score, and its staleness visible.
  • Walkthrough: SessionId + SessionTitle (lines 9-12, required) identify the row. Then the scores, all required decimal on a 1.0 to 10.0 scale: an OverallScore (line 15) plus six dimension sub-scores, TopicRelevanceScore, DescriptionQualityScore, NoveltyScore, ActionableTakeawaysScore, DepthOrInsightQualityScore, CredibilityExperienceScore (lines 18-33). Reasoning (line 36, required) holds the model's free-text justification. ModelUsed (line 39), PromptVersion (line 47), and ScoredOn (line 50) capture provenance, all three required. PromptVersion is the reviewer-brief contract version behind the numbers, shaped yyyy-MM-dd.N or the sentinel legacy for rows written before the column existed (documented at SessionAiScoreDTO.cs:41-46); the value comes from the scoring service's own constant, today "2026-09-04.1" (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Sessions/Scoring/SessionScoringService.cs:55). The tail members are optional display context: Status (line 53, nullable), SpeakerLocalities and SessionCategories (lines 56-59, defaulted to [] so never null), and SessionLevel (line 62, nullable). SpeakerLocalities is the speaker-locality convention surfacing here: those tier names come from a CategoryItem under the "Where are you traveling from" category (Sessionize id 121854), not from any geographic field on Speaker (resolved by SpeakerLocalityHelper in Conference.Application, SpeakerLocalityHelper.cs:19-33).
  • Why it's built this way: embedding display context in the score DTO avoids per-row lookups on a dashboard that shows every session in an event at once, and recording the model id, the prompt contract version, and the timestamp keeps an AI-produced number honest and re-scorable. Two scores are only comparable when both the model and the prompt behind them match, so surfacing PromptVersion next to ModelUsed is what lets a reader tell a genuine ranking change from a change of reviewer brief.
  • Where it's used: nested as the AiScores collection on SessionSelectionDashboardDTO; projected from the SessionAiScore entity by GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:376 carries PromptVersion across), written by SessionScoringRunner, the pass that ScoreEventSessionsInternalCommandHandler runs (ScoreEventSessionsInternalCommandHandler.cs:53), which stamps aiScoringService.ModelId and aiScoringService.PromptVersion (SessionScoringRunner.cs:97) and returns a ScoreEventSessionsResultDTO summary), and read back through SessionSelectionController.
  • Caveats / not-in-source: the 1.0 to 10.0 range and the status vocabulary are documented in the property comments and enforced by the scoring handler and the external model prompt, not by this record. The legacy sentinel is likewise a convention, not a constant on this type: rows predating the column were backfilled with it by the AddSessionAiScorePromptVersion migration (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Sessions/SessionAiScoreConfiguration.cs:59-61).

[Rubric §16, AI-Native Application Architecture] applies: this type is part of the AI session-scoring feature (a model call behind a port, versioned prompt and model, an evaluation gate, metered spend; ADR-111).

SpeakerLocalitySummary

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionSelectionDashboardDTO.cs:45 · Level 0 · record (sealed)

  • What it is: the roll-up for one locality tier (for example "Atlanta and Suburbs", "Georgia"): how many speakers fall in that tier and how their sessions break down by status. It backs the "are we programming enough local speakers?" view.
  • Depends on: nothing first-party. A string tier name and four int counts.
  • Concept reinforced, locality as a category, not a field. [Rubric §4, DDD] (assesses modeling a real domain concept faithfully rather than bolting on an ad-hoc attribute). The LocalityTier string is not read from any geographic property on Speaker: ADC tracks where a speaker travels from through a CategoryItem under the "Where are you traveling from" category (Sessionize id 121854). SpeakerLocalityHelper (Conference.Application) resolves a speaker's tier from their category-item assignments (SpeakerLocalityHelper.cs:19-33) and even flags Atlanta/Georgia/Surrounding as "local" (SpeakerLocalityHelper.cs:41-49). This DTO is the pre-tallied output of that resolution.
  • Walkthrough: five required init members (SessionSelectionDashboardDTO.cs:48-60). LocalityTier names the tier; SpeakerCount counts speakers in it; SessionCount totals their sessions; AcceptedSessionCount and AcceptQueueSessionCount (status "Accept_Queue") break those down. The status buckets mirror the ones on CategoryItemDistribution, keeping the vocabulary consistent across the dashboard.
  • Why it's built this way: pre-counting by tier lets the organizer see local-versus-remote balance at a glance; deriving locality from the category system (rather than a speaker field) keeps the model aligned with how the data actually arrives from Sessionize.
  • Where it's used: nested as the SpeakerLocality collection on SessionSelectionDashboardDTO; assembled by GetSessionSelectionDashboardHandler in Conference.Application.

SpeakerSessionSummary

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SpeakerSessionOverlapDTO.cs:44 · Level 0 · record (sealed)

  • What it is: a compact summary of one submitted session as it appears inside a speaker's overlap entry: id, title, status, and the category tags on it. It is a leaf of the speaker-overlap view, not a general session projection.
  • Depends on: SessionIdentifierType alias (no first-party link). Otherwise string, nullable string, and IReadOnlyList<string>.
  • Concept reinforced, the purpose-shaped leaf. [Rubric §6, CQRS & Event-Driven]. This carries far less than the full SessionDTO: it exists only to list, under a speaker, the sessions that speaker submitted, so it drops everything the overlap review does not need (schedule, media links, concurrency token). CategoryItemNames is a flat list of names rather than join rows because the review just needs to read the tags, not edit them.
  • Walkthrough: four required init members (SpeakerSessionOverlapDTO.cs:46-56). SessionId and Title identify the session; Status (nullable) is the loose Sessionize status; CategoryItemNames lists its category tags by name.
  • Why it's built this way: shaping a minimal per-session leaf keeps the speaker-overlap payload small even when a speaker has several submissions, and pre-resolving category names (rather than ids) means the UI needs no CategoryItem lookup.
  • Where it's used: nested as the Sessions collection on MultiSessionSpeaker; assembled by the private ComputeSpeakerOverlap method of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:217, :240).

CategoryGroupDistribution

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/CategoryDistributionDTO.cs:14 · Level 1 · record (sealed)

  • What it is: the distribution for a single category (for example "Track" or "Level") together with the per-item breakdown inside it. It is the middle tier of the category-balance analysis, one level up from CategoryItemDistribution.
  • Depends on: CategoryItemDistribution (its Items collection); ConferenceCategoryIdentifierType alias (no first-party link).
  • Concept reinforced, the composition tier. [Rubric §6, CQRS & Event-Driven]. The read model mirrors the category, category-item hierarchy of the Category aggregate as a nested DTO graph shaped for display: a category names itself, then owns the list of its items' distributions.
  • Walkthrough: three required init members (CategoryDistributionDTO.cs:17-23). CategoryId and CategoryTitle identify the category; Items is a required IReadOnlyList<CategoryItemDistribution>, one leaf per item.
  • Why it's built this way: grouping item distributions under their parent category lets the dashboard render one balance table per category (a Track table, a Level table) without the client having to regroup a flat list.
  • Where it's used: nested as the Categories collection on CategoryDistributionDTO; built inside the private BuildCategoryGroups step of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:164, :170).

MultiSessionSpeaker

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SpeakerSessionOverlapDTO.cs:18 · Level 1 · record (sealed)

  • What it is: a speaker together with the sessions they submitted (one or more), plus a flag for whether they already have an accepted talk. Despite the name it includes single-session speakers too; it is named for the review scenario it powers (organizers should accept at most one session per speaker).
  • Depends on: SpeakerSessionSummary (its Sessions collection); SpeakerIdentifierType alias (no first-party link).
  • Concept reinforced, the review-shaped grouping. [Rubric §6, CQRS & Event-Driven] and [Rubric §12, Performance & Scalability]. The read model is grouped by speaker (not by session) precisely because the decision it supports is per-speaker, and it precomputes HasAcceptedSession so the UI can immediately flag a speaker who already has a talk in, without scanning their session list client-side.
  • Walkthrough: six members (SpeakerSessionOverlapDTO.cs:21-40). SpeakerId and SpeakerName (required) identify the speaker; IsDeleted (line 31, optional bool) flags a soft-deleted speaker: speaker deletion does not cascade to session links (BR-70/BR-71), so a deleted speaker can still hold submitted sessions, and the report keeps the row (it promises every speaker) while the UI labels it (SpeakerSessionOverlapDTO.cs:26-30); LocalityCategory (line 34, nullable) is their locality tier from the "Where are you traveling from" category (id 121854), the same category-driven locality convention SpeakerLocalitySummary rolls up; HasAcceptedSession (required bool) is the precomputed accept flag; Sessions (required) is the IReadOnlyList<SpeakerSessionSummary> of their submissions.
  • Why it's built this way: grouping submissions under the speaker and precomputing the accept flag makes the "one talk per speaker" rule enforceable at a glance, which is the entire purpose of the overlap view.
  • Where it's used: nested as the Speakers collection on SpeakerSessionOverlapDTO; assembled by the private ComputeSpeakerOverlap method of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:217, :231).

CategoryDistributionDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/CategoryDistributionDTO.cs:7 · Level 2 · record (sealed)

  • What it is: the top of the category-balance analysis: the full distribution of an event's sessions across every category, grouped by category then by item. Organizers use it to judge whether the accepted program is balanced across tracks and levels.
  • Depends on: CategoryGroupDistribution (its Categories collection), which in turn owns CategoryItemDistribution leaves.
  • Concept reinforced, the three-tier read model. [Rubric §6, CQRS & Event-Driven]. This completes the category, category-group, category-item nesting: CategoryDistributionDTO → many CategoryGroupDistribution → many CategoryItemDistribution. The whole tree is computed once, server-side, from the event's sessions and their CategoryItem assignments.
  • Walkthrough: one required init member (CategoryDistributionDTO.cs:10), Categories, an IReadOnlyList<CategoryGroupDistribution>. The record is a pure envelope; all the counts live in the leaves.
  • Why it's built this way: a single composite tree means the dashboard's category-balance view is one fetch, and each level maps cleanly onto a UI grouping (category heading, item rows, status columns).
  • Where it's used: produced by the private ComputeCategoryDistribution method of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:130, :136), which nests it as the CategoryDistribution member of SessionSelectionDashboardDTO; it is surfaced through SessionSelectionController.

SpeakerSessionOverlapDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SpeakerSessionOverlapDTO.cs:8 · Level 2 · record (sealed)

  • What it is: the top of the speaker-overlap analysis: every speaker who submitted at least one session for an event, ordered so multi-session speakers surface first. It backs the "watch for speakers with multiple submissions" review.
  • Depends on: MultiSessionSpeaker (its Speakers collection), which in turn owns SpeakerSessionSummary leaves.
  • Concept reinforced, the ordered analysis envelope. [Rubric §9, API & Contract Design]. Like CategoryDistributionDTO, it is a single-field wrapper around a list, and the ordering (multi-session speakers first) is a documented contract the handler upholds so the UI can show the speakers who need attention at the top.
  • Walkthrough: one required init member (SpeakerSessionOverlapDTO.cs:11), Speakers, an IReadOnlyList<MultiSessionSpeaker> sorted multi-session-first.
  • Why it's built this way: a named envelope keeps the contract consistent with the sibling analyses and leaves room to add summary fields, while the sort order encodes the review priority directly into the payload.
  • Where it's used: produced by the private ComputeSpeakerOverlap method of GetSessionSelectionDashboardHandler (GetSessionSelectionDashboardHandler.cs:217, :264), which nests it as the SpeakerOverlap member of SessionSelectionDashboardDTO.

SessionSelectionDashboardDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.DecisionSupport · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/DecisionSupport/SessionSelectionDashboardDTO.cs:8 · Level 3 · record (sealed)

  • What it is: the composite that ties the whole family together: one event's session-selection dashboard, aggregating the headline counts, the category distribution, the speaker overlap, the locality breakdown, and the AI scores into a single payload.
  • Depends on: CategoryDistributionDTO, SpeakerSessionOverlapDTO, SpeakerLocalitySummary, and SessionAiScoreDTO (its members and collections); EventIdentifierType alias (no first-party link).
  • Concept reinforced, the composite dashboard read model. [Rubric §6, CQRS & Event-Driven] (a query-shaped DTO assembled from several independent analyses) and [Rubric §12, Performance & Scalability] (one round trip instead of four). This is the root of the decision-support graph: rather than make the organizer UI call one endpoint per analysis, a single query composes all of them, plus the top-line event counts, into one immutable snapshot.
  • Walkthrough: EventId + EventName (lines 11-14, required) identify the event. Five required int headline counts follow, TotalSessions (non-service sessions), AcceptedSessions, AcceptQueueSessions, PendingSessions, DeclinedSessions (lines 17-29), the same status buckets the leaf DTOs use, tallied at event scope; PendingSessions (line 26) is the catch-all for every non-declined status other than accepted and "Accept_Queue" (Nominated, Waitlisted, "Decline_Queue" or an unrecognized value). Then the four analysis members, all required: CategoryDistribution (line 32), SpeakerOverlap (line 35), SpeakerLocality (line 38, an IReadOnlyList<SpeakerLocalitySummary>), and AiScores (line 41, an IReadOnlyList<SessionAiScoreDTO>, documented as empty until an AI scoring run has happened).
  • Why it's built this way: bundling the counts and all four analyses into one composite lets the organizer dashboard render its entire face from a single fetch, and lets the read side cache one blob per event. The AiScores list being allowed to arrive empty keeps the dashboard usable before any ScoreEventSessionsResultDTO run has produced scores.
  • Where it's used: returned by GetSessionSelectionDashboardQuery (assembled by GetSessionSelectionDashboardHandler in Conference.Application); served by SessionSelectionController and consumed by the organizer session-selection dashboard page in the Conference UI.

LinkUserRequest

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/LinkUserRequest.cs:6 · Level 0 · record (sealed)

  • What it is: the request body a client sends to manually bind an Identity user to a Speaker (BR-209, LinkUserRequest.cs:4). It carries exactly one field, the UserId to link.
  • Depends on: nothing first-party. Its one member is typed over the UserIdentifierType alias, which is int and is authored in the Identity module (MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Shared/MMCA.ADC.Identity.GlobalUsings.IdentifierType.cs:2) yet compiled into every other project by a linked <Compile Include> in MMCA.ADC/Directory.Build.props:94-95. That is how a Conference contract can name an Identity id without referencing the Identity assembly (see the primer on identifier-type aliases).
  • Concept introduced, the request record (API input contract). [Rubric §9, API & Contract Design] (assesses whether inbound payloads are declared as explicit, typed contracts rather than loose parameters) and [Rubric §7, Microservices Readiness] (the contract lives in Shared, the project a caller can reference without pulling in Conference's Domain). Where the DTOs below are outbound read shapes, this is an inbound write shape: a sealed record with a single required init UserId (LinkUserRequest.cs:9). required means the model binder cannot leave it unset, and init makes it immutable once bound, so a controller receives a read-only value rather than a mutable bag. The type is deliberately tiny: it exists so the link endpoint has a named, versionable body instead of a bare route or query scalar.
  • Walkthrough: one member, UserId (LinkUserRequest.cs:9), the Identity-side id to attach to the speaker. There is no SpeakerId on the body: that comes from the route (the speaker being edited).
  • Why it's built this way: strongly typing the body over the UserIdentifierType alias keeps "who" named end to end, and placing it in Shared lets the UI and any future extracted client bind the same contract without a Domain reference.
  • Where it's used: bound by SpeakerLinksController.LinkUserAsync, a PUT /Speakers/{id}/link gated by [HasPermission(ConferencePermissions.SpeakersManage)] (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Speakers/SpeakerLinksController.cs:43-58), which forwards request.UserId into the LinkUserToSpeakerCommand (SpeakerLinksController.cs:51), then evicts the conference:speakers output-cache tags and answers 204 No Content (SpeakerLinksController.cs:56-57). This endpoint moved off the speaker CRUD controller onto its own sub-resource controller so SpeakersController stays within the repo's constructor-dependency ceiling; the route, verb and authorization posture are unchanged by the split (SpeakerLinksController.cs:17-22). The command's handler enforces BR-208 first (no other speaker may already hold that LinkedUserId, otherwise a Speaker.UserAlreadyLinked invariant failure comes back) and only then links and raises SpeakerLinkedToUser on the aggregate before the save (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/UseCases/LinkUser/LinkUserToSpeakerHandler.cs:42-55,57-64), so the outbox row lands in the same transaction as the link itself, which is exactly what the handler's own comment records (ADR-003, LinkUserToSpeakerHandler.cs:60-62).

RatingQuestionSummary

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SessionFeedbackDTO.cs:22 · Level 0 · record (sealed)

  • What it is: one row of a session's aggregated rating feedback, the per-question roll-up of a numeric rating: the question, its average score, and how many responses fed that average. It is a child component of SessionFeedbackDTO.
  • Depends on: nothing first-party (uses the QuestionIdentifierType alias, int); BCL only.
  • Concept introduced, the hand-built query-projection record. [Rubric §6, CQRS & Event-Driven] (assesses read models shaped for the query, not the table) and [Rubric §9, API & Contract Design]. Unlike the entity DTOs later in this part, this record does not implement IBaseDTO<TIdentifierType> and is not produced by a Mapperly mapper: it is a bespoke aggregation shape assembled by a query handler from a group-by over answers. It exists purely as the wire shape of a computed report.
  • Walkthrough: four required init members (SessionFeedbackDTO.cs:25-34), QuestionId, QuestionText (so the client renders a label without a second lookup), AverageRating (a double, the computed mean), and ResponseCount (the sample size behind that mean). The mean is computed in memory over the answers that parse as integers under CultureInfo.InvariantCulture (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/UseCases/GetSessionFeedback/GetSessionFeedbackHandler.cs:71-84), so ResponseCount counts parseable ratings, not raw answer rows.
  • Why it's built this way: carrying QuestionText and ResponseCount alongside the average makes the record self-describing, so a UI can show "4.6 (from 32 responses)" straight from the payload.
  • Where it's used: nested in SessionFeedbackDTO.Ratings; built by GetSessionFeedbackHandler.
  • Caveats / not-in-source: a rating question whose answers are all unparseable produces no summary row at all rather than a zero-count one, because the handler only adds the record when at least one value parsed (GetSessionFeedbackHandler.cs:77-86). A consumer therefore cannot tell "nobody rated it" from "the question was never asked" out of this payload alone.

SpeakerPhotoSettings

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerPhotoSettings.cs:9 · Level 0 · class (sealed)

  • What it is: the options class behind the speaker profile picture host allow-list (N-ADC-data-02): which image hosts a speaker's ProfilePicture URL may point at. Its doc comment states the threat it answers: the picture renders as an image that every visitor's browser and the mobile app fetch, so an arbitrary host would let whoever edits a speaker make every visitor's client call a server of their choosing (SpeakerPhotoSettings.cs:3-8).
  • Depends on: nothing first-party; BCL only (IReadOnlyList<string>, Uri).
  • Concept introduced, the bound options class with a safe empty default. [Rubric §11, Security] (an outbound-fetch allow-list on user-editable content) and [Rubric §15, Best Practices & Code Quality] (configuration through typed options, not raw IConfiguration lookups). Two choices make the empty case safe rather than open:
    1. An empty configured list means the default list, never "allow everything". DefaultAllowedHosts is a static ["sessionize.com"], the image host the Sessionize speaker import brings pictures from (SpeakerPhotoSettings.cs:14-18), and the policy falls back to it whenever no non-blank host is configured (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/Validation/SpeakerPhotoHostPolicy.cs:30-31).
    2. The app's own storage host is always allowed on top of the list. StorageServiceUri is not bound from the Conference section: the service host fills it after binding, from FileStorage:ServiceUri, and leaves it null when no storage account is configured (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:296-306). The policy then appends that URI's host to whichever list applies (SpeakerPhotoHostPolicy.cs:32-33), so an uploaded picture never needs its own allow-list entry.
  • Walkthrough: one constant, one static property, two instance properties (SpeakerPhotoSettings.cs:12-32). SectionName = "Conference" (line 12) is the configuration section it binds from, so the key is Conference:SpeakerPhotoAllowedHosts. DefaultAllowedHosts (line 18) is the fallback list. SpeakerPhotoAllowedHosts (line 25) is an init-only IReadOnlyList<string> defaulted to []; its hosts are matched exactly and case-insensitively, which the policy realizes as a trimmed, trailing-dot-stripped FrozenSet under StringComparer.OrdinalIgnoreCase (SpeakerPhotoHostPolicy.cs:35-38). StorageServiceUri (line 32) is the one mutable member, a Uri? with a set accessor precisely so the post-bind Configure callback can write it.
  • Why it's built this way: the type lives in Shared so the setting's shape is visible without referencing Application; the registration deliberately skips ValidateOnStart, because a missing Conference section is the safe default (Sessionize plus own storage), not a misconfiguration (Program.cs:296-299). Deriving the storage host from the existing FileStorage setting instead of asking for it twice keeps the two from drifting apart.
  • Where it's used: bound in the Conference service host next to RoomCheckInSettings, which binds the nested Conference:RoomCheckIn section the same way (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Rooms/RoomCheckInSettings.cs:10, Program.cs:294,300-306); consumed only by SpeakerPhotoHostPolicy through IOptions<SpeakerPhotoSettings> (SpeakerPhotoHostPolicy.cs:25), which checks every write path that sets a new picture (create, update, Sessionize import) and refuses another host with Speaker.ProfilePicture.HostNotAllowed (SpeakerPhotoHostPolicy.cs:8-20).

SponsorTier

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sponsors · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sponsors/SponsorTier.cs:13 · Level 0 · enum

  • What it is: the sponsorship package a conference sponsor bought, from Platinum down to Community. It is the one enum in the Sponsors contract and it drives where a sponsor appears in the public sponsor strip.

  • Depends on: nothing. Four named int members, no attributes, no BCL types beyond the enum itself.

  • Concept introduced, the ordinal-as-ordering enum. [Rubric §9, API & Contract Design] (assesses whether a contract's vocabulary is closed and explicit rather than a loose string) and [Rubric §15, Best Practices & Code Quality]. Two conventions are visible in the declaration and both are load-bearing:

    1. The numeric values are the display order, stated in the type's own doc comment (SponsorTier.cs:4-6): Platinum = 0, Gold = 1, Silver = 2, Community = 3 (SponsorTier.cs:16-25). A plain ascending sort therefore renders the largest package first with no lookup table, and PublicSponsorList relies on exactly that: it groups by Tier and calls .OrderBy(g => g.Key) (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Public/Sponsors/PublicSponsorList.razor.cs:112-116), breaking ties inside a tier by Sort then Name. Renumbering a member would silently reorder the public page.
    2. It is zero-based because CA1008 requires a zero member (SponsorTier.cs:9-12), which has the side effect that an omitted tier defaults to the top package rather than to an "unknown" bucket. The type's remarks call this out rather than leaving it as an accident.

    Contrast this with the loose status strings elsewhere in the Conference contract (for example SessionDTO.Status, a nullable string carrying Sessionize's vocabulary as free text and bounded only by a length cap, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionDTO.cs:28,67): tiers are sold by ADC itself, so the set is closed and can be an enum.

  • Walkthrough: four members with explicit values (SponsorTier.cs:16-25). There is no None, Unknown, or [Flags] member: a sponsor always has exactly one package.

  • Why it's built this way: encoding package rank in the ordinal keeps ordering logic out of the UI and out of SQL; the explicit values (rather than implicit ones) make the ordering contract visible in the source so a future insertion has to be a deliberate decision.

  • Where it's used: the Sponsor aggregate stores it (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/Sponsor.cs:24) and takes it on create and update (Sponsor.cs:65,108,158); it crosses the API boundary on SponsorDTO.Tier and on SponsorCreateRequest / SponsorUpdateRequest; the UI keys its grouped view model on it (PublicSponsorList.razor.cs:52) and renders the label through a localized resource key, L[$"Tier.{tier}"] (PublicSponsorList.razor.cs:55), which is [Rubric §27, i18n] in miniature: the enum member name is the resource key, so the label translates without a switch statement.


TextQuestionResponses

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SessionFeedbackDTO.cs:38 · Level 0 · record (sealed)

  • What it is: the free-text counterpart to RatingQuestionSummary: all the individual text answers given to one non-rating feedback question, grouped under that question. Also a child component of SessionFeedbackDTO.
  • Depends on: nothing first-party (uses the QuestionIdentifierType alias); BCL only.
  • Concept: the hand-built query-projection record (see RatingQuestionSummary). Where a rating collapses to a mean, text answers cannot be averaged, so they are grouped verbatim.
  • Walkthrough: three required init members (SessionFeedbackDTO.cs:41-47), QuestionId, QuestionText, and Responses (an IReadOnlyList<string>, the raw text answers). Exposing the list as IReadOnlyList<string> signals the payload is a read-only snapshot. Which questions land here is decided by elimination: the handler routes a question to Ratings only when its QuestionType is the literal "Rating", and everything else falls into this record (GetSessionFeedbackHandler.cs:69,88-96).
  • Why it's built this way: grouping by question (rather than returning a flat answer list) lets the speaker dashboard render one comment block per prompt without regrouping client-side.
  • Where it's used: nested in SessionFeedbackDTO.TextResponses; built by GetSessionFeedbackHandler.

ActivityDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Activities · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Activities/ActivityDTO.cs:15 · Level 1 · record (class)

  • What it is: the read-model shape of an Activity, a conference social or networking slot (a party, a coffee connect, an after-party, the closing ceremony). It carries the name and blurb, the event-local start and end times, an optional off-site venue, a display tie-breaker, and the FK to its owning event, plus the field-length constants every other layer reads.
  • Depends on: IBaseDTO<TIdentifierType>, IConcurrencyAware (both from MMCA.Common.Shared.DTOs, ActivityDTO.cs:1,15); the aliases ActivityIdentifierType and EventIdentifierType (both int, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:8,11).
  • Concept introduced, the DTO as the single source of field lengths. [Rubric §15, Best Practices & Code Quality] (assesses whether a rule is declared once and consumed everywhere, or copied) and [Rubric §24, Forms/Validation/UX Safety]. Five const int caps sit at the top of this record (ActivityDTO.cs:17-30), and the type's own doc comment states why they live here rather than in the domain (ActivityDTO.cs:9-13): Shared is the lowest project every other layer can reference, so one declaration reaches all of them. Follow the chain: ActivityInvariants.NameMaxLength = ActivityDTO.NameMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/ActivityInvariants.cs:15-22) gives the domain check and, through it, the EF HasMaxLength configuration; the Blazor form binds the same constant to both the input cap and the character counter (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Activities/ActivityFormFields.razor:21) and to its [MaxLength] data annotation (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Activities/ActivityFormModel.cs:37). A cap can therefore never disagree between the counter a user sees, the invariant that rejects, and the column that truncates.
  • Concept, the event-local wall-clock DTO. [Rubric §8, Data Architecture] (assesses how time and ownership are modelled at the storage boundary). StartTime and EndTime are plain DateTime, not DateTimeOffset, because the entity stores them as wall-clock values in the owning event's IANA time zone and the zone lives once on the event rather than repeated per row (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/Activity.cs:28-36). The DTO faithfully carries that decision instead of quietly converting: a consumer that needs an absolute instant has to combine the value with the event's zone, and the public page simply formats it as-is (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Public/Activities/PublicActivityList.razor.cs:55).
  • Walkthrough: five constants (ActivityDTO.cs:17-30) then eleven properties (ActivityDTO.cs:33-63). Id and RowVersion are the two framework contracts (lines 33 and 36; the token defaults to an empty array rather than being nullable, see QuestionDTO). Name is the only required content field (line 39); Description (line 42) is optional. StartTime and EndTime (lines 45-48) are the event-local programme window. The three venue fields VenueName, VenueAddress, and VenueUrl (lines 51-57) are all optional and model the off-site case only: an empty VenueName means the activity happens at the main conference venue, so the public page renders a localized "main venue" label instead of a gap (Activity.cs:38-42, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Public/Activities/PublicActivityList.razor:47), and VenueAddress is what the "directions" affordance hands to a maps URL, labelled with the venue name or the activity name when there is none (PublicActivityList.razor.cs:130-138). SortOrder (line 60) breaks ties between activities that start at the same minute. EventId (line 63) scopes the activity to exactly one event, and it is required alongside Id and Name, so the compiler rejects any initializer that forgets the owning event instead of letting it default to 0. Note what is absent: the entity's [Navigation] Event? reference (Activity.cs:56-58) is not projected, so an activity response never drags an event graph along with it; and there is no room and no speaker collection, because an activity is deliberately neither a session nor a talk.
  • Why it's built this way: activities are ADC's own content rather than a Sessionize import, so the contract is small and mostly optional: an organizer can publish "After party" the moment it is scheduled and fill in the venue later. Naming the tie-breaker SortOrder (where SponsorDTO uses Sort) mirrors the underlying entity property in each case rather than imposing a synthetic house name on the wire.
  • Where it's used: produced by ActivityDTOMapper, a [Mapper] partial class whose doc comment records that nothing is redacted because activity data is published to attendees by design (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Activities/DTOs/ActivityDTOMapper.cs:9-17); projected by the IEntityQueryService<TEntity, TEntityDTO, TIdentifierType> injected into ActivitiesController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Activities/ActivitiesController.cs:44), whose anonymous reads are narrowed for non-privileged callers by one overridden read hook, GetReadSpecificationAsync, so an excluded activity is a 404 rather than a redacted record (ActivitiesController.cs:61-79,89-90); rendered by PublicActivityList, which orders by StartTime then SortOrder (PublicActivityList.razor.cs:112-113), and by the organizer-facing ActivityList; written through ActivityCreateRequest and ActivityUpdateRequest.

CategoryItemDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Categories · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Categories/CategoryItemDTO.cs:13 · Level 1 · record (class)

  • What it is: the read-model shape of a CategoryItem, one selectable option (for example "Beginner" or "Advanced" inside a "Level" category). Carries the item id, display name, sort order, its own concurrency token, and the FK to its parent ConferenceCategoryDTO.
  • Depends on: IBaseDTO<TIdentifierType> and IConcurrencyAware (both from MMCA.Common.Shared.DTOs, CategoryItemDTO.cs:1,13); the aliases CategoryItemIdentifierType and ConferenceCategoryIdentifierType (both int).
  • Concept introduced, the entity read DTO (mapped by Mapperly). [Rubric §4, DDD] and [Rubric §3, Clean Architecture] (the read model is separate from the domain entity, so the API surface never leaks the aggregate), [Rubric §9, API & Contract Design] (a typed, versionable response shape), and [Rubric §7, Microservices Readiness] (it lives in Shared, referenceable without Domain). Every Conference entity has a companion DTO built to the same two rules:
    1. It implements IBaseDTO<TIdentifierType>, the framework's minimal read-model contract: a single required init Id of the entity's id alias (CategoryItemDTO.cs:19, contract at MMCA.Common/Source/Core/MMCA.Common.Shared/DTOs/IBaseDTO.cs:9-13). That is the hook the generic query services and controller base classes key on.
    2. It is populated by a Mapperly-generated mapper, not by hand. The companion IEntityDTOMapper<TEntity, TEntityDTO, TIdentifierType> implementation (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Categories/DTOs/CategoryItemDTOMapper.cs:11-13) is a [Mapper] partial class declaring public partial CategoryItemDTO MapToDTO(CategoryItem entity); with no body (CategoryItemDTOMapper.cs:16), so the source generator writes the field-by-field copy at compile time (ADR-001): no reflection cost, and a shape mismatch is a build error rather than a runtime surprise. The collection overload is the one hand-written member, a null-guarded Select over the single map (CategoryItemDTOMapper.cs:19-23).
  • Walkthrough: one constant and five properties (CategoryItemDTO.cs:16-31). NameMaxLength = 500 (line 16) is the shared cap CategoryInvariants reads back as CategoryItemNameMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/CategoryInvariants.cs:23-24), the same single-declaration chain ActivityDTO introduces. Then Id (the IBaseDTO contract, line 19), RowVersion (the IConcurrencyAware contract, a byte[] defaulted to [], line 22), the required Name (line 25), a plain Sort (int, display order, line 28), and the required CategoryId FK back to the parent category (line 31). Sort is not required, so it defaults to 0 and an item without an explicit order sorts first. The item carries its own token even though it is a child entity: CategoryItem is an AuditableBaseEntity<TIdentifierType> (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/CategoryItem.cs:14), and that base class already holds a RowVersion (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableBaseEntity.cs:13,55), so the DTO only surfaces it. It is exposed because an item is edited directly, not only through its parent: the item update on CategoryItemsController is [SupportsIfMatch] and expects the item's RowVersion in the If-Match header, answering 428 when the header is missing and 412 when the token is stale (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Categories/CategoryItemsController.cs:108-126, ADR-035).
  • Why it's built this way: keeping the DTO a flat record with init-only members makes it an immutable snapshot the query pipeline can project, serialize, and cache without defensive copying; Mapperly keeps the entity to DTO copy allocation-light and drift-proof.
  • Where it's used: nested inside ConferenceCategoryDTO.CategoryItems, and referenced by id from SpeakerCategoryItemDTO and the session tagging DTOs; projected by the IEntityQueryService<TEntity, TEntityDTO, TIdentifierType> injected into CategoryItemsController (CategoryItemsController.cs:65-71), which also returns it from the add-item command, and returned nested by ConferenceCategoriesController.

QuestionDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Questions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Questions/QuestionDTO.cs:14 · Level 1 · record (class)

  • What it is: the read-model shape of a Question, a configurable prompt (for example "Dietary requirements" or "T-shirt size") that events, sessions, or speakers can be asked to answer.
  • Depends on: IBaseDTO<TIdentifierType>, IConcurrencyAware (both from MMCA.Common.Shared.DTOs, QuestionDTO.cs:1,14); the alias QuestionIdentifierType.
  • Concept introduced, the concurrency-aware DTO (the ETag carrier). [Rubric §8, Data Architecture] (assesses whether optimistic concurrency is carried end to end rather than resolved last-write-wins) and [Rubric §9, API & Contract Design]. On top of the entity-DTO pattern from CategoryItemDTO, this DTO implements IConcurrencyAware, contributing one member: byte[] RowVersion (QuestionDTO.cs:38), the SQL Server rowversion token of the version the client just read. Three details are worth reading straight off the interface (MMCA.Common/Source/Core/MMCA.Common.Shared/DTOs/IConcurrencyAware.cs:15-19):
    1. The token travels as an HTTP entity tag, not as a body field on the way back. The API renders it as the response ETag, and the client echoes it in If-Match on its next write, where SupportsIfMatchAttribute turns it into the original RowVersion the persistence layer compares against (IConcurrencyAware.cs:3-8; ADR-035). ConcurrencyETag is the translator both ends share, and it always emits a weak tag, W/"<base64>", because the same row version renders differently under a fields= projection (MMCA.Common/Source/Core/MMCA.Common.Shared/Http/ConcurrencyETag.cs:13-21,27-30,40-45).
    2. It is not optional. RowVersion is a non-nullable byte[] defaulted to [], and the interface's remarks state the rule: a DTO read from a persisted aggregate always has a token, and a write that states no precondition is refused with 428 Precondition Required rather than falling back to last-write-wins (IConcurrencyAware.cs:9-13). Update requests carry no token at all: the precondition travels in the header alone.
    3. The CA1819 suppression that lets a property return byte[] is declared once on the interface member (IConcurrencyAware.cs:18), not repeated on each DTO, so implementing types stay clean.
  • Walkthrough: five constants then eight properties (QuestionDTO.cs:17-56). The first four (QuestionTextMaxLength = 1000 and three 20-character descriptors, lines 17-26) are the caps QuestionInvariants reads back (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/QuestionInvariants.cs:16-23). The fifth, AnswerValueMaxLength = 4000 (line 32), caps the answer to any question rather than the question itself, and it is the shared-constant chain from ActivityDTO fanned out to three owners: EventInvariants, SessionInvariants, and SpeakerInvariants each alias it (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventInvariants.cs:61, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionInvariants.cs:38, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/SpeakerInvariants.cs:51), the three answer-table EF configurations size their column through those aliases (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Events/EventQuestionAnswerConfiguration.cs:26), and the Engagement feedback form model reads the same value (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.UI/Pages/Feedback/FeedbackAnswerModel.cs:33). It lives on the question DTO because the question is the one contract all three answer kinds share. Then Id + RowVersion (the two contracts, lines 35 and 38), the required QuestionText (line 41), and the optional descriptors QuestionEntity ("session" or "speaker"), QuestionType ("text" or "select"), Sort, IsRequired, and QuestionSource ("Sessionize" or "User", recording whether the question was imported or added in-app) at lines 44-56. The descriptors are plain nullable strings, not enums: they arrive from Sessionize and the vocabulary is not ADC's to close.
  • Why it's built this way: carrying RowVersion on the DTO lets the API stamp an ETag on the read and the edit form send back the exact version it saw, so the concurrency check happens at the persistence boundary without the client tracking version state itself; the optional descriptors keep one DTO usable for every question flavor.
  • Where it's used: mapped by QuestionDTOMapper (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Questions/DTOs/QuestionDTOMapper.cs:11-16); returned by QuestionsController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Questions/QuestionsController.cs:34) and consumed by the answer-collection UI. QuestionType is also the switch GetSessionFeedbackHandler reads when it splits feedback into ratings and text (GetSessionFeedbackHandler.cs:69).

SessionFeedbackDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SessionFeedbackDTO.cs:6 · Level 1 · record (sealed)

  • What it is: the aggregated feedback report for a single session (BR-210, SessionFeedbackDTO.cs:4): the session identity plus two grouped result sets, numeric ratings and free-text responses.
  • Depends on: RatingQuestionSummary, TextQuestionResponses; the aliases SessionIdentifierType and QuestionIdentifierType (both int).
  • Concept, the composed query-projection report. [Rubric §6, CQRS & Event-Driven] (a read model purpose-built for one query rather than a mapped entity) and [Rubric §12, Performance & Scalability]. This is the parent that composes the two Level-0 records above. It does not implement IBaseDTO<TIdentifierType>: it is not a CRUD read model but a computed report, so it is assembled by a handler rather than a Mapperly mapper.
  • Walkthrough: four required init members (SessionFeedbackDTO.cs:9-18), SessionId and SessionTitle (the report header), Ratings (an IReadOnlyList<RatingQuestionSummary>, one entry per rating question) and TextResponses (an IReadOnlyList<TextQuestionResponses>, one entry per non-rating question). Splitting ratings from text mirrors the two answer kinds a session collects. The producing handler shows how the shape is filled and where it refuses: it loads the session with its SessionSpeakers and SessionQuestionAnswers untracked, returns NotFound when the session is gone, returns a Forbidden error coded Speaker.NotAssigned if the requested speaker is not assigned to that session, returns an empty-but-valid report when there are no answers, then loads only the questions that actually have answers and routes each answer group to Ratings or TextResponses (GetSessionFeedbackHandler.cs:26-56,58-97).
  • Why it's built this way: pre-aggregating on the server (averages and groupings) keeps the speaker UI a thin renderer and avoids shipping every raw answer row to the client; returning an empty report rather than a 404 when nobody answered keeps the dashboard's happy path free of special cases; and loading only the questions referenced by an answer (GetSessionFeedbackHandler.cs:56-63) keeps the second query proportional to the feedback actually received.
  • Where it's used: returned by GET /Speakers/{speakerId}/sessions/{sessionId}/feedback (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Speakers/SpeakerSessionsController.cs:44-63) via GetSessionFeedbackHandler; fetched by SpeakerDashboardService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Services/Speakers/SpeakerDashboardService.cs:64-70) and rendered on the speaker dashboard. Rubric section 11, Security, is worth reading off that endpoint directly: it is [Authorize] and applies a self-or-organizer gate in the action body, requiring either the Organizer role or a speaker_id claim matching the route speaker before it calls the handler (SpeakerSessionsController.cs:51-54). Its own doc comment records why it carries no output cache: free text comments are the speaker's own read, and every response is authorization-dependent, so a shared public cache entry would be a leak; the endpoint was briefly anonymous with a public output cache before that (SpeakerSessionsController.cs:34-40). This read also moved off the speaker CRUD controller onto its own sub-resource controller so SpeakersController stays within the repo's constructor-dependency ceiling; the route, verb, authorization attributes and output-cache policy are unchanged by the split (SpeakerSessionsController.cs:17-24).
  • Caveats / not-in-source: the answers this report aggregates are the Conference module's SessionQuestionAnswers, not the Engagement module's SessionFeedback aggregate; nothing in this DTO or its handler reads across that module boundary.

SpeakerCategoryItemDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerCategoryItemDTO.cs:8 · Level 1 · record (class)

  • What it is: the read-model shape of the SpeakerCategoryItem join row, the many-to-many link that attaches a CategoryItem (a topic or a locality tier) to a Speaker.
  • Depends on: IBaseDTO<TIdentifierType>; the aliases SpeakerCategoryItemIdentifierType (int), SpeakerIdentifierType (System.Guid), and CategoryItemIdentifierType (int).
  • Concept: the entity read DTO (see CategoryItemDTO), here for a join entity: a flat record of foreign keys with no editable content of its own, hence no length constants.
  • Walkthrough: three required init members (SpeakerCategoryItemDTO.cs:11-17), Id (the IBaseDTO contract), SpeakerId (parent FK), and CategoryItemId (the linked item). No concurrency token: a bare join row is add or remove only, so there is nothing to update optimistically.
  • Why it's built this way: modeling the speaker-to-category-item relationship as an explicit join DTO (rather than an inline id list) keeps the child collection uniform with every other Conference join and lets the mapper project it like any other entity.
  • Where it's used: nested in SpeakerDTO.SpeakerCategoryItems; mapped by SpeakerCategoryItemDTOMapper (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/DTOs/SpeakerCategoryItemDTOMapper.cs:11-16), which SpeakerDTOMapper takes as a constructor dependency and marks [UseMapper] so the generator uses it for the children (SpeakerDTOMapper.cs:18,23-24).

SpeakerQuestionAnswerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerQuestionAnswerDTO.cs:9 · Level 1 · record (class)

  • What it is: the read-model shape of a speaker-level question answer, binding a Speaker to a Question together with the speaker's answer value.
  • Depends on: IBaseDTO<TIdentifierType>; the aliases SpeakerQuestionAnswerIdentifierType, SpeakerIdentifierType, QuestionIdentifierType.
  • Concept: the entity read DTO (see CategoryItemDTO). Unlike the bare SpeakerCategoryItemDTO join, this one carries a payload, the answer text, so it is a link plus a value.
  • Walkthrough: four required init members (SpeakerQuestionAnswerDTO.cs:12-21), Id, SpeakerId (parent FK), QuestionId (the answered question), and AnswerValue (the response, stored as a string regardless of the question's declared QuestionDTO.QuestionType).
  • Why it's built this way: keeping the answer as a flat string AnswerValue lets one DTO carry any question type's answer (free text, a selected option, a numeric rating) without a type-specific shape; the cost is that consumers parse, which is exactly what the feedback handler does when it averages ratings (GetSessionFeedbackHandler.cs:71-75).
  • Where it's used: nested in SpeakerDTO.SpeakerQuestionAnswers; mapped by SpeakerQuestionAnswerDTOMapper (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/DTOs/SpeakerQuestionAnswerDTOMapper.cs:11-16), itself a [UseMapper] dependency of SpeakerDTOMapper (SpeakerDTOMapper.cs:19,26-27).

SponsorDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sponsors · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sponsors/SponsorDTO.cs:15 · Level 1 · record (class)

  • What it is: the read-model shape of the Sponsor aggregate root: display name, SponsorTier, branding links, the owning event's id, and the optional expo-floor booth details.
  • Depends on: IBaseDTO<TIdentifierType>, IConcurrencyAware (SponsorDTO.cs:1,15), SponsorTier; the aliases SponsorIdentifierType (int) and EventIdentifierType.
  • Concept, the DTO that drops the navigation. [Rubric §9, API & Contract Design] and [Rubric §3, Clean Architecture]. Structurally this is the concurrency-aware entity DTO already introduced by QuestionDTO, but it is the cleanest illustration of what a DTO deliberately leaves behind. The Sponsor entity carries both an EventId scalar and a [Navigation] Event? reference used for public-visibility filtering (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/Sponsor.cs:44-49); the DTO keeps only the scalar EventId (SponsorDTO.cs:69). The parent event never rides along, so a sponsor response cannot accidentally serialize an entire event graph. [Rubric §11, Security] shows up by contrast with SpeakerDTO: the sponsor mapper redacts nothing, and says why in its own doc comment, sponsor data is bought placement and therefore public (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sponsors/DTOs/SponsorDTOMapper.cs:9-11). It is also the fullest example of the shared-constant chain from ActivityDTO: seven caps declared here (SponsorDTO.cs:17-36) are consumed by SponsorInvariants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/SponsorInvariants.cs:15-31), by EF through those invariants (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Sponsors/SponsorConfiguration.cs:20-46), and by the sponsor form for both its input cap and its [MaxLength] annotation (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Sponsors/SponsorFormFields.razor:20, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Sponsors/SponsorFormModel.cs:37).
  • Walkthrough: seven constants then thirteen properties (SponsorDTO.cs:17-75). Id + RowVersion are the two contracts (lines 39 and 42). The required Name (line 45) is the only mandatory content field. Tier (line 48) is the enum that drives public ordering. LogoUrl, Description, WebsiteUrl, LinkedInUrl, and TwitterHandle (lines 51-63) are all optional branding, typed as plain nullable strings rather than Uri because they are operator-entered. Sort (line 66) is the tie-breaker within a tier. EventId (line 69) scopes the sponsor to exactly one event and is required, so an initializer cannot silently leave the FK at 0. IsExhibitor + BoothNumber (lines 72-75) model the expo floor; the domain keeps a stored booth number even when the flag is false, because the flag drives display and does not reject stored data (Sponsor.cs:54-58).
  • Why it's built this way: sponsors are sold rather than imported, so unlike the Sessionize-sourced entities this contract is fully ADC's own: a closed enum for tier, a required name, everything else optional so an organizer can create a sponsor the moment a deal closes and fill in the logo later.
  • Where it's used: mapped by SponsorDTOMapper (SponsorDTOMapper.cs:12-17); projected by the IEntityQueryService<TEntity, TEntityDTO, TIdentifierType> injected into SponsorsController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Sponsors/SponsorsController.cs:44), where the one overridden GetReadSpecificationAsync hook narrows every anonymous read to sponsors of published events (SponsorsController.cs:63-81); rendered by PublicSponsorList and the organizer-facing SponsorList.

ConferenceFeatures

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/ConferenceFeatures.cs:10 · Level 1 · class (static)

  • What it is: the feature-flag name catalog for the Conference module. It holds two constants: SessionizeIntegration = "Conference.SessionizeIntegration" (ConferenceFeatures.cs:23), which gates the Sessionize external-data sync capability, and SessionScoring = "Conference.SessionScoring" (ConferenceFeatures.cs:38), which gates the AI session-scoring pass.
  • Depends on: nothing first-party, beyond the [FeatureFlag] attribute (MMCA.Common/Source/Core/MMCA.Common.Shared/FeatureFlags/FeatureFlagAttribute.cs:32) and FeatureFlagLifetime it is decorated with.
  • Concept introduced, feature flags as named constants. Rubric section 6, CQRS and Event-Driven Design (assesses whether cross-cutting behavior such as flags and configuration is centralized rather than scattered). Each constant's value matches a key under the "FeatureManagement" configuration section, and per the class doc comment (ConferenceFeatures.cs:5-9) it is consumed with [FeatureGate] attributes and the IFeatureGated marker interface. Centralizing the string here means the flag name is written once: a typo cannot silently split one flag into two, one of which is never configured and therefore always off. The "{Module}.{Feature}" naming convention keeps flags from different modules unambiguous inside one configuration file. The mechanism itself is ADR-031.
  • Walkthrough: two public const string members, each decorated [FeatureFlag(FeatureFlagLifetime.Permanent, Owner = "ADC Conference")] (ConferenceFeatures.cs:22,37). SessionizeIntegration's doc comment (ConferenceFeatures.cs:12-15) records the runtime contract: when the flag is disabled, RefreshFromSessionizeCommand short-circuits with a failure result and organizers manage event data manually instead of syncing. Its second <para> (ConferenceFeatures.cs:16-20) records why the lifetime is Permanent rather than Temporary: it is a shipped kill switch over a live external dependency, kept so an organizer can shed the Sessionize call during a provider incident, so it is not a rollout toggle and carries no removal date (ADR-031). SessionScoring's doc comment (ConferenceFeatures.cs:25-29) records the parallel contract: when disabled, the organizer trigger endpoint answers 404 and ScoreEventSessionsInternalCommand short-circuits with a failure result, so organizers select sessions from the counts and overlap views alone, and scores already stored stay readable, only the pass that produces new ones is switched off. Its <para> (ConferenceFeatures.cs:30-35) gives the reason it is Permanent: a scoring pass is one paid AI model call per session, and the organizer needs a way to stop it during a provider incident, a pricing surprise, or a runaway loop. FeatureFlagRegistry is what enforces that a Permanent flag never carries a RemoveBy date and a Temporary one always does.
  • Why it's built this way: putting the Sessionize sync and the AI scoring pass each behind a flag lets organizers turn the capability off (for example during a Sessionize API maintenance window, or a scoring provider incident or cost spike) through configuration, with no redeploy; declaring both Permanent with an owner records, in the attribute itself, that these are durable operational switches rather than debt to clean up later.
  • Where it's used: RefreshFromSessionizeCommand implements IFeatureGated (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RefreshFromSessionize/RefreshFromSessionizeCommand.cs:12) and returns SessionizeIntegration from its FeatureName property (RefreshFromSessionizeCommand.cs:17); ScoreEventSessionsInternalCommand and SessionSelectionController read SessionScoring (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/DecisionSupport/ScoreEventSessions/ScoreEventSessionsInternalCommand.cs, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Sessions/SessionSelectionController.cs), so the pipeline decorator (G05), not the handler body, does the gating.

ConferenceCategoryDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Categories · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Categories/ConferenceCategoryDTO.cs:14 · Level 2 · record (class)

  • What it is: the read-model shape of a Category aggregate root (for example "Level", "Track", or "Session format"), including its child CategoryItemDTO options.
  • Depends on: IBaseDTO<TIdentifierType>, IConcurrencyAware, CategoryItemDTO (Level 1); the alias ConferenceCategoryIdentifierType.
  • Concept, the aggregate-root read DTO with a child collection. [Rubric §9, API & Contract Design] and [Rubric §8, Data Architecture]. This combines both patterns seen above: it is a concurrency-aware DTO (RowVersion, as in QuestionDTO) and it nests a child collection of CategoryItemDTO, so the whole aggregate (category plus its options) serializes in one response. The concurrency token sits here and not on the child, which is the aggregate boundary showing through the read model: you version the root, not each option. The entity declarations line up with that split, Category is an AuditableAggregateRootEntity<TIdentifierType> (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/Category.cs:16) while CategoryItem is a plain AuditableBaseEntity<TIdentifierType> (CategoryItem.cs:14).
  • Walkthrough: two constants then seven properties (ConferenceCategoryDTO.cs:17-49). TitleMaxLength = 255 and TypeMaxLength = 100 (lines 17-20) are the caps CategoryInvariants reads back (CategoryInvariants.cs:17-21) and that EF then applies as HasMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Categories/CategoryConfiguration.cs:21,28). Then Id + RowVersion (the contracts, lines 23 and 26), the required Title (line 29), a plain Sort (line 32) and an optional Type ("session" or "speaker", line 35), and the CategoryItems collection, an IReadOnlyCollection<CategoryItemDTO> initialized to [] (ConferenceCategoryDTO.cs:38) so it is never null even when the category has no items yet. The last property, CategoryItemCount (ConferenceCategoryDTO.cs:49), is a plain int alongside the loaded CategoryItems collection: its own doc comment (ConferenceCategoryDTO.cs:39-46) states its one reason to exist is sorting, the query service maps it to the CategoryItems.Count() entity expression so the category grid orders by item count at the database rather than the page counting a collection it may not have read.
  • Why it's built this way: defaulting the child collection to an empty collection literal removes null checks downstream; nesting the items lets the categories UI render an editable category-with-options block from a single fetch; carrying CategoryItemCount as its own field lets the grid sort on the count without loading (or the page counting) the full CategoryItems collection.
  • Where it's used: mapped by ConferenceCategoryDTOMapper, which takes CategoryItemDTOMapper as a constructor dependency and marks it [UseMapper] so the generator uses it for the children (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Categories/DTOs/ConferenceCategoryDTOMapper.cs:12-26); the CategoryItemCount sort mapping is read by ConferenceCategoryEntityQueryService (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Categories/ConferenceCategoryEntityQueryService.cs); returned by ConferenceCategoriesController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Categories/ConferenceCategoriesController.cs:35) and consumed by the category-management UI, including ConferenceCategoryList, which sorts its grid by the count.

SpeakerDTO

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerDTO.cs:19 · Level 2 · record (class)

  • What it is: the read-model shape of the Speaker aggregate root: profile fields, social links, an optional link to an Identity user, and two child collections (category items and question answers). It is the richest DTO in this unit.
  • Depends on: IBaseDTO<TIdentifierType>, IConcurrencyAware, SpeakerCategoryItemDTO, SpeakerQuestionAnswerDTO; the aliases SpeakerIdentifierType (a System.Guid, because speakers are imported with Sessionize-assigned identity per BR-61, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:4,24) and UserIdentifierType (an int, owned by Identity).
  • Concept, the cross-context read DTO and the redacting mapper. [Rubric §7, Microservices Readiness], [Rubric §8, Data Architecture], [Rubric §11, Security]. Three things make this DTO worth studying beyond its size:
    1. LinkedUserId is a bare nullable scalar (SpeakerDTO.cs:104), not a nested user object and not an EF navigation, because the user and the speaker live in separate databases (ADR-006). The link is reconciled by events (SpeakerLinkedToUser and SpeakerUnlinkedFromUser), never by a cross-database join.
    2. Email and LinkedUserId are both redacted for most callers. Email is nullable on the DTO although the entity holds an Email value object, because SpeakerDTOMapper redacts it: the public MapToDTO calls the generated MapToDTOGenerated and then returns dto with { Email = null, LinkedUserId = null } unless CanSeeEmail admits the caller, which is true only for the Organizer role (BR-66, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/DTOs/SpeakerDTOMapper.cs:38-42,45-53,62). The linked Identity user id identifies the account the same way the email does, so it is gated by the same rule (SpeakerDTOMapper.cs:29-34,51-52). A small private converter, NullableEmailToString (SpeakerDTOMapper.cs:65), is what lets the generator flatten the Email value object to a string in the first place. The redaction is in the mapper rather than the controller, so every read path inherits it, and CanSeeEmail is public so the update path reuses the one rule instead of restating it. This is the DTO layer doing real work, not just shape translation.
    3. The biography has two caps, and only one of them is a rule. BioMaxLength = 4000 (SpeakerDTO.cs:33-37) is the input cap and character counter the speaker-profile pages bind to. BioStorageMaxLength = 8000 (SpeakerDTO.cs:39-44) is the ceiling every write path enforces: SpeakerInvariants exposes it as its own BioMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/SpeakerInvariants.cs:29-33, checked with error code Speaker.Bio.TooLong at line 98), and the request validators reuse it through SpeakerBioRules<T> (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/Validation/SpeakerValidationRules.cs:38-42). The storage ceiling sits above the counter so a longer bio imported from Sessionize still persists, and the Sessionize refresh truncates a bio over the ceiling with a warning rather than refusing the speaker (SpeakerSyncStrategy, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RefreshFromSessionize/SpeakerSyncStrategy.cs:158-172). The column itself has no EF length, so the ceiling is a rule, not a schema constraint (SpeakerDTO.cs:12-16). Every other cap follows the plain chain into SpeakerInvariants (SpeakerInvariants.cs:17-48) that ActivityDTO introduces.
  • Walkthrough: eleven constants (SpeakerDTO.cs:22-59) then seventeen properties (SpeakerDTO.cs:62-110). Id + RowVersion are the contracts (lines 62 and 65). The required name fields are FirstName, LastName, and FullName (lines 68-74); FullName is a computed expression on the entity (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:72) flattened into a stored string here, so a client renders a display name without concatenating. Then the optional profile fields, Email (line 77, the redacted one), Bio, TagLine, ProfilePicture, the IsTopSpeaker flag, and the social handles TwitterHandle, LinkedInUrl, GitHubUrl, WebsiteUrl (lines 80-101, plain nullable strings because they come through the Sessionize import). LinkedUserId (line 104) is the cross-context link. The two child collections SpeakerCategoryItems and SpeakerQuestionAnswers (lines 107-110) are both IReadOnlyCollection<...> defaulted to [], and both are filled by [UseMapper] child mappers rather than by hand (SpeakerDTOMapper.cs:23-27).
  • Why it's built this way: denormalizing FullName and defaulting both collections keeps the speaker UI a thin renderer; exposing LinkedUserId as a bare nullable id is exactly the database-per-service posture, since the Conference read model knows the id of the linked user but never reaches across the boundary to fetch it; and redacting Email and LinkedUserId in the mapper means the PII rule cannot be forgotten by a new endpoint.
  • Where it's used: projected by the IEntityQueryService<TEntity, TEntityDTO, TIdentifierType> injected into SpeakersController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Speakers/SpeakersController.cs:52), and returned by its create and update commands; the update path is the concurrency story end to end, an [Authorize] self-or-manager action marked [SupportsIfMatch] that pulls the required token out of the request header and hands it to the command together with SpeakerDTOMapper.CanSeeEmail's verdict, so a caller that was shown a redacted email keeps the stored one (SpeakersController.cs:352-383, ADR-035). Rendered by the public speaker pages and by SpeakerDashboardService.

CategoryItemChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Categories.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/DomainEvents/CategoryItemChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the domain event a Category aggregate raises when one of its CategoryItem children is added, updated, or removed. It carries the parent category id, the child item id, and the item's display name.
  • Depends on: BaseDomainEvent (Level 1), DomainEntityState (Level 0), both from MMCA.Common.Domain (CategoryItemChanged.cs:1-2); the aliases ConferenceCategoryIdentifierType and CategoryItemIdentifierType.
  • Concept introduced, the child-change domain event. [Rubric §6, CQRS & Event-Driven] (assesses whether state changes are expressed as typed, first-class events that typed handlers can subscribe to) and [Rubric §4, DDD] (domain events are part of the ubiquitous language: an aggregate announces what happened inside its boundary). Every Conference child or join entity has a companion Changed record, and two design choices visible here are reused across that whole family:
    1. It derives from BaseDomainEvent directly, not from EntityChangedEvent<TIdentifierType>. EntityChangedEvent<T> models a single entity id (MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/EntityChangedEvent.cs:24-27); a child change needs two identifiers (the parent aggregate and the child) plus a descriptor, so it does not fit that one-id shape. The aggregate-root lifecycle events, CategoryChanged and its siblings, do use EntityChangedEvent<T>.
    2. It is a sealed record class with no behavior. The inherited DateOccurred and MessageId come from BaseDomainEvent, each defaulted at construction (MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/BaseDomainEvent.cs:26-35); the type exists purely so IDomainEventHandler<CategoryItemChanged> can be registered and dispatched independently of every other event type. Being a record gives it structural equality, but the base's own remarks warn that this is not a deduplication mechanism: two logically identical events raised separately are never equal because both defaults are fresh per instance, and consumer-side dedup is the inbox's job keyed on MessageId (BaseDomainEvent.cs:9-17, ADR-021).
  • Walkthrough: four positional members (CategoryItemChanged.cs:13-17), State (the Added/Updated/Deleted transition), CategoryId (the parent), CategoryItemId (the child), and Name (the item's display name, so a handler or log line has a human-readable label without re-loading the entity).
  • Why it's built this way: keeping the payload flat and self-describing (ids plus a name) means a downstream handler never has to re-query the aggregate to act, and the event survives serialization through the dispatch pipeline unchanged.
  • Where it's used: raised by Category at all three child mutation points, AddCategoryItem, UpdateCategoryItem, and RemoveCategoryItem (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/Category.cs:152,186,203); collected on the aggregate and dispatched in-process by DomainEventDispatcher after SaveChangesAsync.
  • Caveats / not-in-source: no handler subscribes to it in the ADC source today; it is available for future observers and audit. Note also the one asymmetry: deleting the parent category cascade soft-deletes its items (BR-71) through a single DeleteChildren call but raises one CategoryChanged(Deleted) rather than one CategoryItemChanged per item (Category.cs:107-119), so a subscriber must treat parent deletion as implying its children.

EventQuestionAnswerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/EventQuestionAnswerChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the domain event an Event aggregate raises when one of its EventQuestionAnswer children is added, updated, or removed. It announces a change inside the aggregate boundary, not a change of the aggregate root itself.
  • Depends on: BaseDomainEvent (the base record) and the DomainEntityState enum, both from MMCA.Common.Domain (EventQuestionAnswerChanged.cs:1-2); the module identifier aliases EventIdentifierType, EventQuestionAnswerIdentifierType, and QuestionIdentifierType, all int behind a global using (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:11, :12, :15, see the primer). No NuGet dependency.
  • Concept introduced, the child-change domain event. [Rubric §6, CQRS & Event-Driven] (assesses whether state transitions are published as typed, first-class events that typed handlers can subscribe to, instead of leaking out as ad-hoc side effects) and [Rubric §4, DDD] (assesses whether the aggregate root is the sole author of change inside its consistency boundary and names that change in the ubiquitous language). Every child and join entity in the Conference model has a companion ...Changed record, and this family shares three design choices worth learning once:
    1. It derives from BaseDomainEvent directly, not from EntityChangedEvent<TIdentifierType>. That base models exactly one identifier (State plus a generic EntityId, MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/EntityChangedEvent.cs:24-27), which a child change cannot fit: it needs the parent id and the child id, plus a descriptor. The aggregate-root lifecycle events later in this part (EventChanged and siblings) do use it.
    2. It is a sealed record class with no behavior. Structural equality is free, and the inherited MessageId / DateOccurred come from the base (MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/BaseDomainEvent.cs:28-35). The type exists so an IDomainEventHandler<in TDomainEvent> closed over EventQuestionAnswerChanged can be registered and dispatched independently of every other event type.
    3. The payload is flat ids plus a descriptor. The event must survive being serialized into an OutboxMessage row in the same transaction as the data (ADR-003), so it carries no entity references. How a raised event reaches the outbox and the in-process handlers is taught once in Group 04; this part only produces them.
  • Walkthrough: four positional members (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/EventQuestionAnswerChanged.cs:13-17): State (the Added / Updated / Deleted transition), EventId (the parent aggregate), EventQuestionAnswerId (the child row), and QuestionId (line 17), the FK to the Question that was answered, so a handler knows which question the answer belongs to without re-loading the aggregate.
  • Why it's built this way: publishing ids rather than the entity keeps the event a self-describing, serializable fact and keeps a subscriber out of the aggregate's internals. Raising one event per child type (rather than a single generic "event updated") lets cache invalidation and projections target exactly what moved.
  • Where it's used: raised by Event's AddEventQuestionAnswer (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:649, raises at :667), UpdateEventQuestionAnswer (:678, raises at :690), and RemoveEventQuestionAnswer (:700, raises at :707). The save-changes interceptor writes an outbox row for every integration event and for each local domain event that has a handler registered in this host for its exact type, and routes only the non-integration ones to in-process dispatch; a local event with no handler gets neither a row nor a dispatch (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Interceptors/DomainEventSaveChangesInterceptor.cs:291-307, :317-320), where DomainEventDispatcher delivers them.
  • Caveats / not-in-source: no IDomainEventHandler subscribes to it today. In fact the Conference module contains no IDomainEventHandler<> implementation at all, so every event in this part is raised but neither persisted to the outbox nor dispatched, since no handler exists for it (DomainEventSaveChangesInterceptor.cs:290-291, :317-320). That is a deliberate cost: the contract exists so a consumer can be added without touching the aggregate.

EventSpeakerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/EventSpeakerChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the change event an Event raises when an EventSpeaker join entity is added or removed, that is, when a Speaker is attached to or detached from the event.
  • Depends on: BaseDomainEvent, DomainEntityState; aliases EventIdentifierType, EventSpeakerIdentifierType, SpeakerIdentifierType (the last is System.Guid, not int, because speakers carry Sessionize-assigned GUIDs per BR-61, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:24).
  • Concept: the child-change domain event introduced by EventQuestionAnswerChanged, here for a join entity. [Rubric §6, CQRS & Event-Driven]. The XML doc says "added or removed" with no update case (EventSpeakerChanged.cs:7): a pure FK-pair join carries no editable content, so only two transitions are meaningful. The parameter type stays DomainEntityState (nothing narrows it structurally), and the raise sites use only Added and Deleted.
  • Walkthrough: State, EventId (parent), EventSpeakerId (the join row), SpeakerId (the linked speaker), lines 14-17.
  • Where it's used: raised by Event's AddEventSpeaker (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:578, raises at :530), RestoreEventSpeaker (:546, raises at :555), and RemoveEventSpeaker (:565, raises at :573). Note the restore path: un-deleting a soft-deleted join row raises Added again (:555), so a subscriber sees the same transition it saw the first time and needs no separate "restored" case.
  • Caveats / not-in-source: no handler subscribes today (see EventQuestionAnswerChanged).

RoomChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/RoomChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the child-change event an Event raises when one of its Room children is added, updated, or removed. Carries the parent event id, the room id, and the room name.
  • Depends on: BaseDomainEvent, DomainEntityState; aliases EventIdentifierType, RoomIdentifierType.
  • Concept: the child-change domain event (see EventQuestionAnswerChanged). [Rubric §6, CQRS & Event-Driven] and [Rubric §13, Observability & Operability] (assesses whether the system emits structured, correlatable signal about what it did). The instructive detail here is the descriptor choice: the fourth member is RoomName, a display label, not another foreign key (RoomChanged.cs:17). Every other child event in this family carries an FK as its fourth member. A label makes the event readable on its own, so a log line or a projection can render the room by name with no reload; an FK would force the subscriber back into the database. Which of the two a ...Changed record carries is therefore a real contract decision, not boilerplate.
  • Walkthrough: State, EventId (parent), RoomId (child), RoomName (display label), lines 14-17.
  • Where it's used: raised by Event's AddRoom (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:397, raises at :379), UpdateRoom (:395, raises at :417), RestoreRoom (:438, raises Added at :474), and RemoveRoom (:484, raises at :491).
  • Caveats / not-in-source: no handler subscribes today. The self-describing payload is there for a subscriber that does not yet exist.

SessionCategoryItemChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/DomainEvents/SessionCategoryItemChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the domain event a Session raises when one of its SessionCategoryItem join rows is added or removed (the tags, track, and level assignments on a session).
  • Depends on: BaseDomainEvent, DomainEntityState; aliases SessionIdentifierType, SessionCategoryItemIdentifierType, CategoryItemIdentifierType.
  • Concept: the child-change domain event (EventQuestionAnswerChanged), applied to the Session aggregate. [Rubric §6, CQRS & Event-Driven] and [Rubric §4, DDD]. It carries three ids so a handler can react without reloading: the parent session, the join row, and the CategoryItem that was linked.
  • Walkthrough: sealed record class with State, SessionId, SessionCategoryItemId, CategoryItemId (SessionCategoryItemChanged.cs:13-17). Being a record, immutability and structural equality come for free; the primary-constructor parameters are the only state.
  • Where it's used: raised by Session's AddSessionCategoryItem (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:432, raises at :418), RestoreSessionCategoryItem (:435, raises Added at :447), and RemoveSessionCategoryItem (:457, raises at :465); captured by the outbox in SaveChangesAsync and dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today.

SessionQuestionAnswerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/DomainEvents/SessionQuestionAnswerChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the domain event a Session raises when a SessionQuestionAnswer child row is added, updated, or removed. Same shape as SessionCategoryItemChanged, for the answer child rather than the category join.
  • Depends on: BaseDomainEvent, DomainEntityState; aliases SessionIdentifierType, SessionQuestionAnswerIdentifierType, QuestionIdentifierType.
  • Concept: the child-change domain event (EventQuestionAnswerChanged). [Rubric §6, CQRS & Event-Driven]. The behavioral difference against a join event is the Updated state: an answer's value can change in place (a join row cannot), so UpdateSessionQuestionAnswer exists (Session.cs:533) and the raise sites use all three transitions.
  • Walkthrough: sealed record class with State, SessionId, SessionQuestionAnswerId, QuestionId (SessionQuestionAnswerChanged.cs:13-17).
  • Where it's used: raised by Session's AddSessionQuestionAnswer (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:511, raises at :497), UpdateSessionQuestionAnswer (:508, raises at :521), and RemoveSessionQuestionAnswer (:531, raises at :539); captured by the outbox. Do not confuse it with SessionFeedbackSubmitted, the cross-module event the application layer raises alongside the same create path: the domain event says "a row changed", the integration event says "an attendee gave feedback".
  • Caveats / not-in-source: no handler subscribes today.

SessionSpeakerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/DomainEvents/SessionSpeakerChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the domain event a Session raises when a SessionSpeaker join row (the session-to-speaker association) is added or removed.
  • Depends on: BaseDomainEvent, DomainEntityState; aliases SessionIdentifierType, SessionSpeakerIdentifierType, SpeakerIdentifierType.
  • Concept: the child-change domain event (EventQuestionAnswerChanged), join-entity flavor as in EventSpeakerChanged. [Rubric §6, CQRS & Event-Driven]. The XML doc records "added or removed" (SessionSpeakerChanged.cs:7), and the raise sites use only Added and Deleted.
  • Walkthrough: sealed record class with State, SessionId, SessionSpeakerId, SpeakerId (SessionSpeakerChanged.cs:13-17).
  • Where it's used: raised by Session's AddSessionSpeaker (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:358, raises at :336), RestoreSessionSpeaker (:352, raises Added at :361), and RemoveSessionSpeaker (:371, raises at :379); captured by the outbox.
  • Caveats / not-in-source: no handler subscribes today.

SpeakerCategoryItemChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/DomainEvents/SpeakerCategoryItemChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the Speaker-side twin of SessionCategoryItemChanged: raised when a SpeakerCategoryItem join row is added or removed from a speaker (for example the speaker's topic or locality tags).
  • Depends on: BaseDomainEvent, DomainEntityState; aliases SpeakerIdentifierType, SpeakerCategoryItemIdentifierType, CategoryItemIdentifierType.
  • Concept: the child-change domain event (EventQuestionAnswerChanged). [Rubric §6, CQRS & Event-Driven]. Structurally identical to the session variant with the parent id swapped from session to speaker, which is exactly the point of the family: one shape, one id triple, one type per relationship so handlers stay narrow.
  • Walkthrough: sealed record class with State, SpeakerId, SpeakerCategoryItemId, CategoryItemId (SpeakerCategoryItemChanged.cs:13-17).
  • Where it's used: raised by Speaker's AddSpeakerCategoryItem (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:385, raises at :335), RestoreSpeakerCategoryItem (:352, raises Added at :364), and RemoveSpeakerCategoryItem (:374, raises at :382); captured by the outbox.
  • Caveats / not-in-source: no handler subscribes today.

SpeakerQuestionAnswerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/DomainEvents/SpeakerQuestionAnswerChanged.cs:13 · Level 2 · record (sealed)

  • What it is: the Speaker-side twin of SessionQuestionAnswerChanged: raised when a SpeakerQuestionAnswer child row is added, updated, or removed.
  • Depends on: BaseDomainEvent, DomainEntityState; aliases SpeakerIdentifierType, SpeakerQuestionAnswerIdentifierType, QuestionIdentifierType.
  • Concept: the child-change domain event (EventQuestionAnswerChanged). [Rubric §6, CQRS & Event-Driven]. As with the session answer, the answer value is mutable, so the raise sites span Added, Updated, and Deleted.
  • Walkthrough: sealed record class with State, SpeakerId, SpeakerQuestionAnswerId, QuestionId (SpeakerQuestionAnswerChanged.cs:13-17).
  • Where it's used: raised by Speaker's AddSpeakerQuestionAnswer (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:464, raises at :414), UpdateSpeakerQuestionAnswer (:425, raises at :438), and RemoveSpeakerQuestionAnswer (:448, raises at :456); captured by the outbox.
  • Caveats / not-in-source: no handler subscribes today.

CategoryChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Categories.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/DomainEvents/CategoryChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-lifecycle event a Category raises when it is created, updated, or deleted. Carries the category id and its title.
  • Depends on: EntityChangedEvent<TIdentifierType> (Level 2), DomainEntityState (Level 0); the alias ConferenceCategoryIdentifierType.
  • Concept introduced, the aggregate-root lifecycle event. [Rubric §6, CQRS & Event-Driven] and [Rubric §15, Best Practices & Code Quality] (one event type per aggregate instead of a separate Created/Updated/Deleted trio). Where the Level-2 events above derive from BaseDomainEvent directly, the root-level events derive from EntityChangedEvent<TIdentifierType>, which consolidates the CRUD-lifecycle pattern: it holds State plus a single generic EntityId (constrained notnull, MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/EntityChangedEvent.cs:24-27), and each concrete record passes its own id up to that base (CategoryChanged.cs:16: : EntityChangedEvent<ConferenceCategoryIdentifierType>(State, CategoryId)). A subtle but real consequence: the derived record re-exposes the id under a domain-meaningful name (CategoryId) while the same value is also reachable as the inherited generic EntityId, one identity under two property names, so handlers written against EntityChangedEvent<T> and handlers written against the concrete type both work. The base's own doc comment draws the dividing line, generic CRUD lifecycle belongs here while a business transition such as OrderPaid keeps inheriting BaseDomainEvent directly (EntityChangedEvent.cs:15-19), and it also fixes the raise convention: Added from factory methods, Updated from mutators, Deleted from Delete() (EntityChangedEvent.cs:9-14).
  • Walkthrough: three positional members (CategoryChanged.cs:13-15), State, CategoryId, and Title; State and CategoryId are forwarded to the base constructor (line 16), and Title is the record's own added property, the human-readable descriptor a handler or log line can use without re-loading the aggregate.
  • Why it's built this way: one lifecycle event per aggregate keeps the event surface small, and State lets a handler branch on the transition rather than subscribing to three separate types.
  • Where it's used: raised from Category's Create (Added), Update (Updated), and Delete (Deleted) at Category.cs:75,100,116, where the delete only raises once the combined cascade result succeeds (Category.cs:111-116); dispatched in-process by DomainEventDispatcher after SaveChangesAsync.
  • Caveats / not-in-source: like CategoryItemChanged, no handler subscribes to it in the ADC source today. It is an in-process domain event, not an integration event, so it never reaches the outbox or the broker on its own.

ActivityChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Activities.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/DomainEvents/ActivityChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for an Activity, the non-session agenda item (a keynote reception, a lunch break, a hallway track slot): raised when one is created, updated, or soft-deleted. It carries the activity id and its display name.
  • Depends on: EntityChangedEvent<TIdentifierType> (the base record), DomainEntityState; alias ActivityIdentifierType.
  • Concept: the aggregate-root lifecycle event, taught in detail under EventChanged below. [Rubric §6, CQRS & Event-Driven] and [Rubric §15, Best Practices & Code Quality] (assesses whether a recurring shape is factored once instead of copied). The instructive detail is a contrast: Activity owns an EventId property (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/Activity.cs:54), yet ActivityChanged does not carry it, where the structurally similar SessionChanged does. A subscriber that needs the parent event for an activity therefore has to reload it, which is a real (if small) asymmetry in the event contracts of this bounded context rather than a rule you can infer.
  • Walkthrough: three positional members (ActivityChanged.cs:12-16): State, ActivityId, and Name, with (State, ActivityId) forwarded to EntityChangedEvent<ActivityIdentifierType> on line 16.
  • Where it's used: raised from Activity's Create factory (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/Activity.cs:99, raises at :127), its Update method (:145, raises at :173), and its Delete override, which calls the base soft-delete first and raises the event only when that base call returned success (:180-188, raise at :185); dispatched in-process.
  • Caveats / not-in-source: no IDomainEventHandler<ActivityChanged> is implemented today; the event is raised and persisted to the outbox regardless.

EventChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/EventChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event an Event raises when it is created, updated, or deleted. Publish and unpublish also flip state and emit it with Updated. It carries the event id and name.
  • Depends on: EntityChangedEvent<TIdentifierType> (the base record), DomainEntityState; alias EventIdentifierType.
  • Concept introduced, the aggregate-root lifecycle event. [Rubric §6, CQRS & Event-Driven] (assesses whether the write model announces its transitions as consumable events) and [Rubric §15, Best Practices & Code Quality] (assesses whether a recurring shape is factored once instead of copied: one event type per aggregate rather than a separate Created / Updated / Deleted trio). Where the Level-2 events above derive from BaseDomainEvent directly, the root-level events derive from EntityChangedEvent<TIdentifierType>, which consolidates the CRUD lifecycle into State plus a single generic EntityId (MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/EntityChangedEvent.cs:24-27), and each concrete record forwards its own id to that base (line 16: : EntityChangedEvent<EventIdentifierType>(State, EventId)). A subtle but real consequence: the derived record re-exposes the identity under a domain-meaningful name (EventId) while the same value is also reachable as the inherited EntityId, so a handler written against EntityChangedEvent<T> and one written against the concrete type both work. The base's own doc is explicit that this shape is for generic CRUD lifecycle only: a business transition with a unique payload should derive straight from BaseDomainEvent (EntityChangedEvent.cs:15-19).
  • Walkthrough: three positional members (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/DomainEvents/EventChanged.cs:12-16): State, EventId, and Name; the first two are forwarded to the base constructor on line 16, Name is the record's own added property and exists so a log line or cache-invalidation handler has a human-readable label without a reload.
  • Why it's built this way: one lifecycle event per aggregate keeps the event surface small and lets a subscriber branch on State rather than subscribing to three separate types. Because these records are serialized through the outbox, keeping the base shared also keeps their contract shape stable (ADR-010 governs the versioning rules for anything that crosses a boundary).
  • Where it's used: raised from Event's Create (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:174, raises at :207), Update (:229, raises at :265), Publish (:272, raises at :285), Unpublish (:292, raises at :305), and Delete (:328, raises at :340); dispatched in-process by DomainEventDispatcher after SaveChangesAsync. Note that publish and unpublish reuse the Updated transition rather than introducing dedicated event types, which is the CRUD-lifecycle base doing its job: a subscriber that cares specifically about publication has to compare the Event's own state, not the event type.
  • Caveats / not-in-source: no handler subscribes today.

PartnerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Partners.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/DomainEvents/PartnerChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a Partner (a conference sponsor/partner listing scoped to one event): raised when it is created, updated, or soft-deleted. Carries the partner id and display name.
  • Depends on: EntityChangedEvent<TIdentifierType> (the base record), DomainEntityState; alias PartnerIdentifierType.
  • Concept: the aggregate-root lifecycle event (EventChanged). [Rubric section 6, CQRS & Event-Driven] and [Rubric section 15, Best Practices & Code Quality] (a recurring shape factored once, not copied). Structurally the same shape as SponsorChanged: three members, no descriptor beyond the display name. Like ActivityChanged, Partner owns an EventId property (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/Partner.cs:64), yet PartnerChanged does not publish it, so a subscriber that needs the owning event has to reload the entity. The XML doc on Update is explicit that the owning event is deliberately not updatable: moving a partner between events is modeled as a create plus a delete, not a field edit (Partner.cs:108).
  • Walkthrough: three positional members (PartnerChanged.cs:12-16): State, PartnerId, and Name, with (State, PartnerId) forwarded to EntityChangedEvent<PartnerIdentifierType> on line 16.
  • Where it's used: raised from Partner's Create factory (declared at Partner.cs:79, raises Added at :100), its Update method (:116, raises Updated at :135), and its Delete override, which calls the base soft-delete first and raises the event only when that base call returned success (:142-149, raise at :147); dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today (see EventQuestionAnswerChanged).

QuestionChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Questions.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/DomainEvents/QuestionChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a Question, the reusable custom-form question definition: raised when one is created, updated, or deleted.
  • Depends on: EntityChangedEvent<TIdentifierType>, DomainEntityState; alias QuestionIdentifierType.
  • Concept: the aggregate-root lifecycle event introduced by EventChanged. [Rubric §6, CQRS & Event-Driven]. Structurally identical, with QuestionText as its descriptor.
  • Walkthrough: sealed record class QuestionChanged(DomainEntityState State, QuestionIdentifierType QuestionId, string QuestionText) forwarding (State, QuestionId) to EntityChangedEvent<QuestionIdentifierType> (QuestionChanged.cs:12-16).
  • Where it's used: raised from Question's Create (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/Question.cs:70, raises at :94), Update (:108, raises at :128), and Delete (:135, raises at :140); dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today.

SessionChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/DomainEvents/SessionChanged.cs:13 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a Session: raised on create, update, or delete.
  • Depends on: EntityChangedEvent<TIdentifierType>, DomainEntityState; aliases SessionIdentifierType, EventIdentifierType.
  • Concept: the aggregate-root lifecycle event (EventChanged). [Rubric §6, CQRS & Event-Driven]. It is the one root event in this bounded context that carries a second identifier, the parent EventId (line 17), in addition to Title, so a subscriber knows which event's schedule moved (useful for invalidating that event's session list rather than the whole cache). Compare ActivityChanged, whose entity also has an EventId but whose event does not publish it: the two are inconsistent, and SessionChanged is the shape worth copying.
  • Walkthrough: sealed record class SessionChanged(DomainEntityState State, SessionIdentifierType SessionId, string Title, EventIdentifierType EventId) chaining (State, SessionId) to the base (SessionChanged.cs:13-18).
  • Where it's used: raised by Session's Create (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:195, raises at :212), Update (:235, raises at :273), and Delete (:283, raises at :294); captured by the outbox and dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today.

SpeakerChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/DomainEvents/SpeakerChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a Speaker: raised on create, update, or delete, and also on every change to the speaker-to-user link and on erasure anonymization.
  • Depends on: EntityChangedEvent<TIdentifierType>, DomainEntityState; alias SpeakerIdentifierType.
  • Concept: the aggregate-root lifecycle event introduced by EventChanged. [Rubric §6, CQRS & Event-Driven]. Structurally identical, with FullName as its descriptor. The cross-context link bookkeeping (BR-70, BR-209) does not ride on this event: the aggregate raises the dedicated SpeakerLinkedToUser and SpeakerUnlinkedFromUser integration events beside it, in the same save (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:187-193). [Rubric §7, Microservices Readiness].
  • Walkthrough: sealed record class SpeakerChanged(DomainEntityState State, SpeakerIdentifierType SpeakerId, string FullName) chaining (State, SpeakerId) to EntityChangedEvent<SpeakerIdentifierType> (SpeakerChanged.cs:12-16). The Delete override (Speaker.cs:274) captures LinkedUserId into a local before calling base.Delete(), then nulls the field, raises SpeakerChanged with Deleted, and, when a user was linked, raises SpeakerUnlinkedFromUser carrying the captured id (Speaker.cs:277-290); per the XML doc the outbox captures that event atomically with the delete (Speaker.cs:263-266). LinkUser and UnlinkUser raise SpeakerChanged with Updated followed by the matching link event (Speaker.cs:314-316, :337-340), so a subscriber that cares about the link reads the link events, not this one.
  • Why it's built this way: the link snapshot lives on the integration event that needs it, so the lifecycle event stays a plain three-field record, and the unlink reaches Identity through the outbox in the same transaction as the delete instead of through a post-save domain-event handler.
  • Where it's used: raised by Speaker's Create (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:127, raises at :179), Update (:207, raises at :257), Delete (:274, raises at :286), LinkUser (:303, raises at :315), UnlinkUser (:326, raises at :339), and Anonymize (:354, raises at :373). Its FullName is classified as public conference data by the PII convention test (MMCA.ADC/Tests/Architecture/MMCA.ADC.Architecture.Tests/Privacy/PiiConventionTests.cs:96).
  • Caveats / not-in-source: no handler subscribes today.

SessionAssetChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.SessionAssets.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/DomainEvents/SessionAssetChanged.cs:13 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a SessionAsset: raised when the asset (a link or an uploaded file attached to a Session) is created, updated, or deleted.
  • Depends on: EntityChangedEvent<TIdentifierType>, DomainEntityState; aliases SessionAssetIdentifierType, SessionIdentifierType.
  • Concept: the aggregate-root lifecycle event (EventChanged). [Rubric §6, CQRS & Event-Driven]. Like SessionChanged, it carries a second identifier beyond its own id: SessionId, the parent session the asset belongs to, so a subscriber can tell which session's asset list moved without a reload.
  • Walkthrough: four positional members (SessionAssetChanged.cs:13-17): State, SessionAssetId, SessionId (the parent), and Title (the display label), with (State, SessionAssetId) forwarded to EntityChangedEvent<SessionAssetIdentifierType> on line 18.
  • Where it's used: raised by SessionAsset's private CreateCore helper, the shared tail of its three public factories Create, CreateLink, and CreateFile (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/SessionAsset.cs:275, raises Added at :304), by Update (:234, raises Updated at :258), and by the Delete override, which calls the base soft-delete first and raises the event only when that call returned success (:265-273, raise at :270); captured by the outbox and dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today (see EventQuestionAnswerChanged).

SponsorChanged

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sponsors.DomainEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/DomainEvents/SponsorChanged.cs:12 · Level 3 · record (sealed)

  • What it is: the aggregate-root lifecycle event for a Sponsor: raised when a sponsor is created, updated, or soft-deleted. Carries the sponsor id and display name.
  • Depends on: EntityChangedEvent<TIdentifierType>, DomainEntityState; alias SponsorIdentifierType.
  • Concept: the aggregate-root lifecycle event (EventChanged). [Rubric §6, CQRS & Event-Driven] and [Rubric §15, Best Practices & Code Quality]. Sponsors are among the newest aggregates in this bounded context, and the fact that its event is a five-line record derived from the same base is the payoff of the shared shape: a new aggregate gets the full lifecycle-event story without inventing anything.
  • Walkthrough: three positional members (SponsorChanged.cs:12-16): State, SponsorId, and Name, with (State, SponsorId) forwarded to EntityChangedEvent<SponsorIdentifierType> on line 16.
  • Where it's used: raised from Sponsor's Create factory (declared at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/Sponsor.cs:105, raises at :133), its Update path (:153, raises at :183), and its Delete override, which calls the base soft-delete first and raises the event only when that base call returned success (:190-198, raise at :195); dispatched in-process.
  • Caveats / not-in-source: no handler subscribes today.

SpeakerLinkedToUser

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers.IntegrationEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/IntegrationEvents/SpeakerLinkedToUser.cs:17 · Level 3 · record (sealed)

  • What it is: the cross-module integration event Conference raises when it binds a Speaker to an Identity User, either through the manual LinkUserToSpeaker command or through automatic email-match linking triggered by UserRegistered. Identity subscribes and sets User.LinkedSpeakerId, so the next token refresh carries the speaker_id claim (BR-209, per the XML doc at SpeakerLinkedToUser.cs:6-13).
  • Depends on: BaseIntegrationEvent (the base it derives from, SpeakerLinkedToUser.cs:20); the EventName attribute from MMCA.Common.Domain.Attributes (SpeakerLinkedToUser.cs:1, :21); the identifier aliases UserIdentifierType and SpeakerIdentifierType.
  • Concept introduced, the integration event (as distinct from the domain event). [Rubric §7, Microservices Readiness] assesses whether cross-module coupling runs through a published contract a peer can consume without a code reference back into the producer, and [Rubric §9, API & Contract Design] treats the asynchronous message as a public contract in its own right. Three things separate this record from the domain events in this chapter. First, it derives from BaseIntegrationEvent rather than BaseDomainEvent: a domain event stays inside the producing module, an integration event is meant to cross a module (and eventually a service) boundary over the broker via the outbox. Second, it lives in the .Shared project, not .Domain, precisely so the subscribing Identity module can reference the contract without pulling in Conference's domain model. Third, it carries [EventName("Conference.SpeakerLinkedToUser.v1")] (SpeakerLinkedToUser.cs:16): the wire name is pinned as data, so the CLR type can be renamed or moved without changing what a subscriber matches on, and the .v1 suffix leaves room for a second shape alongside the first.
  • Walkthrough: the whole type is a positional record, sealed record class SpeakerLinkedToUser( UserIdentifierType UserId, SpeakerIdentifierType SpeakerId) : BaseIntegrationEvent (SpeakerLinkedToUser.cs:17-20), preceded by the EventName attribute (:21). Two ids and nothing else: the receiver needs no more than that to set LinkedSpeakerId. The XML doc records that it replaced a former direct in-process call, IUserSpeakerLinkService.LinkSpeakerAsync (SpeakerLinkedToUser.cs:12-17).
  • Why it's built this way: modeling the link as a published fact rather than a synchronous call is the outbox and eventual-consistency story of ADR-003; it lets Identity and Conference run as separate services with no shared database and no cross-database FK (ADR-006).
  • Where it's used: raised on two different paths, and the difference is worth reading. The manual path in LinkUserToSpeakerHandler calls entity.AddDomainEvent(new SpeakerLinkedToUser(...)) (LinkUserToSpeakerHandler.cs:63), so the message is serialized into the outbox inside the same save as the aggregate change. The auto-link path in UserRegisteredHandler instead publishes through IEventBus (UserRegisteredHandler.cs:95 on the already-linked branch, :101 after the link is saved). It is consumed on the Identity side by SpeakerLinkedToUserHandler.

SpeakerUnlinkedFromUser

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Speakers.IntegrationEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/IntegrationEvents/SpeakerUnlinkedFromUser.cs:15 · Level 3 · record (sealed)

  • What it is: the inverse of SpeakerLinkedToUser. Conference raises it when a speaker is unlinked from a user, either via the UnlinkUserFromSpeaker command or as cascade cleanup when a speaker is soft-deleted; Identity subscribes and clears User.LinkedSpeakerId (SpeakerUnlinkedFromUser.cs:6-11).
  • Depends on: BaseIntegrationEvent (SpeakerUnlinkedFromUser.cs:18); the EventName attribute (:1, :18); the aliases UserIdentifierType, SpeakerIdentifierType.
  • Concept: the integration event taught at SpeakerLinkedToUser. [Rubric §7, Microservices Readiness]. Same contract shape, same .Shared placement, same pinned wire name ([EventName("Conference.SpeakerUnlinkedFromUser.v1")], SpeakerUnlinkedFromUser.cs:14). The one nuance worth reading off the parameter docs: the id actually being cleared is UserId, and SpeakerId rides along for audit and log correlation (SpeakerUnlinkedFromUser.cs:12-13).
  • Walkthrough: sealed record class SpeakerUnlinkedFromUser(UserIdentifierType UserId, SpeakerIdentifierType SpeakerId) : BaseIntegrationEvent (SpeakerUnlinkedFromUser.cs:15-18). Like its sibling it replaced a direct call, here IUserSpeakerLinkService.ClearLinkedSpeakerAsync (SpeakerUnlinkedFromUser.cs:10-14).
  • Why it's built this way: it closes the loop on the eventually-consistent link, and it is the downstream half of a SpeakerChanged delete. That is exactly why Speaker.Delete snapshots the previous link id into a local before the soft-delete runs (Speaker.cs:276-277), clears LinkedUserId (Speaker.cs:284), and then raises this event itself with the snapshotted id (Speaker.cs:287-290): read after the clear, the link would have nothing left to carry to Identity.
  • Where it's used: raised on the aggregate in both directions it can happen, by Speaker.UnlinkUser (Speaker.cs:340), which UnlinkUserFromSpeakerHandler calls before the save (UnlinkUserFromSpeakerHandler.cs:44), and by Speaker.Delete for the speaker-delete cleanup (Speaker.cs:289, BR-70); either way the outbox row is written in the same transaction as the change. Consumed on the Identity side by SpeakerUnlinkedFromUserHandler.

SessionFeedbackSubmitted

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Sessions.IntegrationEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/IntegrationEvents/SessionFeedbackSubmitted.cs:21 · Level 3 · record (sealed)

  • What it is: the session-level counterpart of EventFeedbackSubmitted: the integration event Conference raises when an attendee submits feedback on a session, which Engagement turns into a points award.
  • Depends on: BaseIntegrationEvent and EventNameAttribute ([EventName("Conference.SessionFeedbackSubmitted.v1")], line 20); aliases UserIdentifierType, SessionIdentifierType, EventIdentifierType; BCL DateTime.
  • Concept: the integration event introduced by EventFeedbackSubmitted. [Rubric §7, Microservices Readiness] and [Rubric §9, API & Contract Design]. Same delivery contract (BR-107 upsert, create path only, idempotent consumer, SessionFeedbackSubmitted.cs:9-14); the only payload difference is that it carries both the SessionId and the owning EventId (lines 23-24), so the consumer can scope the award without a call back into Conference to resolve the session's parent. That extra id is the whole point of a self-contained contract: a cross-service consumer must not need a synchronous lookup to interpret the message.
  • Walkthrough: four positional members (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/IntegrationEvents/SessionFeedbackSubmitted.cs:21-26): UserId, SessionId, EventId, and SubmittedOnUtc.
  • Where it's used: raised on the aggregate pre-save from two producers, both taking the timestamp from an injected TimeProvider. AddSessionQuestionAnswerHandler raises it on its create path (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/AddSessionQuestionAnswer/AddSessionQuestionAnswerHandler.cs:124, inside CreateNewAnswerAsync at :99-117), and BatchAddSessionQuestionAnswersHandler raises one per newly created answer inside its per-answer loop (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/BatchAddSessionQuestionAnswers/BatchAddSessionQuestionAnswersHandler.cs:173-174). The batch path is the clearest illustration of why the consumer must be idempotent: one submitted form can emit the event many times inside a single transaction. It is consumed by SessionFeedbackSubmittedPointsHandler, which resolves it onto a session subject key and awards through IPointsAwarder (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Application/Points/IntegrationEventHandlers/SessionFeedbackSubmittedPointsHandler.cs:42-49), and is registered as a broker consumer in the Engagement service host (MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/EngagementBrokerConsumers.cs:27).

EventFeedbackSubmitted

MMCA.ADC.Conference.Shared · MMCA.ADC.Conference.Shared.Events.IntegrationEvents · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/IntegrationEvents/EventFeedbackSubmitted.cs:20 · Level 3 · record (sealed)

  • What it is: the cross-module integration event Conference raises when an attendee submits feedback on an event. The Engagement module subscribes and awards the attendee points for the feedback.

  • Depends on: BaseIntegrationEvent (the base record) and EventNameAttribute (applied on line 19); aliases UserIdentifierType, EventIdentifierType; BCL DateTime.

  • Concept introduced, the integration event (as distinct from the domain event). [Rubric §7, Microservices Readiness] (assesses whether cross-module coupling runs through a published contract a peer can consume without a code reference back into the producer's domain) and [Rubric §9, API & Contract Design] (the async message is a public contract, versioned like one). Three things separate it from every event above.

    1. It derives from BaseIntegrationEvent, which adds a virtual SchemaVersion defaulting to 1 (MMCA.Common/Source/Core/MMCA.Common.Domain/DomainEvents/BaseIntegrationEvent.cs:32) and implements IIntegrationEvent, the marker the save-changes interceptor branches on: an integration event still gets an outbox row, but it is deliberately not dispatched in process, so its row stays unprocessed (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Interceptors/DomainEventSaveChangesInterceptor.cs:279-280, MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Interceptors/DomainEventSaveChangesInterceptor.cs:295-298) and the OutboxProcessor publishes it through IMessageBus instead, wrapped in a broker-publish resilience pipeline (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:701-716). The registered transport then decides delivery: the monolith's default InProcessMessageBus hands the event to the in-process dispatcher (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:414, MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Messaging/InProcessMessageBus.cs:18-24), while an extracted service's AddBrokerMessaging(...) swaps in BrokerMessageBus, which publishes to the broker the MessageBus:Provider setting selects through the framework's own transports (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Messaging.cs:128, MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Messaging/BrokerMessageBus.cs:46-51).
    2. It carries an explicit wire name. [EventName("Conference.EventFeedbackSubmitted.v1")] (EventFeedbackSubmitted.cs:19) pins the serialized message-type name, so renaming the C# record does not silently break an already-deployed consumer.
    3. It lives in the .Shared project, not .Domain, precisely so a subscribing module can reference the contract without pulling in Conference's domain model.

    ADR-010 is the rule for evolving it: additive changes keep the version, a breaking change means a new type plus a consumer-side upcaster registered per ADR-090.

  • Walkthrough: three positional members (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Events/IntegrationEvents/EventFeedbackSubmitted.cs:20-24): UserId (the attendee, line 21), EventId (the subject, line 22), and SubmittedOnUtc (when the answer was recorded, in UTC, line 23). The producer supplies that instant from an injected TimeProvider, never an ambient clock (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/AddEventQuestionAnswer/AddEventQuestionAnswerHandler.cs:114).

  • Why it's built this way: the delivery semantics are the interesting part, and the XML doc states them (EventFeedbackSubmitted.cs:9-14). Event feedback is an upsert writing one row per form question (BR-107), so one submitted form raises this event once per newly created answer, and only on the create path: the update branch of the same handler raises nothing (AddEventQuestionAnswerHandler.cs:83-96 for the update path versus :96-117 for the create path). Because at-least-once outbox delivery and a multi-question form both mean the consumer can see the message more than once, the consumer is idempotent on its own side: it collapses everything onto one subject key and lets the awarder's uniqueness rule reject the duplicates (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Application/Points/IntegrationEventHandlers/EventFeedbackSubmittedPointsHandler.cs:40-47). That is the standard posture for ADR-003 and ADR-021: the producer guarantees the fact was recorded atomically with the data, the consumer guarantees the effect happens once.

  • Where it's used: raised on the aggregate pre-save by AddEventQuestionAnswerHandler (:112), so the outbox captures it in the same SaveChangesAsync; consumed by EventFeedbackSubmittedPointsHandler, which maps it onto an event subject key via PointsSubjectKeys and calls IPointsAwarder (EventFeedbackSubmittedPointsHandler.cs:40-47); registered as a broker consumer in the Engagement service host (MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/EngagementBrokerConsumers.cs:28).


SessionAiScore

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionAiScore.cs:13 · Level 5 · class (sealed)

  • What it is: an aggregate root holding the AI-generated score for one session across seven criteria (overall, topic relevance, description quality, novelty, actionable takeaways, depth or insight quality, credibility and experience), plus the model's free-text Reasoning, the ModelUsed identifier, and the PromptVersion of the scoring contract that produced the numbers. One live score per session.
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> bound to SessionAiScoreIdentifierType, IdValueGeneratedAttribute, and Result / Error (G01). The alias resolves to int (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:17), per ADR-048.
  • Concept: the private-constructor plus static Result<T> Create factory pattern was introduced in G02. What this type adds to the discussion is where you validate machine output. [Rubric §4, DDD] and [Rubric §11, Security] overlap here: the 1.0 to 10.0 range check runs inside the domain, so a hallucinated or out-of-range model response is rejected before it can reach the database, even though nothing about the data's origin is visible to the entity. The [IdValueGenerated] attribute (SessionAiScore.cs:12) marks the identity as database-generated. Storing ModelUsed and PromptVersion on the row is the governance half of the same idea: the entity cannot tell whether a number is trustworthy, so it records exactly which model and which prompt contract produced it, per ADR-111.
  • Walkthrough
    • ReasoningMaxLength (SessionAiScore.cs:19) is a public const int of 4000, the column width for Reasoning. Its doc comment (:15-18) states the policy: longer model output is truncated rather than rejected, because the text is display-only and refusing it would throw away a paid scoring call. SessionAiScoreConfiguration reads the same constant for the column (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Sessions/SessionAiScoreConfiguration.cs:51), so schema and entity share one number.
    • Eleven private set properties (SessionAiScore.cs:22-58): the FK SessionId, seven decimal scores, the Reasoning / ModelUsed text, and PromptVersion (:58). decimal rather than double keeps the stored values exactly as the model reported them.
    • PromptVersion is a dated string in the shape yyyy-MM-dd.N, stored beside ModelUsed so a row says which reviewer brief produced it: a prompt revision re-bases every number the dashboard shows, and without the column nothing on the row records which rules applied. Rows written before the column existed carry legacy (SessionAiScore.cs:51-57).
    • The EF parameterless constructor (SessionAiScore.cs:61-66) seeds Reasoning, ModelUsed and PromptVersion to string.Empty, satisfying non-nullable reference types without an = null! escape hatch.
    • Create (SessionAiScore.cs:83-123): takes the seven scores plus reasoning, modelUsed and promptVersion (:92-94), combines seven EnsureScoreInRange checks through Result.Combine (:96-103) so a caller sees every out-of-range field at once rather than the first; on failure it returns Result.Failure<SessionAiScore>(result.Errors) (:106), otherwise it constructs with Id = default (:110), leaves identity to the database, and assigns Reasoning through TruncateReasoning (:119).
    • There is no Update method: Create is the only public way to set a score, so every property keeps the value it was created with. A re-score replaces the row rather than mutating it (see Caveats).
    • TruncateReasoning (SessionAiScore.cs:125-126): a private expression-bodied helper that cuts the text to ReasoningMaxLength with a range slice (reasoning[..ReasoningMaxLength]) and returns shorter text unchanged. Create is its one caller, and since Create is the only write path, an over-long reasoning string can never reach the column.
    • EnsureScoreInRange (SessionAiScore.cs:128-135): a private helper using the C# relational pattern score is >= 1.0m and <= 10.0m (:129), applied once per criterion inside Create, so the range is written in one place. The failure carries the stable code SessionAiScore.OutOfRange (:132) and a message built with string.Create(CultureInfo.InvariantCulture, ...) (:133) so a machine-readable diagnostic does not change shape with the request culture.
    • Note the asymmetry between numbers and text: an out-of-range score fails the whole call, while an over-long Reasoning is silently truncated, and PromptVersion and ModelUsed are stored as given. The entity judges the numeric range, clamps the display text to its column, and records the provenance strings without judging them.
    • No domain events are raised anywhere in this file: there is no AddDomainEvent call, because no other module reacts to a score change.
  • Why it's built this way: range validation belongs to the domain because it is a statement about what a score is, not about who asked for one. Keeping the check in one private helper that the single factory applies to all seven criteria means a future range change is made once and covers every score. Having no in-place mutator at all means there is no second write path for that check to be forgotten on.
  • Where it's used: created by the scoring pass (SessionScoringRunner, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sessions/UseCases/DecisionSupport/ScoreEventSessions/SessionScoringRunner.cs:93, passing aiScoringService.ModelId and aiScoringService.PromptVersion as the provenance pair at :97, and persisting through the repository resolved on a fresh scope's unit of work inside ReplaceScoreAsync at :164), invoked from the internal-command handler ScoreEventSessionsInternalCommandHandler (ADR-114), read back by the organizer dashboard (GetSessionSelectionDashboardHandler, .../GetSessionSelectionDashboard/GetSessionSelectionDashboardHandler.cs:103,352,363), configured by SessionAiScoreConfiguration in Infrastructure, projected as SessionAiScoreDTO, and rendered by the organizer page SessionSelectionAiScores.
  • Caveats / not-in-source: re-scoring never edits an existing score; the entity offers no operation that could. The runner replaces a session's score with a delete-then-add pair (ExecuteDeleteAsync then AddAsync, SessionScoringRunner.cs:169-170) inside one transaction in ReplaceScoreAsync (:157), called in the same step that writes the new score (:118). Its comment (:108-117) justifies this by partial-failure behavior: N sequential paid model calls follow, so a run that dies partway through has replaced only what it actually re-scored, a session whose call or save failed keeps the score it already had, and the unique filtered index on SessionId keeps at most one live row either way. A score row is therefore write-once: created by Create, later removed by the next pass's delete, never updated.

[Rubric §16, AI-Native Application Architecture] applies: this type is part of the AI session-scoring feature (a model call behind a port, versioned prompt and model, an evaluation gate, metered spend; ADR-111).

ActivityInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Activities · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/ActivityInvariants.cs:13 · Level 6 · class (static)

  • What it is: the domain rules for the Activity aggregate: a required name, an optional description and three optional venue fields that are length-checked only, and a start-before-end time range check. The length constants declared here are read by domain validation, by the EF configuration, and by the application-layer rule types, so a column width and a domain rule cannot silently diverge (ActivityInvariants.cs:7-12).
  • Depends on: CommonInvariants (ActivityInvariants.cs:2), Result (:3), and ActivityDTO (:1), which is where the numbers actually live; BCL DateTime.
  • Concept: the static-invariants-class pattern introduced for the framework at CommonInvariants and shown for a Conference aggregate at SessionInvariants. [Rubric §4, Domain-Driven Design]: the rules live in the domain rather than in a handler or a validator. Two things this class teaches that its siblings do not.
    1. The length constant is a forwarder, not a literal. Every MaxLength here is public const int X = ActivityDTO.X (ActivityInvariants.cs:16-28). The number is declared once on the Shared DTO, which the Blazor pages bind their input caps to, so the same cap is enforced at the input, at the domain rule, and at the column. [Rubric §8, Data Architecture] and [Rubric §24, Forms/Validation/UX Safety]: the UI stops the user before the domain has to, and neither can drift from the schema, because there is only one number.
    2. The optional field is a first-class domain concept. Four of the six rule methods take a string? and delegate to CommonInvariants.EnsureOptionalStringMaxLength, which passes a null or empty value. The doc on EnsureVenueNameIsValid states the reason plainly (:41-44): an empty venue name means the activity happens at the main conference venue, so absence is a meaningful value, not missing data.
  • Walkthrough
    • Length constants (ActivityInvariants.cs:16-28), all public const int forwarding to ActivityDTO: NameMaxLength (200), DescriptionMaxLength (2000), VenueNameMaxLength (200), VenueAddressMaxLength (500, chosen to match the event venue address per the doc at :24), and VenueUrlMaxLength (2000). The values themselves are declared at ActivityDTO.cs:18, :21, :24, :27, and :30.
    • EnsureNameIsValid (:36-39): the standard Result.Combine of CommonInvariants.EnsureStringIsNotEmpty plus CommonInvariants.EnsureStringMaxLength, tagged with the stable codes Activity.Name.Empty and Activity.Name.TooLong.
    • EnsureVenueNameIsValid (:48-49), EnsureVenueAddressIsValid (:58-59), EnsureDescriptionIsValid (:68-69), and EnsureVenueUrlIsValid (:78-79): each is a single expression delegating to CommonInvariants.EnsureOptionalStringMaxLength with its own error code (Activity.VenueName.TooLong, Activity.VenueAddress.TooLong, Activity.Description.TooLong, Activity.VenueUrl.TooLong). The description check's doc (:61-64) states why it exists at all: a write path that skips the request validator is refused here rather than failing at save. Note what is deliberately absent for the URL: no scheme parse, no reachability check. The doc (:71-74) records that the value is stored as an opaque string with no fetch or upload pipeline behind it, matching the sponsor website-URL precedent, so only the storage constraint is enforced here.
    • EnsureTimeRangeIsValid (:89-96): delegates to the generic CommonInvariants.EnsureEndIsNotBeforeStart, failing with Activity.TimeRange.Invalid. The doc (:81-84) explains why the comparison is a plain one: both values are event-local wall times, and the IANA zone lives on the owning Event, never repeated per row. A zero-length activity is allowed; only an inverted range is rejected.
  • Why it's built this way: pushing the "absent is legal" decision into the invariant, rather than into every caller, means a handler cannot accidentally require a venue name and the EF column cannot accidentally be narrower than the rule. Delegating the mechanics (optional max length, end-not-before- start) to CommonInvariants leaves this class holding only what is genuinely Conference vocabulary: which field, which error code, which message. Comparing naive wall times instead of instants keeps the domain free of time-zone conversion, which belongs where the zone is known.
  • Where it's used: Activity.Create and Activity.Update (Activity.cs:111-117 and :157-163); the length constants feed ActivityConfiguration (ActivityConfiguration.cs:20, :24, :36, :40, :44) and the application-layer rule types ActivityNameRules<T> and its siblings (ActivityValidationRules.cs:17, :29, :41, :53, :71).

SessionInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionInvariants.cs:14 · Level 6 · class (static)

  • What it is: the invariant-rule library for the Session aggregate and its children: title validity, optional-text max lengths, answer-value validity, a not-a-service-session guard (BR-91), status eligibility for engagement actions (BR-49), a scheduled-window guard (BR-16), and an end-after-start check (BR-122). It also owns the reserved manual id range for sessions that never came from Sessionize.

  • Depends on: CommonInvariants (SessionInvariants.cs:3), Result / Error (:4), SessionStatuses (same namespace), SessionDTO from MMCA.ADC.Conference.Shared.Sessions (:2), and QuestionDTO from MMCA.ADC.Conference.Shared.Questions (:1).

  • Concept: the static-invariant-class pattern (methods returning Result, composed with Result.Combine) was introduced for the framework in CommonInvariants. [Rubric §4, Domain-Driven Design]: the rules live in the domain, not in handlers, validators, or the database.

    The interesting detail here is which direction the constants flow. [Rubric §15, Best Practices & Code Quality] (assesses whether a single change stays a single edit). Every length constant on this class is an alias for a constant on a Shared DTO, seven of them on SessionDTO (public const int TitleMaxLength = SessionDTO.TitleMaxLength;, SessionInvariants.cs:17) and the answer-value width on QuestionDTO (:38). The class doc comment (:8-13) explains the direction: the numbers live on the DTO, "the lowest layer the UI can also reach, so markup and domain validation cannot drift apart". A Blazor MaxLength attribute, an EF HasMaxLength(...) call, and a domain length check therefore all resolve to one literal. Domain does not depend on Application here; Conference.Shared sits beneath both, so [Rubric §3, Clean Architecture] is preserved rather than bent.

  • Walkthrough

    • Length constants (SessionInvariants.cs:17-38): TitleMaxLength (:17), DescriptionMaxLength (:20), StatusMaxLength (:23), AccessibilityInfoMaxLength (:26), ResourceLinksMaxLength (:29), LiveUrlMaxLength (:32), and RecordingUrlMaxLength (:35) all forward to their SessionDTO counterparts, whose literals are 500, 4000, 100, 500, 2000, 2000, and 2000 respectively (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sessions/SessionDTO.cs:18-40). AnswerValueMaxLength (SessionInvariants.cs:38) forwards to QuestionDTO.AnswerValueMaxLength, the literal 4000 (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Questions/QuestionDTO.cs:32): the answer value is a child-entity field with no counterpart on SessionDTO, so its number lives on the question contract the answers respond to. No literal is declared on this class.
    • Reserved id range (SessionInvariants.cs:45,48): ManualIdRangeStart = 999_999_000 and ManualIdRangeEnd = 999_999_999, both static readonly SessionIdentifierType. The doc comment (:40-44) encodes the design decision behind them: session ids are app-assigned because the int PK is the Sessionize id, so ids for sessions never imported from Sessionize (organizer-created and seeded samples) sit above any real Sessionize id and never collide. It mirrors QuestionInvariants.
    • EnsureTitleIsValid (SessionInvariants.cs:50-53): combines a not-empty and a max-length check from CommonInvariants, each tagged with a stable error code (Session.Title.Empty, Session.Title.TooLong) and the caller's source string for tracing.
    • EnsureOptionalTextLengthsAreValid (SessionInvariants.cs:68-82): one call validating description, status, live URL, recording URL, accessibility info, and resource links against their constants. Its doc comment (:55-59) gives both reasons it exists: oversize input should fail as a domain validation error rather than as a database constraint violation, and the URL fields are length-checked only because the values are stored as opaque strings for Sessionize compatibility.
    • EnsureAnswerValueIsValid (SessionInvariants.cs:84-87): the not-empty plus max-length pair for SessionQuestionAnswer.AnswerValue, coded SessionQuestionAnswer.AnswerValue.Empty / .TooLong.
    • EnsureNotServiceSession (SessionInvariants.cs:95-101): delegates to CommonInvariants.EnsureFlagIsFalse and fails with Session.IsServiceSession when the session is a service slot such as lunch or a break (BR-91), which is how bookmarking and feedback are kept off non-content sessions.
    • EnsureStatusIsEligible (SessionInvariants.cs:110-117): delegates to SessionStatuses.IsEligible (:111) and turns a false into a Session.StatusIneligible error carrying the offending status in its message. The eligibility allow-list stays in the Level 0 catalog: there is exactly one definition of "eligible".
    • EnsureIsScheduled (SessionInvariants.cs:127-140): requires both startsAt and endsAt to have a value before a time-gated action such as feedback submission (BR-16). When either is missing it fails with Session.NotScheduled, and the error target names whichever bound is absent (endsAt when only the start is set, otherwise startsAt).
    • EnsureEndsAtIsAfterStartsAt (SessionInvariants.cs:150-162): a statement body, like EnsureIsScheduled. Both values must be non-null for the check to run (null means not yet scheduled), and endsAt <= startsAt fails with Session.Duration.Invalid, so a zero-duration session is rejected as firmly as an inverted one (BR-122).
  • Why it's built this way: sharing the length constants between the DTO, the EF configuration, and the domain check keeps markup, schema, and rule in lockstep, and expressing each rule as a Result-returning function makes them composable: Session.Create combines three of them in one Result.Combine and reports all failures together.

  • Where it's used: Session.Create and Session.Update (Session.cs:213-216 and :281-284), SessionQuestionAnswer.Create / UpdateAnswer (SessionQuestionAnswer.cs:61 and :82), the application-layer session validators (G18), and the EF entity configurations for column lengths (G19, SessionConfiguration).

  • Caveats / not-in-source: EnsureNotServiceSession and the two ManualIdRange* values have no caller inside this file; their consumers are in the Application layer and the seeders, so their call sites are covered in G18 and G19.


Activity

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Activities · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Activities/Activity.cs:20 · Level 8 · class (sealed, aggregate root)

  • What it is: the aggregate root for a social or networking activity attached to a conference event: a pre-conference party, a morning coffee connect, an after-party, a closing ceremony (Activity.cs:11-18). It carries a name, an optional description, a start and end time, three optional venue fields, a sort order, and the FK to its owning Event. Activity ids are database-generated.
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (the base, Activity.cs:20), ActivityInvariants, Event (the navigation target, :58), Result, DomainEntityState, IdValueGeneratedAttribute, NavigationAttribute, and the ActivityChanged domain event. Aliases ActivityIdentifierType, EventIdentifierType.
  • Concept: the aggregate root taught at Category and Event, in its childless form (compare Question). What Activity teaches that the others do not is a modeling decision stated outright in the class doc (Activity.cs:11-18): an activity is deliberately not a Session. It has no room and no speakers, and it frequently happens at an external venue, so the venue is carried on the activity itself instead of being inherited from the event. [Rubric §4, Domain-Driven Design]: rather than overload Session with nullable room/speaker/venue fields and a "kind" discriminator, the ubiquitous language gets a second, smaller aggregate whose invariants are genuinely different. [Rubric §15, Best Practices & Code Quality]: the cost of that choice is a parallel command, query, and UI slice, and the benefit is that neither type carries the other's optionality.
  • Walkthrough
    • [IdValueGenerated] on the class (Activity.cs:19): activities are planned, not imported from Sessionize, so the database owns the id. Create applies that policy through typeof(Activity).TryResolveId(id, out var resolvedId, out var idError) (:121-122), the EntityTypeExtensions member that ignores a supplied id for a generated type and resolves default for the database to fill (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:52-64).
    • Scalars (Activity.cs:22-54): Name, Description?, StartTime/EndTime, VenueName?, VenueAddress?, VenueUrl?, SortOrder, and EventId, all with private setters. Read the two time docs carefully (:28-32, :35): both are plain wall-clock DateTime values in the owning event's IANA time zone, exactly as Session.StartsAt does, and the zone lives on the event, never repeated per row. SortOrder (:50) exists only to break ties between activities starting at the same time.
    • [Navigation] public Event? Event (Activity.cs:56-58): a single-reference navigation (not a collection) with a private setter, described in its doc as read-only and used for public visibility filtering, so a public read can honor the parent event's published state (ADR-002). The class declares no setter method for it: the [Navigation] attribute is the whole contract the populator reads.
    • Constructors (Activity.cs:61-83): the private parameterless EF constructor seeds Name = string.Empty; the private nine-parameter field constructor is what the factory calls.
    • Create (Activity.cs:99-132): a six-way Result.Combine over ActivityInvariants (:111-117, name, description, time range and the three venue fields) so a caller sees every problem at once, then the TryResolveId guard (:121-122), which returns its invariant error as a failed Result<Activity> rather than throwing, then Id = resolvedId (:126), then AddDomainEvent(new ActivityChanged(DomainEntityState.Added, activity.Id, activity.Name)) (:129).
    • Update (Activity.cs:147-179): the same six checks (:157-163), then eight scalar writes (:167-174), then ActivityChanged(Updated) (:176). Note the parameter list has no eventId: the doc (:134-137) records that the owning event is not updatable, and that moving an activity between events is a create plus a delete.
    • Delete (Activity.cs:183-191): overrides the base soft-delete and, on success, raises ActivityChanged(Deleted). There is no cascade, because the aggregate owns no children.
  • Why it's built this way: storing event-local wall times rather than instants means an organizer edits the time they see printed on the schedule, and the single authoritative zone on Event is applied once at render. Keeping venue on the activity is what lets an off-site after-party carry its own address and map link while an on-site coffee connect simply leaves the fields null and the reader falls back to the event venue.
  • Where it's used: mutated by the Conference activity command handlers and mapped to ActivityDTO by ActivityDTOMapper; persisted through ActivityConfiguration; rendered by the ActivityList, ActivityDetail, and ActivityCreate pages.

Session

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/Session.cs:22 · Level 8 · class (sealed)

  • What it is: the richest aggregate root in the Conference module. Session owns three child collections (SessionSpeaker, SessionCategoryItem, SessionQuestionAnswer) and coordinates their whole lifecycle: creation, update, restore, cascade soft-delete, and a domain event for every structural change. Session ids are Sessionize-assigned, not database-generated.

  • Depends on: AuditableAggregateRootEntity<TIdentifierType> bound to SessionIdentifierType, IAuditedEntity, DomainEntityState, NavigationAttribute, EntityTypeExtensions (the TryResolveId extension), Result / Error; the sibling entities Event and Room as reference navigations; SessionInvariants; its three children and their domain events SessionChanged, SessionSpeakerChanged, SessionCategoryItemChanged, SessionQuestionAnswerChanged.

  • Concept introduced, the aggregate root as consistency boundary. [Rubric §4, Domain-Driven Design] (assesses aggregates with a single transactional boundary and correct child lifecycle management). An aggregate root is the only entry point for mutations inside its boundary: nothing outside Session constructs or removes a SessionSpeaker, every such operation goes through Session.AddSessionSpeaker / RemoveSessionSpeaker. Three guarantees follow at once:

    • Cross-child invariants have a home. AddSessionSpeaker rejects a duplicate live speaker (Session.cs:362-369) and AddSessionCategoryItem rejects a duplicate live category item (Session.cs:436-443). Neither check could live on the child, which cannot see its siblings.
    • Event emission is not optional. Every structural change raises a domain event, making the change observable to other modules through the outbox (ADR-003) without the aggregate knowing who listens. [Rubric §6, CQRS & Event-Driven].
    • Cascade soft-delete is domain behavior. Delete() (Session.cs:334) soft-deletes every active child before raising SessionChanged(Deleted), implementing BR-55 in the model rather than through a database cascade or handler glue.

    The private constructors (Session.cs:118 and :120) plus the static Result<Session> Create factory (Session.cs:195) are what make that boundary real: there is no way to obtain a Session that skipped validation or the creation event.

    A second concept lands here too: the change trail. The class is marked IAuditedEntity (Session.cs:22), and the class doc comment (Session.cs:16-20) gives the reason in business terms: sessions are written by organizers and overwritten by the Sessionize sync, so "what changed this title, room, or time slot, and was it a person or the importer" is a question that actually gets asked, and only a change history answers it. [Rubric §13, Observability & Operability]: audit stamps say who touched the row last, the trail says what the sequence was.

    A third: the framework owns the child-collection mechanics. [Rubric §1, SOLID] and [Rubric §15, Best Practices & Code Quality]. Delete, restore, and remove-by-id are not hand-rolled loops here; they call four protected static helpers on the base class, DeleteChildren, RestoreChild, RemoveChildOrNotFound, and GetChildOrNotFound (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableAggregateRootEntity.cs:274, :213, :159, :106). The split is deliberate and documented at the helper: the helper owns the mechanics, and the aggregate method owns the meaning, so the caller still decides which domain event to raise and what it carries (AuditableAggregateRootEntity.cs:135).

  • Walkthrough

    • Scalar properties (Session.cs:25-67): fifteen private set fields. Title is the only non-nullable text (:25); Status is free text imported from Sessionize (:37); the booleans IsInformed / IsConfirmed (:40,43) track the speaker-communication workflow, and IsServiceSession / IsPlenumSession (:46,49) classify the slot. LiveUrl and RecordingUrl (:52,55) are string?, not Uri, for Sessionize compatibility. EventId (:64) and RoomId (:67) are scalar FKs, the latter nullable because a session may not have a room yet.
    • Reference navigations (Session.cs:70-75): Event? and Room? are [Navigation]-tagged with a private set (:70-71, :74-75), and the class declares no setter method for either: the attribute is what the navigation populator (G11) reads. The Event doc comment notes it exists for query filtering (BR-132) (:69). The private setter means no handler can assign either navigation by property syntax.
    • Duration (Session.cs:77-88): an int? in whole minutes, a persisted private set property rather than a computed one. The remarks (Session.cs:80-87) explain why: the sessions grid sorts on it, and neither dynamic LINQ nor the SQL Server provider can express the difference of two DateTime values in an ORDER BY. On SQL Server the column is a stored computed column over StartsAt and EndsAt, so the database keeps it true; the domain assigns the identical value through the private CalculateDuration(startsAt, endsAt) helper (:151-164) in both the constructor (:139) and Update (:293), so an unsaved session answers the duration question exactly as a loaded one does.
    • Child collections (Session.cs:90-115): three private readonly List<T> fields exposed as IReadOnlyCollection<T> through .AsReadOnly(). SessionSpeakers (:94) and SessionCategoryItems (:115) carry [Navigation(IsCollection = true)]. SessionQuestionAnswers (:109) deliberately does not, and its remarks (:101-108) are worth reading in full: the collection grows with attendance rather than with the schedule, the hottest public reads (the session grid, session detail, the speaker dashboard) never render it, and it is the one child collection here that is not public data, since its dedicated controller is authenticated and scopes rows per caller while GET /sessions?includeChildren=true is anonymous. Handlers that genuinely need the answers pass an explicit includes: list. [Rubric §12, Performance & Scalability] and [Rubric §11, Security] in one attribute that is absent.
    • Create (Session.cs:195-246): combines EnsureTitleIsValid, EnsureEndsAtIsAfterStartsAt, and EnsureOptionalTextLengthsAreValid (:213-216) so all validation failures surface together, then resolves the key through typeof(Session).TryResolveId(id, out var resolvedId, out var idError) (:220-221). Session carries no [IdValueGenerated] attribute, so the supplied Sessionize id is required: a missing one comes back as an invariant failure in the returned Result<Session> rather than a null dereference (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:20-22), and on success the factory assigns Id = resolvedId (:238). The same call in a database-generated entity ignores the supplied id and resolves default. It ends by raising SessionChanged(Added) (:243).
    • Status normalization (Session.cs:172): the private NormalizeStatus turns a null, empty, or whitespace status into null, and both the constructor (:140) and Update (:294) route Status through it. The doc comment (:166-171) gives the reason: a blank string would read as a set-but-unknown status, dropping the session out of the eligible set (SessionStatuses) and off the public schedule, so a cleared status is stored as "no status". Create and Update validate the raw status length first (:216, :285) and normalize only on assignment.
    • Update (Session.cs:266-308): the same three-invariant combine (:282-285), then assigns every mutable field including the two workflow booleans and RoomId (:289-303, recomputing Duration at :293 and normalizing Status at :294), and raises SessionChanged(Updated) (:305).
    • UnassignRoom (Session.cs:317-327): clears RoomId and leaves every other field alone. Its doc comment (:310-315) names the caller's reason (O-60): when a room is removed from the event, a session still pointing at it would fail room re-validation on every later edit. It is a no-op returning success when RoomId is already null (:319-320); otherwise it raises SessionChanged(Updated) (:324). The consumer is RemoveRoomHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RemoveRoom/RemoveRoomHandler.cs:47).
    • Delete (Session.cs:334-348): one Result.Combine over three DeleteChildren<TChild, TChildId> calls and base.Delete() (:338-342), then SessionChanged(Deleted) only when the whole combine succeeded (:344-345). The comment above it (:336-337) records why combine rather than short-circuit: aggregating every child failure with the root's own means a failing child cannot leave earlier children and the root already flagged. The helper itself skips children that are already deleted (AuditableAggregateRootEntity.cs:284-287), which makes re-deleting a parent idempotent with respect to its children.
    • Child mutation methods: speakers at Session.cs:358 (AddSessionSpeaker), :393 (RestoreSessionSpeaker), :412 (RemoveSessionSpeaker); category items at :432 (AddSessionCategoryItem), :468 (RestoreSessionCategoryItem), :490 (RemoveSessionCategoryItem); question answers at :511 (AddSessionQuestionAnswer), :533 (UpdateSessionQuestionAnswer), :555 (RemoveSessionQuestionAnswer). Each delegates to the child's own Create / UpdateAnswer or to a base helper, mutates the private list, and raises the child-specific *Changed event. Every Result<T> these calls return is unwrapped with TryGetValue(out var ...) (for example Session.cs:372, :416, :538), the Result accessor (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/Result.cs:206) that tests success and binds the value in one step, so no method dereferences .Value! after a separate failure check.
    • The restore path (Session.cs:393-405 and :468-483) is the interesting one. It takes the join instance rather than an id, because a soft-deleted row is excluded by the global query filter and so must be resolved by the caller (remarks at :386-390 and :461-465). It hands the instance to RestoreChild<...> along with the aggregate's own error code, "Session.Speaker.NotDeleted" (:398) or "Session.CategoryItem.NotDeleted" (:475); the helper refuses a not-deleted candidate (AuditableAggregateRootEntity.cs:224), calls the child's Reactivate() (:234), and re-adds it to the list only if absent (:246). The aggregate then raises SessionSpeakerChanged(Added) because the association re-enters the visible set (Session.cs:402). BR-135: an association that reappears in the Sessionize feed is reactivated rather than duplicated by a second row.
    • Removal (Session.cs:412-422, :490-500, :555-565): each calls RemoveChildOrNotFound<TChild, TChildId> and, on success, raises the matching *Changed(Deleted) event with the removed child's id. A missing or already-deleted id yields a NotFound failure from the helper rather than a null reference.
    • Lookup helper (Session.cs:568-571): a single private GetSessionQuestionAnswerOrNotFound routing through the base GetChildOrNotFound<TChild, TChildId>, used only by UpdateSessionQuestionAnswer (:537). The other two children have no update path, so they need no lookup wrapper.
    • No populator-only setters. The class declares no SetEvent, SetRoom, or SetSession* method: nothing on Session exists solely for query-side population, so every public mutator is a domain operation on the command path.
  • Why it's built this way: the aggregate boundary makes atomicity natural, one SaveChangesAsync commits the session and all of its children together, and domain events raised inside the same transaction reach other modules through the outbox without the aggregate knowing they exist. [Rubric §29, Resilience & Business Continuity]: cascade soft-delete keeps children from surviving in a live-but-unreachable state after their parent is gone, the policy recorded in ADR-005.

  • Where it's used: the central Conference entity. Persisted through SessionConfiguration and the repositories (G19), read as SessionDTO through the query services, and mutated by the Session command handlers (G18); its ids and eligibility rules are consumed cross-service by Engagement through the bookmark and live-validation contracts.


SessionCategoryItem

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionCategoryItem.cs:14 · Level 8 · class (sealed)

  • What it is: the join entity linking a Session to a CategoryItem, with database-generated identity ([IdValueGenerated], SessionCategoryItem.cs:13). A child of the Session aggregate.
  • Depends on: AuditableBaseEntity<TIdentifierType> bound to SessionCategoryItemIdentifierType, IReactivatable, IdValueGeneratedAttribute, EntityTypeExtensions, NavigationAttribute, Result, and Session as the back-reference.
  • Concept introduced, the join entity. [Rubric §4, DDD]: rather than letting EF create a raw join table, a many-to-many association is modeled as a domain entity, so it carries its own identity, audit fields, and soft-delete state, and participates in domain events through the owning aggregate. All three Session children share this shape and differ only in the FK they carry, whether they hold a payload, and whether they can be reactivated.
  • Walkthrough: CategoryItemId (SessionCategoryItem.cs:17, private set); the Session? back-navigation (:20-21, [Navigation] with a private set and no setter method, so the attribute is the populator's whole contract); SessionId (:24), get-only because EF sets it as the shadow-side FK when the child is added to the parent's list. Two constructors: the EF parameterless one (:27) and a private assigning one (:29). Create(id?, categoryItemId) (:37-50) resolves the key through typeof(SessionCategoryItem).TryResolveId(...) (:41-42); the type is database-generated, so a supplied id is ignored and Id is assigned default for the database to fill (:46). It performs no payload validation, because the association is structurally always valid, and for a generated type the id guard cannot fail, so it returns Result.Success (:49). Reactivate() (:58) is the IReactivatable implementation and simply exposes the protected base Undelete() (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableBaseEntity.cs:91) to the framework's RestoreChild helper; its doc comment (:52-56) explains why the join is reactivated rather than re-created when an association reappears in the Sessionize feed (BR-135).
  • Where it's used: managed exclusively through Session.AddSessionCategoryItem / RestoreSessionCategoryItem / RemoveSessionCategoryItem, and projected as SessionCategoryItemDTO.

SessionQuestionAnswer

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionQuestionAnswer.cs:14 · Level 8 · class (sealed)

  • What it is: a child entity of Session storing the answer to a Question for that session. Database-generated identity ([IdValueGenerated], SessionQuestionAnswer.cs:13).
  • Depends on: AuditableBaseEntity<TIdentifierType> bound to SessionQuestionAnswerIdentifierType, IdValueGeneratedAttribute, EntityTypeExtensions, NavigationAttribute, Result, Session, and SessionInvariants.
  • Concept: the same join-entity shape as SessionCategoryItem, with two differences that matter. It carries a validated payload, so unlike its two siblings its Create can fail; and it does not implement IReactivatable (contrast SessionQuestionAnswer.cs:14 with SessionCategoryItem.cs:14), so it can never be passed to the framework's RestoreChild helper. That absence is the design statement: an answer is content a person wrote, not a Sessionize-fed association that may reappear, so a deleted answer is re-created rather than resurrected. [Rubric §4, DDD].
  • Walkthrough: QuestionId (SessionQuestionAnswer.cs:17) and AnswerValue (:20), the computed HasErasableText (:28), the Session? navigation (:31-32, [Navigation] with a private set and no setter method), and the get-only SessionId (:35). The EF constructor seeds AnswerValue to string.Empty (:38); the private assigning constructor starts at :40. Create(id?, questionId, answerValue) (:55) validates through SessionInvariants.EnsureAnswerValueIsValid (:61) before touching identity, then applies the same TryResolveId guard as its siblings (:65-66) and assigns Id = resolvedId (:70). UpdateAnswer(answerValue) (:81) re-runs the identical invariant (:83) and mutates the field, so an update cannot bypass a rule that creation enforced.
  • Account erasure (GDPR right to be forgotten): HasErasableText (SessionQuestionAnswer.cs:28) delegates to QuestionInvariants.IsErasableAnswerText (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/QuestionInvariants.cs:170), which is false for a value already equal to the ErasedAnswerValue sentinel "[deleted]" (QuestionInvariants.cs:37) and for a valid rating, and true for any other text. EraseAnswerText() (SessionQuestionAnswer.cs:102) overwrites AnswerValue with that sentinel only when HasErasableText holds (:104), so it is idempotent and a redelivered erasure finds nothing left to write. The doc comment (:92-101) ties the method to section 11 of the repo's PRIVACY.md (:94) and keeps it deliberately separate from the soft delete the parent aggregate performs: only the erasure is irreversible, and the row survives (anonymize-in-place, ADR-005). The caller is UserDeletedFeedbackHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Users/IntegrationEventHandlers/UserDeletedFeedbackHandler.cs:116-117, and again at :155-156), which reads HasErasableText to decide whether the row changed before calling EraseAnswerText().
  • Where it's used: managed through Session.AddSessionQuestionAnswer / UpdateSessionQuestionAnswer / RemoveSessionQuestionAnswer, and exposed as SessionQuestionAnswerDTO through a dedicated authenticated controller (G20).

SessionSpeaker

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sessions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sessions/SessionSpeaker.cs:14 · Level 8 · class (sealed)

  • What it is: the join entity linking a Session to a Speaker, with database-generated identity ([IdValueGenerated], SessionSpeaker.cs:13).
  • Depends on: AuditableBaseEntity<TIdentifierType> bound to SessionSpeakerIdentifierType, IReactivatable, IdValueGeneratedAttribute, EntityTypeExtensions, NavigationAttribute, Result, and Session.
  • Concept: the same join-entity pattern as SessionCategoryItem, and the thinnest of the three (a single SpeakerId payload). Its value as a teaching example is where the uniqueness rule is not: the duplicate-speaker invariant lives in Session.AddSessionSpeaker (Session.cs:362-369), not here. A rule that spans a collection belongs to the aggregate root that owns the collection, because the child can only see itself. [Rubric §4, DDD].
  • Walkthrough: SpeakerId (SessionSpeaker.cs:17), the Session? navigation (:20-21, [Navigation] with a private set and no setter method), the get-only SessionId (:24), the EF and assigning constructors (:27,29). Create(id?, speakerId) (:37-50) only resolves identity through the TryResolveId guard (:41-42) and assigns Id = resolvedId (:46); the type is database-generated, so the guard cannot fail and the factory always succeeds. Reactivate() (:58) forwards to the protected base Undelete() (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableBaseEntity.cs:91); its doc comment (:52-56) records the BR-135 rationale, that the row carries the Sessionize-assigned speaker id, so a returning association is reactivated rather than duplicated.
  • Where it's used: managed through Session.AddSessionSpeaker / RestoreSessionSpeaker / RemoveSessionSpeaker; its projection SessionSpeakerDTO is what the public session grid renders for speaker names.

Category

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Categories · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/Category.cs:16 · Level 6 · class (sealed, aggregate root)

  • What it is: the aggregate root for a conference category, for example "Level", "Track", or "Session format" (Category.cs:10-14). Each category owns a collection of CategoryItem children representing the selectable options inside it.

  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (the base, Category.cs:16), CategoryInvariants, CategoryItem, Result, DomainEntityState, IdValueGeneratedAttribute, NavigationAttribute, and the domain events CategoryChanged and CategoryItemChanged. Identifier aliases ConferenceCategoryIdentifierType and CategoryItemIdentifierType.

  • Concept introduced, the aggregate root as the consistency boundary. [Rubric §4, Domain-Driven Design] assesses whether invariants are enforced inside a boundary and whether children are mutated only through their root. An aggregate root is the only member of its cluster a repository hands out; callers never hold a bare CategoryItem. Two consequences are visible directly in this file:

    1. All child mutation routes through the parent. AddCategoryItem, UpdateCategoryItem, and RemoveCategoryItem (Category.cs:130, :161, :193) live on Category, never on CategoryItem, and each raises a CategoryItemChanged from the root (for example Category.cs:152) so observers learn the aggregate changed.
    2. The private list enforces encapsulation. _categoryItems is a private readonly List<CategoryItem> (Category.cs:27); the public surface is the read-only projection CategoryItems => _categoryItems.AsReadOnly() (Category.cs:31). EF still materializes the backing field, which is why the private parameterless constructor exists (Category.cs:34).

    [Rubric §8, Data Architecture] also applies: cascade soft-delete is orchestrated by the aggregate, not by a handler. Delete() (Category.cs:107-119) cascade-soft-deletes every still-active child per BR-71 before raising CategoryChanged(Deleted).

  • Walkthrough

    • Marker [IdValueGenerated] (Category.cs:15): category PKs are database-generated, and Sessionize imports still supply explicit ids via IDENTITY_INSERT (Category.cs:13).
    • Fields (Category.cs:19-31): Title, Sort, the optional Type (for example "session" or "speaker"), the private list, and the CategoryItems projection tagged [Navigation(IsCollection = true)] so the populator knows this is a child collection (ADR-002).
    • Constructors (Category.cs:34-44): the private EF constructor sets Title = string.Empty to satisfy the non-nullable field before EF assigns columns; the private field constructor is what the factory calls.
    • Create (Category.cs:54-78): validate through one Result.Combine of CategoryInvariants.EnsureTitleIsValid, CategoryInvariants.EnsureTypeIsValid and CategoryInvariants.EnsureSortIsNotNegative (Category.cs:60-63), so a missing title, an over-long Type and a negative sort are reported together, then resolve the key through typeof(Category).TryResolveImportedId(id, out var resolvedId, out var idError) (Category.cs:67-68), then construct with Id = resolvedId (Category.cs:72). The id policy is worth reading closely. TryResolveImportedId is the import variant of the framework's id reconciliation (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:88): a supplied id wins even though this type is id-value-generated, so a Sessionize import keeps its external key; an omitted id falls back to the database only because the type is generated; and a non-generated type with no id would come back as an Entity.Id.Required invariant Error (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:137-140), returned as a failed Result rather than thrown. Finally AddDomainEvent(new CategoryChanged(DomainEntityState.Added, ...)) (Category.cs:75). This is the canonical validate, then construct, then emit shape used by every aggregate in this chapter.
    • Update (Category.cs:87-103): re-validates the title, the optional type and the sort with the same three-way Result.Combine (Category.cs:89-92), writes the three scalars, raises CategoryChanged(Updated).
    • Delete (Category.cs:107-119): one Result.Combine of DeleteChildren<CategoryItem, CategoryItemIdentifierType>(_categoryItems) and base.Delete() (:111-113). DeleteChildren is the framework helper on AuditableAggregateRootEntity<TIdentifierType> that replaced the loop each aggregate used to hand-roll; it skips already-deleted children so re-deleting a parent is idempotent. The comment at :109-110 records the ordering rationale: children first, root last, so a failing child aggregates into the combined result instead of leaving a half-applied delete.
    • AddCategoryItem (Category.cs:130-155): trim the name first (Category.cs:138), then the uniqueness check (BR-138) via CategoryInvariants.EnsureCategoryItemNameIsUnique (:140-142), then delegate construction to CategoryItem.Create (:146), then add to the private list, then emit. Callers never new CategoryItem(...). The trim exists because of the database, not the UI: the comment at :135-137 (L226) records that SQL Server ignores trailing spaces in the unique (CategoryId, Name) index comparison, so an untrimmed "Cloud " would pass the in-memory check and then fail on the index as a generic data conflict. The child result is unwrapped with TryGetValue(out var categoryItem) (:147), the Result accessor (MMCA.Common/Source/Core/MMCA.Common.Shared/Abstractions/Result.cs:206) that tests success and binds the value in one step, so there is no separate .Value! dereference.
    • UpdateCategoryItem (Category.cs:164-189): trims the name the same way (:170), resolves the child through the private GetCategoryItemOrNotFound helper (Category.cs:209, which wraps the base GetChildOrNotFound<T, TId> so a missing child becomes an Error rather than a null) and unwraps it with TryGetValue (:173), re-checks uniqueness while excluding the item being renamed (:177-178), then delegates to the child's own Update (:182).
    • RemoveCategoryItem (Category.cs:196-206): a single call to the base RemoveChildOrNotFound<CategoryItem, CategoryItemIdentifierType> (:198-199), which resolves and soft-deletes in one step, then emits CategoryItemChanged(Deleted) (:203).
    • No hydration hook. The type declares no internal setter for its children: the private GetCategoryItemOrNotFound wrapper (Category.cs:209-213) is the last member, so every write to _categoryItems goes through a method that validates and raises an event. The child collection is known to the navigation layer only through its [Navigation(IsCollection = true)] marker (Category.cs:30), which the metadata provider maps to a child collection (MMCA.Common/Source/Core/MMCA.Common.Application/Services/Navigation/NavigationMetadataProvider.cs:78).
  • Why it's built this way: a single class owning uniqueness, cascade delete, and event emission keeps the consistency rules in one place instead of scattered across handlers, and pushing the mechanical parts (DeleteChildren, RemoveChildOrNotFound, GetChildOrNotFound, TryResolveImportedId) down into the framework leaves the aggregate holding only its own vocabulary. ADR-002 covers the two load paths: when category and items share a database EF Include() loads them together, and when they could be split the populator queries them separately, so the aggregate stays agnostic to the load path and carries no load-path code of its own.

  • Where it's used: loaded through IReadRepository<TEntity, TIdentifierType>, mutated by the Conference category command handlers such as AddCategoryItemHandler, persisted through CategoryConfiguration, and projected to ConferenceCategoryDTO for the category UI.

CategoryItem

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Categories · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/CategoryItem.cs:14 · Level 6 · class (sealed, child entity)

  • What it is: the child entity of Category: one selectable option inside a category, for example "Beginner" within "Level" or "C#" within "Language" (CategoryItem.cs:8-12). It carries Name, Sort, the back-navigation Category?, and the FK CategoryId.
  • Depends on: AuditableBaseEntity<TIdentifierType> (CategoryItem.cs:14), Category, CategoryInvariants, Result, IdValueGeneratedAttribute, NavigationAttribute.
  • Concept introduced, the child entity as distinct from the aggregate root. [Rubric §4, Domain-Driven Design] covers the entity hierarchy within an aggregate. A child entity has its own identity (it extends AuditableBaseEntity<TIdentifierType>, so it gets soft-delete and audit fields) but it is owned by a root, is never fetched directly from a repository, and, decisively, raises no domain events: its Create (CategoryItem.cs:47-66) mirrors the root's validate-then-construct shape but ends without an AddDomainEvent call, because event emission is the root's job.
  • Walkthrough
    • [IdValueGenerated] (CategoryItem.cs:13): item PKs are database-generated, with the same Sessionize IDENTITY_INSERT exception as the parent.
    • [Navigation] public Category? Category { get; private set; } (CategoryItem.cs:23-24): the back-navigation. The setter is private and the type declares no method that writes it (the class ends with Update, CategoryItem.cs:74-86), so nothing outside the class can repoint a child at a different category. The [Navigation] marker is what the metadata provider reads to treat it as a foreign-key navigation (MMCA.Common/Source/Core/MMCA.Common.Application/Services/Navigation/NavigationMetadataProvider.cs:78). [Rubric §1, SOLID]: no public or internal writer is a narrower surface than any setter.
    • CategoryId (CategoryItem.cs:27): the FK, get-only, never externally assigned; EF populates it by relationship fixup off the parent's CategoryItems navigation.
    • Create (CategoryItem.cs:47-66): validates the name through CategoryInvariants, resolves the key through typeof(CategoryItem).TryResolveImportedId(...) (:57-58), the same import policy as the root (a supplied Sessionize id wins, an omitted one falls to the database, and a failure comes back as a Result rather than an exception), and constructs with Id = resolvedId (:62).
    • Update (CategoryItem.cs:74-86): re-validates the name, then writes Name and Sort. Again no event; the root's UpdateCategoryItem raises CategoryItemChanged around it.
  • Why it's built this way: keeping the child lean, holding only its own field constraints, means a caller cannot bypass the parent's uniqueness and cascade rules by reaching in and calling categoryItem.Update(...) directly. The parent method is the only path that also runs BR-138.
  • Where it's used: loaded through Category (EF Include or the navigation populator); referenced by SpeakerCategoryItem and SessionCategoryItem as the target of those many-to-many bridges; projected to CategoryItemDTO.

CategoryInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Categories · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Categories/CategoryInvariants.cs:15 · Level 6 · class (static)

  • What it is: the invariant rules for Category and its CategoryItem children: title validation, the optional type's length cap, the non-negative sort order, item-name validation, and case-insensitive uniqueness checking (BR-138).
  • Depends on: CommonInvariants (the reusable lower layer it delegates to, CategoryInvariants.cs:3), Result and Error (:4), CategoryItem (it takes the child collection as a parameter), and ConferenceCategoryDTO plus CategoryItemDTO (:2), where the numbers live; BCL CultureInfo (:1).
  • Concept: the module invariants class (see SessionInvariants and EventInvariants). The distinctive method here, which the simpler invariant classes lack, is the collection-aware uniqueness guard. [Rubric §4, Domain-Driven Design]: the ubiquitous-language rule "an item name is unique within its category" is expressed directly in the domain rather than deferred to a database index or a UI check.
  • Walkthrough
    • Length constants (CategoryInvariants.cs:18, :21, :24): TitleMaxLength (255), TypeMaxLength (100), and CategoryItemNameMaxLength (500), all forwarding to the Shared DTO constants at ConferenceCategoryDTO.cs:17, :20, and CategoryItemDTO.cs:16. Note these are public static readonly int here rather than the public const int used by the other invariant classes in this chapter.
    • EnsureTitleIsValid (:26-29) and EnsureCategoryItemNameIsValid (:48-51): each a Result.Combine of CommonInvariants.EnsureStringIsNotEmpty plus CommonInvariants.EnsureStringMaxLength, with the message built through string.Create(CultureInfo.InvariantCulture, ...) so the text does not vary by ambient culture. That call is needed here and not in the sibling classes precisely because the length is a static readonly int rather than a compile-time constant, so the interpolation is evaluated at run time.
    • EnsureTypeIsValid (:35-36, documented as the M139 column cap at :31): a single call to CommonInvariants.EnsureOptionalStringMaxLength with code Category.Type.TooLong. Because Type is optional, the helper treats a null or empty value as success and only fails when the value exceeds TypeMaxLength (MMCA.Common/Source/Core/MMCA.Common.Domain/Invariants/CommonInvariants.cs:242-245).
    • EnsureSortIsNotNegative (:45-46): a single delegation to CommonInvariants.EnsureIntIsNotNegative with code Category.Sort.Negative. Its doc (:38-44) frames it as parity: category items, rooms and sponsors already require a non-negative display order, and this brings the category itself in line.
    • EnsureCategoryItemNameIsUnique (:61-82): takes the existing item collection plus an optional excludeItemId (so renaming an item to its own name during an update does not self-conflict). It skips IsDeleted items and compares with StringComparison.OrdinalIgnoreCase (:70-73), returning Error.Conflict("CategoryItem.Name.Duplicate") on a duplicate (:75-81). The inline comment at :67-69 records why the exclusion is modeled as a nullable rather than defaulted: defaulting to default(id) would silently exclude every unsaved sibling, since a database-generated CategoryItem id is 0 until the save.
  • Why it's built this way: co-locating the rules per aggregate keeps the entity itself readable, and the Result-returning style composes with Result.Combine. The uniqueness method takes the collection as a parameter so it stays a pure function with no repository and no EF dependency, which is what lets the aggregate call it in memory.
  • Where it's used: called from Category's Create, Update, AddCategoryItem, and UpdateCategoryItem (Create and Update combine EnsureTitleIsValid, EnsureTypeIsValid and EnsureSortIsNotNegative at Category.cs:60-63 and :89-92), and from CategoryItem's Create and Update; the length constants are read by the Categories EF configurations (CategoryConfiguration at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Categories/CategoryConfiguration.cs:21 and :28, CategoryItemConfiguration at :19), and TitleMaxLength plus CategoryItemNameMaxLength by the FluentValidation rules in ConferenceCategoryValidationRules.cs:20 and :34.
  • Caveats / not-in-source: the domain now caps Category.Type through EnsureTypeIsValid, matching the EF column at MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Categories/CategoryConfiguration.cs:28, but ConferenceCategoryValidationRules has no Type rule (only :20 and :34 read the constants), so an over-long Type passes request validation and is rejected by the aggregate as a domain Result failure.

PartnerInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Partners · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/PartnerInvariants.cs:13 · Level 6 · class (static)

  • What it is: the domain rule set for the Partner aggregate. Four field-length constants for a partner record and four EnsureXxx guards the aggregate calls before it mutates anything.
  • Depends on: CommonInvariants (Level 5), Result (Level 2), and PartnerDTO (Level 1) for the numbers.
  • Concept: the same three-layer constant chain SpeakerInvariants introduces, with the identical doc comment stating it (PartnerInvariants.cs:7-11). All four constants forward to PartnerDTO rather than holding a literal, so the storage schema and the domain rule cannot drift apart. Coverage is complete here: each of the four constants has a matching guard, so a write path that skips the request validator (a seeder, an import) is refused at the aggregate instead of at SaveChangesAsync.
  • Walkthrough
    • Constants (PartnerInvariants.cs:16-25): NameMaxLength 200 (:16), LogoUrlMaxLength 2000 (:19), DescriptionMaxLength 2000 (:22), WebsiteUrlMaxLength 2000 (:25). The literals live on PartnerDTO (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Partners/PartnerDTO.cs:18,21,24,27).
    • EnsureNameIsValid(string name, string source) (:33-36): the only required field check. A Result.Combine of CommonInvariants.EnsureStringIsNotEmpty (Partner.Name.Empty) and CommonInvariants.EnsureStringMaxLength (Partner.Name.TooLong).
    • EnsureLogoUrlIsValid(string? logoUrl, string source) (:45-46): the optional-field shape, a single call to CommonInvariants.EnsureOptionalStringMaxLength (Partner.LogoUrl.TooLong), so absence is legal by construction and only a supplied value is length-checked. Its doc (:38-41) notes the value is a plain URL string with no upload pipeline behind it, so only the storage constraint is enforced.
    • EnsureWebsiteUrlIsValid(string? websiteUrl, string source) (:56-59): a Result.Combine of the same optional length check against WebsiteUrlMaxLength (Partner.WebsiteUrl.TooLong) and CommonInvariants.EnsureUrlIsWellFormed (Partner.WebsiteUrl.Invalid, the value must be an absolute http or https URL). The doc (:48-52) gives the reason: the landing page links the partner logo to this URL, so both rules are enforced at the aggregate as well as in the request validators.
    • EnsureDescriptionIsValid(string? description, string source) (:68-69): the optional shape against DescriptionMaxLength (Partner.Description.TooLong). Its doc (:61-67) states the intent: a write path that skips the request validator is refused here rather than failing at save.
  • Why it's built this way: same rationale as SpeakerInvariants and SponsorInvariants: a const int reachable from the Domain layer lets the outer layers depend inward on it rather than each re-typing a number, and the optional-field helper keeps each single-rule guard to one expression instead of a hand-written null check. [Rubric §15, Best Practices & Code Quality].
  • Where it's used: Partner's private Validate helper, called from both Create (Partner.cs:89) and Update (Partner.cs:125); the constants additionally feed PartnerConfiguration's HasMaxLength calls (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Partners/PartnerConfiguration.cs, 4 call sites) and PartnerValidationRules (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Partners/Validation/PartnerValidationRules.cs, 6 call sites). Unit-tested directly by PartnerInvariantsTests (MMCA.ADC/Tests/Modules/Conference/MMCA.ADC.Conference.Domain.Tests/Partners/PartnerInvariantsTests.cs).

QuestionInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Questions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/QuestionInvariants.cs:14 · Level 6 · class (static)

  • What it is: the domain rules for the Question aggregate: text length, target entity ("Session", "Event", "Speaker"), input type ("Rating", "Text", "Email"), source ("Sessionize", "User"), and, the richest part, type-specific answer validation (BR-124). It also owns the account-erasure vocabulary the answer entities share: the ErasedAnswerValue placeholder and IsErasableAnswerText, plus named constants for the entity and source values.
  • Depends on: CommonInvariants (:2), Result and Error (:3), QuestionDTO (:1), and the shared Email value object (from MMCA.Common.Shared.ValueObjects.Contact, :4); BCL int.TryParse, NumberStyles, CultureInfo, and StringComparison.
  • Concept: the same invariants-class pattern as EventInvariants, but notably richer. [Rubric §4, Domain-Driven Design]: the closed value sets and the answer rules are expressed as domain logic, not as API or UI validation. The permitted values are held as data rather than as long switch statements: ValidQuestionEntities, ValidQuestionTypes, and ValidQuestionSources are private static readonly string[] (QuestionInvariants.cs:61, :64, :67). Entity and type are checked with StringComparer.Ordinal (:101, :118), source with StringComparer.OrdinalIgnoreCase (:133).
  • Walkthrough
    • Length constants (QuestionInvariants.cs:16-29): QuestionTextMaxLength (1000) and the three 20-char discriminator limits (QuestionEntityMaxLength, QuestionTypeMaxLength, QuestionSourceMaxLength), all forwarding to QuestionDTO (QuestionDTO.cs:17-26), plus TextAnswerMaxLength (2000, :29), the one literal, because the answer cap is a BR-124 rule rather than a bound input field.
    • ErasedAnswerValue (:37, "[deleted]"): the placeholder written over a free-text feedback answer when the account that wrote it is erased (PRIVACY.md section 11, per the doc at :31-36). It is shared by the session and the event answer types, and is non-empty and well under both answer length caps, so an erased row still satisfies the answer invariants and the required, length-capped column.
    • Named discriminator values: SessionEntity, EventEntity and SpeakerEntity (:40, :43, :46) for QuestionEntity, and SessionizeSource and UserSource (:52, :58) for QuestionSource, all public const string. The UserSource doc (:54-57) records M241: an organizer-created question is the only source attendees may answer, and the only one erasure and export cover. ValidQuestionEntities and ValidQuestionSources are composed from these constants (:61, :67), so a caller names the value instead of retyping the literal; ValidQuestionTypes still holds its three literals (:64).
    • The user-created id range ManualIdRangeStart / ManualIdRangeEnd (:70, :73, 999_999_000 to 999_999_999), distinguishing Sessionize ids from user-created ones, the same device SessionInvariants and EventInvariants use.
    • EnsureQuestionTextIsValid (:81-90): CommonInvariants.EnsureStringIsNotEmpty first, returning its failure immediately, then max length via CommonInvariants.EnsureStringMaxLength. The early return means an empty text reports one error, not an empty error plus a length error.
    • EnsureQuestionEntityIsValid (:100-107), EnsureQuestionTypeIsValid (:117-124), and EnsureQuestionSourceIsValid (:132-139): membership tests against the closed arrays, each returning a specific Error.Invariant code. The entity and type checks are ordinal, so only the canonical casing ("Session", "Rating") passes; the doc comments (:94-95, :111-112) give the reason (M143): consumers match and switch on the stored value case-sensitively, so a differently cased value accepted here would be silently unmatched downstream. The source check stays case-insensitive.
    • EnsureAnswerValueMatchesQuestionType (:149-160): a switch expression on questionType dispatching to three private validators, because what counts as a valid answer depends on the question's type:
      • ValidateRatingAnswer (:174-186): int.TryParse with NumberStyles.Integer and CultureInfo.InvariantCulture, requiring 1 to 5, otherwise Error.Validation. The invariant culture is deliberate: a rating must parse identically wherever the request originates.
      • ValidateTextAnswer (:188-200): length must not exceed TextAnswerMaxLength (2000).
      • ValidateEmailAnswer (:207-214): accepts the value only when Email.Create(answerValue) succeeds, otherwise Error.Validation("Answer.Email.Invalid"). The doc comment (:202-206) states the intent: the same email rule as every other address in ADC, so a display-name form or a dotless host is refused, and only the accept or reject decision comes from the value object; the answer is stored as submitted, not in its normalized form.
      • An unrecognized type falls through to Error.Invariant("Question.QuestionType.Unknown") (:155-159). The dispatch is an ordinal switch on the literal strings, which is exactly the case-sensitive consumer the ordinal EnsureQuestionTypeIsValid check protects: a stored type can only ever be one of the three canonical spellings.
    • IsErasableAnswerText (:170-172): decides from the value alone whether an answer carries free text an account erasure must overwrite. A value already equal to ErasedAnswerValue (ordinal compare) is not erasable, and neither is one that passes ValidateRatingAnswer (an integer 1 to 5 names nobody); every other value (a Text or an Email answer) is erasable. Deciding from the value rather than the question type means the erasure needs no cross-aggregate read of the Question.
  • Why it's built this way: encoding answer-shape rules in the domain means the model rejects a malformed rating or email before it can reach a handler or the database, and expressing the allowed sets as arrays keeps adding a new question type a one-line data change rather than a code restructure. Delegating the email decision to the Email value object keeps one definition of a valid address across the module instead of a second, looser BCL parse here.
  • Where it's used: called from Question's Create and Update; EnsureAnswerValueMatchesQuestionType is applied by the answer-recording paths in the Application tier, EventQuestionAnswerRules (EventQuestionAnswerRules.cs:57) and SessionQuestionAnswerRules (SessionQuestionAnswerRules.cs:81); the length constants feed QuestionConfiguration (QuestionConfiguration.cs:19, :23, :27, :37). ErasedAnswerValue and IsErasableAnswerText are used by the answer entities' HasErasableText and EraseAnswerText (EventQuestionAnswer, EventQuestionAnswer.cs:28, :106) and by UserDeletedFeedbackHandler (UserDeletedFeedbackHandler.cs:105, :105).
  • Caveats / not-in-source: Question.Update takes no source parameter (Question.cs:109-114) and re-checks only text, entity and type (:116-119), so EnsureQuestionSourceIsValid runs once, at Create (Question.cs:83).

SessionAssetInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.SessionAssets · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/SessionAssetInvariants.cs:13 · Level 6 · class (static)

  • What it is: the domain rule set for the SessionAsset aggregate. Four field-length constants plus six EnsureXxx guards covering every writable field on the entity, including the two that are conditional on the asset's kind.
  • Depends on: CommonInvariants (Level 5, SessionAssetInvariants.cs:2), which now carries the URL-shape and non-negative mechanics as well, Result and Error (Level 2, :3), SessionAssetDTO (Level 1, :1) for the four length numbers, and SessionAssetKind (Level 0), the discriminator EnsureBlobNameIsValid branches on. No direct BCL dependency remains beyond string.IsNullOrWhiteSpace.
  • Concept: the same three-layer constant chain taught on SpeakerInvariants: TitleMaxLength, UrlMaxLength, BlobNameMaxLength, and ContentTypeMaxLength (:16,19,22,25) all forward to SessionAssetDTO rather than holding a literal (class doc, :7-12). What is different from the speaker and sponsor siblings is coverage: every one of the four length constants here has a matching EnsureXxx guard, plus two more guards (EnsureSizeIsValid, EnsureSortOrderIsValid) for fields with no length constant at all, so nothing on this aggregate reaches SaveChangesAsync unvalidated the way Speaker.Bio or Sponsor.Description can.
  • Walkthrough
    • EnsureTitleIsValid(string title, string source) (:33-36): the familiar Result.Combine of EnsureStringIsNotEmpty (SessionAsset.Title.Empty) and EnsureStringMaxLength (SessionAsset.Title.TooLong).
    • EnsureUrlIsValid(string url, string source) (:47-51): a three-way Result.Combine adding EnsureUrlIsAbsoluteHttp (:122-138) to the empty/length pair. That private helper first returns success for a null, empty or whitespace value (:124-130): the blank case is already reported by the non-empty rule, and the comment notes the shared helper lets only null or empty through, so a whitespace-only value has to be skipped here before it reaches it. Otherwise it delegates to CommonInvariants.EnsureUrlIsWellFormed (:132-137, MMCA.Common/Source/Core/MMCA.Common.Domain/Invariants/CommonInvariants.cs:293), which demands an absolute http or https URL, with the module's own code SessionAsset.Url.NotAbsoluteHttp. The doc comment on the public method (:38-43) states why: the value is rendered as a download link on an anonymous page, so a javascript: or data: value is refused here rather than sanitized at every render site.
    • EnsureBlobNameIsValid(SessionAssetKind kind, string? blobName, string source) (:62-83): the kind-conditional guard. File with no blob name fails SessionAsset.BlobName.Required (:64-71); Link with a blob name fails SessionAsset.BlobName.NotAllowed (:73-80); otherwise the optional length check runs (:82). The doc comment (:53-57) frames it as the invariant that keeps a file row pointing at something the blob-delete path can actually find.
    • EnsureContentTypeIsValid (:93-94) and the optional-length shape one hop further: EnsureSizeIsValid(long? sizeBytes, string source) (:103-110) requires a positive value or null (SessionAsset.SizeBytes.Invalid otherwise), and EnsureSortOrderIsValid(int sortOrder, string source) (:119-120) delegates to CommonInvariants.EnsureIntIsNotNegative (CommonInvariants.cs:426) with the code SessionAsset.SortOrder.Negative; neither has a matching length constant because neither is a string.
  • Why it's built this way: routing every field through a static guard keeps the aggregate's CreateCore and Update free of inline conditionals, and combining the guards into Result.Combine calls (see SessionAsset) surfaces every problem in one round trip rather than one error at a time. Delegating the reusable mechanics (URL shape, non-negative integer) to the framework leaves this class holding only the Conference vocabulary: the error codes, the messages, and the kind-specific blob rule.
  • Where it's used: called from SessionAsset's CreateCore (SessionAsset.cs:289-295) and Update (SessionAsset.cs:247-250). Unit-tested directly by SessionAssetInvariantsTests (MMCA.ADC/Tests/Modules/Conference/MMCA.ADC.Conference.Domain.Tests/SessionAssets/SessionAssetInvariantsTests.cs). The constants and the kind check additionally feed SessionAssetValidationRules and SessionAssetConfiguration in the Application and Infrastructure tiers.

EventInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventInvariants.cs:16 · Level 6 · class (static)

  • What it is: the static invariants toolbox for the Event aggregate and its children (Room, EventQuestionAnswer). It holds the field-length constants and the Ensure... rule methods that the domain factories, the EF configuration, and the application-layer rules all reuse, so a business rule is stated once (EventInvariants.cs:10-15).
  • Depends on: CommonInvariants (:4), Result and Error (:5), and EventDTO, QuestionDTO and RoomDTO (:1-3), which declare the numbers; the shared Email value object (MMCA.Common.Shared.ValueObjects.Contact, :6); BCL DateOnly. Alias RoomIdentifierType.
  • Concept: the module invariants class, the same idiom taught for the framework at CommonInvariants and for a Conference aggregate at SessionInvariants, here in its widest form: fifteen length constants, a reserved id range, nine rule methods covering a root plus two children, and a Sessionize-code normalizer with its matching conflict error. [Rubric §4, Domain-Driven Design] (invariants live in the domain, expressed as reusable named rules rather than inline if blocks) and [Rubric §8, Data Architecture] (the MaxLength constants are the single source of truth shared by the EF column configuration and by validation, keeping schema and rule in sync). Each Ensure... returns a Result rather than throwing, and callers combine several through Result.Combine. Read this class next to ActivityInvariants to see the same forwarding discipline, here without exception: all fifteen constants are forwards, fourteen to EventDTO.X or RoomDTO.X and one to QuestionDTO.X, so every number is declared once on a Shared DTO.
  • Walkthrough, in teaching order:
    • Length constants (EventInvariants.cs:18-61), all public const int: NameMaxLength (500), DescriptionMaxLength (4000), TimeZoneMaxLength (100), SessionizeCodeMaxLength (100), VenueAddressMaxLength (500), VenueMapUrlMaxLength (2000), WiFiInfoMaxLength (500), OrganizerContactEmailMaxLength (255, :40), SponsorshipPacketUrlMaxLength (2000, :43), TicketingUrlMaxLength (2000, :46), and the four room limits (RoomNameMaxLength 255, RoomFloorMaxLength 100, RoomLocationMaxLength 255, RoomAccessibilityInfoMaxLength 500). The values are declared at EventDTO.cs:19-46 and RoomDTO.cs:16-25. AnswerValueMaxLength (4000, :61) forwards to QuestionDTO.AnswerValueMaxLength (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Questions/QuestionDTO.cs:32), the same constant SpeakerInvariants reads, so the event and speaker answer types share one cap.
    • Reserved id range (EventInvariants.cs:63-71): RoomManualIdRangeStart (999_999_000, :68) and RoomManualIdRangeEnd (999_999_999, :71), both static readonly RoomIdentifierType. Room ids are app-assigned, the int PK is the Sessionize id, so organizer-created rooms draw from this reserved high range and never collide with a real Sessionize id. The comment (:63-67) notes it mirrors SessionInvariants.ManualIdRangeStart.
    • EnsureNameIsValid (:73-76): a Result.Combine of a not-empty and a max-length check delegated to CommonInvariants.
    • EnsureOptionalFieldsAreValid (:88-98): checks the optional free-text fields (description, venueAddress, venueMapUrl, wifiInfo) against the same column caps EF applies, through CommonInvariants.EnsureOptionalStringMaxLength combined with Result.Combine, so an over-length value is refused at the factory (codes such as Event.Description.TooLong) rather than failing at save. A null value passes. Event.Create and Event.Update both call it.
    • EnsureContactAndLinksAreValid (:112-122): one Result.Combine over the contact and link fields. The organizer email is length-checked through its .Value against OrganizerContactEmailMaxLength (Event.OrganizerContactEmail.TooLong), because, per the doc (:100-111), the column holds 255 characters while the shared Email value object admits 256. The sponsorship packet and ticketing URLs each get a length check plus CommonInvariants.EnsureUrlIsWellFormed (Event.SponsorshipPacketUrl.Invalid, Event.TicketingUrl.Invalid: an absolute http or https URL), since the public pages render both as links. The doc is explicit that the request validators apply the same rules and that this method is the backstop for every other write path (a seeder, an import). Event.Create and Event.Update both call it (Event.cs:205, :285).
    • EnsureTimeZoneIsValid (:130-148): CommonInvariants.EnsureStringIsNotEmpty first, returning its failure immediately (Event.TimeZone.Empty, :132-136), then max length (:138-140), then a delegation to CommonInvariants.EnsureTimeZoneIsValid (:142-147) that maps an unrecognized identifier to Event.TimeZone.Invalid (BR-87). The early returns keep one mistake to one error, and the framework helper owns the actual BCL lookup; the domain carries no zone table of its own and names only the error code and message.
    • EnsureDateRangeIsValid (:157-164): delegates to CommonInvariants.EnsureEndIsNotBeforeStart with the code Event.DateRange.Invalid, so a single-day event (equal dates) is legal.
    • EnsureRoomCapacityIsValid (:172-178): delegates to CommonInvariants.EnsureNullableIntIsPositive with Room.Capacity.Invalid, so a null capacity passes and a supplied non-positive one fails (BR-93).
    • EnsureRoomNameIsValid (:180-183) and EnsureAnswerValueIsValid (:185-188): not-empty plus max-length pairs for the two children.
    • EnsureEventIsPublished (:196-202): guards actions that require a published event (BR-108), delegating to CommonInvariants.EnsureFlagIsTrue and failing with Event.NotPublished.
    • NormalizeSessionizeCode (:210-211): maps a blank or white-space code to null and returns any other code unchanged. The doc comment (:204-209) gives the reason (O-09): the unique index on the code is filtered on IS NOT NULL, so storing "no code" as null rather than an empty string lets any number of events have none. It is the one place that defines what "no code" means, read by both the aggregate and the application-layer uniqueness check.
    • SessionizeCodeInUseError (:219-224): builds the Error.Conflict with code Event.SessionizeCode.Duplicate and target SessionizeCode. It is a factory rather than an Ensure... method because the rule needs a database read the domain cannot make; the domain owns only the vocabulary, and the doc comment (:213-218) notes the create and update handlers check it before the save instead of surfacing the unique index's generic 409.
  • Why it's built this way: keeping the length limits as constants read by the EF configuration and by the domain prevents the classic drift where a validator accepts a value the column then truncates. Returning Result instead of throwing keeps validation composable at the factory, where several checks are combined into one error list. Every rule that has a reusable mechanism behind it (empty check, time-zone lookup, range comparison, nullable positive, flag, well-formed URL) is a thin delegation, so the Conference-specific part of each rule is exactly the error code, the message, and the target field name, which is the vocabulary the framework must not invent.
  • Where it's used: the Event, Room, and EventQuestionAnswer factories and updaters call these; the length constants are read by EventConfiguration and RoomConfiguration and by the application-layer event and room validation rules. EnsureEventIsPublished is called from EventQuestionAnswerRules.EnsureEventAcceptsFeedback (EventQuestionAnswerRules.cs:29-30), itself invoked by AddEventQuestionAnswerHandler (AddEventQuestionAnswerHandler.cs:45) and SessionQuestionAnswerRules (SessionQuestionAnswerRules.cs:54). The reserved room-id range is consumed in two places: AddRoomHandler allocates the next free id from it and refuses once it is exhausted (AddRoomHandler.cs:132-140), and RoomSyncStrategy skips any Sessionize room whose id falls inside it, recording a warning rather than importing a colliding row (RoomSyncStrategy.cs:95-97). The two Sessionize-code members are consumed by EventSessionizeCodeUniqueness, the check shared by the event create and update handlers: it normalizes the requested code first and passes a blank one (EventSessionizeCodeUniqueness.cs:49-51), then returns SessionizeCodeInUseError when another event, soft-deleted ones included, already holds it (EventSessionizeCodeUniqueness.cs:56-62). Event calls the normalizer itself when it stores the code (Event.cs:144, :294).

Question

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Questions · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Questions/Question.cs:14 · Level 7 · class (sealed, aggregate root)

  • What it is: a standalone aggregate root for a survey or custom-form question, for example "Dietary requirements" or "T-shirt size" (Question.cs:9-13). A question targets an entity type (QuestionEntity), has an input type (QuestionType), a sort order, an IsRequired flag, and a QuestionSource. Unlike the other roots in this part it owns no children: answers live on the answering entity (EventQuestionAnswer, SpeakerQuestionAnswer, SessionQuestionAnswer).
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (Question.cs:14), QuestionInvariants, Result, DomainEntityState, and the QuestionChanged domain event. Alias QuestionIdentifierType.
  • Concept: a "thin" aggregate root, where the consistency boundary is just the record itself. The detail worth noticing is the absent attribute: the class header carries no [IdValueGenerated] (Question.cs:14), so question ids are explicitly assigned, typically by Sessionize. Create resolves the key through typeof(Question).TryResolveId(id, out var resolvedId, out var idError) (:87-88): because the type is not generated, a supplied id is assigned as is (Id = resolvedId, :92) and an omitted one returns the Entity.Id.Required invariant error as a failed Result (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:137-140) rather than throwing. [Rubric §8, Data Architecture]: the id-origin decision is expressed once, as an attribute on the type (or its absence), and every factory reads it uniformly.
  • Walkthrough
    • Scalars (Question.cs:16-32): QuestionText, QuestionEntity (documented as "Session", "Event" or "Speaker", :19, matching the closed set in QuestionInvariants.cs:61), QuestionType, Sort, IsRequired, QuestionSource, all with private setters. The three discriminators are plain strings validated against the closed sets in QuestionInvariants rather than enums.
    • Constructors (Question.cs:35-57): the EF constructor seeds all four non-nullable strings.
    • Create (Question.cs:70-98): four invariant checks (text, entity, type, source) combined through Result.Combine (:79-83) so the caller gets every problem at once, then resolve the id (:87-88), then construct, then emit QuestionChanged(Added) (:95).
    • Update (Question.cs:109-132): re-validates text, entity, and type, but drops the questionSource parameter entirely. Source is immutable after creation, a business rule encoded by absence rather than by a guard clause.
    • Delete (Question.cs:136-144): calls the base soft-delete and, on success, emits QuestionChanged(Deleted). No cascade loop and no DeleteChildren call, because it owns nothing.
  • Why it's built this way: validating against closed value lists rather than accepting free-form strings means the domain rejects an invalid type, entity, or source before persistence. Making QuestionSource non-updatable preserves the provenance distinction between an imported question and a user-created one, which is what the reserved manual id range in QuestionInvariants also protects.
  • Where it's used: referenced by scalar FK (QuestionId) from EventQuestionAnswer, SpeakerQuestionAnswer, and SessionQuestionAnswer; mapped by QuestionConfiguration; projected to QuestionDTO and fed into the feedback and custom-form features in the Application and UI tiers.

SessionAsset

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.SessionAssets · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/SessionAssets/SessionAsset.cs:23 · Level 7 · class (sealed)

  • What it is: the aggregate root for one piece of material published against a conference session, either an uploaded file (a slide deck, a handout, an archive) or a link to material hosted elsewhere (a GitHub repository, a recording) (class doc, SessionAsset.cs:9-16). It carries no navigation properties at all: the public list is a flat projection keyed by session id, and the two parents are reached by their own repositories rather than through this entity (:14-16).
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (Level 4), SessionAssetInvariants (Level 6), SessionAssetKind (Level 0), SessionAssetChanged (Level 3), Result and Error (Level 2), DomainEntityState (Level 0). The identifier alias is SessionAssetIdentifierType = System.Guid (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:18). EventId and SessionId are scalar FKs to Event and Session; UploadedBySpeakerId is a nullable scalar FK to Speaker.
  • Concept, a third identity pattern. [Rubric §8, Data Architecture] assesses how an aggregate's identity is generated. Sponsor is [IdValueGenerated] (database-assigned int) and Speaker accepts an externally supplied Guid because the Sessionize import hands it one. SessionAsset carries neither attribute: the class doc (:18-20) states the reason directly, the identifier is a server-minted GUID because it is a path segment of the public blob name, so it has to be unguessable, a sequential id would let anyone who downloaded one asset walk the container. CreateCore reflects this: Id = id ?? Guid.NewGuid() (:301), not the isIdValueGenerated-branching pattern Sponsor.Create and SpeakerCategoryItem.Create use.
  • Walkthrough
    • Scalar state (:24-65), every setter private set: EventId (:31, denormalized from the session on purpose per the remarks at :26-30, since it lets the blob-delete cascade and the published-event read filter select without joining through the session), SessionId (:34), Kind (:37), Title (:40), Url (:46, the absolute http or https URL: the blob URL for a file or the supplied address for a link), BlobName (:49, null for a link), ContentType (:52, null for a link), SizeBytes (:55, null for a link), SortOrder (:58), UploadedBySpeakerId (:65, the remarks at :60-64 call it provenance, not authorization: who may edit the asset is decided by the session's current speaker list, so a co-speaker can fix a colleague's typo).
    • Constructors: the EF parameterless one (:68-72) assigns Title and Url to string.Empty; the private ten-parameter one (:74-96) is reachable only through the factories.
    • Create(...) (:116-140): the general factory covering both kinds by taking every field and delegating to CreateCore. The doc comment (:98-103) says to prefer CreateLink or CreateFile, which state the kind in their name; Create exists for a caller that already holds the kind as a value, a deserializer, an import, and would otherwise have to branch on it.
    • CreateLink(...) (:154-174) and CreateFile(...) (:192-215): kind-specific factories that only take the fields their kind carries (no blob name, content type, or size on a link), both delegating to CreateCore with the kind fixed. The CreateLink doc (:142-145) describes a link as an opaque http or https URL with no blob behind it.
    • Update(string title, int sortOrder, string? url = null) (:234-261): a supplied url is refused for anything but a Link (SessionAsset.Url.NotEditable, :236-243); the remarks (:221-226) explain the asymmetry, a link's address is the whole value of the row so it must be editable in place, while a file's URL is the blob it was stored as, so replacing the content is a delete plus a fresh upload instead. Validates title, url, and sort order through Result.Combine (:247-250), then raises SessionAssetChanged(Updated, Id, SessionId, Title) (:258).
    • Delete() (:265-273): overrides the base soft-delete, calling base.Delete() first and raising SessionAssetChanged(Deleted, ...) only on success.
    • CreateCore(...) (:275-307), private: runs all six SessionAssetInvariants guards through one Result.Combine (:289-295), constructs with Id = id ?? Guid.NewGuid() (:299-302), and raises SessionAssetChanged(Added, asset.Id, asset.SessionId, asset.Title) (:304).
  • Why it's built this way: [Rubric §4, Domain-Driven Design]: assets are their own aggregate rather than a child collection of Session because a session is imported from Sessionize and re-imported on every refresh, while assets are authored here and must survive that refresh untouched (class doc, :9-14). [Rubric §11, Security]: the URL is sanitized against javascript:/data: schemes once, inside SessionAssetInvariants.EnsureUrlIsAbsoluteHttp (which delegates the shape check to CommonInvariants.EnsureUrlIsWellFormed), rather than at each of the places that render it, because it is displayed as a public download link on an anonymous page.
  • Where it's used: rendered and driven by SessionAssetsPanel.razor.cs; its access rules resolved by SessionAssetAccessService; created, listed, updated and deleted by AddSessionAssetLinkHandler, UploadSessionAssetHandler, GetSessionAssetsHandler, and DeleteSessionAssetHandler; validated by SessionAssetValidationRules and SessionAssetUpdateRequestValidator; persisted by SessionAssetConfiguration; projected by SessionAssetDTO. Its cascade-delete behavior when the owning event or session is removed is exercised by DeleteEventHandlerTests and DeleteSessionHandlerTests. Unit-tested by SessionAssetTests (MMCA.ADC/Tests/Modules/Conference/MMCA.ADC.Conference.Domain.Tests/SessionAssets/SessionAssetTests.cs).

Event

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Event.cs:24 · Level 7 · class (sealed, aggregate root)

  • What it is: the aggregate root for a conference event. It owns three child collections (Rooms, EventSpeaker associations, and EventQuestionAnswers) and enforces every rule about them through its own methods. Event ids are database-generated, not sourced from Sessionize (Event.cs:13-16).
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> and IAuditedEntity (both on Event.cs:24), EventInvariants, Result and Error, DomainEntityState, IdValueGeneratedAttribute, NavigationAttribute, Email (from MMCA.Common.Shared.ValueObjects.Contact, Event.cs:9), QuestionModerationDefault (from MMCA.ADC.Conference.Shared.Events.Live, Event.cs:2), and the EventChanged / RoomChanged / EventSpeakerChanged / EventQuestionAnswerChanged domain events. Aliases EventIdentifierType, RoomIdentifierType, EventSpeakerIdentifierType, EventQuestionAnswerIdentifierType, SpeakerIdentifierType, QuestionIdentifierType, UserIdentifierType.
  • Concept: the aggregate root taught at Category, here in its fullest expression in this chapter, plus two things Category does not show. [Rubric §4, Domain-Driven Design] and [Rubric §1, SOLID]: child collections are exposed only as read-only views over private backing lists, all mutation flows through root methods, each mutation validates and then raises a domain event, and the root owns cascade delete. [Rubric §6, CQRS & Event-Driven]: every state change announces itself, which is what gives the outbox a single ordered stream. Two additions worth naming:
    1. Selective auditing. Event implements IAuditedEntity (Event.cs:24). The class doc (Event.cs:17-21) states the reason as a cost-benefit judgment rather than a blanket policy: the event record is the schedule everything else hangs off, several organizers edit it, and a wrong date, venue or live window is felt by every attendee, so one trail row per change is worth it.
    2. Selective navigation. Rooms and EventSpeakers are marked [Navigation(IsCollection = true)] (Event.cs:95, :101) but EventQuestionAnswers deliberately is not (Event.cs:106-116). [Rubric §12, Performance & Scalability]: the remarks record that the collection grows with attendance rather than with the schedule, that the public reads which load events with children never render it (PublicSessionList loads them only for the room names and the Room picker), and that it is per-attendee feedback behind an anonymous endpoint. Handlers that genuinely need it pass an explicit includes: list instead.
  • Walkthrough, in teaching order:
    • [IdValueGenerated] on the class (Event.cs:23): the factory reads this at run time through typeof(Event).TryResolveId(id, out var resolvedId, out var idError) (Event.cs:209-210), the create policy of the framework's id reconciliation (MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:62): for a generated type a supplied id is ignored and the database assigns the key, so a create request cannot choose it.
    • Scalar state (Event.cs:26-90): Name, Description?, StartDate/EndDate (DateOnly), TimeZone, SessionizeCode? (:46, whose doc comment at :41-45 records that a blank or white-space code is stored as null, because the unique index is filtered on IS NOT NULL and an empty string would let only one event have no code, O-09), VenueAddress?, VenueMapUrl?, WiFiInfo?, OrganizerContactEmail? (:63, typed as the shared Email value object rather than a string (ADR-068), so the format invariant travels with the value instead of being restated by every caller; when absent the public event page falls back to the host-configured support address), SponsorshipPacketUrl? (:69, whose absence hides the sponsorship call to action entirely), TicketingUrl? (:75, whose absence likewise hides the ticketing call to action on the landing and public event pages), IsPublished, QuestionModerationDefault (:84, the BR-233 initial status a newly submitted live-layer question receives), and the nullable LastSessionizeRefreshOn/LastSessionizeRefreshBy refresh-audit pair. All have private setters.
    • Child collections (Event.cs:92-116): three private List<T> backing fields exposed as IReadOnlyCollection<T> projections.
    • Constructors (Event.cs:119-151): a private parameterless EF constructor that seeds the non-nullable strings, plus a private twelve-parameter field constructor used by the factory, which stores the Sessionize code through EventInvariants.NormalizeSessionizeCode (:144).
    • Create (Event.cs:174-233): takes the organizer email as a raw string? and converts it first, but only when it is not blank (!string.IsNullOrWhiteSpace(organizerContactEmail), :192; a comment at :191 says blank is absent, as the request validator treats it, so clearing the optional field saves). A non-blank value goes through Email.Create (:194), returning its own failure before any other validation runs, so the email format rule is stated once on the value object and merely surfaced here; then combines EnsureNameIsValid, EnsureTimeZoneIsValid, EnsureDateRangeIsValid and EnsureOptionalFieldsAreValid over the description, venue address, venue map URL and WiFi info, and EnsureContactAndLinksAreValid over the converted email and the sponsorship packet and ticketing URLs (:200-205); then resolves the id (:209-210); on success builds the instance with Id = resolvedId (:226) and sets QuestionModerationDefault (:227, defaulted to QuestionModerationDefault.Pending at the parameter, :185), then raises EventChanged(Added) (:230). The Sessionize code is not validated here: its uniqueness needs a database read, so the create and update handlers check it before the save, and the aggregate only normalizes it.
    • Update (Event.cs:255-306): runs the same blank-tolerant string-to-Email conversion (:271-279), re-validates the same five checks including EnsureOptionalFieldsAreValid and EnsureContactAndLinksAreValid (:280-285), writes the scalars including the normalized Sessionize code (:294), the moderation default (:298), the converted email (:299) and the two URLs, then raises EventChanged(Updated) (:303).
    • Publish and Unpublish (Event.cs:310, :330): flip IsPublished, refusing a no-op transition with Event.AlreadyPublished / Event.AlreadyUnpublished, and raise EventChanged(Updated).
    • RecordSessionizeRefresh (Event.cs:354-358): stamps LastSessionizeRefreshOn/By from a caller-supplied UTC instant. The parameter doc (:350-353) is explicit that the value comes from an injected TimeProvider so the domain never reads an ambient clock. [Rubric §14, Testability]. Note this method returns void and raises no event.
    • Delete (Event.cs:367-382): overrides the base soft-delete as one Result.Combine of three DeleteChildren<T, TId> calls (rooms, event-speakers, answers) plus base.Delete() (:372-376, BR-72), then raises EventChanged(Deleted) (:379) only when the whole cascade succeeded. The comment at :369-371 records why children come first: Result.Combine aggregates every child failure with the root's own, so a failing child leaves the cascade reported as a failure instead of a half-applied delete. The cascade to the event's other aggregates is deliberately not here: the doc comment (:363-364) names the sessions, sponsors, partners, activities and session assets, coordinated by the static EventCascadeDeletionDomainService (BR-127), because they are separate aggregates this root cannot reach.
    • Room management (Event.cs:384-557): AddRoom (:397) trims the name first (:409, because SQL Server ignores trailing spaces in the IX_Room_EventId_Name comparison, so an untrimmed "Room A " would pass the in-memory check and then fail on the index as a generic data conflict), then checks name uniqueness (:411); UpdateRoom and RestoreRoom trim the same way (:447, :504), delegates to Room.Create, unwraps the child with TryGetValue(out var room) (:416), adds, and raises RoomChanged(Added) (:421); UpdateRoom (:437) resolves the child through the same TryGetValue unwrap (:450), re-checks uniqueness excluding itself (:453), and delegates (:457). Every add, update and remove on this type reads a child result that way rather than through .Value, so the failure branch and the bound child come from one expression. RotateRoomCheckInCode (:474-481) resolves the room through GetRoomOrNotFound and returns the new code from the room's internal RotateCheckInCode as a Result<string>. The doc comment (:466-471) states its consequences: every QR printed with the previous code (or with no code) stops recording room check-ins, so the door code must be re-printed, and it raises no domain event because the code is not part of any read model or cached response. RestoreRoom (:499) is the BR-135 reactivation path and the most defensive method on the type. It takes the room instance rather than an id because a soft-deleted row is excluded by the global query filter and so is not reachable through the loaded collection (:489-494), and it then runs its guards in order: the room must belong to this event (:511-518, Event.Room.WrongEvent), whose comment at :506-510 explains the stakes precisely (Room.EventId has no setter and is populated purely by EF relationship fixup off this Rooms navigation, so adding a foreign room here would silently rewrite its EventId on save and move the row out of its real event); the incoming name must clear the same uniqueness bar as an add (:523, with the comment at :520-522 noting that otherwise a Sessionize refresh restoring a room whose name an organizer has since reused would fail on the database index and abort the whole refresh); and only then room.Update runs (:529) before the base RestoreChild<Room, RoomIdentifierType> helper (:533-534), so a rejected name leaves the room untouched and still deleted rather than half-restored. RestoreChild is where the "must actually be soft-deleted" guard lives, which is why the aggregate hands it the error code "Event.Room.NotDeleted" as a parameter (:534): the framework enforces the rule, the module owns the vocabulary. It raises RoomChanged(Added) (:538) because the room re-enters the visible set. RemoveRoom (:548) delegates to RemoveChildOrNotFound (:550) and raises RoomChanged(Deleted) (:554).
    • Event-speaker management (Event.cs:559-638): the public static DuplicateSpeakerError (:566-570, code Event.Speaker.Duplicate) is the single definition of the duplicate failure, public so a handler that loses the insert race to a concurrent identical add (the unique index fires after the in-memory check passed) can answer with the same error. AddEventSpeaker (:578) guards duplicates in memory and returns DuplicateSpeakerError (:582-585); RestoreEventSpeaker (:609) is the join-entity counterpart to RestoreRoom and is far shorter, a single RestoreChild call with "Event.Speaker.NotDeleted" (:613-614), because the join carries no organizer-entered data, so there is nothing to re-apply and no uniqueness to re-check; RemoveEventSpeaker (:628) soft-deletes through RemoveChildOrNotFound.
    • Answer management (Event.cs:640-703): AddEventQuestionAnswer (:649), UpdateEventQuestionAnswer (:671), RemoveEventQuestionAnswer (:693). Unlike the two collections above, the add has no duplicate guard: an event answering the same question twice is not blocked in the domain.
    • No populator hooks: the type declares no hydration setter for any of its three collections, so every write to a backing list goes through a method above that validates and raises an event. The two [Navigation(IsCollection = true)] markers (Event.cs:95, :101) are what the navigation metadata reads (MMCA.Common/Source/Core/MMCA.Common.Application/Services/Navigation/NavigationMetadataProvider.cs:78, ADR-002).
    • Private helpers (Event.cs:705-744): EnsureRoomNameIsUnique (:716), whose doc comment notes the ordinal-ignore-case comparison is chosen to match the database uniqueness index under the server's default case-insensitive collation, and which uses the same nullable-exclusion shape as CategoryInvariants (:724); plus two Get...OrNotFound wrappers over the base GetChildOrNotFound so a missing child returns an Error rather than a null, GetRoomOrNotFound (:735, shared by UpdateRoom and RotateRoomCheckInCode) and GetEventQuestionAnswerOrNotFound (:740). There is no event-speaker equivalent, because no method on this type needs to resolve a join by id and then act on it: add guards in memory, restore takes the instance, and remove goes straight through RemoveChildOrNotFound.
  • Why it's built this way: routing every child change through the root is what makes the invariants (no duplicate room name, cascade on delete) enforceable at all, and what gives the outbox an ordered change stream. Passing the clock in rather than reading DateTime.UtcNow keeps the domain deterministic. Holding the organizer contact as an Email rather than a string means an invalid address cannot exist on a stored event at all, and the factory and Update only forward the value object's failure instead of each writing their own format check. The restore methods exist because Sessionize is an upstream feed that can withdraw and reinstate a room or a speaker, and reactivating a soft-deleted row preserves its id and history where re-creating it would not (BR-135). The mechanical halves of all of that (cascade, remove, restore, resolve) live on the framework base, so this file reads as a list of Conference rules rather than a list of collection manipulations.
  • Where it's used: loaded and mutated by the Conference application-layer command handlers (Group 18), including RotateRoomCheckInCodeHandler for the room check-in code, and queried by EventSessionizeCodeUniqueness for the Sessionize-code uniqueness read (EventSessionizeCodeUniqueness.cs:56-59); persisted through EventConfiguration; projected to EventDTO for the read endpoints; and referenced by FK from Activity, Room, EventSpeaker, and EventQuestionAnswer.

EventQuestionAnswer

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventQuestionAnswer.cs:14 · Level 7 · class (sealed, child entity)

  • What it is: a child entity of Event storing the event's answer to one custom-form Question (EventQuestionAnswer.cs:9-12). Database-generated id.
  • Depends on: AuditableBaseEntity<TIdentifierType> (EventQuestionAnswer.cs:14), EventInvariants, Result, IdValueGeneratedAttribute, NavigationAttribute. Aliases EventQuestionAnswerIdentifierType, QuestionIdentifierType, EventIdentifierType.
  • Concept: the child entity taught at CategoryItem, here under a different root. [Rubric §4, Domain-Driven Design]. It has identity, soft-delete, and audit fields but no domain-event list of its own: neither Create nor UpdateAnswer calls AddDomainEvent, because Event wraps both and raises EventQuestionAnswerChanged itself. Unlike Room and EventSpeaker it does not implement IReactivatable, which is the decisive difference: a withdrawn answer is not something an upstream feed reinstates, so the type never publishes a reactivation capability and the base RestoreChild helper cannot be pointed at it.
  • Walkthrough: [IdValueGenerated] (:12); QuestionId (the FK to the answered question) and AnswerValue, both with private setters (:16-20); HasErasableText (:28), a computed property that asks QuestionInvariants.IsErasableAnswerText(AnswerValue) whether the value still holds free text an account erasure must overwrite (a rating, or a value already erased, returns false, which lets a redelivered erasure recognise there is nothing left to write); the [Navigation] Event? back-navigation with a private setter and the get-only EventId FK (:30-35); a private EF constructor that seeds AnswerValue = string.Empty and a private field constructor (:37-46); Create (:55-73), which validates through EventInvariants.EnsureAnswerValueIsValid and assigns Id = isIdValueGenerated ? default : id!.Value (:69); UpdateAnswer (:80-89), which re-validates and then writes AnswerValue; EraseAnswerText() (:101-107), which overwrites an erasable value with QuestionInvariants.ErasedAnswerValue and is a no-op otherwise, so it is idempotent (its doc, :91-100, ties the erasure to GDPR right-to-be-forgotten, PRIVACY.md section 11); and SetEvent(Event?) (:111), the explicit populator hook that replaces a public navigation setter. The erasure is deliberately separate from the soft delete the parent aggregate performs: only the erasure is irreversible, and the row itself survives (anonymize-in-place, ADR-005). Like Create and UpdateAnswer, EraseAnswerText raises no domain event.
  • Why it's built this way: keeping the answer a child of the event rather than a standalone aggregate means it shares the event's transaction and cascade delete, and its lifecycle notifications flow through the root's ordered event stream.
  • Where it's used: created and mutated only through Event's AddEventQuestionAnswer, UpdateEventQuestionAnswer, and RemoveEventQuestionAnswer; mapped by EventQuestionAnswerConfiguration. Because the collection is not marked [Navigation], handlers that need it request it explicitly rather than getting it from the populator. The erasure members are driven by UserDeletedFeedbackHandler (UserDeletedFeedbackHandler.cs:116-117, :116-117), which reads HasErasableText to count changes and then calls EraseAnswerText.
  • Caveats / not-in-source: nothing in this file checks that AnswerValue matches the referenced question's type. EventInvariants.EnsureAnswerValueIsValid (EventInvariants.cs:185) only enforces not-empty plus the 4000-character cap it reads from QuestionDTO.AnswerValueMaxLength (QuestionDTO.cs:32). The BR-124 shape rule (QuestionInvariants.EnsureAnswerValueMatchesQuestionType, QuestionInvariants.cs:149) is applied one layer up by AddEventQuestionAnswerHandler's ValidateQuestionAsync (AddEventQuestionAnswerHandler.cs:77-80), where the handler has the question in hand; the reason the check cannot live in a validator is recorded at UpdateEventQuestionAnswerCommandValidator.cs:14.

EventSpeaker

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventSpeaker.cs:14 · Level 7 · class (sealed, join entity)

  • What it is: the join entity linking an Event to a Speaker, that is, which speakers appear at which event (EventSpeaker.cs:9-12). Database-generated id.
  • Depends on: AuditableBaseEntity<TIdentifierType> and IReactivatable (both on EventSpeaker.cs:14), Result, IdValueGeneratedAttribute, NavigationAttribute. Aliases EventSpeakerIdentifierType, SpeakerIdentifierType, EventIdentifierType.
  • Concept introduced, the explicit join entity. [Rubric §4, Domain-Driven Design] and [Rubric §8, Data Architecture]. Rather than let EF create an implicit link table, the many-to-many is modeled as a real entity, which is what gives the association its own id, its own soft-delete flag, and its own audit trail. This is the thinnest child in the chapter: it holds only the SpeakerId FK plus the standard back-navigation and EventId, so Create (:37-49) does no validation at all beyond assigning the id. There is no Update, because a join either exists or it does not.
  • Walkthrough: [IdValueGenerated] (:13); SpeakerId (:17); the [Navigation] Event? with a private setter and the get-only EventId (:19-24); an empty private EF constructor and a one-line private field constructor (:27, :29); Create (:37-49); Reactivate() (:57), a one-line delegation to the base Undelete(); and SetEvent(Event?) (:61) for the populator. The Reactivate doc (:51-56) explains its reason for existing: the join row carries the Sessionize-assigned speaker id, so an association that reappears in the feed is reactivated rather than duplicated by a second row (BR-135). Implementing IReactivatable is what makes the type eligible for the aggregate's RestoreChild helper at all: the base Undelete() is non-public on purpose, so reversing a soft delete is a decision each entity publishes for itself.
  • Why it's built this way: an explicit join entity is what lets Event raise EventSpeakerChanged when the association is added, restored, or removed, and it is what makes the soft-delete-then-reactivate cycle possible under a repeatedly re-run import.
  • Where it's used: created, restored, and removed only through Event's AddEventSpeaker, RestoreEventSpeaker, and RemoveEventSpeaker; the duplicate-speaker guard lives in the root (Event.cs:582), not here. Mapped by EventSpeakerConfiguration.

Room

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/Room.cs:15 · Level 7 · class (sealed, child entity)

  • What it is: a child entity of Event representing a physical or virtual room where sessions take place. Unlike its siblings, a room's id is Sessionize-assigned, not database-generated (Room.cs:11-14, and note the absence of [IdValueGenerated] on Room.cs:15). It also holds the secret its printed check-in QR carries.
  • Depends on: AuditableBaseEntity<TIdentifierType> and IReactivatable (both on Room.cs:15), EventInvariants, Result, NavigationAttribute; BCL CryptographicOperations and RandomNumberGenerator (System.Security.Cryptography, Room.cs:1) and Encoding (System.Text, :2). Aliases RoomIdentifierType, EventIdentifierType.
  • Concept: the child entity (CategoryItem, EventQuestionAnswer) with an externally assigned id. [Rubric §8, Data Architecture]. Because Room is not marked [IdValueGenerated], typeof(Room).IsIdValueGenerated (Room.cs:95) is false and Create always assigns the supplied id (:105), which is how a Sessionize room id becomes the PK directly. Organizer-created rooms therefore draw from the reserved high range (EventInvariants.RoomManualIdRangeStart) so app-assigned ids never collide with imported ones. [Rubric §11, Security]: the check-in code is a secret compared in constant time and minted from a cryptographic random source (ADR-072).
  • Walkthrough: scalars Name, Sort, Capacity?, Floor?, Location?, AccessibilityInfo? (Room.cs:17-33); CheckInCode? (:39), private setter, null until a code is issued, and per its doc (:35-38) never exposed through the public room reads; the [Navigation] Event? with a private setter and the get-only EventId (:41-46); the EF constructor and the private field constructor (:49-65); Create (:78-109) trimming the name first (:87) and then validating EnsureRoomNameIsValid plus EnsureRoomCapacityIsValid (:89-91); Update (:121-145) trimming (:129) and re-validating the same pair and writing all six profile scalars; Reactivate() (:153), the IReactivatable implementation delegating to the base Undelete(), whose doc (:147-152) explains that a room reappearing in the Sessionize feed has to be reactivated rather than re-created precisely because its id is externally owned (BR-135); AcceptsCheckInCode(string? presentedCode, bool codeRequired) (:167-178), which accepts any request while the room has no code (:169-170), answers !codeRequired when the request presents no code (:172-173), and otherwise compares with CryptographicOperations.FixedTimeEquals over the UTF-8 bytes (:175-177), so the comparison takes the same time whatever the input; the doc (:155-166) explains the staging: QRs printed before codes existed keep working until an organizer issues the first code, a wrong code is always refused, and a request with no code is refused only once enforcement is on; RotateCheckInCode() (:185-189), internal, which replaces the code with 16 random bytes from RandomNumberGenerator rendered as lowercase hex (:187) and returns it; and SetEvent(Event?) (:193) for the populator. As a child it raises no events itself.
  • Why it's built this way: preserving the Sessionize id as the PK keeps imported rooms stable across refreshes, so a re-import updates in place instead of creating duplicates, and the reserved manual range lets organizers add rooms without an id clash. Note the room-name uniqueness rule is not here: it lives in Event (Event.cs:716), because uniqueness is a statement about the collection, which only the root can see. The same reasoning puts the "does this room belong to this event" check in the root as well (Event.cs:511): EventId is get-only here (Room.cs:48), so only EF relationship fixup ever sets it. RotateCheckInCode is internal for the same reason: the only door to it is Event.RotateRoomCheckInCode (Event.cs:474-481), so a rotation always goes through the aggregate root.
  • Where it's used: created, updated, restored, and removed through Event's AddRoom, UpdateRoom, RestoreRoom, and RemoveRoom, each of which raises RoomChanged, and its code rotated through Event.RotateRoomCheckInCode (driven by RotateRoomCheckInCodeHandler behind RoomCheckInCodesController); AcceptsCheckInCode is called by EventLiveValidationService with the RoomCheckInSettings RequireCode flag (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/EventLiveValidationService.cs:332); mapped by RoomConfiguration; projected to RoomDTO; referenced by Session scheduling.

Partner

MMCA.ADC.Conference.Domain . MMCA.ADC.Conference.Domain.Partners . MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Partners/Partner.cs:19 . Level 8 . class (sealed)

  • What it is: the aggregate root for a conference partner, a community organization or a special partner (for example the venue host) that supports an event without buying a sponsorship package (class doc, Partner.cs:12-16). A partner belongs to exactly one Event, carries a PartnerType (Community or Special) that drives which group of the public partners band it appears in, and carries no children of its own.
  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (Level 4), PartnerInvariants (Level 6), PartnerType (Level 0), Event (Level 7, navigation only), PartnerChanged (Level 3), Result (Level 2), DomainEntityState (Level 0), IdValueGeneratedAttribute (Level 0), NavigationAttribute (Level 0). The identifier alias is PartnerIdentifierType = int (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:14).
  • Concept: the aggregate-root mechanics, the flat-childless shape, and the database-generated identity are the same pattern Sponsor teaches, applied to a second, simpler kind of event supporter. The class carries [IdValueGenerated] (:18), so partner IDs come from the database rather than an externally supplied value. What is new for this part is the generic write-side CRUD adoption: ADC's Conference module registers Partner as a fourth AddEntityCrud aggregate alongside Category, Activity, and Sponsor (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/DependencyInjection.cs:154), which is the mechanism ADR-099 (Generic Write-Side Entity Commands) adds: the create, update, and delete handlers come from the framework rather than being hand-written per aggregate, and a PartnerUpdateApplier supplies the piece that is still aggregate-specific, translating the generic update request into the guarded Partner.Update(...) call. The aggregate's own factory methods below are unaffected: whichever caller reaches them, the same domain guards run.
  • Walkthrough
    • Scalar state (:21-40), every setter private set: Name (:21), PartnerType (:24), LogoUrl (:27), Description (:30), WebsiteUrl (:33), Sort (:36, display order within the partner type), EventId (:39, the FK to the owning event).
    • Navigation (:42-43): [Navigation] public Event? Event { get; private set; }, assigned by SetEvent(Event? @event) (:221), the populator hook, the same shape Sponsor uses.
    • EF constructor (:46): private, parameterless, assigns Name = string.Empty for definite assignment. Private seven-parameter constructor (:48-64): reachable only through the factory.
    • Create(...) (:78-102): validates through the private Validate helper (:158), returning Result.Failure<Partner>(result.Errors) on any failure; reads typeof(Partner).IsIdValueGenerated (:92) to decide whether the caller's id or a database-assigned value is used (Id = isIdValueGenerated ? default : id!.Value, :96); raises PartnerChanged(DomainEntityState.Added, partner.Id, partner.Name) (:99).
    • Update(...) (:115-137): re-runs the same Validate call, assigns the six mutable fields, and raises PartnerChanged(Updated, ...). EventId is absent from the parameter list, so the owning event is not updatable: moving a partner between events is a create plus a delete, not an update, the same rule Sponsor enforces for the same reason.
    • Delete() (:141-149): overrides the base soft-delete, calling base.Delete() first and only raising PartnerChanged(Deleted, Id, Name) when that succeeded. No child cascade, because the aggregate owns no children.
    • Validate(string name, string? logoUrl, string? websiteUrl, string source) (:154-158), private: a three-way Result.Combine of PartnerInvariants.EnsureNameIsValid, PartnerInvariants.EnsureLogoUrlIsValid, and PartnerInvariants.EnsureWebsiteUrlIsValid. Called identically from Create and Update.
  • Why it's built this way: a flat, childless aggregate sized to its own transaction (the same rationale Sponsor states): partners are added and edited on their own cadence, so pulling one into an event's transaction would widen it for no benefit. All three lifecycle transitions raise the same PartnerChanged record differing only by DomainEntityState, so one handler can react to any change; that shape plus a database-assigned id is exactly the surface the generic AddEntityCrud registration expects, which is why Partner was a low-friction fourth aggregate to add to it.
  • Where it's used: created and updated through the generic ADR-099 commands, with PartnerUpdateApplier supplying the update-side translation to Partner.Update; exposed over REST by PartnersController (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.API/Controllers/Partners/PartnersController.cs); filtered for public display by GetPublicPartnerFilterHandler (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Partners/UseCases/GetPublicPartnerFilter/GetPublicPartnerFilterHandler.cs); projected to PartnerDTO by PartnerDTOMapper (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Partners/DTOs/PartnerDTOMapper.cs); persisted by PartnerConfiguration (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Partners/PartnerConfiguration.cs); rendered by PartnerDetail.razor.cs (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.UI/Pages/Partners/PartnerDetail.razor.cs) and surfaced on the home page, per ADCHomeTests. Cascade-deleted alongside its owning event, per DeleteEventHandlerTests. Unit-tested by PartnerTests (MMCA.ADC/Tests/Modules/Conference/MMCA.ADC.Conference.Domain.Tests/Partners/PartnerTests.cs).
  • ADRs: ADR-099 (Generic Write-Side Entity Commands), for the AddEntityCrud registration (Website/docs-src/adr/099-generic-write-side-entity-commands.md:20).

EventCascadeDeletionDomainService

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Events · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventCascadeDeletionDomainService.cs:16 · Level 9 · static class

  • What it is: a static class (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Events/EventCascadeDeletionDomainService.cs:16) with a single static CascadeDelete method, so there is no instance to construct and no interface to resolve through. It soft-deletes an event's Sessions, then its Sponsors, then its Partners, then its Activitys, then its SessionAssets, then the Event itself.

  • Depends on: Event, Session, Sponsor, Partner, Activity, SessionAsset, Result. Its five using directives (:1-5) are the whole dependency list, and none of them is an infrastructure namespace.

  • Concept: the smallest possible shape for a pure domain service: no fields, no constructor, a public static CascadeDelete method plus one private static helper. Being static and stateless, it needs no DI registration at all, and is thread-safe by construction.

  • Walkthrough: CascadeDelete(Event @event, IReadOnlyCollection<Session> sessions, IReadOnlyCollection<Sponsor> sponsors, IReadOnlyCollection<Partner> partners, IReadOnlyCollection<Activity> activities, IReadOnlyCollection<SessionAsset> sessionAssets) (:19-25) runs five child phases through a shared helper, then the event, in a fixed order:

    1. Sessions first: childResult = DeleteAll(sessions, s => s.Delete()) (:39; BR-127, each session cascades to its own children per BR-55).
    2. Then sponsors (:40-41), then partners (:42-43), and then activities (:44-45): the same shape over sponsor.Delete(), partner.Delete(), and activity.Delete(), each guarded by if (childResult.IsSuccess) so the chain short-circuits on the first failure. The comment at :31-33 records the intent: sponsors, partners, and activities are all separate aggregates rooted on the event, and one that refuses to delete leaves the event untouched, orphaning rows the public pages still read.
    3. Then session assets (:46-47, comment at :35-38): DeleteAll(sessionAssets, a => a.Delete()). Unlike the other four, session assets are not cascade-deleted through the per-session loop in phase 1; the comment explains that they are their own aggregate, rooted on the event through the denormalized EventId their blob names are also scoped by, and are deleted here instead so the caller loads them once for the whole event rather than once per session. The blob behind each file row is removed afterwards by the caller's scheduled delete command, not by this method.
    4. Failure check (:48-49): if (childResult.IsFailure) return childResult; exits with the first child's error once all five phases have run.
    5. Then the event (:52): return @event.Delete(), which itself cascades to the event's owned children (rooms, event speakers, event question answers) per BR-72, and that Result becomes the method's return value.

    The private static helper, DeleteAll<T>(IEnumerable<T> items, Func<T, Result> delete) (:55-66), replaces what used to be four separately hand-rolled foreach loops: it iterates, calls the supplied delete delegate, and returns the first failing Result or Result.Success(). Each Delete() also queues its aggregate's domain event (SponsorChanged(Deleted) for a sponsor, and the equivalent for sessions, partners, activities, session assets, and the event), which the unit of work dispatches after SaveChangesAsync.

  • Why it's built this way: [Rubric §8, Data Architecture] (assesses whether a multi-entity write can leave the store half-changed): the short-circuit plus the caller's save discipline is the whole consistency story. The service aborts in memory, and DeleteEventHandler calls SaveChangesAsync only when the returned Result is a success (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/Delete/DeleteEventHandler.cs:91-93), so the already-applied IsDeleted flags on the earlier aggregates are discarded with the scoped DbContext instead of being persisted. [Rubric §1, SOLID]: extracting DeleteAll<T> collapsed four near-identical loops into one generic helper, so adding partners as a fifth cascaded child aggregate needed one new call rather than a fifth copy of the loop body. [Rubric §14, Testability]: with no infrastructure to stub, the whole behavior is exercised by passing domain objects and asserting IsDeleted and the queued domain events.

  • Where it's used: called directly by its static type name from DeleteEventHandler, which loads the event with its owned children (DeleteEventHandler.cs:51-55), its active sessions with their children (:38-43), its active sponsors (:47-52), its active partners (:60-63), its active activities (:56-61), and its active session assets, all asTracking: true, before calling CascadeDelete (:91). Unit-tested by EventCascadeDeletionDomainServiceTests.

  • Caveats / not-in-source: the ordering (sessions, then sponsors, then partners, then activities, then session assets, then event) is fixed by the method body and is not configurable; nothing in the source explains why sessions precede sponsors, partners, activities, and session assets, and since all five are short-circuiting the choice only affects which error a caller sees when more than one would fail.

SpeakerInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/SpeakerInvariants.cs:15 · Level 6 · class (static)

  • What it is: the domain rule set for the Speaker aggregate and its SpeakerQuestionAnswer child. Eleven field-length constants, six EnsureXxx guards, and one IsAcceptableProfilePicture predicate that the two entities call before they mutate anything.
  • Depends on: CommonInvariants (Level 5, SpeakerInvariants.cs:3), Result and Error (Level 2, :4), Email (Level 4, the parameter type of EnsureEmailFitsColumn, SpeakerInvariants.cs:71), and SpeakerDTO (Level 2, :2) plus QuestionDTO (Level 1, :1) for the numbers themselves. BCL Uri.TryCreate and StringComparison for the profile picture check.
  • Concept: the invariant-class pattern itself is taught on CategoryInvariants. What this sibling shows is the three-layer constant chain, and it runs one hop further than most. The class doc (SpeakerInvariants.cs:9-14) states the rule: "The numbers themselves live on SpeakerDTO, the lowest layer the UI can also reach, so markup and domain validation cannot drift apart." So all eleven constants here are aliases, not literals: FirstNameMaxLength = SpeakerDTO.FirstNameMaxLength (:18) forwards to MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Speakers/SpeakerDTO.cs:22, which is where 200 is actually written. [Rubric §8, Data Architecture] assesses whether the storage schema and the domain rules can drift apart: every HasMaxLength in SpeakerConfiguration reads a constant from this class rather than a literal (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Speakers/SpeakerConfiguration.cs:21, :25, :32, :36, :44, :48, :52, :56, :60), and so does every FluentValidation rule in SpeakerValidationRules (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Speakers/Validation/SpeakerValidationRules.cs:17, :28, :42, :61, :80, :99, :118, :138). [Rubric §15, Best Practices & Code Quality]: one edit in the Shared DTO moves the Razor maxlength, the validator message, the domain guard, and the column width together, because there is exactly one definition point.
  • Walkthrough
    • Constants (SpeakerInvariants.cs:18-51): FirstNameMaxLength 200 (:18), LastNameMaxLength 200 (:21), EmailMaxLength 255 (:24), TagLineMaxLength 500 (:27), ProfilePictureMaxLength 2000 (:36), TwitterHandleMaxLength 100 (:39), LinkedInUrlMaxLength 2000 (:42), GitHubUrlMaxLength 2000 (:45), WebsiteUrlMaxLength 2000 (:48). The values are read from SpeakerDTO (SpeakerDTO.cs:22,25,28,31,47,50,53,56,59). BioMaxLength (:33) is the one that does not mirror the same-named DTO constant: it forwards to SpeakerDTO.BioStorageMaxLength (8000, SpeakerDTO.cs:44), the server-side ceiling every write path enforces, while SpeakerDTO.BioMaxLength (4000, SpeakerDTO.cs:37) stays the input cap and character counter the profile pages bind to (DTO class doc, SpeakerDTO.cs:12-13). The doc comment on the constant (:29-32) is explicit that the column stays unbounded and this constant is the rule. The eleventh, AnswerValueMaxLength (:51), forwards to QuestionDTO.AnswerValueMaxLength (4000, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Questions/QuestionDTO.cs:32) rather than to SpeakerDTO, because it belongs to the child answer rather than to the speaker profile the DTO describes; EventInvariants reads the same constant, so both answer types share one cap.
    • EnsureFirstNameIsValid(string firstName, string source) (:53-56): a Result.Combine of CommonInvariants.EnsureStringIsNotEmpty (error code Speaker.FirstName.Empty) and CommonInvariants.EnsureStringMaxLength (Speaker.FirstName.TooLong). Combining rather than short-circuiting means a caller that submits an over-long empty-ish value gets both errors in one round trip. The source parameter is the caller's method name (nameof(Create)), threaded into the error for tracing, and nameof(firstName) becomes the error target so a UI can bind the message to a field.
    • EnsureLastNameIsValid (:58-61): identical shape against LastNameMaxLength, error codes Speaker.LastName.Empty and Speaker.LastName.TooLong.
    • EnsureEmailFitsColumn(Email? email, string source) (:71-72): a single CommonInvariants.EnsureOptionalStringMaxLength over email?.Value against EmailMaxLength (Speaker.Email.TooLong). The doc comment (:63-70) gives the reason it exists: the shared Email value object admits one character more (256) than the 255-character column, so without this guard the domain would accept a value the column cannot hold and the write would fail at save instead of as a result. It runs on an email that Email.Create has already parsed, so it checks length only.
    • EnsureOptionalFieldsAreValid(bio, tagLine, profilePicture, twitterHandle, linkedInUrl, gitHubUrl, websiteUrl, source) (:88-107): one Result.Combine of ten checks. Seven are CommonInvariants.EnsureOptionalStringMaxLength (MMCA.Common/Source/Core/MMCA.Common.Domain/Invariants/CommonInvariants.cs:242), which passes a null or empty value and otherwise caps it at the matching constant (:98-104, codes Speaker.Bio.TooLong, then Speaker.TagLine.TooLong through Speaker.WebsiteUrl.TooLong). The other three are CommonInvariants.EnsureUrlIsWellFormed (CommonInvariants.cs:293) on the LinkedIn, GitHub and website links (:105-107), which also passes an empty value and otherwise demands an absolute http or https URL (Speaker.LinkedInUrl.Invalid and siblings). The doc comment (:74-78) names both reasons: the caps (M139) stop SQL truncation and the URL shape (M161) stops a link a browser would run as script, and putting both in the domain covers every write path (API, Sessionize sync, seeder) rather than only the HTTP one.
    • EnsureProfilePictureIsHttpsUrl(string? profilePicture, string source) (:120-127) and IsAcceptableProfilePicture(string? profilePicture) (:135-138): the picture rule is stricter than the link rule. The predicate passes null or empty (no picture) and otherwise requires Uri.TryCreate(..., UriKind.Absolute, ...) with a scheme equal, ordinally, to https; the guard wraps it and fails with Speaker.ProfilePicture.Invalid. The doc comment (:109-116) gives the reason: the picture renders as an image on the public speaker pages, in the mobile app and in MCP results, so every visitor's client fetches it, and an http:, data: or relative value is refused. It is deliberately not part of EnsureOptionalFieldsAreValid: a create always runs it, an update runs it only when the picture changes, so a value stored before the rule existed never blocks an edit of the other fields. The predicate is public because the Sessionize import and the request validator ask the same question (:129-131).
    • EnsureAnswerValueIsValid(string answerValue, string source) (:140-143): the same shape against AnswerValueMaxLength, but the error codes are namespaced to the child entity, SpeakerQuestionAnswer.AnswerValue.Empty and SpeakerQuestionAnswer.AnswerValue.TooLong, because that is the type a consumer sees the failure from.
  • Why it's built this way: keeping lengths as const int reachable from the Domain layer lets the outer layers depend inward on them (Clean Architecture) instead of each layer re-typing a number, and routing them through the Shared DTO lets the Blazor client, which cannot reference Domain, use the identical figure. Static methods returning Result keep the aggregate free of exceptions on the validation path.
  • Where it's used: Speaker.Create (Speaker.cs:151-156, the email column guard at :154, the picture guard at :156) and Speaker.Update (Speaker.cs:230-241, where the picture guard runs only when the incoming value differs from the stored one, :232-234); SpeakerQuestionAnswer.Create (SpeakerQuestionAnswer.cs:52) and UpdateAnswer (SpeakerQuestionAnswer.cs:74). The constants additionally feed SpeakerConfiguration, SpeakerQuestionAnswerConfiguration (SpeakerQuestionAnswerConfiguration.cs:25), SpeakerValidationRules, and SpeakerSyncStrategy, which pre-screens Sessionize links and pictures against the same caps and rules (the picture through IsAcceptableProfilePicture, MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Events/UseCases/RefreshFromSessionize/SpeakerSyncStrategy.cs:309) and cuts a feed bio longer than BioMaxLength down to it with a warning (SpeakerSyncStrategy.cs:159-172), so the domain guard does not reject the whole speaker. Covered directly by SpeakerInvariantsTests.
  • Caveats / not-in-source: Bio is the one capped field with no matching column width: SpeakerConfiguration.cs:28 maps it with no HasMaxLength, so the column is unbounded and the 8000-character BioMaxLength is enforced only by this class, the request validator's SpeakerBioRules (SpeakerValidationRules.cs:38-42, under the same Speaker.Bio.TooLong code) and the Sessionize truncation. The 4000-character SpeakerDTO.BioMaxLength the profile pages bind to is a UI input cap, not a server rule.

SponsorInvariants

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sponsors · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/SponsorInvariants.cs:13 · Level 6 · class (static)

  • What it is: the domain rule set for the Sponsor aggregate. Seven field-length constants for a sponsor record and five EnsureXxx guards the aggregate calls before it mutates anything.
  • Depends on: CommonInvariants (Level 5), Result (Level 2), and SponsorDTO (Level 1) for the numbers.
  • Concept: the same three-layer constant chain SpeakerInvariants introduces, with the same doc comment stating it (SponsorInvariants.cs:7-12). All seven constants forward to SponsorDTO rather than holding a literal. [Rubric §8, Data Architecture]: the HasMaxLength calls in SponsorConfiguration read them (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Sponsors/SponsorConfiguration.cs:20, :30, :34, :38, :42, :46, :56), as do the rule classes in SponsorValidationRules (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sponsors/Validation/SponsorValidationRules.cs:18, :34, :47, :64, :82, :95, :107). What is different from the speaker side is that the optional fields are split across three guards rather than one (logo URL, the description-and-links group, and the booth number), and one guard is enum-defined rather than a length or shape rule.
  • Walkthrough
    • Constants (SponsorInvariants.cs:16-34): NameMaxLength 200 (:16), LogoUrlMaxLength 2000 (:19), DescriptionMaxLength 2000 (:22), WebsiteUrlMaxLength 2000 (:25), LinkedInUrlMaxLength 2000 (:28), TwitterHandleMaxLength 100 (:31), BoothNumberMaxLength 50 (:34). The literals live on SponsorDTO (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/Sponsors/SponsorDTO.cs:18,21,24,27,30,33,36). The 2000-char URL fields match the URL columns used elsewhere in the module; the 100-char handle and the 50-char booth number are the two deliberately tight ones.
    • EnsureNameIsValid(string name, string source) (:42-45): the only required field check. A Result.Combine of CommonInvariants.EnsureStringIsNotEmpty (Sponsor.Name.Empty) and CommonInvariants.EnsureStringMaxLength (Sponsor.Name.TooLong).
    • EnsureLogoUrlIsValid(string? logoUrl, string source) (:54-55): the optional-field shape. It is a single call to CommonInvariants.EnsureOptionalStringMaxLength, so absence is legal by construction and only a supplied value is length-checked (Sponsor.LogoUrl.TooLong). No Result.Combine wrapper, because there is exactly one rule. The doc comment (:47-50) records why nothing else is checked: the value is a plain URL string with no upload pipeline behind it, so only the storage constraint applies.
    • EnsureOptionalFieldsAreValid(string? description, string? websiteUrl, string? linkedInUrl, string? twitterHandle, string source) (:68-80): one Result.Combine of six checks, four EnsureOptionalStringMaxLength caps (Sponsor.Description.TooLong, Sponsor.WebsiteUrl.TooLong, Sponsor.LinkedInUrl.TooLong, Sponsor.TwitterHandle.TooLong) and two CommonInvariants.EnsureUrlIsWellFormed checks on the website and LinkedIn links (Sponsor.WebsiteUrl.Invalid, Sponsor.LinkedInUrl.Invalid, :77, :79). The doc comment (:57-60) gives both reasons: the sponsor pages render the two links as link targets, and while the request validators apply the same rules, this guard is the backstop for every other write path. The Twitter/X handle gets a length cap only, no format check.
    • EnsureBoothNumberIsValid(string? boothNumber, string source) (:89-90): the same optional-field shape (Sponsor.BoothNumber.TooLong). The comment (:82-84) states the rule explicitly: a booth number is accepted even when the sponsor is not flagged IsExhibitor, because the flag drives display and does not reject stored data. There is deliberately no cross-field invariant between the two.
    • EnsureTierIsDefined(SponsorTier tier, string source) (:99-100, doc :92-98): a single call to CommonInvariants.EnsureEnumIsDefined (Sponsor.Tier.Invalid, "Tier must be one of Platinum, Gold, Silver or Community."). The doc comment gives the reason: an out-of-range number cannot be persisted and then render under no tier at all, since Tier is stored as a plain int column.
  • Why it's built this way: same rationale as SpeakerInvariants. The optional-field helper is worth noting on its own: hand-writing if (value is null) return Result.Success() in each guard is the kind of repetition that eventually gets one branch wrong, so the framework ships EnsureOptionalStringMaxLength and the module rule reduces to one expression. [Rubric §15, Best Practices & Code Quality].
  • Where it's used: Sponsor.Create (Sponsor.cs:119-124) and Sponsor.Update (Sponsor.cs:168-173); the constants additionally feed SponsorConfiguration and SponsorValidationRules. Covered directly by SponsorInvariantsTests.
  • Caveats / not-in-source: every one of the seven length constants is enforced by a domain guard (four of them through EnsureOptionalFieldsAreValid), so a caller that constructs a Sponsor through the domain factory alone (a test, or the sample-data seeder) gets a Result failure rather than a SaveChangesAsync truncation error. The tier check is the one guard with no length constant, and TwitterHandle is the one link-like field with no shape rule.

Speaker

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/Speaker.cs:29 · Level 7 · class (sealed)

  • What it is: the aggregate root for a conference speaker. It carries the profile (names, optional Email value object, bio, tag line, picture, four social links), owns two child collections, and holds the nullable link to an Identity user that grants a person speaker rights over their own sessions.

  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (Level 4), IAuditedEntity (Level 0), IAnonymizable and PiiAttribute (the [Pii] marker on Email, Speaker.cs:41), SpeakerInvariants (Level 6), Email (Level 4), SpeakerCategoryItem and SpeakerQuestionAnswer (both Level 7, a mutual cycle: each child holds a back-navigation to Speaker), SpeakerChanged, SpeakerCategoryItemChanged, SpeakerQuestionAnswerChanged (Level 2-3), Result and Error, DomainEntityState and NavigationAttribute (Level 0). The identifier alias is SpeakerIdentifierType = System.Guid (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:24), the only Guid identity in the Conference module.

  • Concept introduced, the cross-context link maintained by events rather than a foreign key. [Rubric §7, Microservices Readiness] assesses whether a module can be lifted out without a relational tether to a peer, and [Rubric §8, Data Architecture] assesses how a relationship is physically expressed. LinkedUserId (Speaker.cs:69) is a nullable scalar, not an EF navigation property, because User lives in the Identity database and ADR-006 forbids a foreign key across that boundary. The two-way link (Speaker.LinkedUserId on one side, User.LinkedSpeakerId on the other) is kept consistent by publishing facts, not by a constraint: the uniqueness half is a filtered unique index in SQL (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/Persistence/EntityConfiguration/Speakers/SpeakerConfiguration.cs:63-65, HasFilter("[LinkedUserId] IS NOT NULL"), so many speakers may have no user but no user may have two speakers), and the propagation half is SpeakerLinkedToUser / SpeakerUnlinkedFromUser over the outbox (ADR-003), raised by the aggregate itself in LinkUser, UnlinkUser and Delete (Speaker.cs:316, :340, :289), so the event always rides the same save as the link change.

    [Rubric §11, Security] and [Rubric §30, Compliance, Privacy and Data Governance]: the class is tagged IAuditedEntity (Speaker.cs:29), and the doc comment (:16-20) gives the reason rather than leaving it to convention. This row holds personal data and the link that grants a person authority over sessions, and it is written by three different actors (organizers, the speaker themselves, and the Sessionize sync), so a change history is what lets "who linked this account to this speaker" or a data-subject question be answered.

  • Walkthrough

    • Scalar state (Speaker.cs:32-72), every setter private set: FirstName (:32), LastName (:35), Email as an Email? value object (:42), Bio (:45), TagLine (:48), ProfilePicture (:51), TwitterHandle (:54), LinkedInUrl (:57), GitHubUrl (:60), WebsiteUrl (:63), IsTopSpeaker (:66), LinkedUserId (:69). FullName (:72) is a computed $"{FirstName} {LastName}" with no backing column; EF is told to skip it with builder.Ignore(p => p.FullName) (SpeakerConfiguration.cs:68).
    • Owned collections (:74-84): two private List<T> backing fields exposed as IReadOnlyCollection<T> through .AsReadOnly(), each tagged [Navigation(IsCollection = true)] for the populator (ADR-002). A caller cannot Add to SpeakerCategoryItems or SpeakerQuestionAnswers; the aggregate methods below are the only doors.
    • Constructors: the EF parameterless one (:87-91) assigns the two non-nullable names to string.Empty so they are definitely assigned before EF writes the columns; the private seven-parameter one (:93-109) can only be reached through the factory, which guarantees validation ran first.
    • Create(...) (:127-182): note the ordering. The optional email is parsed into a value object first (:141-149), but only when it is not blank (!string.IsNullOrWhiteSpace(email), :143, with a comment at :142 that blank is absent, as the request validator treats it, so clearing the optional field saves). A malformed non-blank email returns Result.Failure<Speaker>(emailResult.Errors) immediately, and only then are the field guards combined (:151-156): the two name guards, SpeakerInvariants.EnsureEmailFitsColumn over the parsed email (:154), EnsureOptionalFieldsAreValid over the bio, tag line, picture, Twitter handle and three links (:155), and EnsureProfilePictureIsHttpsUrl (:156), so an over-long bio or email, an over-long or non-http(s) link, or a picture that is not an absolute https URL, fails the factory rather than the database write. Identity resolution is the interesting part (:172): SpeakerIdentifierType is a client-assigned Guid, so a Sessionize-imported speaker carries the id the feed gave it, while Id = typeof(Speaker).ResolveIdOrNewGuid(id) generates one when the caller passes null (a supplied id wins, otherwise a new Guid for a type without [IdValueGenerated]; MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:111-112). The comment above that line (:169-171) names the callers that rely on it: organizer-created speakers and the sample-data seeder both pass null. The four social links are set through an object initializer (:173-176) rather than the constructor. Finally AddDomainEvent(new SpeakerChanged(DomainEntityState.Added, speaker.Id, speaker.FullName)) (:179).
    • Update(...) (:207-260): the same blank-tolerant email-then-fields validation order (:220-241, the IsNullOrWhiteSpace email guard at :222, the email column guard at :239, the optional field guard, bio included, at :240). The picture rule is conditional here (:230-234): EnsureProfilePictureIsHttpsUrl runs only when the incoming picture differs (ordinal compare) from the stored ProfilePicture, so a value saved before the https rule existed never blocks an edit of the other fields. Then eleven scalar writes (:245-255), then SpeakerChanged(Updated, ...) (:257). LinkedUserId is deliberately absent from the parameter list, and the remarks (:187-194) explain the risk that drove that: the link changes only through LinkUser and UnlinkUser (and the BR-70 clear in Delete), which raise the SpeakerLinkedToUser / SpeakerUnlinkedFromUser events that keep Identity's User.LinkedSpeakerId in sync and whose callers run the BR-208 uniqueness cross-check, whereas a generic update raises only SpeakerChanged, so writing the link here would silently desynchronize the two sides.
    • Delete() (:274-294): captures LinkedUserId into a local before anything else (:277), calls base.Delete() (:279), and on success clears the link inside the Conference context (:284), raises SpeakerChanged(Deleted, Id, FullName) (:286) and, only when a user was linked, SpeakerUnlinkedFromUser(previousLinkedUserId.Value, Id) (:287-290). The captured value is the whole point: by the time the event is built the field on the entity is already null, so the unlink event has to carry the old id, and the doc comment (:262-265) notes the outbox captures it atomically with the delete. The same comment (:266-271) also records a deliberate non cascade: the child associations survive the soft-delete, because the Sessionize import reactivates them in place when the speaker returns and no cascade-restore counterpart exists, and junction reads follow the parent's visibility so the surviving children are not observable meanwhile.
    • LinkUser(UserIdentifierType userId) (:303-317) and UnlinkUser() (:326-342): mirror guards. Linking an already-linked speaker fails with Speaker.AlreadyLinked (:305-312), unlinking an unlinked one fails with Speaker.NotLinked (:328-335). Both raise SpeakerChanged(Updated, ...) on success (:315, :339) plus the cross-context fact: SpeakerLinkedToUser(userId, Id) (:316), and SpeakerUnlinkedFromUser with the id captured before the clear (:337, :340). The doc comments (:296-300, :320-324) state that every link path (the organizer link and the BR-207 auto-link) and every unlink path (the organizer unlink and the erasure) goes through these two methods, so the event always rides the same save as the link change.
    • Anonymize() (:354-375), the IAnonymizable implementation (Speaker.cs:29) that runs when the linked account is erased (ADR-005). Only the Email moves ([Pii] on :41, so the audit trail stores it redacted): name, biography and the rest of the profile are the published program and are kept (class doc, :21-26). A speaker with no email is a no-op success (:356-359). Otherwise the email becomes deleted-{Id}@anonymized.invalid (:361), a valid Email on the reserved .invalid domain, unique per speaker and unable to match any address a person registers with, which keeps the BR-207 email auto-link from re-attaching the profile to anyone. Idempotent: an email already equal to the placeholder returns success without raising anything (:367-370); a real change raises SpeakerChanged(Updated, ...) (:373).
    • Category-item children (:377-453): AddSpeakerCategoryItem (:385) guards against a duplicate live association with _speakerCategoryItems.Exists(sci => !sci.IsDeleted && sci.CategoryItemId == categoryItemId) (:389), failing with Speaker.CategoryItem.Duplicate; the !sci.IsDeleted half is what leaves room for the reactivation path. It then unwraps the child factory's result with TryGetValue(out var speakerCategoryItem) (:399), the same shape every add, update and remove on this type uses to bind the child in the failure check itself rather than read .Value afterward. RestoreSpeakerCategoryItem (:421) takes the join instance rather than an id, because a soft-deleted row is excluded by the global query filter and so must be resolved by the caller (remarks, :414-418); it delegates to the framework's RestoreChild<TChild, TChildId> (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableAggregateRootEntity.cs:213) and then raises SpeakerCategoryItemChanged(Added, ...) (:433), because the association re-enters the visible set. RemoveSpeakerCategoryItem (:443) goes through RemoveChildOrNotFound (AuditableAggregateRootEntity.cs:159) and raises the Deleted variant (:450).
    • Question-answer children (:455-518): AddSpeakerQuestionAnswer (:464) has no duplicate guard, unlike the category-item side; validation lives in the child factory. UpdateSpeakerQuestionAnswer (:486) resolves through the private GetSpeakerQuestionAnswerOrNotFound helper (:521, over GetChildOrNotFound at AuditableAggregateRootEntity.cs:106), calls answer.UpdateAnswer and re-raises SpeakerQuestionAnswerChanged(Updated, ...) (:498). RemoveSpeakerQuestionAnswer (:508) mirrors the category-item remove.
    • No populator hooks: the type declares no Set... method for either collection. The two collections carry only the [Navigation(IsCollection = true)] marker (:77, :83), which the framework's navigation metadata classifies as a child collection (MMCA.Common/Source/Core/MMCA.Common.Application/Services/Navigation/NavigationMetadataProvider.cs:78), so bulk replacement is not part of the aggregate's surface at all.
  • Why it's built this way: [Rubric §4, Domain-Driven Design] (assesses whether an aggregate owns a consistency boundary sized to a real transaction). Category items and question answers are edited as part of "editing a speaker", so they are children inside this root; sessions and events are not, so they are separate roots referenced by FK. [Rubric §6, CQRS and Event-Driven]: every mutation path ends in an AddDomainEvent call, which is what lets the delete cascade its cross-context consequence to Identity without Conference ever calling Identity synchronously.

  • Where it's used: linked and unlinked by LinkUserToSpeakerHandler (.../Speakers/UseCases/LinkUser/LinkUserToSpeakerHandler.cs:59) and UnlinkUserFromSpeakerHandler (.../UnlinkUser/UnlinkUserFromSpeakerHandler.cs:44), automatically by UserRegisteredHandler on an email match (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Users/IntegrationEventHandlers/UserRegisteredHandler.cs:109), and unlinked on account erasure by UserDeletedSpeakerErasureHandler (.../Users/IntegrationEventHandlers/UserDeletedSpeakerErasureHandler.cs:86); imported and reconciled by SpeakerSyncStrategy (.../Events/UseCases/RefreshFromSessionize/SpeakerSyncStrategy.cs:135,145,188,214,218); hydrated through the framework's INavigationPopulator<Speaker>, which SpeakerEntityQueryService takes and hands to its base (.../Speakers/SpeakerEntityQueryService.cs:20-22); projected by SpeakerDTOMapper; persisted by SpeakerConfiguration; exposed by SpeakersController; rendered by SpeakerList, SpeakerDetail, SpeakerDashboard, PublicSpeakerList and PublicSpeakerDetail. Referenced by FK from EventSpeaker, SessionSpeaker, and Identity's User. Unit-tested by SpeakerTests.

SpeakerCategoryItem

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/SpeakerCategoryItem.cs:14 · Level 7 · class (sealed)

  • What it is: the join entity binding a Speaker to a CategoryItem. It carries no data of its own beyond the two foreign keys, and it is how a speaker's tags (topic areas, and the locality classification the conference uses) are modeled: there is no Speaker.Location field, the value is a category item joined through this row.
  • Depends on: AuditableBaseEntity<TIdentifierType> (Level 3), IReactivatable (Level 3), Speaker (Level 7, back-navigation), Result (Level 2), IdValueGeneratedAttribute and NavigationAttribute (Level 0). Alias SpeakerCategoryItemIdentifierType = int (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:23).
  • Concept introduced, reactivation as an explicit contract. [Rubric §8, Data Architecture] assesses the interplay of soft delete with re-entry of the same logical row. The join implements IReactivatable (:14), and Reactivate() (:58) is a one-liner over the framework's protected Undelete() (MMCA.Common/Source/Core/MMCA.Common.Domain/Entities/AuditableBaseEntity.cs:91). The reason is in the doc comment (:52-57): the row carries the Sessionize-assigned category item id, so an association that disappears from the feed and later returns must be reactivated rather than duplicated by a second row (BR-135). Implementing the interface is what makes that intent discoverable and testable, instead of leaving the reactivation as an ad-hoc flag flip somewhere in the sync code.
  • Walkthrough
    • CategoryItemId (:17), private set: the FK to the tag. Speaker? (:21) is the back-navigation tagged [Navigation]. SpeakerId (:24) is getter-only, written by EF from the shadow FK rather than by the domain.
    • Create(SpeakerCategoryItemIdentifierType? id, CategoryItemIdentifierType categoryItemId) (:37-50): no field validation at all, because a pure FK pair has nothing to validate. Identity goes through typeof(SpeakerCategoryItem).TryResolveId(id, out var resolvedId, out var idError) (:41-42, MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:62), which reads the [IdValueGenerated] marker (:13) and, for a generated type, ignores any supplied id and resolves to default, so the database assigns the key (Id = resolvedId, :46); the failure branch is reachable only for a non-generated type called with no id (EntityTypeExtensions.cs:20-22). No domain event is raised here: the parent aggregate emits SpeakerCategoryItemChanged, which keeps event ownership with the root.
    • Reactivate() (:58) is the one capability hook. There is no SetSpeaker method: the Speaker back-navigation is private set and carries only the [Navigation] marker (:20-21), matching the parent, which exposes no collection setter either.
  • Why it's built this way: modeling a speaker's locality and topics as join rows to shared CategoryItem values rather than as string columns means the same vocabulary serves sessions and speakers, and a rename happens in one place. [Rubric §4, Domain-Driven Design]: the join is a child of the speaker root, not a root of its own, because it has no lifecycle independent of the speaker.
  • Where it's used: created, restored and removed only through Speaker (Speaker.cs:385,421,443); reconciled against the feed by SpeakerSyncStrategy.SyncCategoryItems (.../RefreshFromSessionize/SpeakerSyncStrategy.cs:202, the restore at :214), which is the only caller of RestoreSpeakerCategoryItem; projected by SpeakerCategoryItemDTOMapper to SpeakerCategoryItemDTO; persisted by SpeakerCategoryItemConfiguration; read by SpeakerLocalityHelper. Unit-tested by SpeakerCategoryItemTests.

SpeakerQuestionAnswer

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Speakers · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Speakers/SpeakerQuestionAnswer.cs:13 · Level 7 · class (sealed)

  • What it is: the child entity holding one speaker's answer to one Question, for example a dietary preference or a shirt size collected in the call-for-papers form.
  • Depends on: AuditableBaseEntity<TIdentifierType> (Level 3), SpeakerInvariants (Level 6), Speaker (Level 7, back-navigation), Result (Level 2), IdValueGeneratedAttribute and NavigationAttribute (Level 0). Alias SpeakerQuestionAnswerIdentifierType = int (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:25).
  • Concept: the same child-entity shape as SpeakerCategoryItem, with one difference that is worth naming. This child does carry a mutable payload (AnswerValue), so it owns a validating UpdateAnswer method and re-runs the guard on every write. It does not implement IReactivatable, because the sync path updates an existing live answer in place rather than resurrecting a deleted one.
  • Walkthrough
    • QuestionId (:16) and AnswerValue (:19), both private set; Speaker? (:23) tagged [Navigation]; SpeakerId (:26) getter-only. The EF constructor (:29) assigns AnswerValue = string.Empty for definite assignment; the private two-parameter constructor (:31-37) is reachable only from the factory.
    • Create(id, questionId, answerValue) (:46-65): validates through SpeakerInvariants.EnsureAnswerValueIsValid inside a Result.Combine (:51-52), which is a single-argument combine, a shape that reads oddly but leaves room for a second rule without restructuring. Then identity resolves through TryResolveId against the [IdValueGenerated] marker (:12, :56-57), the same framework reconciliation the sibling join uses, and Id = resolvedId (:61). No domain event: the parent emits SpeakerQuestionAnswerChanged.
    • UpdateAnswer(string answerValue) (:72-81): re-validates with the identical guard (:74) before assigning (:78). Validating on update as well as on create is the point of routing both through the invariants class: an entity that can only be constructed valid but then freely mutated is not actually protected.
    • No populator hook: as on the sibling join, there is no SetSpeaker method; the back-navigation is private set with the [Navigation] marker (:22-23).
  • Why it's built this way: [Rubric §4, Domain-Driven Design]: keeping the answer text guarded inside the entity (rather than validating it once in a request validator) means every write path, including the Sessionize import, which never touches a FluentValidation validator, is held to the same 4000-character rule.
  • Where it's used: added, updated and removed only through Speaker (Speaker.cs:464,486,508); populated from the feed by SpeakerSyncStrategy.SyncQuestionAnswers (.../RefreshFromSessionize/SpeakerSyncStrategy.cs:227, the update-or-add at :237-238), which updates a live answer in place when one exists for the question and adds otherwise; projected by SpeakerQuestionAnswerDTOMapper to SpeakerQuestionAnswerDTO; persisted by SpeakerQuestionAnswerConfiguration. Unit-tested by SpeakerQuestionAnswerTests.

MMCA.ADC.Conference.Domain · MMCA.ADC.Conference.Domain.Sponsors · MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Domain/Sponsors/Sponsor.cs:18 · Level 8 · class (sealed)

  • What it is: the aggregate root for a conference sponsor or exhibitor. A sponsor belongs to exactly one Event, carries a SponsorTier that drives its public placement, and optionally staffs an expo booth (class doc, Sponsor.cs:12-16).

  • Depends on: AuditableAggregateRootEntity<TIdentifierType> (Level 4), SponsorInvariants (Level 6), SponsorTier (Level 0), Event (Level 7, navigation only), SponsorChanged (Level 3), Result (Level 2), DomainEntityState (Level 0), IdValueGeneratedAttribute (Level 0), NavigationAttribute (Level 0). The identifier alias is SponsorIdentifierType = int (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Shared/MMCA.ADC.Conference.GlobalUsings.IdentifierType.cs:26).

  • Concept: the aggregate-root mechanics are taught on Category; this section covers what is different here. [Rubric §4, Domain-Driven Design] (assesses whether each aggregate owns a consistency boundary sized to a real transaction): Sponsor is a flat, childless aggregate. It has no owned collection, so Delete() has nothing internal to cascade to, and its whole invariant surface is field validation. That flatness is exactly why it is a separate root instead of a child of Event: sponsors are sold and edited on their own cadence, and loading an event to add one would widen the event's transaction for no benefit.

    [Rubric §8, Data Architecture] (assesses identity generation and relational shape): the class carries [IdValueGenerated] (:17), so sponsor IDs come from the database. The doc comment (:15) gives the reason in one clause: "sponsors are sold, not imported from Sessionize". Where Speaker has to accept an externally supplied Guid because the Sessionize import supplies one, Sponsor never does. Relationally it is the many side of a plain FK to Event (SponsorConfiguration.cs:62-65) with a soft-delete-filtered index on EventId (SponsorConfiguration.cs:67-68), and Tier is persisted through HasConversion<int>() (SponsorConfiguration.cs:25-27) so the tier ordering is a plain column sort.

  • Walkthrough

    • Scalar state (:21-58), every setter private set so mutation can only happen through Update: Name (:21), Tier (:24), LogoUrl (:27), Description (:30), WebsiteUrl (:33), LinkedInUrl (:36), TwitterHandle (:39), Sort (:42, the display order within the tier), EventId (:45), IsExhibitor (:52), BoothNumber (:58, kept even when IsExhibitor is false, per the comment at :54-57).
    • Navigation (:48-49): [Navigation] public Event? Event { get; private set; }, with no public setter and no SetEvent method on the type; the [Navigation] marker is what the populator machinery reads (ADR-002). It is not part of the aggregate's own invariants.
    • EF constructor (:61): private, parameterless, assigning Name = string.Empty so the non-nullable field is definitely assigned before EF writes the columns.
    • Private constructor (:63-87): takes all eleven values and assigns them. Being private, it can only be reached through the factory, which guarantees validation ran first.
    • Create(...) (:105-139): the canonical validate, then resolve identity, then construct, then emit shape.
      1. Result.Combine of the five guards (:119-124: name, logo URL, the optional description-and-links group, booth number, and EnsureTierIsDefined), returning Result.Failure<Sponsor>(result.Errors) on any failure (:125-126) so all validation errors surface at once rather than the first one.
      2. typeof(Sponsor).TryResolveId(id, out var resolvedId, out var idError) (:128-129) reads the [IdValueGenerated] marker (cached per type, MMCA.Common/Source/Core/MMCA.Common.Domain/Extensions/EntityTypeExtensions.cs:48-50) and reconciles the supplied id with it (EntityTypeExtensions.cs:62-64): with the marker present a supplied ID is ignored and default is resolved, so the failure return is reachable only for a non-generated type called with no id.
      3. Construction with Id = resolvedId (:133), so the database assigns the key.
      4. AddDomainEvent(new SponsorChanged(DomainEntityState.Added, sponsor.Id, sponsor.Name)) (:136). The ID captured here is default under DB-generated identity, since the row does not exist yet.
    • Update(...) (:156-191): re-runs the same five guards (:168-173), returns the combined failure unchanged (:174-175), then assigns the ten mutable fields (:177-186) and emits SponsorChanged(Updated, ...) (:188). EventId is absent from the parameter list on purpose: the doc comment (:143) states that moving a sponsor between events is a create plus a delete, not an update, so the owning-event relationship is immutable for the lifetime of the row.
    • Delete() (:195-203): overrides the base soft-delete, calls base.Delete() first (:197), and only raises SponsorChanged(Deleted, ...) when that succeeded (:199-200). No child cascade, because there are no children.
  • Why it's built this way: [Rubric §6, CQRS and Event-Driven] (assesses whether state changes announce themselves): all three lifecycle transitions raise the same SponsorChanged record differing only by DomainEntityState, so a single handler can invalidate the sponsor output cache for any change. Soft delete rather than row removal follows ADR-005; the aggregate never hard-deletes itself.

  • Where it's used: created by CreateSponsorHandler and edited through SponsorUpdateApplier; cascade-deleted by EventCascadeDeletionDomainService; projected to SponsorDTO by SponsorDTOMapper; exposed over REST by SponsorsController; mapped by SponsorConfiguration; seeded by ConferenceModuleDbSeeder (.../Persistence/DbContexts/Seeding/ConferenceModuleDbSeeder.cs:381); rendered by SponsorList, SponsorDetail and SponsorCreate. Unit-tested by SponsorTests.

  • Caveats / not-in-source: the Event navigation's doc comment (:47) describes it as being there "for public visibility filtering", but the public sponsor filter does not join through it: GetPublicSponsorFilterHandler resolves published event ids first and returns a publishedEventIds.Contains(s.EventId) criteria instead (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Application/Sponsors/UseCases/GetPublicSponsorFilter/GetPublicSponsorFilterHandler.cs:29-30), which its own doc comment (:13-14) justifies as keeping the criteria translatable on any engine. Treat the navigation as available for populators and detail screens, not as the visibility path.


⬅ Aspire Orchestration & Service Defaults • Index • ADC Conference - Application & Use Cases ➡