

# **TUTORHUB**

**FRONTEND GUIDE FOR AI CODING AGENTS - PART 8 - CourseScheduling Service**

This document is a part of a REST API guide for the tutorhub project.
It is designed for AI agents that will generate frontend code to consume the project’s backend.

This document provides extensive instruction for the usage of courseScheduling

## Service Access

CourseScheduling service management is handled through service specific base urls.

CourseScheduling  service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs.
The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.).

For the courseScheduling service, the base URLs are:

* **Preview:** `https://tutorhub.prw.mindbricks.com/coursescheduling-api`
* **Staging:** `https://tutorhub-stage.mindbricks.co/coursescheduling-api`
* **Production:** `https://tutorhub.mindbricks.co/coursescheduling-api`


## Scope

**CourseScheduling Service Description**

Handles all scheduling: tutor availability, lesson slot management/booking, preliminary meeting scheduling for screened courses. Ensures schedule privacy (authenticated only).

CourseScheduling service provides apis and business logic for following data objects in tutorhub application. 
Each data object may be either a central domain of the application data structure or a related helper data object for a central concept.
Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows.  


**`availability` Data Object**: Weekly availability window for a tutor, determines open slots for student booking. Each tuple is for a specific day/time window.

**`lessonSlot` Data Object**: 

**`preliminaryMeeting` Data Object**: Request for a pre-enrollment screening meeting with a tutor, required for some advanced coursePacks.


## CourseScheduling Service Frontend Description By The Backend Architect

This service manages tutor lesson slot scheduling, preliminary screening meetings, and weekly availabilities for tutors. Schedule data is privacy-controlled: only tutors (for their own slots), enrolled students (for their course slots), and admins can access relevant entries. Public endpoints are not present; all APIs require authentication and membership validation. Lesson slot status changes are strictly regulated (ownership and state transitions checked). Availability can only be set/modified by the tutor or admin.

## API Structure

### Object Structure of a Successful Response

When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client.

**HTTP Status Codes:**

* **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully.
* **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully.

**Success Response Format:**

For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below:

```json
{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3,
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}
```
* **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation.

### Additional Data

Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature.

### Error Response

If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity:

* **400 Bad Request**: The request was improperly formatted or contained invalid parameters.
* **401 Unauthorized**: The request lacked a valid authentication token; login is required.
* **403 Forbidden**: The current token does not grant access to the requested resource.
* **404 Not Found**: The requested resource was not found on the server.
* **500 Internal Server Error**: The server encountered an unexpected condition.

Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution.

```js
{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}
```


## Availability Data Object

Weekly availability window for a tutor, determines open slots for student booking. Each tuple is for a specific day/time window.

### Availability  Data Object Frontend Description By The Backend Architect

Represents a recurring (or one-off) time window when the tutor is available for lessons. Only the owning tutor or admins may create or update these records. Frontend should provide a day-of-week picker and HH:mm input, plus a toggle for recurrence.


### Availability Data Object Properties

Availability data object has got following properties that are represented as table fields in the database scheme. 
These properties don't stand just for data storage, but each may have different settings to manage the business logic. 

| Property | Type | IsArray | Required | Secret | Description |
|----------|------|---------|----------|--------|-------------|
| `tutorProfileId` | ID | false | Yes | No | FK to tutorCatalog:tutorProfile. Only owner tutor or admin can edit. |
| `dayOfWeek` | Enum | false | Yes | No | Day of week: sunday-saturday. |
| `startTime` | String | false | Yes | No | Start time of window (HH:mm, 24h). |
| `endTime` | String | false | Yes | No | End time of window (HH:mm, 24h). |
| `isRecurring` | Boolean | false | Yes | No | If true, this slot recurs weekly. |
| `specificDate` | Date | false | No | No | Specific date (YYYY-MM-DD) for non-recurring availability. Null for recurring slots. |
| `teachingMode` | Enum | false | Yes | No | - |
* Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.



