Repository navigation
[MBA-3831] Capacity-change notification event to affected candidates (notification stub) - #98
Conversation
…nPort logging stub Co-Authored-By: Mason <masonbatchelor81@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-Authored-By: Mason <masonbatchelor81@gmail.com>
…listing) Co-Authored-By: Mason <masonbatchelor81@gmail.com>
There was a problem hiding this comment.
Devin Review found 2 findings. Devin automatically fixed all 2 findings.
Fixed by Devin (2)
- Plain-text notification logs lose event details — impact, candidateNumber, bookingId, sessionId, previous/new status and eventId are now message placeholders (StructuredArguments), so plain-logs shows them as key=value. JSON logs still carry every field.
- Unauthenticated bulk access to candidate notifications — candidateNumber is now required: 400 when missing or blank, so there is no bulk listing (IT asserts this). The endpoint stays off the gateway (/internal is not routed) and out of the public OpenAPI spec, like /internal/reconciliation.
Co-Authored-By: Mason <masonbatchelor81@gmail.com>
…mismatches, 0 drift) Co-Authored-By: Mason <masonbatchelor81@gmail.com>
…in/mba-3831-capacity-impact-notifications
|
Test results on merged head a1be7db (estate/legacy-baseline 192a423 merged in, M5 included)
Runtime (services rebuilt from a1be7db, real SQL Server, [REDACTED SECRET] /app through gateway :8000) Session 155 (DUB01): capacity 16 to 1 with 3 BOOKED. The two newest bookings were demoted to WAITLISTED, and 3 notifications were queued:
Raising capacity 1 to 16 returned
Recording: Not exercised at runtime: a forced duplicate replay of the same event. |
…-3831; notify SEAT_OFFERED / OFFER_WITHDRAWN on capacity changes Co-Authored-By: Mason <masonbatchelor81@gmail.com>
Runtime check on merged head 8af1a0b (base 8cc35d8, A4 included)Setup: real SQL Server, a fresh Scheduling DB (Flyway V1→V4), and the relay running, driven through the gateway at Session #158
Other checks
Relay and reconciliation
Not exercised at runtime: forcing a duplicate replay of the same event. |
1864c97
into
estate/legacy-baseline
Summary
A6 / MBA-3831.
PUT /api/v2/sessions/{id}/capacitynow writes oneCandidateCapacityImpactNotifiedoutbox event for each affected candidate. Legacy never told anyone when their booking was demoted (MR-04 "who notifies demoted candidates?", HB-05 / ODD-02). The relay delivers these events to a newNotificationPort. The only implementation is the stubLoggingNotificationAdapter: it writes a structured log line and keeps an in-memory store, readable atGET /internal/notifications?candidateNumber=(the filter is required). Nothing is sent by email or SMS.Merged with A4 (#99, waitlist auto-offer, base
8cc35d8). Both features run in the samechangeCapacitytransaction:AssessmentDelivery: no AuditLog, no RelayCheckpoint, so reconciliation is unaffected.LegacyRelay.applyalso returns false for these events as a guard. Delivery is at least once, and the stub ignores aneventIdit has already recorded. A4'sSeatOffer*events still project to legacy.V4__candidate_notification_event.sqlruns after A4'sV3__waitlist_offers.sqland appends the event type tock_outbox_event_type, rebuilding the constraint from its current definition so all of V2 and V3's types are kept.OutboxEventTypekeeps every type from M4, A4 and this story.CapacityResultDto.notifiedCandidatesis new.api/openapi.yamlwas regenerated with theOpenApiSpecIT -Dopenapi.write=truecommand, and the UI contractcapacity.ymlwas updated. TheCapacityEditortoast now shows "N candidate notification(s) queued (stub, no email/SMS)", and the confirm dialog has a hint.services/scheduling-service/docs/events.mddocuments the event, anddocs/schemas/candidate-capacity-impact-notified.schema.jsonholds the JSON Schema 2020-12.CandidateCapacityImpactSchemaTestchecks the record against the schema; the ITs validate stored payloads against it.impact. This is one field beyond the ticket's list. It tells consumers why the candidate is notified: an offer change leaves the status unchanged, so the status pair alone doesn't say.docs/runbooks/scheduling-service.mdhas both the "Candidate notifications" and A4's "Waitlist offers" sections.Tests
JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 SCHEDULING_IT_SQL_URL='jdbc:sqlserver://localhost:1433;encrypt=true;trustServerCertificate=true' ./mvnw -B clean verifyinservices/scheduling-service, on merged head 8af1a0b (base 8cc35d8, A4 included): 80 unit + 77 IT tests, 0 failures, BUILD SUCCESS. CIverify(API contract) is green. Runtime evidence is in a PR comment.CapacityImpactTest(7),LoggingNotificationAdapterTest(3),CandidateCapacityImpactSchemaTest(5).CapacityImpactNotificationIT(5):CapacityChanged, 2×SeatOfferedand 2×SEAT_OFFEREDin one call. Capacity 5→2 then withdraws both offers and notifiesOFFER_WITHDRAWNfor both,STATUS_CHANGEDfor the demoted bookings andSEAT_CONFIRMEDfor the rest.RelayITorder 6: the real worker delivers to the stub once, legacy gets +1 AuditLog / +1 RelayCheckpoint (CapacityChanged only), a replay changes nothing, and reconciliation shows 0 mismatches and 0 drift. A4's offer lifecycle relay test is order 5.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/9a510b2ddf494f54a366e5f0f28e49c0
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/9a510b2ddf494f54a366e5f0f28e49c0?variant=devin
Requested by: @mbatchelor81
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work