Skip to main content

Routes

auth0.py

Defines API endpoints related to authentication using Auth0.

Functions:

  • get_token: Returns an authentication token for the Auth0 service.
  • get_user_info: Returns information about the authenticated user.
  • login: Handles the login process for the application.
  • logout: Handles the logout process for the application.

common_apis.py

Defines common API endpoints used throughout the application.

Admin_list_of_orders

  • Description: Returns a list of orders for the admin dashboard.
  • Input: AdminListInput (Pydantic Model)
    • page_number: Integer
    • page_size: Integer
  • Output: JSON list of orders with total count.
  • Success Response:
    {
    "data": [...],
    "total_count": <int>,
    "message": "Success"
    }
  • Failure Response:
    {
    "detail": "error in admin upload service --> <error message>"
    }

Order_Creation

  • Type: POST
  • Description: Processes and stores an input order.
  • Input: CreateOrderUserInput (Pydantic Model)
  • Output: Success or error message in JSON.

vendor_file_validate

  • Description: Validates and analyzes a vendor file.
  • Input: VendorFileValidateInput (Pydantic Model)
  • Output: JSON validation result

user_list_of_orders

  • Description: Retrieves a list of user orders based on query params.
  • Input: ListOfOrdersInput (Pydantic Model)
  • Output: JSON list of orders with total count.

Admin_update_service

  • Type: POST
  • Description: Updates the status of the order.
  • Input: AdminUpdateInput (Pydantic Model)
  • Output:
    {
    "order_id": <int>,
    "status": <str>,
    "message": "Success"
    }

Search_cam_dashboard_service

  • Description: Searches for orders in the CAM dashboard.
  • Input: SearchCAMDashboardInput (Pydantic Model)
  • Output: JSON with search results

Check_user_order

  • Description: Checks if a user has orders.
  • Input: UserIdOrgIdInput (Pydantic Model)
  • Output: Boolean result in JSON

Check_order_price_service

  • Description: Checks the price of an order.
  • Input: UserIdOrgIdTypeSubType (Pydantic Model)
  • Output: Price data in JSON

Update_file_name

  • Type: POST
  • Description: Renames a user file.
  • Input: UpdateFileInput (Pydantic Model)
  • Output:
    {
    "data": {},
    "message": "Success"
    }

Contact Sales

  • Type: POST
  • Description: Sends contact sales request.
  • Input: Fields inherited from UserIdOrgIdInput, and type, sub_type
  • Output: Status response in JSON

Update Order Price

  • Type: POST
  • Description: Updates the price of an order.
  • Input: Various fields including sales_order_id, price, vendor_range, sales_person_name, etc.
  • Output: JSON containing updated order ID and status

List_of_contact_sales_for_price

  • Type: GET
  • Description: Retrieves list of contact sales for price.
  • Output: List in JSON format

List_of_all_biling_invoices

  • Type: GET
  • Description: Retrieves list of billing invoices for a user.
  • Input: user_id, org_id
  • Output: JSON list of billing invoices