Skip to content

Implemented the basics for voting#130

Merged
david-poindexter merged 5 commits intoDNNCommunity:developfrom
valadas:voting
Feb 10, 2026
Merged

Implemented the basics for voting#130
david-poindexter merged 5 commits intoDNNCommunity:developfrom
valadas:voting

Conversation

@valadas
Copy link
Copy Markdown
Member

@valadas valadas commented Feb 10, 2026

image

Closes #125

Added REST API for UserVoice module settings (get/update, admin-only), including new SettingsController, UserVoiceSettings model, and repository interface/implementation. Integrated settings into DI and request context. Added integration tests for settings API and improved test infrastructure. Enhanced coverage reporting with combined badges and updated README. Refactored idea deletion validation logic and added related unit test. Increased code coverage and applied code quality improvements, including ExcludeFromCodeCoverage attributes and DI updates. Cleaned up namespaces and using statements.
Introduced UserVote entity and repository for user voting.
Updated database schema and migration to include UserVotes table.
Added unique index and foreign key for votes.
Extended Idea entity with UserVotes collection.
Implemented repository methods to add/remove votes, prevent duplicates.
Added unit tests for voting logic and updated existing tests.
Updated project and migration resource files for new schema.
- Introduced IVotingService and VotingService for upvoting, removing votes, and retrieving user vote stats
- Added VoteDto, VoteDtoWithContext, and VoteStatsViewModel
- Implemented UpvoteDtoValidator to enforce voting rules (vote limits, idea existence)
- Registered new services and validators in DI container
- Extended IUserVoteRepository with CountVotesForUserAsync
- Updated ModelValidation.resx and LocalizationViewModel for vote limit messages
- Enhanced TypeScript client for new settings and localization fields
- Added unit tests for voting service and validator; improved test data setup
- Updated coverage history to reflect new code and tests
- All changes are backward compatible and additive
Implemented voting functionality with new VotingController REST endpoints for stats, upvoting, and vote removal. Added TypeScript client support and DTOs. Updated idea view models to include vote counts. Added integration tests for voting endpoints. Removed unused localization and refactored related code.
Backend now tracks if user has voted for each idea (`IsVotedByUser`). Frontend displays real vote counts, voting status, and allows upvoting/withdrawing votes. Added progress bar and localized label for remaining votes. Updated unit tests, CSS, DI registration, and documentation. Improved code coverage.
@valadas valadas added this to the 0.2.0 milestone Feb 10, 2026
@valadas valadas added the enhancement New feature or request label Feb 10, 2026
Copy link
Copy Markdown
Contributor

@david-poindexter david-poindexter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@david-poindexter david-poindexter merged commit 2643daf into DNNCommunity:develop Feb 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement voting

2 participants