Serendipity2-0 / TradeManV1

0 stars 0 forks source link

Refactor FastAPI endpoints #40

Closed amolkittur closed 1 month ago

amolkittur commented 1 month ago

Here are the current endpoints

  1. GET /swagger

    • Description: Displays the Swagger UI for API documentation.
  2. POST /v1/user/login

    • Description: Authenticates a user and returns a trader number if successful.
  3. POST /v1/user/register

    • Description: Registers a new user with the provided details.
    • Schemas: Accounts,Active, Broker, Profile, Strategies.
  4. GET /v1/user/profile-page

    • Description: Retrieves the profile information for a specific user.
  5. GET /v1/user/portfolio-stats-view

    • Description: Fetches portfolio statistics for a specific user.
  6. GET /v1/user/monthly-returns

    • Description: Retrieves paginated monthly returns data for a user.
  7. GET /v1/user/weekly-cummulative-returns

    • Description: Fetches paginated weekly cumulative returns data for a user.
  8. GET /v1/user/individual-strategy-data

    • Description: Retrieves paginated data for a specific strategy of a user.
  9. GET /v1/user/strategy-graph-data

    • Description: Fetches graph data for a specific strategy of a user.
  10. GET /v1/user/strategy-statistics

    • Description: Retrieves statistics for a specific strategy of a user.
  11. GET /v1/user/user-broker-transactions

    • Description: Fetches paginated broker transactions data for a user, with optional date filtering.
  12. GET /v1/user/users-strategy

    • Description: Retrieves a list of strategies associated with a user.
  13. GET /v1/user/users-holdings

    • Description: Fetches the holdings (equity or other modes) for a user.
  14. GET /v1/user/strategy-params/{strategy_name}

    • Description: Retrieves the current parameters for a specific strategy.
  15. PUT /v1/user/strategy-params/{strategy_name}/{section}

    • Description: Updates parameters for a specific section of a strategy.
  16. PUT /v1/admin/market-info-params

    • Description: Updates market information parameters.
  17. GET /v1/admin/market-info-params

    • Description: Retrieves current market information parameters.
  18. PUT /v1/admin/strategy-qty-amplifier

    • Description: Updates the StrategyQtyAmplifier for a specific strategy or all strategies.
  19. GET /v1/admin/user-strategy-risk-params

    • Description: Fetches strategy risk parameters for one or multiple users.
  20. PUT /v1/admin/user-strategy-risk-params

    • Description: Modifies strategy risk parameters for one or multiple users.

These endpoints cover a range of functionalities including user authentication, profile management, portfolio and strategy data retrieval, transaction history, and various administrative tasks related to market information and risk management.

Changes Made

Description: Registers a new user with the provided details.

Schemas: Includes sub-endpoints for Accounts, Active, Broker, Profile, and Strategies to allow for modular data submission. Each section can be submitted independently, stored temporarily, and then merged upon final registration.

New Endpoints:

amolkittur commented 1 month ago

Task Assignments

@VarshitaTP

Objective: Write comprehensive test cases for the newly implemented endpoints.

Details:

@Anand-ak7

Objective: Review and update documentation and configurations based on the recent changes in the endpoints.

Details:

amolkittur commented 1 month ago

I've updated the accounts schema according to the required format. The changes are now reflected in the latest commit.

Please review the updates at your earliest convenience. Let me know if there are any issues or further modifications needed.

Thanks!


🔄 Updated Files:

amolkittur commented 1 month ago

@Anand-ak7 I have created a new endpoint to fetch the user_id from the admin collection from firebase.

Also we need to pass the user_id in the endpoints releated to registering the user.

Please go through it and let me know if any changes are to be made.

Serendipity2-0 commented 1 month ago

@amolkittur Any tasks pending in this issue? If not please close it

amolkittur commented 1 month ago

Closing this sub-issue:

All the endpoints are working as expected and we can close this issue now.

Resolution:

Enhancement

Closing as resolved.