Add general user collaboration requests
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled

هذا الالتزام موجود في:
boutmoun123
2026-06-10 15:47:36 +03:00
الأصل e74bc757ac
التزام bd2e676e89

عرض الملف

@@ -2840,6 +2840,46 @@
}
]
},
{
"name": "Create General Collaboration Request",
"request": {
"method": "POST",
"url": "{{baseUrl}}/users/{{targetUserId}}/collaboration-requests",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collaborationType\": \"{{collaborationType}}\",\n \"message\": \"{{collaborationMessage}}\",\n \"attachmentUrl\": \"{{collaborationAttachmentUrl}}\",\n \"attachmentType\": \"{{collaborationAttachmentType}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"pm.test('Status is 200 or 201', function () { pm.expect([200, 201]).to.include(pm.response.code); });",
"const json = pm.response.json();",
"pm.expect(json).to.have.property('request');",
"pm.environment.set('collaborationRequestId', json.request._id || json.request.id);",
"pm.test('General collaboration request has no post', function () {",
" pm.expect(json.request.postId === null || typeof json.request.postId === 'undefined').to.equal(true);",
" pm.expect(json.request).to.have.property('status', 'pending');",
"});"
]
}
}
]
},
{
"name": "List My Collaboration Requests",
"request": {
@@ -2872,6 +2912,104 @@
}
]
},
{
"name": "List Received Collaboration Requests",
"request": {
"method": "GET",
"url": "{{baseUrl}}/collaboration-requests/received?status={{collaborationRequestStatus}}&page=1&limit=20",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
]
},
"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('items');",
"pm.expect(json).to.have.property('pagination');",
"if (json.items.length) {",
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
" pm.expect(json.items[0]).to.have.property('status');",
" pm.expect(json.items[0]).to.have.property('requesterId');",
" pm.expect(json.items[0]).to.have.property('targetUserId');",
" pm.expect(json.items[0]).to.have.property('postId');",
"}"
]
}
}
]
},
{
"name": "List Sent Collaboration Requests",
"request": {
"method": "GET",
"url": "{{baseUrl}}/collaboration-requests/sent?status={{collaborationRequestStatus}}&page=1&limit=20",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
]
},
"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('items');",
"pm.expect(json).to.have.property('pagination');",
"if (json.items.length) {",
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
" pm.expect(json.items[0]).to.have.property('status');",
" pm.expect(json.items[0]).to.have.property('requesterId');",
" pm.expect(json.items[0]).to.have.property('targetUserId');",
" pm.expect(json.items[0]).to.have.property('postId');",
"}"
]
}
}
]
},
{
"name": "Get Collaboration Request Details",
"request": {
"method": "GET",
"url": "{{baseUrl}}/collaboration-requests/{{collaborationRequestId}}",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
]
},
"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('request');",
"pm.expect(json.request).to.have.property('status');",
"pm.expect(json.request).to.have.property('requesterId');",
"pm.expect(json.request).to.have.property('targetUserId');",
"pm.expect(json.request).to.have.property('postId');"
]
}
}
]
},
{
"name": "Approve Collaboration Request",
"request": {
@@ -2925,6 +3063,34 @@
}
}
]
},
{
"name": "Cancel Collaboration Request",
"request": {
"method": "PATCH",
"url": "{{baseUrl}}/collaboration-requests/{{collaborationRequestId}}/cancel",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
]
},
"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('cancelled', true);",
"pm.expect(json).to.have.property('request');",
"pm.expect(json.request).to.have.property('status', 'cancelled');"
]
}
}
]
}
]
},
@@ -5609,6 +5775,117 @@
}
]
},
{
"name": "Music World",
"item": [
{
"name": "Get Music World Config",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"url": "{{baseUrl}}/music-world",
"description": "Arabic-friendly static screen metadata and optional shortcut cards. The main Instagram-like grid should use Music World Explore Grid."
},
"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('title', '???? ????????');",
"pm.expect(json).to.have.property('searchPlaceholder');",
"pm.expect(json.cards).to.be.an('array');",
"pm.expect(json.sections).to.be.an('array');"
]
}
}
]
},
{
"name": "Music World Explore Grid",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"url": "{{baseUrl}}/music-world/explore?page=1&limit=20&cursor={{feedCursor}}",
"description": "Main Flutter Music World grid. Uses real feed explore posts and maps them to displayUrl/thumbnailUrl for Instagram-like explore UI."
},
"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.items).to.be.an('array');",
"pm.expect(json).to.have.property('pagination');",
"pm.expect(json.pagination).to.have.property('hasNextPage');",
"if ((json.items || []).length) {",
" const item = json.items[0];",
" pm.expect(item).to.have.property('id');",
" pm.expect(item).to.have.property('postType');",
" pm.expect(item).to.have.property('thumbnailUrl');",
" pm.expect(item).to.have.property('displayUrl');",
" pm.expect(item).to.have.property('media');",
" pm.expect(item).to.have.property('author');",
" pm.expect(item).to.have.property('engagement');",
" pm.expect(item).to.have.property('isLiked');",
" pm.expect(item).to.have.property('isSaved');",
"}"
]
}
}
]
},
{
"name": "Music World Search Posts",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"url": "{{baseUrl}}/music-world/search?q={{searchQuery}}&page=1&limit={{searchLimit}}",
"description": "Search bar endpoint for Music World. Searches real posts/media, not static categories."
},
"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.items).to.be.an('array');",
"pm.expect(json).to.have.property('pagination');",
"if ((json.items || []).length) {",
" const item = json.items[0];",
" pm.expect(item).to.have.property('id');",
" pm.expect(item).to.have.property('postType');",
" pm.expect(item).to.have.property('displayUrl');",
" pm.expect(item).to.have.property('author');",
"}"
]
}
}
]
}
]
},
{
"name": "Smoke",
"item": [
@@ -7371,6 +7648,11 @@
"value": "",
"type": "string"
},
{
"key": "collaborationRequestStatus",
"value": "pending",
"type": "string"
},
{
"key": "fcmToken",
"value": "postman-fcm-token",
@@ -7442,4 +7724,4 @@
"value": "{{accessToken}}"
}
]
}
}