### Enum Properties
Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. 
The enum options value will be stored as strings in the database, 
but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option.
You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values.
In the frontend input components, enum type properties should only accept values from an option component that lists the enum options.

- **dayOfWeek**: [sunday, monday, tuesday, wednesday, thursday, friday, saturday]

- **teachingMode**: [online, faceToFace, both]


### Relation Properties

`tutorProfileId`

Mindbricks supports relations between data objects, allowing you to define how objects are linked together.
The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search.
These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects.
If the relation points to another service, frontend should use the referenced service api in case it needs related data.
The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. 
In mmost cases the api response will provide the relational data as well as the main one.

In frontend, please ensure that, 

1- instaead of these relational ids you show the main human readable field of the related target data (like name),
2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.


- **tutorProfileId**: ID
Relation to `tutorProfile`.id

The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.

Required: Yes


### Filter Properties

`teachingMode`

Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria.
These properties are automatically mapped as API parameters in the listing API's.

- **teachingMode**: Enum  has a filter named `teachingMode`


## LessonSlot Data Object





### LessonSlot Data Object Properties

LessonSlot data object has got following properties that are represented as table fields in the database scheme. 
These properties don't stand just for data storage, but each may have different settings to manage the business logic. 

| Property | Type | IsArray | Required | Secret | Description |
|----------|------|---------|----------|--------|-------------|
| `coursePackId` | ID | false | Yes | No | FK to tutorCatalog:coursePack. Only tutors for the pack, enrolled student, or admin may update/view. |
| `studentId` | ID | false | No | No | FK to auth:user (student). Set on booking. Nullable when open (free). |
| `scheduledDate` | Date | false | Yes | No | Date for the lesson slot (yyyy-mm-dd). |
| `scheduledTime` | String | false | Yes | No | Start time of lesson (HH:mm 24h). |
| `status` | Enum | false | Yes | No | State of lesson slot (free, booked, completed, canceled). |
| `locationType` | Enum | false | No | No | - |
| `locationDetails` | String | false | No | No | Optional: Location address/details; editable after booking by either party. |
| `sessionMode` | Enum | false | Yes | No | Chosen delivery mode for this lesson. Set at booking time based on student choice or tutor's teachingMode. 'online' triggers Google Meet link generation, 'faceToFace' uses locationType/locationDetails. |
| `meetLink` | String | false | No | No | Google Meet URL for online lessons. Auto-populated when sessionMode is 'online'. Null for face-to-face sessions. |
* Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.



### Enum Properties
Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. 
The enum options value will be stored as strings in the database, 
but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option.
You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values.
In the frontend input components, enum type properties should only accept values from an option component that lists the enum options.

- **status**: [free, booked, completed, canceled]

- **locationType**: [online, studentHome, tutorHome, other]

- **sessionMode**: [online, faceToFace]


### Relation Properties

`coursePackId` `studentId`

Mindbricks supports relations between data objects, allowing you to define how objects are linked together.
The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search.
These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects.
If the relation points to another service, frontend should use the referenced service api in case it needs related data.
The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. 
In mmost cases the api response will provide the relational data as well as the main one.

In frontend, please ensure that, 

1- instaead of these relational ids you show the main human readable field of the related target data (like name),
2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.


- **coursePackId**: ID
Relation to `coursePack`.id

The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.

Required: Yes

- **studentId**: ID
Relation to `user`.id

The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.

Required: No


### Filter Properties

`coursePackId` `studentId` `status` `sessionMode`

Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria.
These properties are automatically mapped as API parameters in the listing API's.

- **coursePackId**: ID  has a filter named `coursePackId`

- **studentId**: ID  has a filter named `studentId`

- **status**: Enum  has a filter named `status`

- **sessionMode**: Enum  has a filter named `sessionMode`


## PreliminaryMeeting Data Object

Request for a pre-enrollment screening meeting with a tutor, required for some advanced coursePacks.

### PreliminaryMeeting  Data Object Frontend Description By The Backend Architect

