📚 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
-
Repository Setup
- Fork and clone the synapz repository.
- Navigate to the backend folder.
-
Database Models
- Point Model
- PointHistory Model
- Fields:
user_id, point, action, description.
-
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.
-
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! 🚀
📚 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:
For more context on the project, please refer to the README.
🛠️ Details & Requirements
Repository Setup
Database Models
user_id,point.user_id,point,action,description.Controller & Service Implementation
Implement the following endpoints:
Technical Considerations
✅ Definition of Done
💬 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! 🚀