Story 4.1.5a: Architecture Consolidation for Anonymous Event Registration
Table of Contents
Story 4.1.5a: Architecture Consolidation for Anonymous Event Registration
Status
In Progress
Story
As an architect/developer, I want to consolidate and align all architecture documentation for anonymous event registration, so that stories 4.1.5 and 4.1.6 can be implemented with consistent, accurate architecture and clean normalized microservices patterns.
Domain Context
Primary Domain
Cross-cutting (Architecture & Documentation)
Involved Services
- Company User Management Service (user_profiles table)
- Event Management Service (registrations table)
- API Gateway (routing and security)
- web-frontend (React 19 + TypeScript)
Cross-Domain Dependencies
- Event Service β User Management Service (via existing UserManagementClient)
- User Management Service β Cognito (account linking on first login)
Requirements Context
Related Functional Requirements
- Epic 4, Story 4.1 (Public Event Website)
- Prepares for Story 4.1.5 (Registration Wizard)
- Prepares for Story 4.1.6 (Registration Confirmation)
Problem Statement
Current stories 4.1.5 and 4.1.6 contain architectural inconsistencies that must be resolved before implementation:
- Wrong Endpoints: Stories reference
/api/v1/registrationsinstead of/api/v1/events/{eventCode}/registrations - Wrong Registration Scope: Stories suggest session registration instead of whole-event registration
- Data Duplication: registrations table duplicates user data (attendee_name, attendee_email) that exists in user_profiles
- No Anonymous Support: user_profiles.cognito_id is NOT NULL, preventing anonymous registration
- Missing ADR: No documented architecture decision for anonymous registration pattern
- Wireframe Misalignment: Stories donβt match wireframes for registration flow
Acceptance Criteria
- β ADR-005 created documenting anonymous registration architecture
- β
Database migrations created (but not yet applied):
- V9 Shared Kernel: Make user_profiles.cognito_id NULLABLE
- V9 Event Management: Remove denormalized attendee fields from registrations
- β
Data Architecture updated (03-data-architecture.md):
- Fix table name: event_registrations β registrations
- Update user_profiles schema (cognito_id NULLABLE)
- Update registrations schema (remove attendee_name, attendee_email, attendee_id)
- Document cross-service reference pattern
- β
API Architecture updated (04-api-event-management.md):
- Correct endpoints: /api/v1/events/{eventCode}/registrations
- Document anonymous registration flow
- Document UserManagementClient reuse pattern
- β
OpenAPI specs updated:
- events-api.openapi.yml: Update CreateRegistrationRequest, remove sessionIds
- user-management-api.openapi.yml: Document user endpoints
- β
Wireframes updated:
- Add account linking CTAs and flows
- Remove session selection references
- β
Stories 4.1.5 and 4.1.6 corrected:
- Fix endpoints
- Remove session selection (whole-event registration only)
- Document cross-service user creation flow
- Reference ADR-005
Tasks / Subtasks
Phase 1: Create ADR-005 - Anonymous Registration Architecture
- Task 1: Create ADR-005 document
- File:
Phase 2: Create Database Migrations
-
Task 2: Create V9 migration for Shared Kernel (user_profiles)
- File:
- Note
-
Task 3: Create V9 migration for Event Management (registrations)
- File:
- Note
Phase 3: Update Architecture Documentation
-
Task 4: Update Data Architecture (03-data-architecture.md)
- sql
CREATE TABLE registrations ( id UUID PRIMARY KEY, event_id UUID NOT NULL REFERENCES events(id), registration_code VARCHAR(100) UNIQUE NOT NULL, attendee_username VARCHAR(100) NOT NULL, -- Reference to user_profiles status VARCHAR(50) NOT NULL, registration_date TIMESTAMP WITH TIME ZONE, created_at TIMESTAMP WITH TIME ZONE, updated_at TIMESTAMP WITH TIME ZONE, UNIQUE(event_id, attendee_username) );
-
Task 5: Update API Architecture (04-api-event-management.md)
- Document correct endpoints:
-
- Public user submits registration form
- Event Service calls User Management API to create/find user_profile (cognito_id=NULL)
- Event Service creates registration with attendee_username reference
- Add account linking endpoint:
Phase 4: Update OpenAPI Specifications
-
Task 6: Update events-api.openapi.yml
- Update
CreateRegistrationRequest- Add: firstName, lastName, company, role
- Remove: sessionIds (whole-event registration only)
- Update
Registration- Remove: attendeeName, attendeeEmail (client must call User Management API)
- Keep: registrationCode, attendeeUsername, eventId, status
- Update endpoint documentation:
- Update
-
Task 7: Create/Update user-management-api.openapi.yml
- Define
GET /api/v1/users/{username} - Define
GET /api/v1/users?usernames={list} - Define
POST /api/v1/users/anonymous - Define
POST /api/v1/users/{username}/link-account
- Define
Phase 5: Update Wireframes
-
Task 8: Update story-2.4-event-registration.md wireframe
-
Task 9: Update story-2.4-registration-confirmation.md wireframe
-
- View all your registrations in one place
- Receive personalized event updates
- Manage your profile information
-
- User clicks βCreate Accountβ button
- Redirected to account creation with email pre-filled
- On first Cognito login, auto-link to existing user_profile
- Update endpoints to correct pattern:
-
Phase 6: Correct Stories 4.1.5 and 4.1.6
-
Task 10: Correct Story 4.1.5 (registration-wizard.md)
- Fix endpoint:
βPOST /api/v1/registrations - Fix endpoint:
βGET /api/v1/registrations/{id} - Update AC: Make it 2-step wizard
- Update SecurityConfig:
.permitAll()for -
- Event Service receives public registration request
- Event Service calls User Management API (via existing UserManagementClient)
- User Management creates/finds user_profile by email (cognito_id=NULL if new)
- Event Service creates registration with attendee_username reference
- Fix endpoint:
-
Task 11: Correct Story 4.1.6 (registration-confirmation.md)
- Fix endpoints to use pattern:
Dev Notes - Implementation Guide
Migration Timing
CRITICAL: The database migrations created in this story are NOT applied yet. They will be applied during the implementation of Story 4.1.5.
Reason: We want to align all documentation first, then apply schema changes together with the code implementation to maintain consistency.
Cross-Service Architecture Pattern
This consolidation establishes a clean microservices architecture:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Event Management Service β
β β
β registrations table: β
β - id, event_id, registration_code β
β - attendee_username (ref to user_profiles)β
β - status, registration_date β
β β
β RegistrationService: β
β 1. Receive registration request β
β 2. Call UserManagementClient (existing) β
β 3. Create/find user_profile β
β 4. Create registration with username ref β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β HTTP API Call
β (via UserManagementClient)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Company User Management Service β
β β
β user_profiles table: β
β - id, username, email β
β - cognito_user_id (NULLABLE) β
β - first_name, last_name, company β
β β
β UserService: β
β - Create anonymous user (cognito_id=NULL) β
β - Link account on first Cognito login β
βββββββββββββββββββββββββββββββββββββββββββββββ
Benefits of This Architecture
β Single Source of Truth: User data lives only in user_profiles β No Data Duplication: registrations reference users, donβt duplicate β Microservices Independence: Services communicate via APIs, not shared DB β Clean Domain Boundaries: Event Service = events/registrations, User Service = users β Scalable: Can cache user lookups, batch queries prevent N+1 β Reuse Existing Infrastructure: Leverages existing UserManagementClient from speaker integration
Whole-Event Registration (Not Sessions)
Decision: Registrations are for the whole event, not individual sessions.
Rationale:
- Matches wireframes (no session selection shown)
- Matches existing data model (registrations.UNIQUE(event_id, attendee_username))
- Simpler user experience
- Session preferences can be tracked separately if needed for capacity planning (future story)
Anonymous to Authenticated Flow
Anonymous Registration (Story 4.1.5):
- User registers without creating account
- user_profile created with cognito_id=NULL
- Email is unique identifier
Account Creation (Story 4.1.6+):
- User decides to create account from confirmation page
- Redirected to signup with email pre-filled
- User completes Cognito registration
Auto-Linking (Post-authentication):
- Cognito post-authentication trigger fires on first login
- Finds user_profile by email where cognito_id IS NULL
- Sets cognito_id on existing user_profile
- User now has authenticated account with previous registration history
Testing Strategy
This story is documentation-only, so testing focuses on:
- Alignment Review: All documents reference consistent endpoints, schemas, and flows
- ADR Completeness: ADR-005 provides clear architectural guidance
- Migration Correctness: SQL migrations are syntactically correct (verify with
--dry-runor syntax check) - Cross-References: All documents reference ADR-005 where appropriate
- Wireframe Alignment: Stories match updated wireframes
No code testing required - migrations will be tested during Story 4.1.5 implementation.
Definition of Done
Change Log
| Date | Version | Description | Author |
|---|---|---|---|
| 2025-11-08 | 1.0 | Initial story creation for architecture consolidation | Winston (Architect Agent) |