Represents a student's request for a screening with a tutor for an advanced course. Only active if the related coursePack has preliminaryMeetingRequired true. Student can request; tutor can schedule/approve/reject. Both parties and admins can view. Tutor may leave comments/notes. Each student-coursePack pair is unique.


### PreliminaryMeeting Data Object Properties

PreliminaryMeeting data object has got following properties that are represented as table fields in the database scheme. 
These properties don't stand just for data storage, but each may have different settings to manage the business logic. 

| Property | Type | IsArray | Required | Secret | Description |
|----------|------|---------|----------|--------|-------------|
| `coursePackId` | ID | false | Yes | No | FK to tutorCatalog:coursePack (the advanced course) |
| `studentId` | ID | false | Yes | No | FK to auth:user (student who requested). |
| `scheduledDatetime` | Date | false | No | No | Datetime for screening meeting; may be null until both parties agree. |
| `tutorDecision` | Enum | false | Yes | No | - |
| `comments` | String | false | No | No | Optional field for tutor to provide comments/notes about screening result. |
| `meetingLink` | String | false | No | No | Video call link (Google Meet, Zoom, etc.) for the screening interview. Set by the tutor when scheduling. |
* Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set.



### Enum Properties
Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. 
The enum options value will be stored as strings in the database, 
but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option.
You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values.
In the frontend input components, enum type properties should only accept values from an option component that lists the enum options.

- **tutorDecision**: [pending, approved, rejected]


### Relation Properties

`coursePackId` `studentId`

Mindbricks supports relations between data objects, allowing you to define how objects are linked together.
The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search.
These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects.
If the relation points to another service, frontend should use the referenced service api in case it needs related data.
The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. 
In mmost cases the api response will provide the relational data as well as the main one.

In frontend, please ensure that, 

1- instaead of these relational ids you show the main human readable field of the related target data (like name),
2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field.


- **coursePackId**: ID
Relation to `coursePack`.id

The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.

Required: Yes

- **studentId**: ID
Relation to `user`.id

The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object.

Required: Yes




## Default CRUD APIs

For each data object, the backend architect may designate **default APIs** for standard operations (create, update, delete, get, list). These are the APIs that frontend CRUD forms and AI agents should use for basic record management. If no default is explicitly set (`isDefaultApi`), the frontend generator auto-discovers the most general API for each operation.

### Availability Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createAvailability` | `/v1/availabilities` | Yes |
| Update | `updateAvailability` | `/v1/availabilities/:availabilityId` | Yes |
| Delete | `deleteAvailability` | `/v1/availabilities/:availabilityId` | Yes |
| Get | `getAvailability` | `/v1/availabilities/:availabilityId` | Yes |
| List | `listAvailabilities` | `/v1/listavailabilities/:tutorProfileId` | Auto |
### LessonSlot Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createLessonSlot` | `/v1/lessonslots` | Auto |
| Update | `updateLessonSlot` | `/v1/lessonslots/:lessonSlotId` | Yes |
| Delete | `deleteLessonSlot` | `/v1/lessonslots/:lessonSlotId` | Yes |
| Get | `getLessonSlot` | `/v1/lessonslots/:lessonSlotId` | Auto |
| List | `listLessonSlots` | `/v1/lessonslots` | Auto |
### PreliminaryMeeting Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createPreliminaryMeeting` | `/v1/preliminarymeetings` | Yes |
| Update | `updatePreliminaryMeeting` | `/v1/preliminarymeetings/:preliminaryMeetingId` | Yes |
| Delete | _none_ | - | Auto |
| Get | `getPreliminaryMeeting` | `/v1/preliminarymeetings/:preliminaryMeetingId` | Yes |
| List | `listPreliminaryMeetings` | `/v1/preliminarymeetings` | Yes |

When building CRUD forms for a data object, use the default create/update APIs listed above. The form fields should correspond to the API's body parameters. For relation fields, render a dropdown loaded from the related object's list API using the display label property.





## API Reference

### `Create Availability` API
**[Default create API]** — This is the designated default `create` API for the `availability` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor creates available time window for teaching. Only owner tutor or admin.


**Rest Route**

