Skip to content

Implement Point & Point History Module #26

Description

@onlydustapp

📚 Overview

Implement a new module to manage user points and point histories in the synapz project. This module will include both data models and service/controller code to handle various point operations.

🔍 Background

The synapz repository, an on-chain game master system, currently does not handle user point transactions. This feature aims to:

  • Create a Point model to store information about user points.
  • Create a PointHistory model to record detailed histories of point transactions, including actions and descriptions.
  • Build controllers and services to handle point addition, retrieval, and history viewing.

For more context on the project, please refer to the README.

🛠️ Details & Requirements

  1. Repository Setup

    • Fork and clone the synapz repository.
    • Navigate to the backend folder.
  2. Database Models

    • Point Model
      • Fields: user_id, point.
    • PointHistory Model
      • Fields: user_id, point, action, description.
  3. Controller & Service Implementation

    Implement the following endpoints:

    • Add a point to a user:
      • Functionality to add a point for a specific user.
    • Return user points:
      • Retrieve the current point balance of a user.
    • See all point history for a user:
      • List all point history records for a user.
    • Return a single point history record:
      • Retrieve a specific point history by its identifier.
  4. Technical Considerations

    • Ensure proper error handling and validations.
    • Follow the existing code architecture of the backend services.
    • Write clean and maintainable code with appropriate comments where necessary.

✅ Definition of Done

  • Forked and cloned the synapz repo and set up the backend folder.
  • Implemented the Point and PointHistory models with the specified fields.
  • Developed controllers and services to add points, retrieve user point balance, view all point histories, and fetch a single point history record.
  • Validations and error handling are in place.
  • Code reviewed and merged into a feature branch.

💬 Additional Context

This feature will help manage user rewards and transaction histories, which is essential for tracking and auditing point usage in the game master system.

Feel free to ask for clarifications or propose improvements to the initial implementation plan.

Happy coding! 🚀

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions