

# **TUTORHUB**

**FRONTEND GUIDE FOR AI CODING AGENTS - PART 11 - PlatformAdmin 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 platformAdmin

## Service Access

PlatformAdmin service management is handled through service specific base urls.

PlatformAdmin  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 platformAdmin service, the base URLs are:

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


## Scope

**PlatformAdmin Service Description**



PlatformAdmin 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.  


**`adminIssue` Data Object**: 

**`adminModerationAction` Data Object**: Action performed by an admin to moderate user, coursePack, profile, or material. All admin actions logged for audit trail. Only admins can create.

**`adminAnalyticsReport` Data Object**: Stores generated analytics/reporting URLs/metadata for admin dashboard access. Reports are generated by backend tasks/edge (future), but listing is for download/view.



## 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"
}
```


## AdminIssue Data Object





### AdminIssue Data Object Properties

AdminIssue 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 |
|----------|------|---------|----------|--------|-------------|
| `reportedBy` | ID | false | Yes | No | User who filed the issue (student or tutor). |
| `reportedUserId` | ID | false | No | No | (Optional) User being complained about |
| `coursePackId` | ID | false | No | No | (Optional) ID of the related coursePack, if content/pack is complained about |
| `description` | Text | false | Yes | No | Long text/body of the complaint/issue. |
| `issueType` | Enum | false | Yes | No | Type of complaint (user, content, or other). |
| `status` | Enum | false | Yes | No | Issue investigation status (open/investigating/resolved/dismissed). |
| `adminNote` | String | false | No | No | Internal/admin note for progress or findings (not visible to original user). |
| `resolution` | Enum | false | No | No | Resolution outcome chosen by admin when closing the issue. |
* 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.

- **issueType**: [user, content, other]

- **status**: [open, investigating, resolved, dismissed]

- **resolution**: [dismissed, warned, courseEditRequired, courseRemoved, userSuspended, userBanned, acknowledged]


### Relation Properties

`reportedBy` `reportedUserId` `coursePackId`

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.


- **reportedBy**: 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

- **reportedUserId**: 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

- **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: No



## AdminModerationAction Data Object

Action performed by an admin to moderate user, coursePack, profile, or material. All admin actions logged for audit trail. Only admins can create.

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

Displays admin content/user moderation events in the admin dashboard. Lists should show each action (targetType, admin, reason, date), target details, and allow filtering by actionType/status/date.


### AdminModerationAction Data Object Properties

AdminModerationAction 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 |
|----------|------|---------|----------|--------|-------------|
| `adminId` | ID | false | Yes | No | Admin performing moderation action. |
| `targetType` | Enum | false | Yes | No | Moderation target type (user/coursePack/profile/material). |
| `targetId` | ID | false | Yes | No | ID of moderation target object (userId, coursePackId, etc). |
| `actionType` | Enum | false | Yes | No | Type of moderation action (suspend, ban, edit, remove, approve, warn). |
| `actionReason` | String | false | Yes | No | Reason for moderation action, as recorded by the admin. |
| `actionDate` | Date | false | Yes | No | Datetime when the action took place. |
| `targetUserId` | ID | false | Yes | No | UserId of the person affected by the moderation action. For user moderation: the user being moderated. For content moderation: the tutor who owns the content. |
* 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.

- **targetType**: [user, coursePack, profile, material]

- **actionType**: [suspend, ban, edit, remove, approve, warn]


### Relation Properties

`adminId` `targetUserId`

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.


- **adminId**: 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

- **targetUserId**: 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



## AdminAnalyticsReport Data Object

Stores generated analytics/reporting URLs/metadata for admin dashboard access. Reports are generated by backend tasks/edge (future), but listing is for download/view.

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

Internal; used as a registry/audit of analytics report generations. List in admin dashboard with download access by reportType/date. Future versions may trigger report generation via edge controllers.


### AdminAnalyticsReport Data Object Properties

AdminAnalyticsReport 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 |
|----------|------|---------|----------|--------|-------------|
| `reportType` | String | false | Yes | No | Type of the analytics report (enrollments, revenue, complaints, etc). |
| `filterParams` | String | false | No | No | Filter params as stringified JSON for reporting input. |
| `generatedAt` | Date | false | Yes | No | Date/time report was generated. |
| `reportUrl` | String | false | Yes | No | Accessible URL where generated report is stored (PDF, CSV, etc). |
* 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.







## 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.

### AdminIssue Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createAdminIssue` | `/v1/adminissues` | Yes |
| Update | `updateAdminIssue` | `/v1/adminissues/:adminIssueId` | Yes |
| Delete | _none_ | - | Auto |
| Get | `getAdminIssue` | `/v1/adminissues/:adminIssueId` | Yes |
| List | `listAdminIssues` | `/v1/adminissues` | Yes |
### AdminModerationAction Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createAdminModerationAction` | `/v1/adminmoderationactions` | Yes |
| Update | _none_ | - | Auto |
| Delete | _none_ | - | Auto |
| Get | `getAdminModerationAction` | `/v1/adminmoderationactions/:adminModerationActionId` | Yes |
| List | `listAdminModerationActions` | `/v1/adminmoderationactions` | Yes |
### AdminAnalyticsReport Default APIs