The `createAvailability` API REST controller can be triggered via the following route:

`/v1/availabilities`


**Rest Request Parameters**


The `createAvailability` api has got 7 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| tutorProfileId  | ID  | true | request.body?.["tutorProfileId"] |
| dayOfWeek  | Enum  | true | request.body?.["dayOfWeek"] |
| startTime  | String  | true | request.body?.["startTime"] |
| endTime  | String  | true | request.body?.["endTime"] |
| isRecurring  | Boolean  | true | request.body?.["isRecurring"] |
| specificDate  | Date  | false | request.body?.["specificDate"] |
| teachingMode  | Enum  | true | request.body?.["teachingMode"] |
**tutorProfileId** : FK to tutorCatalog:tutorProfile. Only owner tutor or admin can edit.
**dayOfWeek** : Day of week: sunday-saturday.
**startTime** : Start time of window (HH:mm, 24h).
**endTime** : End time of window (HH:mm, 24h).
**isRecurring** : If true, this slot recurs weekly.
**specificDate** : Specific date (YYYY-MM-DD) for non-recurring availability. Null for recurring slots.
**teachingMode** : 



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/availabilities**
```js
  axios({
    method: 'POST',
    url: '/v1/availabilities',
    data: {
            tutorProfileId:"ID",  
            dayOfWeek:"Enum",  
            startTime:"String",  
            endTime:"String",  
            isRecurring:"Boolean",  
            specificDate:"Date",  
            teachingMode:"Enum",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "availability",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"availability": {
		"id": "ID",
		"tutorProfileId": "ID",
		"dayOfWeek": "Enum",
		"dayOfWeek_idx": "Integer",
		"startTime": "String",
		"endTime": "String",
		"isRecurring": "Boolean",
		"specificDate": "Date",
		"teachingMode": "Enum",
		"teachingMode_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Update Availability` API
**[Default update API]** — This is the designated default `update` API for the `availability` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor updates an availability record (only own, or admin).


**Rest Route**

The `updateAvailability` API REST controller can be triggered via the following route:

`/v1/availabilities/:availabilityId`


**Rest Request Parameters**


The `updateAvailability` api has got 7 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| availabilityId  | ID  | true | request.params?.["availabilityId"] |
| dayOfWeek  | Enum  | false | request.body?.["dayOfWeek"] |
| startTime  | String  | false | request.body?.["startTime"] |
| endTime  | String  | false | request.body?.["endTime"] |
| isRecurring  | Boolean  | false | request.body?.["isRecurring"] |
| specificDate  | Date  | false | request.body?.["specificDate"] |
| teachingMode  | Enum  | false | request.body?.["teachingMode"] |
**availabilityId** : This id paremeter is used to select the required data object that will be updated
**dayOfWeek** : Day of week: sunday-saturday.
**startTime** : Start time of window (HH:mm, 24h).
**endTime** : End time of window (HH:mm, 24h).
**isRecurring** : If true, this slot recurs weekly.
**specificDate** : Specific date (YYYY-MM-DD) for non-recurring availability. Null for recurring slots.
**teachingMode** : 



**REST Request**
To access the api you can use the **REST** controller with the path **PATCH  /v1/availabilities/:availabilityId**
```js
  axios({
    method: 'PATCH',
    url: `/v1/availabilities/${availabilityId}`,
    data: {
            dayOfWeek:"Enum",  
            startTime:"String",  
            endTime:"String",  
            isRecurring:"Boolean",  
            specificDate:"Date",  
            teachingMode:"Enum",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "availability",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"availability": {
		"id": "ID",
		"tutorProfileId": "ID",
		"dayOfWeek": "Enum",
		"dayOfWeek_idx": "Integer",
		"startTime": "String",
		"endTime": "String",
		"isRecurring": "Boolean",
		"specificDate": "Date",
		"teachingMode": "Enum",
		"teachingMode_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Delete Availability` API
**[Default delete API]** — This is the designated default `delete` API for the `availability` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor deletes an availability record (only own, or admin).


**Rest Route**

