Skip to content

Ideas Page #31

@dragoonis

Description

@dragoonis

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

  1. The route for this should be at /ideas (/modules/Application/resources/config/routes.yml)

  2. This should be mapped to an Ideas controller (Application/Controller/Ideas.php)

  3. There should be an ideas database table containing fields. id, title, vote_score
    3.1) There should be a Storage class to map to the ideas table named: Application/Storage/Ideas.php
    3.2) Their should be an Application\Entity\Idea class to be returned by the above Storage class

  4. 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_votes with fields. id, idea_id, ip_address this will let us determine if a user of a specific ip_address has already voted on this idea_id before.
    4.2) A cookie will be set on this named ppi_idea_x where X is the ID of the idea, this will let them still vote on multiple ideas.

  5. When someone is voting it will maintain the ideas.vote_score field, either incrementing or decrementing the value.
    5.1) When displaying the ideas a simple ORDER BY ideas.vote_score DESC will be enough to show ideas with the highest votes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions