Category menus
Category menus
Section titled “Category menus”What are they?
Section titled “What are they?”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.
How are they used?
Section titled “How are they used?”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”
Expected behavior from the backend.
Section titled “Expected behavior from the backend.”The backend allows to Create, Read, Update and Delete category menus. It also allows for categories to be related with roles and menus.
Which endpoints are used?
Section titled “Which endpoints are used?”Detailed list of endpoints used for the CRUD operations of Menu Categories:
Create a category menu
Section titled “Create a category menu”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 menuname: name of the category menuvisible: Visibility of the category menu. Category menus can be set as"visible": trueto be seen, or"visible": falseto 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 categories
Section titled “Get categories”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 Categories paginated
Section titled “Get Categories paginated”GET /api/v1/category-menus/paginated:parameters:
| Name | Type | From | Description |
|---|---|---|---|
limit | number | query | limit on pagination |
Page | number | query | page to query |
name | string | query | name 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 a category
Section titled “Get a category”GET /api/v1/category-menus/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 }}Update category
Section titled “Update category”PUT /api/v1/category-menus/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 category
Section titled “Delete category”DELETE /api/v1/category-menus/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 roles from category menus
Section titled “Get roles from category menus”GET /api/v1/category-menus/roles/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 }}Assign multiple roles from category menus
Section titled “Assign multiple roles from category menus”POST /api/v1/category-menus/roles/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 roles from category menus
Section titled “Delete roles from category menus”DELETE /api/v1/category-menus/roles/{id}:parameters:
| Name | Type | From | Description |
|---|---|---|---|
id | string | path | id 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 }}