| Operation | API Name | Route | Explicitly Set |
|-----------|----------|-------|----------------|
| Create | `createAdminAnalyticsReport` | `/v1/adminanalyticsreports` | Yes |
| Update | _none_ | - | Auto |
| Delete | _none_ | - | Auto |
| Get | `getAdminAnalyticsReport` | `/v1/adminanalyticsreports/:adminAnalyticsReportId` | Yes |
| List | `listAdminAnalyticsReports` | `/v1/adminanalyticsreports` | 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 Adminissue` API
**[Default create API]** — This is the designated default `create` API for the `adminIssue` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Student or tutor files a new complaint/issue. Admin receives for review/investigation. Only admins can update or alter status; creator can get their own.


**Rest Route**

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

`/v1/adminissues`


**Rest Request Parameters**


The `createAdminIssue` api has got 8 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| reportedBy  | ID  | true | request.body?.["reportedBy"] |
| reportedUserId  | ID  | false | request.body?.["reportedUserId"] |
| coursePackId  | ID  | false | request.body?.["coursePackId"] |
| description  | Text  | true | request.body?.["description"] |
| issueType  | Enum  | true | request.body?.["issueType"] |
| status  | Enum  | true | request.body?.["status"] |
| adminNote  | String  | false | request.body?.["adminNote"] |
| resolution  | Enum  | false | request.body?.["resolution"] |
**reportedBy** : User who filed the issue (student or tutor).
**reportedUserId** : (Optional) User being complained about
**coursePackId** : (Optional) ID of the related coursePack, if content/pack is complained about
**description** : Long text/body of the complaint/issue.
**issueType** : Type of complaint (user, content, or other).
**status** : Issue investigation status (open/investigating/resolved/dismissed).
**adminNote** : Internal/admin note for progress or findings (not visible to original user).
**resolution** : Resolution outcome chosen by admin when closing the issue.



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/adminissues**
```js
  axios({
    method: 'POST',
    url: '/v1/adminissues',
    data: {
            reportedBy:"ID",  
            reportedUserId:"ID",  
            coursePackId:"ID",  
            description:"Text",  
            issueType:"Enum",  
            status:"Enum",  
            adminNote:"String",  
            resolution:"Enum",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminIssue",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"adminIssue": {
		"id": "ID",
		"reportedBy": "ID",
		"reportedUserId": "ID",
		"coursePackId": "ID",
		"description": "Text",
		"issueType": "Enum",
		"issueType_idx": "Integer",
		"status": "Enum",
		"status_idx": "Integer",
		"adminNote": "String",
		"resolution": "Enum",
		"resolution_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Update Adminissue` API
**[Default update API]** — This is the designated default `update` API for the `adminIssue` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Admin investigates/updates an issue: change status, add internal note, resolve/dismiss. Strictly admin-only.


**Rest Route**

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

`/v1/adminissues/:adminIssueId`


**Rest Request Parameters**


The `updateAdminIssue` api has got 8 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| adminIssueId  | ID  | true | request.params?.["adminIssueId"] |
| reportedUserId  | ID  | false | request.body?.["reportedUserId"] |
| coursePackId  | ID  | false | request.body?.["coursePackId"] |
| description  | Text  | false | request.body?.["description"] |
| issueType  | Enum  | false | request.body?.["issueType"] |
| status  | Enum  | false | request.body?.["status"] |
| adminNote  | String  | false | request.body?.["adminNote"] |
| resolution  | Enum  | false | request.body?.["resolution"] |
**adminIssueId** : This id paremeter is used to select the required data object that will be updated
**reportedUserId** : (Optional) User being complained about
**coursePackId** : (Optional) ID of the related coursePack, if content/pack is complained about
**description** : Long text/body of the complaint/issue.
**issueType** : Type of complaint (user, content, or other).
**status** : Issue investigation status (open/investigating/resolved/dismissed).
**adminNote** : Internal/admin note for progress or findings (not visible to original user).
**resolution** : Resolution outcome chosen by admin when closing the issue.



**REST Request**
To access the api you can use the **REST** controller with the path **PATCH  /v1/adminissues/:adminIssueId**
```js
  axios({
    method: 'PATCH',
    url: `/v1/adminissues/${adminIssueId}`,
    data: {
            reportedUserId:"ID",  
            coursePackId:"ID",  
            description:"Text",  
            issueType:"Enum",  
            status:"Enum",  
            adminNote:"String",  
            resolution:"Enum",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminIssue",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"adminIssue": {
		"id": "ID",
		"reportedBy": "ID",
		"reportedUserId": "ID",
		"coursePackId": "ID",
		"description": "Text",
		"issueType": "Enum",
		"issueType_idx": "Integer",
		"status": "Enum",
		"status_idx": "Integer",
		"adminNote": "String",
		"resolution": "Enum",
		"resolution_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"reporterUser": {}
}
```


### `Get Adminissue` API
**[Default get API]** — This is the designated default `get` API for the `adminIssue` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Fetches a single issue by ID. Admins may get any; creator may get/view their own for status updates.


**Rest Route**

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

`/v1/adminissues/:adminIssueId`


**Rest Request Parameters**


The `getAdminIssue` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| adminIssueId  | ID  | true | request.params?.["adminIssueId"] |
**adminIssueId** : 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/adminissues/:adminIssueId**
```js
  axios({
    method: 'GET',
    url: `/v1/adminissues/${adminIssueId}`,
    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": "adminIssue",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"adminIssue": {
		"reporter": {
			"email": "String",
			"fullname": "String"
		},
		"reportedUser": {
			"email": "String",
			"fullname": "String"
		},
		"coursePack": {
			"tutorProfileId": "ID",
			"title": "String"
		},
		"isActive": true
	}
}
```


### `List Adminissues` API
**[Default list API]** — This is the designated default `list` API for the `adminIssue` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
List issues with filters for admin dashboard: by status/type/target. Admin only.


**Rest Route**

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

`/v1/adminissues`


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




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/adminissues**
```js
  axios({
    method: 'GET',
    url: '/v1/adminissues',
    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": "adminIssues",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"adminIssues": [
		{
			"reporter": [
				{
					"email": "String",
					"fullname": "String",
					"roleId": "String"
				},
				{},
				{}
			],
			"reportedUser": [
				{
					"email": "String",
					"fullname": "String",
					"roleId": "String"
				},
				{},
				{}
			],
			"coursePack": [
				{
					"tutorProfileId": "ID",
					"title": "String"
				},
				{},
				{}
			],
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `Create Adminmoderationaction` API
**[Default create API]** — This is the designated default `create` API for the `adminModerationAction` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Admin records a moderation action against a user/object. Admin only. Write-side audit log for all moderator events.


**Rest Route**

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

`/v1/adminmoderationactions`


**Rest Request Parameters**


The `createAdminModerationAction` api has got 7 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| adminId  | ID  | true | request.body?.["adminId"] |
| targetType  | Enum  | true | request.body?.["targetType"] |
| targetId  | ID  | true | request.body?.["targetId"] |
| actionType  | Enum  | true | request.body?.["actionType"] |
| actionReason  | String  | true | request.body?.["actionReason"] |
| actionDate  | Date  | true | request.body?.["actionDate"] |
| targetUserId  | ID  | true | request.body?.["targetUserId"] |
**adminId** : Admin performing moderation action.
**targetType** : Moderation target type (user/coursePack/profile/material).
**targetId** : ID of moderation target object (userId, coursePackId, etc).
**actionType** : Type of moderation action (suspend, ban, edit, remove, approve, warn).
**actionReason** : Reason for moderation action, as recorded by the admin.
**actionDate** : Datetime when the action took place.
**targetUserId** : UserId of the person affected by the moderation action. For user moderation: the user being moderated. For content moderation: the tutor who owns the content.



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/adminmoderationactions**
```js
  axios({
    method: 'POST',
    url: '/v1/adminmoderationactions',
    data: {
            adminId:"ID",  
            targetType:"Enum",  
            targetId:"ID",  
            actionType:"Enum",  
            actionReason:"String",  
            actionDate:"Date",  
            targetUserId:"ID",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminModerationAction",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"adminModerationAction": {
		"id": "ID",
		"adminId": "ID",
		"targetType": "Enum",
		"targetType_idx": "Integer",
		"targetId": "ID",
		"actionType": "Enum",
		"actionType_idx": "Integer",
		"actionReason": "String",
		"actionDate": "Date",
		"targetUserId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"targetUser": {}
}
```


### `Get Adminmoderationaction` API
**[Default get API]** — This is the designated default `get` API for the `adminModerationAction` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Get one moderation action. Admin only.


**Rest Route**

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

`/v1/adminmoderationactions/:adminModerationActionId`


**Rest Request Parameters**


The `getAdminModerationAction` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| adminModerationActionId  | ID  | true | request.params?.["adminModerationActionId"] |
**adminModerationActionId** : 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/adminmoderationactions/:adminModerationActionId**
```js
  axios({
    method: 'GET',
    url: `/v1/adminmoderationactions/${adminModerationActionId}`,
    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": "adminModerationAction",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"adminModerationAction": {
		"admin": {
			"email": "String",
			"fullname": "String"
		},
		"isActive": true
	}
}
```


### `List Adminmoderationactions` API
**[Default list API]** — This is the designated default `list` API for the `adminModerationAction` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
List all admin moderation actions, filterable by actionType/targetType/date. For admin dashboard audit log.


**Rest Route**

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

`/v1/adminmoderationactions`


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




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/adminmoderationactions**
```js
  axios({
    method: 'GET',
    url: '/v1/adminmoderationactions',
    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": "adminModerationActions",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"adminModerationActions": [
		{
			"admin": [
				{
					"email": "String",
					"fullname": "String"
				},
				{},
				{}
			],
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `Create Adminanalyticsreport` API
**[Default create API]** — This is the designated default `create` API for the `adminAnalyticsReport` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Create record for a new analytics report (usually admin-triggered on dashboard, actual report process may be async via edge controller in future). Admin-only; records metadata and download URL of available report.


**Rest Route**

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

`/v1/adminanalyticsreports`


**Rest Request Parameters**


The `createAdminAnalyticsReport` api has got 4 regular request parameters  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| reportType  | String  | true | request.body?.["reportType"] |
| filterParams  | String  | false | request.body?.["filterParams"] |
| generatedAt  | Date  | true | request.body?.["generatedAt"] |
| reportUrl  | String  | true | request.body?.["reportUrl"] |
**reportType** : Type of the analytics report (enrollments, revenue, complaints, etc).
**filterParams** : Filter params as stringified JSON for reporting input.
**generatedAt** : Date/time report was generated.
**reportUrl** : Accessible URL where generated report is stored (PDF, CSV, etc).



**REST Request**
To access the api you can use the **REST** controller with the path **POST  /v1/adminanalyticsreports**
```js
  axios({
    method: 'POST',
    url: '/v1/adminanalyticsreports',
    data: {
            reportType:"String",  
            filterParams:"String",  
            generatedAt:"Date",  
            reportUrl:"String",  
    
    },
    params: {
    
        }
  });
```   
**REST Response**


```json
{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminAnalyticsReport",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"adminAnalyticsReport": {
		"id": "ID",
		"reportType": "String",
		"filterParams": "String",
		"generatedAt": "Date",
		"reportUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}
```


### `Get Adminanalyticsreport` API
**[Default get API]** — This is the designated default `get` API for the `adminAnalyticsReport` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
Get one analytics report record for download from admin dashboard. Admin only.


**Rest Route**

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

`/v1/adminanalyticsreports/:adminAnalyticsReportId`


**Rest Request Parameters**


The `getAdminAnalyticsReport` api has got 1 regular request parameter  

| Parameter              | Type                   | Required | Population                   |
| ---------------------- | ---------------------- | -------- | ---------------------------- |
| adminAnalyticsReportId  | ID  | true | request.params?.["adminAnalyticsReportId"] |
**adminAnalyticsReportId** : 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/adminanalyticsreports/:adminAnalyticsReportId**
```js
  axios({
    method: 'GET',
    url: `/v1/adminanalyticsreports/${adminAnalyticsReportId}`,
    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": "adminAnalyticsReport",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"adminAnalyticsReport": {
		"isActive": true
	}
}
```


### `List Adminanalyticsreports` API
**[Default list API]** — This is the designated default `list` API for the `adminAnalyticsReport` data object. Frontend generators and AI agents should use this API for standard CRUD operations.
List all analytics reports for admin dashboard access (download/view). Admin only.


**Rest Route**

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

`/v1/adminanalyticsreports`


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




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/adminanalyticsreports**
```js
  axios({
    method: 'GET',
    url: '/v1/adminanalyticsreports',
    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": "adminAnalyticsReports",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"adminAnalyticsReports": [
		{
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}
```


### `List Myissues` API
Students and tutors list their own reported issues. Ownership check ensures users only see their own reports.


**Rest Route**

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

`/v1/myissues`


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




**REST Request**
To access the api you can use the **REST** controller with the path **GET  /v1/myissues**
```js
  axios({
    method: 'GET',
    url: '/v1/myissues',
    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": "adminIssues",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"adminIssues": [
		{
			"reportedUser": [
				{
					"email": "String",
					"fullname": "String"
				},
				{},
				{}
			],
			"coursePack": [
				{
					"title": "String"
				},
				{},
				{}
			],
			"isActive": true
		},
		{},
		{}
	],
	"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.**


