Fix Summary β Backend Architecture Overview
Fixed: 2026-03-09
Changes made
MISMATCH fixes
-
M1 β
canDemoteOrganizerpredicate corrected from> 2to>= 2. The deployed rule allows demotion when 2 or more organizers remain (consistent with bothRoleServiceTestcases: 2 organizers β success, 1 organizer βMinimumOrganizersException). -
M2 β Replaced the role-gated security filter chain snippet (which falsely implied domain services enforce
hasAnyRole("ORGANIZER", "ATTENDEE", ...)) with the actual model: domain services trust the API Gateway and expose public endpoints viapermitAll. Added a note that JWT validation is the gatewayβs responsibility. Documented all public endpoints in a table (event details, sessions, speakers, registration create/confirm, actuator, Swagger UI). -
M3 β Updated the βUser Lifecycleβ key-point line: roles are stored as
Set<Role>on theUserentity, not in a separaterole_assignmentstable. Added a note to the Role Management section header clarifying that theRoleManagementServicesnippet is a design reference; the deployedRoleServiceusesUserRepositoryonly. -
M4 β Replaced the bespoke
CircuitBreakerServicesnippet (count-based threshold of 5, timeout 60 000 ms,ConcurrentHashMap) with the actual Resilience4j YAML configuration:failureRateThreshold: 60%,waitDurationInOpenState: 10s,permittedNumberOfCallsInHalfOpenState: 5, named instanceeventBridgePublisher.
UNDOCUMENTED additions
-
N1 β Added a prominent note at the top of the βRole-Based Security Configurationβ subsection: domain services do not validate JWT signatures; that responsibility belongs to the API Gateway.
-
N2 β Added
/swagger-ui/**and/v3/api-docs/**to the public-endpoints table (confirmed bySecurityConfigTest#should_allowAccess_when_swaggerUiAccessed). -
N3 β Documented public
GET /api/v1/events/**,GET /api/v1/events/{code}/sessions/**, andGET /api/v1/events/{code}/speakers/**endpoints in the new public-endpoints table. -
N4 β Documented public
POST /api/v1/events/{code}/registrationsandPOST /api/v1/events/{code}/registrations/confirmin the public-endpoints table. -
N5 β Added βConflict Detection Severitiesβ subsection after
validateSpeakerInvitation:ROOM_OVERLAPβ ERROR (blocking),SPEAKER_DOUBLE_BOOKEDβ ERROR (blocking),PREFERENCE_MISMATCHβ WARNING (non-blocking). -
N6 β Added idempotency note to the Role Management section header:
addRole/removeRoleare idempotent;UserRoleChangedEventis only published when the role set actually changes.
Skipped β needs manual decision
-
U1 β
"Event date must be at least 30 days in the future"β no test was found in the searched directories. Either a missing test or an aspirational code snippet in the doc. Recommend: add a unit test forEventBusinessRules.validateEventCreationor remove the validation claim from the doc if the rule was never implemented. -
U2 β
"Only one event is allowed per quarter"β no test was found. Same risk as U1: may be aspirational. Recommend: add a test or remove from doc. -
U3 β
@Retryable(value = {TransientException.class, TemporaryUnavailableException.class}, ...)β Resilience4j retry values are consistent with the doc, but no unit test asserts retry behaviour for these exception types. If Spring-Retry (@Retryable) and Resilience4j retry coexist, document which layer handles which exception. Otherwise, add a test or clarify that only Resilience4j retry is used. -
U4 β
X-Correlation-IDheader propagation viaRequestCorrelationFilterβ the error-response test confirms a correlation ID appears in responses, but no test verifies the filter reads an incomingX-Correlation-IDheader and propagates it. Low-risk gap; consider adding a filter-level unit test.