# Nuxt Minimal Starter

Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install dependencies:

```bash
# npm
npm install

```

## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
```

## Production
Build the application for production:

```bash
# npm
npm run build
```

Locally preview production build:
```bash
# npm
npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

## API Calls

Below is a consolidated list of API calls found in this codebase. Environment variables are used for base URLs:
- ADMIN_API = runtimeConfig.public.ADMIN_API
- PU_BT_API_URL = runtimeConfig.public.PU_BT_API_URL

External Admin API (ADMIN_API)
- GET  {ADMIN_API}/prou_api/v1/schools/reseller_catalog/{schoolId}
  - Source: composables/productFetch.js#getResellerProducts
- GET  {ADMIN_API}/prou_api/v1/prou_products/reseller_catalog/{schoolId}
  - Source: composables/productFetch.js#getResellerCatalog
- GET  {ADMIN_API}/prou_api/v1/prou_products/product_display/{schoolId}/{productSku}
  - Source: composables/productFetch.js#getResellerProduct
- GET  {ADMIN_API}/prou_api/v1/reseller_student/students/{schoolId}
  - Source: composables/studentFetch.js#fetchResellerStudents
- GET  {ADMIN_API}/prou_api/v1/reseller_student/student/{studentPin}
  - Source: composables/studentFetch.js#fetchResellerStudentInfo
- POST {ADMIN_API}/prou_api/v1/reseller_student/students/{schoolId}
  - Body: { data: studentProfile }
  - Source: composables/studentFetch.js#addNewStudent
- PUT  {ADMIN_API}/prou_api/v1/reseller_student/students/{studentPid}
  - Body: { data: studentProfile }
  - Source: composables/studentFetch.js#updateStudent
- GET  {ADMIN_API}/prou_api/v1/schools/reseller_profile/{schoolId}
  - Source: composables/resellerFetch.js#fetchResellerInfo
- GET  {ADMIN_API}/prou_api/v1/courses/courseProdSchool?resellerId={resellerId}
  - Source: composables/resellerFetch.js#fetchResellerCourses
- GET  {ADMIN_API}/prou_api/v1/schools/schools/?state={stateId}
  - Source: composables/resellerFetch.js#fetchStateReseller
- GET  {ADMIN_API}/prou_api/v1/prou_orders/order_details?reseller_name={schoolId}
  - Source: composables/orderFetch.js#fetchResellerOrders
- GET  {ADMIN_API}/prou_api/v1/prou_orders/order_details/{orderNum}?reseller_name={schoolId}
  - Source: composables/orderFetch.js#fetchSingleOrder
- POST {ADMIN_API}/prou_api/v1/prou_orders/order_details
  - Body: { data: order }
  - Source: composables/orderFetch.js#createNewOrder
- PUT  {ADMIN_API}/prou_api/v1/prou_orders/order_details/{order.id}
  - Headers include X-CSRF-Token
  - Body: { data: order }
  - Source: composables/orderFetch.js#updateOrder
- POST {ADMIN_API}/prou_api/v1/prou_orders/order_payment
  - Body: { data: transactionInfo }
  - Source: composables/orderPayment.js#recordPayment
- GET  {ADMIN_API}/prou_api/v1/prou_products/courses_package/{productSku}
  - Source: composables/packageItemsFetch.js#fetchPackageCourses
- GET  {ADMIN_API}/prou_api/v1/prou_orders/discounts/{discountCode}/{resellerId}
  - Source: composables/discountFetch.js#fetchDiscount
- GET  {ADMIN_API}/prou_api/v1/prou_orders/discounts?resellerId={resellerId}
  - Source: composables/discountFetch.js#fetchResellerDiscountList
- POST {ADMIN_API}/prou_api/v1/reseller_student/user/token
  - Source: composables/authGetToken.js#authGetToken
- GET  {ADMIN_API}/prou_api/v1/profiles/user/{userUuid}
  - Source: composables/authGetToken.js#getUserBase

External Braintree API (PU_BT_API_URL)
- GET  {PU_BT_API_URL}/getToken
  - Source: composables/braintreeApi.js#getBTClientToken
- POST {PU_BT_API_URL}/processTransaction
  - Body: JSON.stringify(payPack)
  - Source: composables/braintreeApi.js#processOrder and #orderProcess

Internal App Server Endpoints (Nitro server)
- GET  /api/products/catalogType?schoolId={schoolId}
  - Proxies to: {ADMIN_API}/prou_api/v1/prou_products/reseller_catalog/{schoolId}
  - Source: server/api/products/catalogType.get.js
