@docbrasil/api-systemmanager 1.1.63 → 1.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/doc/api.md CHANGED
@@ -2260,12 +2260,14 @@ Class for task, permission user
2260
2260
 
2261
2261
  * [Kanban](#Kanban)
2262
2262
  * [.get(params, session)](#Kanban+get) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>Array</code> \| <code>string</code> \| <code>string</code> \| <code>boolean</code> \| <code>Array</code> \| <code>Array</code>
2263
+ * [.update(params, session)](#Kanban+update) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2263
2264
  * [.updateTaskOrder(params, session)](#Kanban+updateTaskOrder) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2264
2265
  * [.updateTasksOrder(params, session)](#Kanban+updateTasksOrder) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2265
2266
  * [.updateTaskStatus(params, session)](#Kanban+updateTaskStatus) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2266
2267
  * [.addTaskTag(params, session)](#Kanban+addTaskTag) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2267
2268
  * [.removeTaskTag(params, session)](#Kanban+removeTaskTag) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2268
2269
  * [.updateStatusList(params, session)](#Kanban+updateStatusList) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2270
+ * [.startTask(params, session)](#Kanban+startTask) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code> \| <code>string</code>
2269
2271
 
2270
2272
  <a name="Kanban+get"></a>
2271
2273
 
@@ -2321,6 +2323,52 @@ Expected response structure:
2321
2323
  ]
2322
2324
  }
2323
2325
  ```
2326
+ <a name="Kanban+update"></a>
2327
+
2328
+ ### kanban.update(params, session) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2329
+ Updates the tasks order and status
2330
+
2331
+ **Kind**: instance method of [<code>Kanban</code>](#Kanban)
2332
+ **Returns**: <code>promise</code> - Promise that resolves to operation status<code>Object</code> - returns.data - The response data containing:<code>boolean</code> - returns.data.success - Indicates if the operation was successful<code>string</code> - [returns.data.error] - Error message if operation failed
2333
+ **Access**: public
2334
+ **Author**: Myndware <augusto.pissarra@myndware.com>
2335
+
2336
+ | Param | Type | Description |
2337
+ | --- | --- | --- |
2338
+ | params | <code>Object</code> | Parameters object |
2339
+ | params.orgId | <code>string</code> | Organization id (_id database) |
2340
+ | params.tasks | <code>Array</code> | Array of task objects containing taskId and order |
2341
+ | params.tasks[].taskId | <code>string</code> | The unique identifier of the task to update |
2342
+ | params.tasks[].order | <code>number</code> | The new order position for the task |
2343
+ | params.tasks[].status | <code>string</code> | The status of the task |
2344
+ | session | <code>string</code> | Session, token JWT |
2345
+
2346
+ **Example**
2347
+ ```js
2348
+ const API = require('@docbrasil/api-systemmanager');
2349
+ const api = new API();
2350
+ const params = {
2351
+ orgId: '55e4a3bd6be6b45210833fae',
2352
+ tasks: [
2353
+ { taskId: '507f1f77bcf86cd799439011', order: 0, status: '507f1f77bcf86cd799439012' },
2354
+ { taskId: '507f1f77bcf86cd799439012', order: 1, status: '507f1f77bcf86cd799439012' },
2355
+ { taskId: '507f1f77bcf86cd799439013', order: 0, status: '507f1f77bcf86cd799439013' }
2356
+ ]
2357
+ };
2358
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2359
+ const result = await api.user.kanban.updateTasksOrder(params, session);
2360
+
2361
+ Expected response structure (success):
2362
+ {
2363
+ success: true
2364
+ }
2365
+
2366
+ Expected response structure (error):
2367
+ {
2368
+ success: false,
2369
+ error: "One or more tasks not found"
2370
+ }
2371
+ ```
2324
2372
  <a name="Kanban+updateTaskOrder"></a>
2325
2373
 
2326
2374
  ### kanban.updateTaskOrder(params, session) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
@@ -2550,6 +2598,7 @@ Updates the status list order for a specific flow in an organization process on
2550
2598
  | params.flowId | <code>string</code> | The id of the organization process step flowId |
2551
2599
  | params.statusList | <code>Array</code> | The status list with new order |
2552
2600
  | params.statusList[ | <code>Object</code> | Status object configuration |
2601
+ | params.statusList[].guid | <code>string</code> | The guid of the status (the id) |
2553
2602
  | params.statusList[].value | <code>string</code> | The title of the status |
2554
2603
  | params.statusList[].expanded | <code>boolean</code> | If the status column is expanded or not |
2555
2604
  | params.statusList[].color | <code>string</code> | The hexadecimal color code for the status |
@@ -2578,6 +2627,54 @@ Expected response structure (success):
2578
2627
  success: true
2579
2628
  }
2580
2629
 
2630
+ Expected response structure (error):
2631
+ {
2632
+ success: false,
2633
+ error: "Organization process not found"
2634
+ }
2635
+ ```
2636
+ <a name="Kanban+startTask"></a>
2637
+
2638
+ ### kanban.startTask(params, session) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code> \| <code>string</code>
2639
+ Starts a new task in the Kanban board for a specific organization process
2640
+
2641
+ **Kind**: instance method of [<code>Kanban</code>](#Kanban)
2642
+ **Returns**: <code>promise</code> - Promise that resolves to operation status<code>Object</code> - returns.data - The response data containing:<code>boolean</code> - returns.data.success - Indicates if the operation was successful<code>string</code> - [returns.data.taskId] - The ID of the newly created task<code>string</code> - [returns.data.error] - Error message if operation failed
2643
+ **Access**: public
2644
+ **Author**: Myndware <augusto.pissarra@myndware.com>
2645
+
2646
+ | Param | Type | Description |
2647
+ | --- | --- | --- |
2648
+ | params | <code>Object</code> | Parameters object |
2649
+ | params.orgId | <code>string</code> | Organization id (_id database) |
2650
+ | params.orgProcessName | <code>string</code> | The name of the organization process |
2651
+ | params.title | <code>string</code> | The title of the new task |
2652
+ | params.status | <code>string</code> | The status id of the new task |
2653
+ | [params.tags] | <code>Array</code> | Array of tag ids for the new task (optional) |
2654
+ | [params.tasks] | <code>Array</code> | The task ids of each task inside the same status (optional) |
2655
+ | session | <code>string</code> | Session, token JWT |
2656
+
2657
+ **Example**
2658
+ ```js
2659
+ const API = require('@docbrasil/api-systemmanager');
2660
+ const api = new API();
2661
+ const params = {
2662
+ orgId: '55e4a3bd6be6b45210833fae',
2663
+ orgProcessName: 'employee-onboarding',
2664
+ title: 'Complete employee documentation',
2665
+ status: '507f1f77bcf86cd799439014',
2666
+ tags: ['507f1f77bcf86cd799439015', '507f1f77bcf86cd799439016'],
2667
+ tasks: ['507f1f77bcf86cd799439011', '507f1f77bcf86cd799439012']
2668
+ };
2669
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2670
+ const result = await api.user.kanban.startTask(params, session);
2671
+
2672
+ Expected response structure (success):
2673
+ {
2674
+ success: true,
2675
+ taskId: '507f1f77bcf86cd799439013'
2676
+ }
2677
+
2581
2678
  Expected response structure (error):
2582
2679
  {
2583
2680
  success: false,