-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Purpose
The purpose of this page is to let users input their suggestions of what's missing in PPI, and let people vote on these ideas, similar to stack overflow, where the item with the most votes is at the top.
Implementation
-
The route for this should be at /ideas (
/modules/Application/resources/config/routes.yml) -
This should be mapped to an Ideas controller (
Application/Controller/Ideas.php) -
There should be an
ideasdatabase table containing fields.id, title, vote_score
3.1) There should be a Storage class to map to theideastable named:Application/Storage/Ideas.php
3.2) Their should be anApplication\Entity\Ideaclass to be returned by the above Storage class -
The issue of duplication should be avoided, so we need to match on IP Address and cookie, thus a second database table is needed.
4.1) DB table named:ideas_voteswith fields.id, idea_id, ip_addressthis will let us determine if a user of a specific ip_address has already voted on thisidea_idbefore.
4.2) A cookie will be set on this namedppi_idea_xwhere X is the ID of the idea, this will let them still vote on multiple ideas. -
When someone is voting it will maintain the
ideas.vote_scorefield, either incrementing or decrementing the value.
5.1) When displaying the ideas a simpleORDER BY ideas.vote_score DESCwill be enough to show ideas with the highest votes.