The `deleteAvailability` API REST controller can be triggered via the following route:

`/v1/availabilities/:availabilityId`


**Rest Request Parameters**


The `deleteAvailability` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| availabilityId  | ID  | true | request.params?.["availabilityId"] |
**availabilityId** : This id paremeter is used to select the required data object that will be deleted



**REST Request**
To access the api you can use the **REST** controller with the path **DELETE  /v1/availabilities/:availabilityId**
```js
  axios({
    method: 'DELETE',
    url: `/v1/availabilities/${availabilityId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "availability",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"availability": {
		"id": "ID",
		"tutorProfileId": "ID",
		"dayOfWeek": "Enum",
		"dayOfWeek_idx": "Integer",
		"startTime": "String",
		"endTime": "String",
		"isRecurring": "Boolean",
		"specificDate": "Date",
		"teachingMode": "Enum",
		"teachingMode_idx": "Integer",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Get Availability` API
**[Default get API]** — This is the designated default `get` API for the `availability` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Get one availability by id (tutor/owner or admin only).


**Rest Route**

The `getAvailability` API REST controller can be triggered via the following route:

`/v1/availabilities/:availabilityId`


**Rest Request Parameters**


The `getAvailability` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| availabilityId  | ID  | true | request.params?.["availabilityId"] |
**availabilityId** : This id paremeter is used to query the required data object.



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/availabilities/:availabilityId**
```js
  axios({
    method: 'GET',
    url: `/v1/availabilities/${availabilityId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "availability",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"availability": {
		"id": "ID",
		"tutorProfileId": "ID",
		"dayOfWeek": "Enum",
		"dayOfWeek_idx": "Integer",
		"startTime": "String",
		"endTime": "String",
		"isRecurring": "Boolean",
		"specificDate": "Date",
		"teachingMode": "Enum",
		"teachingMode_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `List Availabilities` API



**Rest Route**

The `listAvailabilities` API REST controller can be triggered via the following route:

`/v1/listavailabilities/:tutorProfileId`


**Rest Request Parameters**


The `listAvailabilities` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| tutorProfileId  | ID  | true | request.params?.["tutorProfileId"] |
**tutorProfileId** : FK to tutorCatalog:tutorProfile. Only owner tutor or admin can edit.. The parameter is used to query data.


**Filter Parameters**

The `listAvailabilities` api supports 1 optional filter parameter for filtering list results:

**teachingMode** (`Enum`): Filter by teachingMode

- Single: `?teachingMode=<value>` (case-insensitive)
- Multiple: `?teachingMode=<value1>&teachingMode=<value2>`
- Null: `?teachingMode=null`



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/listavailabilities/:tutorProfileId**
```js
  axios({
    method: 'GET',
    url: `/v1/listavailabilities/${tutorProfileId}`,
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // teachingMode: '<value>' // Filter by teachingMode
            }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "availabilities",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"availabilities": [
		{
			"id": "ID",
			"tutorProfileId": "ID",
			"dayOfWeek": "Enum",
			"dayOfWeek_idx": "Integer",
			"startTime": "String",
			"endTime": "String",
			"isRecurring": "Boolean",
			"specificDate": "Date",
			"teachingMode": "Enum",
			"teachingMode_idx": "Integer",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `Create Lessonslot` API



**Rest Route**

The `createLessonSlot` API REST controller can be triggered via the following route:

`/v1/lessonslots`


**Rest Request Parameters**


The `createLessonSlot` api has got 9 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| coursePackId  | ID  | true | request.body?.["coursePackId"] |
| studentId  | ID  | false | request.body?.["studentId"] |
| scheduledDate  | Date  | true | request.body?.["scheduledDate"] |
| scheduledTime  | String  | true | request.body?.["scheduledTime"] |
| status  | Enum  | true | request.body?.["status"] |
| locationType  | Enum  | false | request.body?.["locationType"] |
| locationDetails  | String  | false | request.body?.["locationDetails"] |
| sessionMode  | Enum  | true | request.body?.["sessionMode"] |
| meetLink  | String  | false | request.body?.["meetLink"] |
**coursePackId** : FK to tutorCatalog:coursePack. Only tutors for the pack, enrolled student, or admin may update/view.
**studentId** : FK to auth:user (student). Set on booking. Nullable when open (free).
**scheduledDate** : Date for the lesson slot (yyyy-mm-dd).
**scheduledTime** : Start time of lesson (HH:mm 24h).
**status** : State of lesson slot (free, booked, completed, canceled).
**locationType** : 
**locationDetails** : Optional: Location address/details; editable after booking by either party.
**sessionMode** : Chosen delivery mode for this lesson. Set at booking time based on student choice or tutor's teachingMode. 'online' triggers Google Meet link generation, 'faceToFace' uses locationType/locationDetails.
**meetLink** : Google Meet URL for online lessons. Auto-populated when sessionMode is 'online'. Null for face-to-face sessions.



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/lessonslots**
```js
  axios({
    method: 'POST',
    url: '/v1/lessonslots',
    data: {
            coursePackId:"ID",  
            studentId:"ID",  
            scheduledDate:"Date",  
            scheduledTime:"String",  
            status:"Enum",  
            locationType:"Enum",  
            locationDetails:"String",  
            sessionMode:"Enum",  
            meetLink:"String",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "lessonSlot",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"lessonSlot": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDate": "Date",
		"scheduledTime": "String",
		"status": "Enum",
		"status_idx": "Integer",
		"locationType": "Enum",
		"locationType_idx": "Integer",
		"locationDetails": "String",
		"sessionMode": "Enum",
		"sessionMode_idx": "Integer",
		"meetLink": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Update Lessonslot` API
**[Default update API]** — This is the designated default `update` API for the `lessonSlot` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Update lesson slot status/location. Tutor can edit any of their coursePack's slots; student can update their own booked slot location (if booked). Admin has override right.


**Rest Route**

The `updateLessonSlot` API REST controller can be triggered via the following route:

`/v1/lessonslots/:lessonSlotId`


**Rest Request Parameters**


The `updateLessonSlot` api has got 7 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| lessonSlotId  | ID  | true | request.params?.["lessonSlotId"] |
| studentId  | ID  | false | request.body?.["studentId"] |
| status  | Enum  | false | request.body?.["status"] |
| locationType  | Enum  | false | request.body?.["locationType"] |
| locationDetails  | String  | false | request.body?.["locationDetails"] |
| sessionMode  | Enum  | false | request.body?.["sessionMode"] |
| meetLink  | String  | false | request.body?.["meetLink"] |
**lessonSlotId** : This id paremeter is used to select the required data object that will be updated
**studentId** : FK to auth:user (student). Set on booking. Nullable when open (free).
**status** : State of lesson slot (free, booked, completed, canceled).
**locationType** : 
**locationDetails** : Optional: Location address/details; editable after booking by either party.
**sessionMode** : Chosen delivery mode for this lesson. Set at booking time based on student choice or tutor's teachingMode. 'online' triggers Google Meet link generation, 'faceToFace' uses locationType/locationDetails.
**meetLink** : Google Meet URL for online lessons. Auto-populated when sessionMode is 'online'. Null for face-to-face sessions.



**REST Request**
To access the api you can use the **REST** controller with the path **PATCH  /v1/lessonslots/:lessonSlotId**
```js
  axios({
    method: 'PATCH',
    url: `/v1/lessonslots/${lessonSlotId}`,
    data: {
            studentId:"ID",  
            status:"Enum",  
            locationType:"Enum",  
            locationDetails:"String",  
            sessionMode:"Enum",  
            meetLink:"String",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "lessonSlot",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"lessonSlot": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDate": "Date",
		"scheduledTime": "String",
		"status": "Enum",
		"status_idx": "Integer",
		"locationType": "Enum",
		"locationType_idx": "Integer",
		"locationDetails": "String",
		"sessionMode": "Enum",
		"sessionMode_idx": "Integer",
		"meetLink": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Delete Lessonslot` API
**[Default delete API]** — This is the designated default `delete` API for the `lessonSlot` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor can remove their own slot if free/booked. Admin can remove any. (Student may not delete).


**Rest Route**

The `deleteLessonSlot` API REST controller can be triggered via the following route:

`/v1/lessonslots/:lessonSlotId`


**Rest Request Parameters**


The `deleteLessonSlot` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| lessonSlotId  | ID  | true | request.params?.["lessonSlotId"] |
**lessonSlotId** : This id paremeter is used to select the required data object that will be deleted



**REST Request**
To access the api you can use the **REST** controller with the path **DELETE  /v1/lessonslots/:lessonSlotId**
```js
  axios({
    method: 'DELETE',
    url: `/v1/lessonslots/${lessonSlotId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "lessonSlot",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"lessonSlot": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDate": "Date",
		"scheduledTime": "String",
		"status": "Enum",
		"status_idx": "Integer",
		"locationType": "Enum",
		"locationType_idx": "Integer",
		"locationDetails": "String",
		"sessionMode": "Enum",
		"sessionMode_idx": "Integer",
		"meetLink": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Get Lessonslot` API



**Rest Route**

The `getLessonSlot` API REST controller can be triggered via the following route:

`/v1/lessonslots/:lessonSlotId`


**Rest Request Parameters**


The `getLessonSlot` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| lessonSlotId  | ID  | true | request.params?.["lessonSlotId"] |
**lessonSlotId** : This id paremeter is used to query the required data object.



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/lessonslots/:lessonSlotId**
```js
  axios({
    method: 'GET',
    url: `/v1/lessonslots/${lessonSlotId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**

This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "lessonSlot",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"lessonSlot": {
		"isActive": true
	}
}
```


### `List Lessonslots` API



**Rest Route**

The `listLessonSlots` API REST controller can be triggered via the following route:

`/v1/lessonslots`


**Rest Request Parameters**
The `listLessonSlots` api has got no request parameters.    




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/lessonslots**
```js
  axios({
    method: 'GET',
    url: '/v1/lessonslots',
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**

This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "lessonSlots",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"lessonSlots": [
		{
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `Create Preliminarymeeting` API
**[Default create API]** — This is the designated default `create` API for the `preliminaryMeeting` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Student requests a screening meeting; only created if related coursePack requires screening.


**Rest Route**

The `createPreliminaryMeeting` API REST controller can be triggered via the following route:

`/v1/preliminarymeetings`


**Rest Request Parameters**


The `createPreliminaryMeeting` api has got 6 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| coursePackId  | ID  | true | request.body?.["coursePackId"] |
| studentId  | ID  | true | request.body?.["studentId"] |
| scheduledDatetime  | Date  | false | request.body?.["scheduledDatetime"] |
| tutorDecision  | Enum  | true | request.body?.["tutorDecision"] |
| comments  | String  | false | request.body?.["comments"] |
| meetingLink  | String  | false | request.body?.["meetingLink"] |
**coursePackId** : FK to tutorCatalog:coursePack (the advanced course)
**studentId** : FK to auth:user (student who requested).
**scheduledDatetime** : Datetime for screening meeting; may be null until both parties agree.
**tutorDecision** : 
**comments** : Optional field for tutor to provide comments/notes about screening result.
**meetingLink** : Video call link (Google Meet, Zoom, etc.) for the screening interview. Set by the tutor when scheduling.



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/preliminarymeetings**
```js
  axios({
    method: 'POST',
    url: '/v1/preliminarymeetings',
    data: {
            coursePackId:"ID",  
            studentId:"ID",  
            scheduledDatetime:"Date",  
            tutorDecision:"Enum",  
            comments:"String",  
            meetingLink:"String",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "preliminaryMeeting",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"preliminaryMeeting": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDatetime": "Date",
		"tutorDecision": "Enum",
		"tutorDecision_idx": "Integer",
		"comments": "String",
		"meetingLink": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"coursePack": {},
	"tutorProfile": {},
	"tutorUser": {},
	"student": {}
}
```


### `Update Preliminarymeeting` API
**[Default update API]** — This is the designated default `update` API for the `preliminaryMeeting` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor updates scheduled date/time, decision, or comments for screening meeting. Only tutor of coursePack or admin can approve/reject/set date; student can only propose initial.


**Rest Route**

The `updatePreliminaryMeeting` API REST controller can be triggered via the following route:

`/v1/preliminarymeetings/:preliminaryMeetingId`


**Rest Request Parameters**


The `updatePreliminaryMeeting` api has got 5 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| preliminaryMeetingId  | ID  | true | request.params?.["preliminaryMeetingId"] |
| scheduledDatetime  | Date  | false | request.body?.["scheduledDatetime"] |
| tutorDecision  | Enum  | false | request.body?.["tutorDecision"] |
| comments  | String  | false | request.body?.["comments"] |
| meetingLink  | String  | false | request.body?.["meetingLink"] |
**preliminaryMeetingId** : This id paremeter is used to select the required data object that will be updated
**scheduledDatetime** : Datetime for screening meeting; may be null until both parties agree.
**tutorDecision** : 
**comments** : Optional field for tutor to provide comments/notes about screening result.
**meetingLink** : Video call link (Google Meet, Zoom, etc.) for the screening interview. Set by the tutor when scheduling.



**REST Request**
To access the api you can use the **REST** controller with the path **PATCH  /v1/preliminarymeetings/:preliminaryMeetingId**
```js
  axios({
    method: 'PATCH',
    url: `/v1/preliminarymeetings/${preliminaryMeetingId}`,
    data: {
            scheduledDatetime:"Date",  
            tutorDecision:"Enum",  
            comments:"String",  
            meetingLink:"String",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "preliminaryMeeting",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"preliminaryMeeting": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDatetime": "Date",
		"tutorDecision": "Enum",
		"tutorDecision_idx": "Integer",
		"comments": "String",
		"meetingLink": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"student": {},
	"coursePack": {}
}
```


### `Get Preliminarymeeting` API
**[Default get API]** — This is the designated default `get` API for the `preliminaryMeeting` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Get a single meeting by id: only tutor, student, or admin can access.


**Rest Route**

The `getPreliminaryMeeting` API REST controller can be triggered via the following route:

`/v1/preliminarymeetings/:preliminaryMeetingId`


**Rest Request Parameters**


The `getPreliminaryMeeting` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| preliminaryMeetingId  | ID  | true | request.params?.["preliminaryMeetingId"] |
**preliminaryMeetingId** : This id paremeter is used to query the required data object.



**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/preliminarymeetings/:preliminaryMeetingId**
```js
  axios({
    method: 'GET',
    url: `/v1/preliminarymeetings/${preliminaryMeetingId}`,
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "preliminaryMeeting",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"preliminaryMeeting": {
		"id": "ID",
		"coursePackId": "ID",
		"studentId": "ID",
		"scheduledDatetime": "Date",
		"tutorDecision": "Enum",
		"tutorDecision_idx": "Integer",
		"comments": "String",
		"meetingLink": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `List Preliminarymeetings` API
**[Default list API]** — This is the designated default `list` API for the `preliminaryMeeting` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Tutor can list all meetings for their courses; students see their own; admin sees all.


**Rest Route**

The `listPreliminaryMeetings` API REST controller can be triggered via the following route:

`/v1/preliminarymeetings`


**Rest Request Parameters**
The `listPreliminaryMeetings` api has got no request parameters.    




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/preliminarymeetings**
```js
  axios({
    method: 'GET',
    url: '/v1/preliminarymeetings',
    data: {
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "preliminaryMeetings",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"preliminaryMeetings": [
		{
			"id": "ID",
			"coursePackId": "ID",
			"studentId": "ID",
			"scheduledDatetime": "Date",
			"tutorDecision": "Enum",
			"tutorDecision_idx": "Integer",
			"comments": "String",
			"meetingLink": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```



**After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.**


