> ## Documentation Index
> Fetch the complete documentation index at: https://poolerz.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Appendix

> Additional information.

## Team Members

* **Tyler Cady** ([tcady3@gatech.edu](mailto:tcady3@gatech.edu))\
  Engineering Manager, responsible for engineering task delegations, system architecture, optimization algorithm development, integration, and documentation.

* **Annie Vallamattam** ([avallamattam6@gatech.edu](mailto:avallamattam6@gatech.edu))\
  Project Manager, responsible for general task delegation, client communication, front-end development, and user interface design.

* **Matthew Dworkin** ([mdworkin3@gatech.edu](mailto:mdworkin3@gatech.edu))\
  Back-end development, responsible for database development, test infrastructure, data integration, and handling optimization algorithm output.

* **Natasha Narayanan** ([nnarayanan34@gatech.edu](mailto:nnarayanan34@gatech.edu))\
  Database management, front-end development, and back-end development.

* **Ignacio Galindo** ([igalindo3@gatech.edu](mailto:igalindo3@gatech.edu))\
  Back-end development, optimization algorithm input handling, database management, and front-end development.

***

## API Documentation

### Response Codes

| Code | Text                  | Description                                                           |
| ---- | --------------------- | --------------------------------------------------------------------- |
| 200  | Success               | The request was completed successfully.                               |
| 400  | Bad Request           | The request is invalid or missing required data.                      |
| 401  | Unauthorized          | The request requires a user to be authenticated or authorized.        |
| 403  | Forbidden             | The server recognized the request but user access was denied.         |
| 404  | Not Found             | The request could not be completed because the URL is not recognized. |
| 500  | Internal Server Error | An unexpected error occurred on the server.                           |

### GET /api/name

Retrieves user names based on user IDs.

#### Parameters

| Parameter | Description                                  |
| --------- | -------------------------------------------- |
| userId    | One or more user IDs used to retrieve names. |

#### Response Fields

| Response | Description                             |
| -------- | --------------------------------------- |
| message  | JSON object mapping user IDs to names.  |
| error    | Message returned if invalid or missing. |

***

### POST /api/create-carpool-data

Generates a unique carpool ID for the created pool, saves the inputted data, and commits carpool data to the database.

#### Parameters

| Parameter         | Description                                           |
| ----------------- | ----------------------------------------------------- |
| createCarpoolData | Object containing data for the carpool to be created. |

#### Response Fields

| Response | Description                                 |
| -------- | ------------------------------------------- |
| message  | Success message                             |
| joinCode | Unique carpool ID generated for the carpool |
| error    | Message returned if invalid or missing      |

***

### GET /api/create-carpool-data

Retrieves carpool data after accepting the user and its carpoolID to identify the corresponding carpool.

#### Parameters

| Parameter | Description                      |
| --------- | -------------------------------- |
| carpoolId | Unique ID of carpool to retrieve |
| creatorId | ID of user who created carpool   |

#### Response Fields

| Response          | Description                            |
| ----------------- | -------------------------------------- |
| createCarpoolData | Carpool data retrieved from database   |
| error             | Message returned if invalid or missing |

***

### POST /api/join-carpool-data

Validates incoming joining data, and commits the carpool and user data to the database.

#### Parameters

| Parameter       | Description                                                                                            |
| --------------- | ------------------------------------------------------------------------------------------------------ |
| joinCarpoolData | Object containing data for the carpool to be joined (includes createCarpoolData, joinData, and userId) |

#### Response Fields

| Response | Description                                   |
| -------- | --------------------------------------------- |
| message  | Success message                               |
| joinCode | Unique carpool ID of carpool that user joined |
| error    | Message returned if invalid or missing        |

***

### GET /api/join-carpool-data

Retrieves carpool data after accepting the user.

#### Parameters

| Parameter | Description                                      |
| --------- | ------------------------------------------------ |
| userId    | ID of user whose carpool data is being retrieved |

#### Response Fields

| Response          | Description                            |
| ----------------- | -------------------------------------- |
| createCarpoolData | Carpool data retrieved from database   |
| error             | Message returned if invalid or missing |

***

### GET /api/optimization-results

Fetches optimization results from the database after authenticating a user and accepting the carpool ID.

#### Parameters

| Parameter | Description                                                         |
| --------- | ------------------------------------------------------------------- |
| carpoolId | Unique ID of carpool whose optimization results are being retrieved |

#### Response Fields

| Response  | Description                                      |
| --------- | ------------------------------------------------ |
| results   | Optimization results retrieved from the database |
| updatedAt | Timestamp of when results were last updated      |
| error     | Message returned if invalid or missing           |

***

### POST /api/save-optimization

Confirms whether the user is the owner of the carpool, sanitizes optimization results, and saves incoming data in the database.

#### Parameters

| Parameter | Description                                                     |
| --------- | --------------------------------------------------------------- |
| carpoolId | Unique ID of carpool whose optimization results are being saved |
| results   | Optimization results to be saved                                |

#### Response Fields

| Response | Description                                           |
| -------- | ----------------------------------------------------- |
| success  | Boolean indicating successful save                    |
| error    | Message returned if invalid, missing, or unauthorized |

***

### POST /api/update-carpool

Validates incoming carpool ID and data, then updates the carpool database with new data.

#### Parameters

| Parameter   | Description                                                     |
| ----------- | --------------------------------------------------------------- |
| carpoolId   | Unique ID of carpool whose optimization results are being saved |
| carpoolData | New data to update the carpool with                             |

#### Response Fields

| Response | Description                                           |
| -------- | ----------------------------------------------------- |
| success  | Boolean indicating successful save                    |
| error    | Message returned if invalid, missing, or unauthorized |

***

### POST /api/update-user-carpool

Validates the incoming user ID, carpool ID, and carpool data, then updates the user-carpool-data database with new data.

#### Parameters

| Parameter    | Description                                                     |
| ------------ | --------------------------------------------------------------- |
| userId       | Unique ID of user whose carpool data is being updated           |
| carpoolId    | Unique ID of carpool whose optimization results are being saved |
| userLocation | Updated user location                                           |
| carpoolData  | New data to update the carpool with                             |

#### Response Fields

| Response | Description                                           |
| -------- | ----------------------------------------------------- |
| success  | Boolean indicating successful save                    |
| message  | Success message                                       |
| error    | Message returned if invalid, missing, or unauthorized |
