feat: create actual News/Event/Resource content on country request ap…#54
Merged
Merged
Conversation
…proval - Add ProposedCategoryId to CountryContentRequest entity + EF config - Pass CategoryId to SubmitResource and FeaturedImageAssetId to SubmitEvent factories - Create CountryContentRequestApprovedContentHandler that reads approved request and creates + publishes the corresponding content aggregate (News.Draft/Publish, Resource.Draft/Publish, Event.Schedule) in the same transaction - MediatR auto-discovers handler via assembly scanning - Add migration for proposed_category_id column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, when an admin approves a state representative's content request (News, Event, or Resource), the request status is updated to Approved but no actual content is created in the news, events, or resources tables. The data remains trapped in the country_content_requests table with no effect.
This PR closes the gap by introducing a domain event handler that, on approval, creates and publishes the corresponding content aggregate in the same transaction.
Changes
Because domain events are dispatched inside EF's SavingChangesAsync interceptor, the new content is persisted atomically with the approval status update — no dual-write window.
Related user stories
Checklist