Skip to content

Category menus

Category menus are a way the system has to group different menus. This are, basically, just logical divisions that can be used to show the information in different ways

Definition and purpose of Menu Categories within the system.
Section titled “Definition and purpose of Menu Categories within the system.”

Menu categories are a system entity. Their purpose is to logically group menus to be shown in the app.

First create a category menu, then add or create the menus that will be grouped, and lastly, assign the roles that will have access to the category.

Functional description of how these categories are used.
Section titled “Functional description of how these categories are used.”

These categories are used to shown different entities that could be related together. Ej: a category “Galaxy” could have the menus “Planets” and “Stars”

The backend allows to Create, Read, Update and Delete category menus. It also allows for categories to be related with roles and menus.

Detailed list of endpoints used for the CRUD operations of Menu Categories:

POST /api/v1/category-menus:

Request Body

{
"roleIds": [
1
],
"name": "test",
"visible": true
}
  • roleIds: List of roles to will be able to see the category menu
  • name: name of the category menu
  • visible: Visibility of the category menu. Category menus can be set as "visible": true to be seen, or "visible": false to be hidden. responses:
{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
GET /api/v1/category-menus:

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
GET /api/v1/category-menus/paginated:

parameters:

NameTypeFromDescription
limitnumberquerylimit on pagination
Pagenumberquerypage to query
namestringqueryname of the category menu (Optional filter)

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
GET /api/v1/category-menus/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
PUT /api/v1/category-menus/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

requestBody:

{
"name": "test",
"visible": true
}

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
DELETE /api/v1/category-menus/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Category 1",
"visible": true,
"roles": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"menus": ["string"]
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}

What other features are they integrated with?

Section titled “What other features are they integrated with?”

Category menus are related with menus (which they group) and roles (which control access to the category). Menus are assigned on the menu endpoints, while roles are managed as follows:

GET /api/v1/category-menus/roles/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

responses:

{
"error": false,
"status": 200,
"message": "string",
"errors": [
{}
],
"data": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
POST /api/v1/category-menus/roles/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

requestBody:

{
"roleIds": [1]
}
  • roleIds: list of roles to be assigned responses:
{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}
DELETE /api/v1/category-menus/roles/{id}:

parameters:

NameTypeFromDescription
idstringpathid of the category menu

requestBody:

{
"roleIds": [1]
}
  • roleIds: list of roles to be deleted responses:
{
"error": false,
"status": 200,
"message": "string",
"errors": [{}],
"data": [
{
"id": "1",
"name": "Administrador",
"dashboardCustomQuery": "2"
}
],
"pagination": {
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 0,
"nextPage": 0,
"recordsTotal": 0,
"currentPage": 0,
"startIndex": 0,
"numPages": 0,
"limit": 0
}
}