feat: add notification badge counts
هذا الالتزام موجود في:
@@ -1258,6 +1258,235 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Get Unread Notifications Count By Category",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category={{notificationCategory}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Grouped Unread Notification Counts",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-counts"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('total');",
|
||||
"pm.expect(json).to.have.property('interactions');",
|
||||
"pm.expect(json).to.have.property('messages');",
|
||||
"pm.expect(json).to.have.property('follows');",
|
||||
"pm.expect(json).to.have.property('followRequests');",
|
||||
"pm.expect(json).to.have.property('collaboration');",
|
||||
"pm.expect(json).to.have.property('system');",
|
||||
"pm.environment.set('notificationUnreadCount', json.total);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Interactions",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=interactions"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'interactions');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Messages",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=messages"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'messages');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Follows",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=follows"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'follows');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Follow Requests",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=follow_requests"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'follow_requests');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Collaboration",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=collaboration"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'collaboration');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - System",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=system"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'system');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2766,6 +2995,223 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Support Admin",
|
||||
"item": [
|
||||
{
|
||||
"name": "Admin List Support Tickets",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets?page=1&limit=20&status={{supportStatus}}&category={{supportCategory}}&priority={{supportPriority}}&sortOrder={{listSortOrder}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"if (json.items && json.items[0]) pm.environment.set('supportTicketId', json.items[0]._id || json.items[0].id);",
|
||||
"pm.expect(json.items).to.be.an('array');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Get Support Ticket",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.ticket).to.exist;",
|
||||
"pm.expect(json.ticket.user).to.exist;",
|
||||
"pm.expect(json.messages).to.be.an('array');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Reply To Ticket",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/messages",
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "message",
|
||||
"value": "{{supportReplyMessage}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"const item = json.item || (json.messages && json.messages[0]);",
|
||||
"if (item) pm.environment.set('supportMessageId', item._id || item.id);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Reply With Image",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/messages",
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "message",
|
||||
"value": "{{supportReplyMessage}}",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"key": "image",
|
||||
"type": "file",
|
||||
"src": "{{supportImagePath}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"const item = json.item || (json.messages && json.messages[0]);",
|
||||
"if (item) pm.environment.set('supportMessageId', item._id || item.id);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Update Support Ticket Status",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/status",
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"status\": \"{{supportStatus}}\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.item).to.have.property('status');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Assign Support Ticket",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/assign",
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"adminId\": \"{{supportAdminId}}\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.item).to.exist;"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Audit",
|
||||
"item": [
|
||||
@@ -3935,6 +4381,235 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Get Unread Notifications Count By Category",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category={{notificationCategory}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Get Grouped Unread Notification Counts",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-counts"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('total');",
|
||||
"pm.expect(json).to.have.property('interactions');",
|
||||
"pm.expect(json).to.have.property('messages');",
|
||||
"pm.expect(json).to.have.property('follows');",
|
||||
"pm.expect(json).to.have.property('followRequests');",
|
||||
"pm.expect(json).to.have.property('collaboration');",
|
||||
"pm.expect(json).to.have.property('system');",
|
||||
"pm.environment.set('notificationUnreadCount', json.total);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Interactions",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=interactions"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'interactions');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Messages",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=messages"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'messages');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Follows",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=follows"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'follows');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Follow Requests",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=follow_requests"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'follow_requests');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - Collaboration",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=collaboration"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'collaboration');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Badge Count - System",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{accessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/notifications/unread-count?category=system"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('unreadCount');",
|
||||
"pm.expect(json).to.have.property('category', 'system');",
|
||||
"pm.environment.set('notificationUnreadCount', json.unreadCount);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Mark Notification Read",
|
||||
"request": {
|
||||
@@ -4009,6 +4684,223 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Support Tickets",
|
||||
"item": [
|
||||
{
|
||||
"name": "Admin List Support Tickets",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets?page=1&limit=20&status={{supportStatus}}&category={{supportCategory}}&priority={{supportPriority}}&sortOrder={{listSortOrder}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"if (json.items && json.items[0]) pm.environment.set('supportTicketId', json.items[0]._id || json.items[0].id);",
|
||||
"pm.expect(json.items).to.be.an('array');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Get Support Ticket",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}"
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.ticket).to.exist;",
|
||||
"pm.expect(json.ticket.user).to.exist;",
|
||||
"pm.expect(json.messages).to.be.an('array');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Reply To Ticket",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/messages",
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "message",
|
||||
"value": "{{supportReplyMessage}}",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"const item = json.item || (json.messages && json.messages[0]);",
|
||||
"if (item) pm.environment.set('supportMessageId', item._id || item.id);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Reply With Image",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/messages",
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "message",
|
||||
"value": "{{supportReplyMessage}}",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"key": "image",
|
||||
"type": "file",
|
||||
"src": "{{supportImagePath}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"const item = json.item || (json.messages && json.messages[0]);",
|
||||
"if (item) pm.environment.set('supportMessageId', item._id || item.id);"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Update Support Ticket Status",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/status",
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"status\": \"{{supportStatus}}\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.item).to.have.property('status');"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Admin Assign Support Ticket",
|
||||
"request": {
|
||||
"method": "PATCH",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer {{superAdminAccessToken}}"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"url": "{{baseUrl}}/support/admin/tickets/{{supportTicketId}}/assign",
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"adminId\": \"{{supportAdminId}}\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"pm.test('Request succeeded', function () { pm.expect(pm.response.code).to.be.oneOf([200, 201]); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json.item).to.exist;"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Collaboration Requests",
|
||||
"item": [
|
||||
@@ -4640,6 +5532,50 @@
|
||||
{
|
||||
"key": "collaborationAttachmentType",
|
||||
"value": "audio"
|
||||
},
|
||||
{
|
||||
"key": "supportTicketId",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "supportMessageId",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "supportSubject",
|
||||
"value": "????? ?? ????? ??? ??? MP3"
|
||||
},
|
||||
{
|
||||
"key": "supportMessage",
|
||||
"value": "????? ??? ????? ???? ?? ??? ??? ????"
|
||||
},
|
||||
{
|
||||
"key": "supportReplyMessage",
|
||||
"value": "?? ?????? ??????? ????? ??? ???????."
|
||||
},
|
||||
{
|
||||
"key": "supportCategory",
|
||||
"value": "technical"
|
||||
},
|
||||
{
|
||||
"key": "supportPriority",
|
||||
"value": "normal"
|
||||
},
|
||||
{
|
||||
"key": "supportStatus",
|
||||
"value": "in_progress"
|
||||
},
|
||||
{
|
||||
"key": "supportImagePath",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "supportAdminId",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "notificationCategory",
|
||||
"value": "interactions"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم