Challenge Overview
Welcome to “Poseidon LPC - API and Database Design”. In this challenge, we would like to create the design for a backend service API that will be used by the Poseidon Mobile SDK.
PROJECT BACKGROUND
The objective is to build an SDK for the Loyalty Payment Card(LPC) for our client. This SDK will be used by LPC’s clients to build the LPC mobile app.
So the SDK will provide all required functionalities from authentication to payment processing, reward management, etc.
REQUIREMENTS
- The LPC backend system is a multi-tenant backend that can allow many clients to use this system. This should be taken into account in API and database design. Each tenant will have a different database on the server.
- In this challenge we want to create the API design for 2 of the application's flow:
- LPC payment system
- Loyalty Points system
- The LPC Payment will act as a passthrough to the payment provider and will also interact with the loyalty points system. The payment provider uses SOAP as the backend. The SOAP documentation for the endpoints will be provided in the forum.
- The payment operations can be done by any logged in user and it's the responsibility of the payment provider to execute the payment actions.
- The second part of the application is the Loyalty points. The points will be rewarded based on the operations of the LPC payment endpoints.
- The following operations should be supported for the loyalty points endpoints:
- CRUD operations for loyalty points rules. These endpoints are for managing the rules that will generate loyalty points.
- Some generic rule language could be used - Example: https://www.npmjs.com/package/json-rules-engine
- Rules will depend on the type of LPC payment operation (create user, make a payment, etc).
- For operations that are dependent on values, we can also have thresholds.
- Amount of points awarded for the operation.
- Ideas are welcome here.
- This is an operation that is to be done only by the Admin of the LPC backend system.
- CRUD operations for loyalty points.
- This is an operation that is to be done only by the Admin of the LPC backend system.
- Redeem loyalty points - any logged-in user can perform such operation
- Buy loyalty points - any logged-in user can perform such operation
- CRUD operations for loyalty points rules. These endpoints are for managing the rules that will generate loyalty points.
- API Authentication must use JWT for authorization
- The API design should be written in Swagger OpenAPI 3.0 JSON format compatible with Amazon API Gateway. This is very important and will be checked by Reviewers.
- The second part of the design is the database ERD. That database must be a Postgresql 11+ database and will be deployed to Amazon RDS.
- The database for the LPC payment system must hold at least the information of the tenant, the ID of the user for the given tenant and an ID from the payment provider that is created using the SOAP endpoints. This is to allow the unique identification of the user against the payment provider. No PII will be held in the LPC system database.
- The database for the Loyalty points will need to hold the rules information, user's loyalty points data and all transactions (buy, earn and redeem points)
- Minimum information to hold for loyalty (member can suggest any additional information): user id, payment operation, the rule applied, points earned and the current amount of loyalty points
TECHNOLOGY STACK
- Swagger OpenAPI 2.0 (Amazon API Gateway)
- Database ERD (PostgreSQL 11+ Amazon RDS)
Final Submission Guidelines
- Swagger OpenAPI 3.0 Json file
- Database ERD file
All files must be uploaded using the Submit button or the Online Review System (https://software.topcoder.com/review). Links to outside systems, like Google Drive, Github, etc, won't be accepted.