Skip to content

Getting Started with CQS

Main Features:

  1. User Role Handling:

    • Redirects users based on role (e.g., procurement_manager) via router.push.
  2. Procurement Categories & Templates:

    • Fetches procurement categories and related templates from external services.
    • Handles selectedProcurementActivity and filters available processes accordingly.
  3. Tender Editing:

    • Fetches and displays details of an existing tender when an editTenderParam is provided.
    • Dynamically updates states like selectedProcess, selectedProcurementActivity, and parentCategory.
  4. Dynamic Process Tabs:

    • Based on the procurement process type (DSSP, CQS, RFQ), it sets the currentTab for the tender process flow.
    • Displays the relevant components for each process type (CSQProcess, DSSProcess, RFQProcurementProcess).
  5. Data Fetching and State Management:

    • Uses multiple useEffect hooks for:
      • Fetching procurement categories (fetchProcurementCategories).
      • Fetching and updating tender details (fetchTender).
      • Updating dynamic fields (dynamicFieldsTOR, dynamicFieldsEOI).
      • Updating state based on query parameters (searchParams).
  6. Submission Handling:

    • Handles final submission of tender data (submitFinal), including document uploads and routing to the review page.
  7. Error Handling & Loading States:

    • Manages loading states (isLoading, disableBtnLoader) and handles errors gracefully with toast notifications.
  8. Procurement Managers & Evaluators:

    • Fetches lists of procurement managers and evaluators from the userService and updates state accordingly.

Key Functions:

  • fetchTender: Fetches details of an edited tender and redirects to a new route.
  • fetchProcurementCategories: Fetches procurement categories and processes, and updates relevant states like availableProcurementActivity.
  • submitFinal: Submits the final tender data and related documents.
  • extractParentZero: Extracts procurement activities with a parent_id of "0".
  • nextStep / prevStep: Placeholder functions for handling process steps.
  • fetchProcurementManagersList: Fetches and updates lists of procurement managers and evaluators.

Key Components:

  • TenderProgressBar: Displays a progress bar for the current tender process.
  • ProcessDecider, CSQProcess, DSSProcess, RFQProcurementProcess: Conditional components for different procurement processes.

Example Usage:

// Example of conditional rendering based on currentTab:
{currentTab === 0 && <ProcessDecider {...props} />}
{currentTab === 1 && <CSQProcess {...props} />}
{currentTab === 2 && <DSSProcess {...props} />}
{currentTab === 3 && <RFQProcurementProcess {...props} />}