diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 89e8e3ce..87b8f808 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2277,7 +2277,8 @@ definitions: type : array description: The ids of the terms of use to add for the challenge items: - type: number + type: string + format: UUID challengeSettings: type: array items: diff --git a/docs/topcoder-challenge-api.postman_collection.json b/docs/topcoder-challenge-api.postman_collection.json index 6fa6c9a8..270e581f 100644 --- a/docs/topcoder-challenge-api.postman_collection.json +++ b/docs/topcoder-challenge-api.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "4d3dd281-d4f2-4bea-b717-01217809098f", + "_postman_id": "e1bee88b-6d40-4667-b3b7-c6d48c0ffe05", "name": "topcoder-challenge-api", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, @@ -905,6 +905,53 @@ }, "response": [] }, + { + "name": "search challenge setting without parameters", + "event": [ + { + "listen": "test", + "script": { + "id": "1ac29d3f-3e7b-4de4-893c-8d5117b96f9e", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "url": { + "raw": "{{URL}}/challengeSettings", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeSettings" + ] + } + }, + "response": [] + }, { "name": "failure search challenge setting invalid parameters 400", "event": [ @@ -1027,6 +1074,67 @@ }, "response": [] }, + { + "name": "failure search challenge setting with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "45e8dbe3-65f4-4657-a194-7b3c996c0173", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "url": { + "raw": "{{URL}}/challengeSettings?name=-NAME-&page=2&perPage=2", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeSettings" + ], + "query": [ + { + "key": "name", + "value": "-NAME-" + }, + { + "key": "page", + "value": "2" + }, + { + "key": "perPage", + "value": "2" + } + ] + } + }, + "response": [] + }, { "name": "failure search challenge setting without token 401", "event": [ @@ -1508,6 +1616,54 @@ }, "response": [] }, + { + "name": "failure get challenge setting with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "a8943e46-a557-4c4c-9383-dfbdda50070d", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "url": { + "raw": "{{URL}}/challengeSettings/{{SETTINGB_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeSettings", + "{{SETTINGB_ID}}" + ] + } + }, + "response": [] + }, { "name": "failure get challenge setting by user 403", "event": [ @@ -2014,6 +2170,110 @@ }, "response": [] }, + { + "name": "failure update challenge setting with invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "6949e508-47fd-4c66-b51a-f8da8a78879d", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer invalid", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-name-failure\"\n}" + }, + "url": { + "raw": "{{URL}}/challengeSettings/{{SETTINGB_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeSettings", + "{{SETTINGB_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge setting with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "6949e508-47fd-4c66-b51a-f8da8a78879d", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{expire_token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-name-failure\"\n}" + }, + "url": { + "raw": "{{URL}}/challengeSettings/{{SETTINGB_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeSettings", + "{{SETTINGB_ID}}" + ] + } + }, + "response": [] + }, { "name": "failure update challenge setting by user 403", "event": [ @@ -2659,14 +2919,66 @@ "response": [] }, { - "name": "failure create missing parameter 400", + "name": "create without optional properties by admin", "event": [ { "listen": "test", "script": { "id": "986df394-b29e-42a6-83da-592eb3db1442", "exec": [ - "pm.test(\"Status code is 400\", function () {", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TYPEB_ID\", pm.response.json().id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"create-without-optional-properties\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"cwoop\"\n}" + }, + "url": { + "raw": "{{URL}}/challengeTypes", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes" + ] + } + }, + "response": [] + }, + { + "name": "failure create missing parameter name 400", + "event": [ + { + "listen": "test", + "script": { + "id": "986df394-b29e-42a6-83da-592eb3db1442", + "exec": [ + "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", "});" ], @@ -2709,6 +3021,108 @@ }, "response": [] }, + { + "name": "failure create missing parameter isActive 400", + "event": [ + { + "listen": "test", + "script": { + "id": "986df394-b29e-42a6-83da-592eb3db1442", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"description\": \"failure\",\n\t\"name\": \"create-for-400\",\n\t\"abbreviation\": \"cf4\",\n\t\"legacyId\": 123\n}" + }, + "url": { + "raw": "{{URL}}/challengeTypes", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes" + ] + } + }, + "response": [] + }, + { + "name": "failure create missing parameter abbreviation 400", + "event": [ + { + "listen": "test", + "script": { + "id": "986df394-b29e-42a6-83da-592eb3db1442", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"description\": \"failure\",\n\t\"name\": \"create-for-400\",\n\t\"isActive\": false,\n\t\"legacyId\": 123\n}" + }, + "url": { + "raw": "{{URL}}/challengeTypes", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes" + ] + } + }, + "response": [] + }, { "name": "failure create without token 401", "event": [ @@ -2806,6 +3220,57 @@ }, "response": [] }, + { + "name": "failure create with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "986df394-b29e-42a6-83da-592eb3db1442", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"create-by-copilot\",\n\t\"description\": \"test-value\",\n\t\"isActive\": true,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + }, + "url": { + "raw": "{{URL}}/challengeTypes", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes" + ] + } + }, + "response": [] + }, { "name": "failure create via user 403", "event": [ @@ -3185,24 +3650,17 @@ } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "get challenge type", - "item": [ + }, { - "name": "get challenge type 1", + "name": "search challenge types invalid parameter isActive 400", "event": [ { "listen": "test", "script": { - "id": "ca548603-f08a-47d7-a4a8-bb68fdb62b31", + "id": "7e183d38-425d-433b-8487-6c21b9a5795c", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3214,38 +3672,43 @@ "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" } ], "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", + "raw": "{{URL}}/challengeTypes?isActive=test", "host": [ "{{URL}}" ], "path": [ - "challengeTypes", - "{{TYPEA_ID}}" + "challengeTypes" + ], + "query": [ + { + "key": "isActive", + "value": "test" + } ] } }, "response": [] }, { - "name": "get challenge type 2", + "name": "search challenge types invalid parameter legacyId 400", "event": [ { "listen": "test", "script": { - "id": "4ed529b6-2e86-49eb-a575-603e071d2514", + "id": "7e183d38-425d-433b-8487-6c21b9a5795c", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3267,24 +3730,122 @@ } ], "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes?legacyId=-5678", "host": [ "{{URL}}" ], "path": [ - "challengeTypes", - "{{TYPEB_ID}}" + "challengeTypes" + ], + "query": [ + { + "key": "legacyId", + "value": "-5678" + } ] } }, "response": [] - }, - { - "name": "failure get challenge type invalid id 400", - "event": [ - { - "listen": "test", - "script": { + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "get challenge type", + "item": [ + { + "name": "get challenge type 1", + "event": [ + { + "listen": "test", + "script": { + "id": "ca548603-f08a-47d7-a4a8-bb68fdb62b31", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes", + "{{TYPEA_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge type 2", + "event": [ + { + "listen": "test", + "script": { + "id": "4ed529b6-2e86-49eb-a575-603e071d2514", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeTypes", + "{{TYPEB_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure get challenge type invalid id 400", + "event": [ + { + "listen": "test", + "script": { "id": "ed8483b2-a9f5-49ac-9d9f-3cfd2a1872fc", "exec": [ "pm.test(\"Status code is 400\", function () {", @@ -3581,15 +4142,15 @@ "response": [] }, { - "name": "failure partial update challenge type with invalid token 401", + "name": "failure partial update challenge type invalid parameter description 400", "event": [ { "listen": "test", "script": { - "id": "27836ef1-3d48-4d67-a2bf-63a93d7ca189", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3612,12 +4173,12 @@ { "key": "Authorization", "type": "text", - "value": "Bearer invalid" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" + "raw": "{\n\t\"name\": \"1234\",\n\t\"description\": 1234\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", @@ -3633,15 +4194,15 @@ "response": [] }, { - "name": "failure partial update challenge type via user 403", + "name": "failure partial update challenge type invalid parameter isActive 400", "event": [ { "listen": "test", "script": { - "id": "87677a37-622e-440c-ba16-edf6f3b58e3a", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3664,12 +4225,12 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" + "raw": "{\n\t\"name\": \"1234\",\n\t\"isActive\": \"update-description\"\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", @@ -3685,15 +4246,15 @@ "response": [] }, { - "name": "failure partial update challenge type not found 404", + "name": "failure partial update challenge type invalid parameter abbreviation 400", "event": [ { "listen": "test", "script": { - "id": "4f069a8a-ed67-4364-b10a-825b3b8ab828", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3721,31 +4282,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" + "raw": "{\n\t\"abbreviation\": 1234\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{SETTINGA_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure partial update challenge type duplicate name 409", + "name": "failure partial update challenge type invalid parameter legacyId 400", "event": [ { "listen": "test", "script": { "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -3773,7 +4334,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"TYPE-name-1\",\n\t\"description\": \"update-description\"\n}" + "raw": "{\n\t\"legacyId\": -1234\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", @@ -3789,15 +4350,15 @@ "response": [] }, { - "name": "failure partial update challenge type duplicate abbreviation 409", + "name": "failure partial update challenge type without token 401", "event": [ { "listen": "test", "script": { - "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", + "id": "27836ef1-3d48-4d67-a2bf-63a93d7ca189", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -3816,16 +4377,11 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"abbreviation\": \"abbxxxyyzz11\"\n}" + "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", @@ -3841,15 +4397,15 @@ "response": [] }, { - "name": "partial update challenge type using m2m", + "name": "failure partial update challenge type with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "27836ef1-3d48-4d67-a2bf-63a93d7ca189", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -3872,36 +4428,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_types_update}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"patch-by-m2m\",\n\t\"description\": \"patch-description\"\n}" + "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TEST_TYPE_M2M_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure partial update challenge type using forbidden m2m 403", + "name": "failure partial update challenge type with expire token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "27836ef1-3d48-4d67-a2bf-63a93d7ca189", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -3924,43 +4480,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"patch-by-m2m\",\n\t\"description\": \"patch-description\"\n}" + "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TEST_TYPE_M2M_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "update challenge type", - "item": [ + }, { - "name": "update challenge type 1", + "name": "failure partial update challenge type via user 403", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "87677a37-622e-440c-ba16-edf6f3b58e3a", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -3968,27 +4517,27 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Authorization", - "value": "Bearer {{admin_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{user_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-1789\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb789\",\n\t\"legacyId\": 789\n}" + "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", @@ -4004,15 +4553,15 @@ "response": [] }, { - "name": "update challenge type 2", + "name": "failure partial update challenge type not found 404", "event": [ { "listen": "test", "script": { - "id": "4795bcd3-e62c-4431-8f7d-e2a6441d6031", + "id": "4f069a8a-ed67-4364-b10a-825b3b8ab828", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -4020,7 +4569,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4035,36 +4584,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot2_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb56756\",\n\t\"legacyId\": 12356756\n}" + "raw": "{\n\t\"name\": \"update-name\",\n\t\"description\": \"update-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type invalid id 400", + "name": "failure partial update challenge type duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -4072,7 +4621,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4092,31 +4641,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + "raw": "{\n\t\"name\": \"TYPE-name-1\",\n\t\"description\": \"update-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/invalid-id", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "invalid-id" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type invalid parameter 400", + "name": "failure partial update challenge type duplicate abbreviation 409", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -4124,7 +4673,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4144,31 +4693,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"test-name\",\n\t\"description\": 12345,\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": \"abc\"\n}" + "raw": "{\n\t\"abbreviation\": \"abbxxxyyzz11\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type missing parameter 400", + "name": "failure partial update challenge type duplicate legacyId 409", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "0cdf6f5f-d4d3-4d01-9ecd-856c2e03eb20", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -4176,7 +4725,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4196,31 +4745,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"description\": \"update-description2\",\n\t\"isActive\": false\n}" + "raw": "{\n\t\"legacyId\": 222\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type without token 401", + "name": "partial update challenge type using m2m", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -4228,7 +4777,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4239,32 +4788,37 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_types_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + "raw": "{\n\t\"name\": \"patch-by-m2m\",\n\t\"description\": \"patch-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "{{TEST_TYPE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type via user 403", + "name": "failure partial update challenge type using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -4275,7 +4829,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -4289,37 +4843,44 @@ }, { "key": "Authorization", - "value": "Bearer {{user_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + "raw": "{\n\t\"name\": \"patch-by-m2m\",\n\t\"description\": \"patch-description\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "{{TEST_TYPE_M2M_ID}}" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "update challenge type", + "item": [ { - "name": "failure update challenge type not found 404", + "name": "update challenge type 1", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -4331,13 +4892,13 @@ "header": [ { "key": "Accept", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Authorization", @@ -4347,31 +4908,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + "raw": "{\n\t\"name\": \"update-name-1789\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb789\",\n\t\"legacyId\": 789\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{SETTINGA_ID}}" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type duplicate name 409", + "name": "update challenge type 2", "event": [ { "listen": "test", "script": { - "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", + "id": "4795bcd3-e62c-4431-8f7d-e2a6441d6031", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -4394,12 +4955,12 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot2_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"TYPE-name-2\",\n\t\"description\": \"description\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abbaaabb34342\",\n\t\"legacyId\": 12322338899\n}" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb56756\",\n\t\"legacyId\": 12356756\n}" }, "url": { "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", @@ -4415,15 +4976,15 @@ "response": [] }, { - "name": "failure update challenge type duplicate legacyId 409", + "name": "failure update challenge type invalid id 400", "event": [ { "listen": "test", "script": { "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4451,31 +5012,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"TYPE-name-2-aaaa-bb\",\n\t\"description\": \"description\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abbaxxabb34342\",\n\t\"legacyId\": 789\n}" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", + "raw": "{{URL}}/challengeTypes/invalid-id", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TYPEB_ID}}" + "invalid-id" ] } }, "response": [] }, { - "name": "update challenge type using m2m", + "name": "failure update challenge type invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4498,50 +5059,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_types_update}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-by-m2m-aabbcc\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb29293939\",\n\t\"legacyId\": 12329293939\n}" + "raw": "{\n\t\"name\": \"test-name\",\n\t\"description\": 12345,\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": \"abc\"\n}" }, "url": { - "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengeTypes", - "{{TEST_TYPE_M2M_ID}}" + "{{TYPEB_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - } - ], - "protocolProfileBehavior": {} - }, - { - "name": "ChallengePhases", - "item": [ - { - "name": "create challenge phase", - "item": [ + }, { - "name": "create phase 1", + "name": "failure update challenge type invalid parameter name 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"PHASEA_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4549,7 +5096,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4569,31 +5116,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": 123,\n\t\"description\": \"12345\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": \"abc\"\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase 2", + "name": "failure update challenge type invalid parameter inactive 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"PHASEB_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4601,7 +5148,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4621,31 +5168,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-2\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"test-name\",\n\t\"description\": \"12345\",\n\t\"isActive\": 123,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": \"abc\"\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase 3", + "name": "failure update challenge type invalid parameter abbreviation 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"PHASEC_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4653,7 +5200,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4673,31 +5220,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-3\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"test-name\",\n\t\"description\": \"12345\",\n\t\"isActive\": false,\n\t\"abbreviation\": 123445,\n\t\"legacyId\": \"abc\"\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create inactive phase", + "name": "failure update challenge type invalid parameter legacyId 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4705,7 +5252,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4725,27 +5272,28 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-4\",\n\t\"isOpen\": false,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"test-name\",\n\t\"description\": \"12345\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"123445\",\n\t\"legacyId\": \"abc\"\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase missing parameter 400", + "name": "failure update challenge type missing parameter 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -4756,7 +5304,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4776,30 +5324,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"description\": \"update-description2\",\n\t\"isActive\": false\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase without token 401", + "name": "failure update challenge type missing parameter isActive 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4807,7 +5356,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4818,34 +5367,40 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"update\",\n\t\"abbreviation\": \"123\"\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase with invalid token 401", + "name": "failure update challenge type missing parameter abbreviation 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -4853,7 +5408,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4868,35 +5423,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer invalid" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"update\",\n\t\"isActive\": false\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase via copilot 403", + "name": "failure update challenge type without token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -4904,7 +5460,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4915,39 +5471,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase duplicate name 409", + "name": "failure update challenge type with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -4955,7 +5507,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -4969,37 +5521,37 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"PHASE-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 100000\n}\n" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "create phase using m2m", + "name": "failure update challenge type with expire token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEST_PHASE_M2M_ID\", pm.response.json().id);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -5007,7 +5559,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -5021,33 +5573,34 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenge_phases_create}}" + "value": "Bearer {{expire_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-by-m2m\",\n\t\"description\": \"m2m-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "failure create phase using forbidden m2m 403", + "name": "failure update challenge type via user 403", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -5058,7 +5611,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -5072,43 +5625,37 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{user_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"phase-by-m2m\",\n\t\"description\": \"m2m-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "search challenge phases", - "item": [ + }, { - "name": "search challenge phases by admin", + "name": "failure update challenge type not found 404", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -5116,7 +5663,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5134,34 +5681,33 @@ "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-name-2\",\n\t\"description\": \"update-description2\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb\",\n\t\"legacyId\": 123\n}" + }, "url": { - "raw": "{{URL}}/challengePhases?name=ph", + "raw": "{{URL}}/challengeTypes/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" - ], - "query": [ - { - "key": "name", - "value": "ph" - } + "challengeTypes", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "search challenge phases by copilot", + "name": "failure update challenge type duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "1428ff8d-857a-4bcc-85bc-8fffd41cb214", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -5169,7 +5715,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5184,31 +5730,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"TYPE-name-2\",\n\t\"description\": \"description\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abbaaabb34342\",\n\t\"legacyId\": 12322338899\n}" + }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "search challenge phases without token", + "name": "failure update challenge type duplicate legacyId 409", "event": [ { "listen": "test", "script": { - "id": "4170ca10-42e9-4278-93bf-65b9d60a1477", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -5216,7 +5767,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5227,30 +5778,40 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"TYPE-name-2-aaaa-bb\",\n\t\"description\": \"description\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abbaxxabb34342\",\n\t\"legacyId\": 789\n}" + }, "url": { - "raw": "{{URL}}/challengePhases", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "search challenge phases using m2m", + "name": "failure update challenge type duplicate abbreviation 409", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "867406cc-7f20-4aa4-b3d0-40082ba72d7d", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -5258,7 +5819,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5273,37 +5834,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_phases_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"TYPE-name-2-aaaa-bb\",\n\t\"description\": \"description\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb1\"\n}" + }, "url": { - "raw": "{{URL}}/challengePhases?name=ph", + "raw": "{{URL}}/challengeTypes/{{TYPEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" - ], - "query": [ - { - "key": "name", - "value": "ph" - } + "challengeTypes", + "{{TYPEB_ID}}" ] } }, "response": [] }, { - "name": "search challenge phases invalid parameter 400", + "name": "update challenge type using m2m", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -5311,7 +5871,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5326,44 +5886,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenge_types_update}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-by-m2m-aabbcc\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb29293939\",\n\t\"legacyId\": 12329293939\n}" + }, "url": { - "raw": "{{URL}}/challengePhases?invalid=test", + "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases" - ], - "query": [ - { - "key": "invalid", - "value": "test" - } + "challengeTypes", + "{{TEST_TYPE_M2M_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "get challenge phase", - "item": [ + }, { - "name": "get challenge phase by copilot", + "name": "failure update challenge type using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -5371,7 +5923,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -5385,33 +5937,51 @@ }, { "key": "Authorization", - "value": "Bearer {{copilot1_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-by-m2m-aabbcc\",\n\t\"isActive\": false,\n\t\"abbreviation\": \"abb29293939\",\n\t\"legacyId\": 12329293939\n}" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengeTypes/{{TEST_TYPE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengeTypes", + "{{TEST_TYPE_M2M_ID}}" ] } }, "response": [] - }, - { - "name": "get challenge phase by admin", - "event": [ - { - "listen": "test", - "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "ChallengePhases", + "item": [ + { + "name": "create challenge phase", + "item": [ + { + "name": "create phase 1", + "event": [ + { + "listen": "test", + "script": { + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"PHASEA_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5419,7 +5989,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5437,29 +6007,33 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase invalid id 400", + "name": "create phase 2", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"PHASEB_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5467,7 +6041,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5485,29 +6059,33 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"phase-2\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/invalid-id", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "invalid-id" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase without token 401", + "name": "create phase 3", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"PHASEC_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5515,7 +6093,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5526,31 +6104,40 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"phase-3\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase with invalid token 401", + "name": "create inactive phase", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5558,7 +6145,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5572,33 +6159,37 @@ }, { "key": "Authorization", - "value": "Bearer invalid", - "type": "text" + "type": "text", + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"phase-4\",\n\t\"isOpen\": false,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase with expire token 401", + "name": "create phase with invalid description 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5606,7 +6197,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5621,32 +6212,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"4444\",\n\t\"description\": 1111,\n\t\"isOpen\": false,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase by user 403", + "name": "create phase with invalid name 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5654,7 +6249,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5669,32 +6264,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": 4444,\n\t\"isOpen\": false,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase not found 404", + "name": "create phase with invalid isOpen 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5702,7 +6301,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5720,29 +6319,33 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"4444\",\n\t\"isOpen\": 10000,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{TYPEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{TYPEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "get challenge phase using m2m", + "name": "create phase with invalid duration 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.environment.set(\"PHASED_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -5750,7 +6353,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5765,32 +6368,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_phases_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"4444\",\n\t\"isOpen\": true,\n\t\"duration\": \"invalid\"\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "failure get challenge phase using forbidden m2m 403", + "name": "create phase missing parameter 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -5798,7 +6404,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -5813,39 +6419,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "challengePhases" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "partial update challenge phase", - "item": [ + }, { - "name": "partial update challenge phase 1", + "name": "create phase missing parameter isOpen 400", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -5853,7 +6455,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -5873,31 +6475,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-5\",\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "partial update challenge phase 2", + "name": "create phase missing parameter duration 400", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -5905,7 +6506,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -5925,31 +6526,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-2\"\n}\n" + "raw": "{\n\t\"name\": \"phase-5\",\n\t\"isOpen\": true\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "failure partial update challenge phase invalid id 400", + "name": "create phase without token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -5957,7 +6557,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -5968,37 +6568,31 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/invalid-id", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "invalid-id" + "challengePhases" ] } }, "response": [] }, { - "name": "failure partial update challenge phase with invalid token 401", + "name": "create phase with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -6009,7 +6603,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6029,28 +6623,27 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "failure partial update challenge phase with expire token 401", + "name": "create phase with expire token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -6061,7 +6654,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6081,28 +6674,27 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "failure partial update challenge phase by copilot 403", + "name": "create phase via copilot 403", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -6113,7 +6705,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6133,31 +6725,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "failure partial update challenge phase not found 404", + "name": "create phase duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -6165,7 +6756,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6185,31 +6776,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"PHASE-1\",\n\t\"description\": \"has-description\",\n\t\"isOpen\": true,\n\t\"duration\": 100000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{SETTINGA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "partial update challenge phase duplicate name 409", + "name": "create phase using m2m", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEST_PHASE_M2M_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -6217,7 +6808,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6232,36 +6823,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenge_phases_create}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-PHASE-2\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-by-m2m\",\n\t\"description\": \"m2m-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "partial update challenge phase using m2m", + "name": "failure create phase using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -6269,7 +6859,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -6284,36 +6874,42 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_phases_update}}" + "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + "raw": "{\n\t\"name\": \"phase-by-m2m\",\n\t\"description\": \"m2m-description\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "challengePhases" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "search challenge phases", + "item": [ { - "name": "failure partial update challenge phase using forbidden m2m 403", + "name": "search challenge phases by admin", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -6321,7 +6917,7 @@ } ], "request": { - "method": "PATCH", + "method": "GET", "header": [ { "key": "Accept", @@ -6335,41 +6931,35 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{admin_token}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"update-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases?name=ph", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "challengePhases" + ], + "query": [ + { + "key": "name", + "value": "ph" + } ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "update challenge phase", - "item": [ + }, { - "name": "update challenge phase 1", + "name": "search challenge phases with page parameter by admin", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -6380,7 +6970,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6398,30 +6988,39 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases?name=ph&page=1&perPage=2", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" + ], + "query": [ + { + "key": "name", + "value": "ph" + }, + { + "key": "page", + "value": "1" + }, + { + "key": "perPage", + "value": "2" + } ] } }, "response": [] }, { - "name": "update challenge phase 2", + "name": "search challenge phases by copilot", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "1428ff8d-857a-4bcc-85bc-8fffd41cb214", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -6432,7 +7031,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6447,36 +7046,31 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot1_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-PHASE-2\",\n\t\"description\": \"add-description-in-put\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEB_ID}}" + "challengePhases" ] } }, "response": [] }, { - "name": "update challenge phase invalid id 400", + "name": "search challenge phases without token", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "4170ca10-42e9-4278-93bf-65b9d60a1477", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -6484,7 +7078,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6495,40 +7089,30 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/invalid-id", + "raw": "{{URL}}/challengePhases", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "invalid-id" + "challengePhases" ] } }, "response": [] }, { - "name": "update challenge phase invalid parameter 400", + "name": "search challenge phases using m2m", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -6536,7 +7120,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6551,36 +7135,37 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenge_phases_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": 12345,\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases?name=ph", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" + ], + "query": [ + { + "key": "name", + "value": "ph" + } ] } }, "response": [] }, { - "name": "update challenge phase with expire token 401", + "name": "search challenge phases invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -6588,7 +7173,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6603,36 +7188,44 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases?invalid=test", "host": [ "{{URL}}" ], "path": [ - "challengePhases", - "{{PHASEA_ID}}" + "challengePhases" + ], + "query": [ + { + "key": "invalid", + "value": "test" + } ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "get challenge phase", + "item": [ { - "name": "update challenge phase without token 401", + "name": "get challenge phase by copilot", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -6640,7 +7233,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6651,12 +7244,13 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{copilot1_token}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ @@ -6671,15 +7265,15 @@ "response": [] }, { - "name": "update challenge phase by copilot", + "name": "get challenge phase by admin", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -6687,7 +7281,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6702,36 +7296,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEA_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "update challenge phase not found 404", + "name": "get challenge phase invalid id 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -6739,7 +7329,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6757,33 +7347,29 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengePhases/invalid-id", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{SETTINGA_ID}}" + "invalid-id" ] } }, "response": [] }, { - "name": "update challenge phase duplicate name 409", + "name": "get challenge phase without token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -6791,7 +7377,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6802,40 +7388,31 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"phAse-3\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEA_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "update challenge phase using m2m", + "name": "get challenge phase with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -6843,7 +7420,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6857,37 +7434,33 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenge_phases_update}}" + "value": "Bearer invalid", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge phase using forbidden m2m 403", + "name": "get challenge phase with expire token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -6895,7 +7468,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -6910,43 +7483,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{expire_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"new-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" - }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "delete challenge phase", - "item": [ + }, { - "name": "delete challenge phase", + "name": "get challenge phase by user 403", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -6954,51 +7516,47 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Authorization", - "value": "Bearer {{admin_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{user_token}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEC_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEC_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge phase invalid id 400", + "name": "get challenge phase not found 404", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -7006,7 +7564,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -7024,33 +7582,29 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/challengePhases/invalid-id", + "raw": "{{URL}}/challengePhases/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "invalid-id" + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge phase without token 401", + "name": "get challenge phase using m2m", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -7058,7 +7612,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -7069,35 +7623,36 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_phases_read}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEB_ID}}" + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge phase with expired token 401", + "name": "failure get challenge phase using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -7105,7 +7660,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -7119,37 +7674,40 @@ }, { "key": "Authorization", - "value": "Bearer {{expire_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEB_ID}}" + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] - }, - { - "name": "failure delete challenge phase by copilot 403", - "event": [ - { - "listen": "test", + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "partial update challenge phase", + "item": [ + { + "name": "partial update challenge phase 1", + "event": [ + { + "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -7157,7 +7715,7 @@ } ], "request": { - "method": "DELETE", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7172,36 +7730,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{PHASEB_ID}}" + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge phase not found 404", + "name": "partial update challenge phase 2", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -7209,7 +7767,7 @@ } ], "request": { - "method": "DELETE", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7229,31 +7787,31 @@ ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"update-phase-2\"\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{SETTINGA_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "delete challenge phase using m2m", + "name": "failure partial update challenge phase invalid id 400", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -7261,7 +7819,7 @@ } ], "request": { - "method": "DELETE", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7276,36 +7834,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_phases_delete}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/invalid-id", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "invalid-id" ] } }, "response": [] }, { - "name": "failure delete challenge phase using forbidden m2m 403", + "name": "failure partial update challenge phase invalid name 400", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -7313,7 +7871,7 @@ } ], "request": { - "method": "DELETE", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7328,50 +7886,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": 199,\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ "challengePhases", - "{{TEST_PHASE_M2M_ID}}" + "{{PHASEB_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - } - ], - "protocolProfileBehavior": {} - }, - { - "name": "TimelineTemplates", - "item": [ - { - "name": "create timeline template", - "item": [ + }, { - "name": "create timeline template", + "name": "failure partial update challenge phase invalid description 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEMPLATEA_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -7379,7 +7923,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7399,31 +7943,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"description\": 5000,\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "create inactive timeline template", + "name": "failure partial update challenge phase invalid isOpen 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEMPLATEB_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -7431,7 +7975,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7451,31 +7995,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-2\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": 1,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "create timeline template for delete testing later", + "name": "failure partial update challenge phase invalid duration 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEMPLATEC_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -7483,7 +8027,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7503,30 +8047,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-3\",\n \"description\": \"desc-3\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": \"1day\"\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure create timeline template contain invalid phase 400", + "name": "failure partial update challenge phase with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -7534,7 +8079,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7549,32 +8094,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-4\",\n \"description\": \"desc-4\",\n \"isActive\": true,\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure create timeline template with expired token 401", + "name": "failure partial update challenge phase without token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -7585,7 +8131,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7596,39 +8142,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure create timeline template by copilot 403", + "name": "failure partial update challenge phase with expire token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -7636,7 +8178,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7651,35 +8193,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure create timeline template duplicate name 409", + "name": "failure partial update challenge phase by copilot 403", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -7687,7 +8230,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7702,36 +8245,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"tempLATE-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "create timeline template using m2m", + "name": "failure partial update challenge phase not found 404", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEST_TEMPLATE_M2M_ID\", pm.response.json().id);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -7739,7 +8282,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7754,35 +8297,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_timeline_templates_create}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-by-m2m\",\n \"description\": \"desc-by-m2m\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure create timeline template using forbidden m2m 403", + "name": "partial update challenge phase duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -7790,7 +8334,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7805,39 +8349,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_create}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-by-m2m\",\n \"description\": \"desc-by-m2m\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"update-PHASE-2\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "search timeline templates", - "item": [ + }, { - "name": "search timeline template by admin", + "name": "partial update challenge phase using m2m", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -7848,7 +8386,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7863,37 +8401,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenge_phases_update}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates?name=1", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" - ], - "query": [ - { - "key": "name", - "value": "1" - } + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] }, { - "name": "search timeline template by copilot", + "name": "failure partial update challenge phase using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -7901,7 +8438,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -7916,37 +8453,43 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_challenges_read}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 50000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates?name=LA", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" - ], - "query": [ - { - "key": "name", - "value": "LA" - } + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "update challenge phase", + "item": [ { - "name": "failure search timeline template invalid parameter 400", + "name": "update challenge phase 1", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -7954,7 +8497,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -7972,38 +8515,30 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates?invalid=test", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates" - ], - "query": [ - { - "key": "invalid", - "value": "test" - } + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "get timeline template", - "item": [ + }, { - "name": "get timeline template by admin", + "name": "update challenge phase 2", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -8014,7 +8549,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8032,29 +8567,33 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-PHASE-2\",\n\t\"description\": \"add-description-in-put\",\n\t\"isOpen\": true,\n\t\"duration\": 10000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "get timeline template by copilot", + "name": "update challenge phase invalid id 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -8062,7 +8601,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8077,29 +8616,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", + "raw": "{{URL}}/challengePhases/invalid-id", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEB_ID}}" + "challengePhases", + "invalid-id" ] } }, "response": [] }, { - "name": "failure get timeline template invalid id 400", + "name": "update challenge phase invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -8110,7 +8653,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8128,26 +8671,30 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": 12345,\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/invalid-id", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "invalid-id" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template with expired token 401", + "name": "update challenge phase with expire token 401", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -8158,7 +8705,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8176,26 +8723,30 @@ "value": "Bearer {{expire_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template with invalid token 401", + "name": "update challenge phase without token 401", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -8206,7 +8757,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8217,36 +8768,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer invalid" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template without token 401", + "name": "update challenge phase by copilot", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -8254,7 +8804,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8265,31 +8815,40 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template by user 403", + "name": "update challenge phase not found 404", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -8297,7 +8856,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8312,32 +8871,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-1\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template not found 404", + "name": "update challenge phase duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -8345,7 +8908,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8363,26 +8926,30 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"phAse-3\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{SETTINGA_ID}}" + "challengePhases", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "get timeline template using m2m", + "name": "update challenge phase using m2m", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -8393,7 +8960,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8408,29 +8975,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_timeline_templates_read}}" + "value": "Bearer {{m2m_challenge_phases_update}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure get timeline template using forbidden m2m 403", + "name": "failure update challenge phase using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -8441,7 +9012,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "Accept", @@ -8459,14 +9030,18 @@ "value": "Bearer {{m2m_challenges_read}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-phase-by-m2m\",\n\t\"isOpen\": true,\n\t\"duration\": 20000\n}\n" + }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, @@ -8477,15 +9052,15 @@ "_postman_isSubFolder": true }, { - "name": "partial update timeline template", + "name": "delete challenge phase", "item": [ { - "name": "partial update timeline template 1", + "name": "delete challenge phase", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -8496,51 +9071,51 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{admin_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEC_ID}}" ] } }, "response": [] }, { - "name": "partial update timeline template 2", + "name": "failure delete challenge phase invalid id 400", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -8548,7 +9123,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8568,31 +9143,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-2\",\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", + "raw": "{{URL}}/challengePhases/invalid-id", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEB_ID}}" + "challengePhases", + "invalid-id" ] } }, "response": [] }, { - "name": "failure partial update timeline template phases can't be empty 400", + "name": "failure delete challenge phase without token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -8600,7 +9175,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8611,37 +9186,32 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\",\n \"phases\": []\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure partial update timeline template with invalid token 401", + "name": "failure delete challenge phase with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -8652,7 +9222,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8666,34 +9236,34 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer invalid" + "value": "Bearer invalid", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure partial update timeline template with expired token 401", + "name": "failure delete challenge phase with expired token 401", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -8704,7 +9274,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8718,34 +9288,34 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{expire_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure partial update timeline template by copilot 403", + "name": "failure delete challenge phase by copilot 403", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -8756,7 +9326,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8776,28 +9346,28 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{PHASEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{PHASEB_ID}}" ] } }, "response": [] }, { - "name": "failure partial update timeline template not found 404", + "name": "failure delete challenge phase not found 404", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 404\", function () {", " pm.response.to.have.status(404);", @@ -8808,7 +9378,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8828,15 +9398,15 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", + "raw": "{{URL}}/challengePhases/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", + "challengePhases", "{{SETTINGA_ID}}" ] } @@ -8844,15 +9414,15 @@ "response": [] }, { - "name": "failure partial update timeline template duplicate name 409", + "name": "delete challenge phase using m2m", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -8860,7 +9430,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8875,36 +9445,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenge_phases_delete}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-2\",\n \"description\": \"new-desc-1\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, "response": [] }, { - "name": "partial update timeline template using m2m token", + "name": "failure delete challenge phase using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -8912,7 +9482,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -8927,21 +9497,21 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_timeline_templates_update}}" + "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"new-template-m2m\",\n \"description\": \"new-desc-m2m\"\n}\n" + "raw": "" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/challengePhases/{{TEST_PHASE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "challengePhases", + "{{TEST_PHASE_M2M_ID}}" ] } }, @@ -8950,20 +9520,27 @@ ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true - }, + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "TimelineTemplates", + "item": [ { - "name": "update timeline template", + "name": "create timeline template", "item": [ { - "name": "update timeline template 1", + "name": "create timeline template", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEMPLATEA_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -8971,7 +9548,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -8994,28 +9571,28 @@ "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "update timeline template 2", + "name": "create inactive timeline template", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEMPLATEB_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -9023,7 +9600,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9046,36 +9623,36 @@ "raw": "{\n\t\"name\": \"template-2\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEB_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template incorrect phase 400", + "name": "create timeline template for delete testing later", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});" + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEMPLATEC_ID\", pm.response.json().id);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9095,28 +9672,27 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-3\",\n \"isActive\": false,\n \"phases\": [\n {\n \"id\": \"{{SETTINGA_ID}}\",\n \"name\": \"new-PHASE-2\",\n \"description\": \"add-description-in-put\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n \t\"isActive\": true,\n\t \"duration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-3\",\n \"description\": \"desc-3\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template invalid id", + "name": "failure create timeline template contain invalid phase 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -9127,7 +9703,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9147,31 +9723,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-4\",\n \"description\": \"desc-4\",\n \"isActive\": true,\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/invalid-id", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "invalid-id" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template with expired token 401", + "name": "failure create timeline template invalid name 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9179,7 +9754,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9194,36 +9769,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": 1234,\n \"description\": \"desc-4\",\n \"isActive\": true,\n \"phases\": [\n {\n \"id\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template invalid token 401", + "name": "failure create timeline template invalid description 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9231,7 +9805,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9246,36 +9820,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer invalid" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-4\",\n \"description\": 1234,\n \"isActive\": true,\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template by copilot 403", + "name": "failure create timeline template invalid isActive 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9283,7 +9856,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9298,36 +9871,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-4\",\n \"isActive\": \"active\",\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template not found 404", + "name": "failure create timeline template missing name 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9335,7 +9907,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9355,31 +9927,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n \"isActive\": true,\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{SETTINGA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template duplicate name 409", + "name": "failure create timeline template missing isActive 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9387,7 +9958,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9407,31 +9978,30 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"TEMPlate-2\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-4\",\n \"phases\": [\n {\n \"id\": \"{{PHASED_ID}}\",\n \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEA_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "update timeline template using m2m", + "name": "failure create timeline template invalid phases 400", "event": [ { "listen": "test", "script": { "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -9439,7 +10009,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9454,36 +10024,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_timeline_templates_update}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-template-by-m2m\",\n \"description\": \"update-desc-by-m2m\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-4\",\n \"isActive\": true\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure update timeline template using forbidden m2m 403", + "name": "failure create timeline template without token 401", "event": [ { "listen": "test", "script": { "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -9491,7 +10060,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Accept", @@ -9502,47 +10071,34 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-template-by-m2m\",\n \"description\": \"update-desc-by-m2m\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "timelineTemplates" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "delete timeline template", - "item": [ + }, { - "name": "delete timeline template", + "name": "failure create timeline template with expired token 401", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -9550,7 +10106,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9565,36 +10121,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure delete timeline template invalid id 400", + "name": "failure create timeline template with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -9602,7 +10157,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9617,36 +10172,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/invalid-id", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "invalid-id" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure delete timeline template without token 401", + "name": "failure create timeline template by copilot 403", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -9654,7 +10208,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9665,35 +10219,39 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure delete timeline template with invalid token 401", + "name": "failure create timeline template duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -9701,7 +10259,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9715,37 +10273,37 @@ }, { "key": "Authorization", - "value": "Bearer invalid", - "type": "text" + "type": "text", + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"tempLATE-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure delete timeline template with expired token 401", + "name": "create timeline template using m2m", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEST_TEMPLATE_M2M_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -9753,7 +10311,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9768,33 +10326,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{m2m_timeline_templates_create}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-by-m2m\",\n \"description\": \"desc-by-m2m\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] }, { - "name": "failure delete timeline template by copilot 403", + "name": "failure create timeline template using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -9805,7 +10362,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "Accept", @@ -9820,36 +10377,42 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_challenges_create}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-by-m2m\",\n \"description\": \"desc-by-m2m\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", + "raw": "{{URL}}/timelineTemplates", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEMPLATEC_ID}}" + "timelineTemplates" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "search timeline templates", + "item": [ { - "name": "failure delete timeline template not found 404", + "name": "search timeline template by admin", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -9857,7 +10420,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -9875,30 +10438,31 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", + "raw": "{{URL}}/timelineTemplates?name=1", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{SETTINGA_ID}}" + "timelineTemplates" + ], + "query": [ + { + "key": "name", + "value": "1" + } ] } }, "response": [] }, { - "name": "delete timeline template using m2m token", + "name": "search timeline template with page by admin", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -9909,7 +10473,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -9924,36 +10488,41 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_timeline_templates_delete}}" + "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/timelineTemplates?page=1&perPage=2", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "timelineTemplates" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "perPage", + "value": "2" + } ] } }, "response": [] }, { - "name": "failure delete timeline template using forbidden m2m token 403", + "name": "search timeline template by copilot", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -9961,7 +10530,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "Accept", @@ -9976,50 +10545,37 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{copilot1_token}}" } ], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", + "raw": "{{URL}}/timelineTemplates?name=LA", "host": [ "{{URL}}" ], "path": [ - "timelineTemplates", - "{{TEST_TEMPLATE_M2M_ID}}" + "timelineTemplates" + ], + "query": [ + { + "key": "name", + "value": "LA" + } ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - } - ], - "protocolProfileBehavior": {} - }, - { - "name": "ChallengeTypeTimelineTemplates", - "item": [ - { - "name": "create challenge type timeline template", - "item": [ + }, { - "name": "create challenge type timeline template", + "name": "failure search timeline template invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TYPE_TEMPLATEA_ID\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -10027,7 +10583,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10045,32 +10601,41 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates?invalid=test", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates" + ], + "query": [ + { + "key": "invalid", + "value": "test" + } ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "get timeline template", + "item": [ { - "name": "failure create challenge type timeline template - 409 conflict", + "name": "get timeline template by admin", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -10078,7 +10643,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10096,32 +10661,29 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge type timeline template - 400 missing typeId", + "name": "get timeline template by copilot", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -10129,7 +10691,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10144,32 +10706,29 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot1_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "{{TEMPLATEB_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge type timeline template - 400 invalid timelineTemplateId", + "name": "failure get timeline template invalid id 400", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -10180,7 +10739,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10198,29 +10757,26 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"invalid\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/invalid-id", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "invalid-id" ] } }, "response": [] }, { - "name": "failure create challenge type timeline template - 401 expired token", + "name": "failure get timeline template with expired token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", @@ -10231,7 +10787,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10249,32 +10805,29 @@ "value": "Bearer {{expire_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "create challenge type timeline template using m2m", + "name": "failure get timeline template with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -10282,7 +10835,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10297,35 +10850,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_full}}" + "value": "Bearer invalid" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge type timeline template using forbidden m2m 403", + "name": "failure get timeline template without token 401", "event": [ { "listen": "test", "script": { - "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -10333,7 +10883,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", @@ -10344,68 +10894,31 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" - }, "url": { - "raw": "{{URL}}/challengeTimelines", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "13e2f43a-e4f7-4eb9-b2f1-ac9e6bf8fe8b", - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "id": "52d9a4b4-63e6-4050-8055-cebfad0f852f", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "search challenge type timeline templates", - "item": [ - { - "name": "search challenge type timeline templates by admin", + "name": "failure get timeline template by user 403", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -10428,41 +10941,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{user_token}}" } ], "url": { - "raw": "{{URL}}/challengeTimelines?typeId={{TYPEA_ID}}&timelineTemplateId={{TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" - ], - "query": [ - { - "key": "typeId", - "value": "{{TYPEA_ID}}" - }, - { - "key": "timelineTemplateId", - "value": "{{TEMPLATEA_ID}}" - } + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "search challenge type timeline templates by m2m", + "name": "failure get timeline template not found 404", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -10485,43 +10989,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], "url": { - "raw": "{{URL}}/challengeTimelines?", + "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" - ], - "query": [ - { - "key": "typeId", - "value": "{{TYPEA_ID}}", - "disabled": true - }, - { - "key": "timelineTemplateId", - "value": "{{TEMPLATEA_ID}}", - "disabled": true - } + "timelineTemplates", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure search challenge type timeline templates - 400 invalid param", + "name": "get timeline template using m2m", "event": [ { "listen": "test", "script": { - "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -10544,71 +11037,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{m2m_timeline_templates_read}}" } ], "url": { - "raw": "{{URL}}/challengeTimelines?other={{TYPEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines" - ], - "query": [ - { - "key": "other", - "value": "{{TYPEA_ID}}" - }, - { - "key": "timelineTemplateId", - "value": "{{TEMPLATEA_ID}}", - "disabled": true - } + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "d84e499b-0461-4d62-8d14-5be4e0b2227e", - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "id": "8f85a339-16dc-4f38-a0c9-ec98e9eb023b", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "get challenge type timeline template", - "item": [ - { - "name": "get challenge type timeline template by admin", + "name": "failure get timeline template using forbidden m2m 403", "event": [ { "listen": "test", "script": { "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -10631,29 +11085,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenges_read}}" } ], "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "partial update timeline template", + "item": [ { - "name": "get challenge type timeline template by m2m", + "name": "partial update timeline template 1", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -10664,7 +11125,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10679,32 +11140,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" + }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure get challenge type timeline template 403 forbidden", + "name": "partial update timeline template 2", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -10712,7 +11177,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10727,32 +11192,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"template-2\",\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" + }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEB_ID}}" ] } }, "response": [] }, { - "name": "failure get challenge type timeline template 401 expired token", + "name": "failure partial update timeline template phases can't be empty 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -10760,7 +11229,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10775,32 +11244,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\",\n \"phases\": []\n}\n" + }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure get challenge type timeline template 404 not found", + "name": "failure partial update timeline template invalid name 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -10808,7 +11281,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10823,29 +11296,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": 1234\n}\n" + }, "url": { - "raw": "{{URL}}/challengeTimelines/{{PHASEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{PHASEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure get challenge type timeline template 400 invalid id", + "name": "failure partial update timeline template invalid description 400", "event": [ { "listen": "test", "script": { - "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -10856,7 +11333,7 @@ } ], "request": { - "method": "GET", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10871,61 +11348,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": 111111\n}\n" + }, "url": { - "raw": "{{URL}}/challengeTimelines/invalid", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "invalid" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "a27c8d06-eb5f-4475-9d7b-7aae18e68bfe", - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "id": "b1bc17ef-bb5c-4d0f-a8a9-e7159bde6d7f", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "update challenge type timeline template", - "item": [ - { - "name": "update challenge type timeline template by admin", + "name": "failure partial update timeline template invalid isActive 400", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -10933,7 +11385,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -10953,31 +11405,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"isActive\": 111111\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge type timeline template by m2m", + "name": "failure partial update timeline template with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -10985,7 +11437,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11000,36 +11452,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_update}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template 400 unexpected field", + "name": "failure partial update timeline template without token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -11037,7 +11489,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11048,40 +11500,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\",\n \"other\": 123\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template 400 missing timelineTemplateId", + "name": "failure partial update timeline template with expired token 401", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -11089,7 +11536,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11104,36 +11551,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_update}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template 400 invalid typeId", + "name": "failure partial update timeline template by copilot 403", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -11141,7 +11588,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11156,36 +11603,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_update}}" + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": [\"abc\"],\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template by user 403", + "name": "failure partial update timeline template not found 404", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -11193,7 +11640,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11208,36 +11655,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template by forbidden m2m token 403", + "name": "failure partial update timeline template duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -11245,7 +11692,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11260,36 +11707,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"template-2\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template 404 not found", + "name": "partial update timeline template using m2m token", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -11297,7 +11744,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11312,36 +11759,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_update}}" + "value": "Bearer {{m2m_timeline_templates_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-m2m\",\n \"description\": \"new-desc-m2m\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPEA_ID}}" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge type timeline template 409 conflict", + "name": "failure partial update timeline template using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", + "id": "c6ad399d-6048-445e-a0c1-b99395ce0b76", "exec": [ - "pm.test(\"Status code is 409\", function () {", - " pm.response.to.have.status(409);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -11349,7 +11796,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Accept", @@ -11364,73 +11811,51 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_update}}" + "value": "Bearer {{m2m_challenges_create}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + "raw": "{\n\t\"name\": \"new-template-1\",\n \"description\": \"new-desc-1\"\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] } ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "bbcd012f-421d-47ac-a81a-8f94afc23f6f", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "df48988e-0120-4a2b-a1b4-61e5c1346a1c", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true }, { - "name": "delete challenge type timeline template", + "name": "update timeline template", "item": [ { - "name": "delete challenge type timeline template", + "name": "update timeline template 1", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "}); " + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Accept", @@ -11450,39 +11875,39 @@ ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge type timeline template 401 missing token", + "name": "update timeline template 2", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "}); " - ], + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Accept", @@ -11493,35 +11918,40 @@ "key": "Content-Type", "type": "text", "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-2\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEB_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEB_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge type timeline template 403 forbidden", + "name": "failure update timeline template incorrect phase 400", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -11529,7 +11959,7 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Accept", @@ -11544,44 +11974,44 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_read}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-3\",\n \"isActive\": false,\n \"phases\": [\n {\n \"id\": \"{{SETTINGA_ID}}\",\n \"name\": \"new-PHASE-2\",\n \"description\": \"add-description-in-put\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n \t\"isActive\": true,\n\t \"duration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPE_TEMPLATEA_ID}}" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure delete challenge type timeline template 400 invalid id", + "name": "failure update timeline template invalid id", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", - "}); " + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Accept", @@ -11601,39 +12031,39 @@ ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/invalid", + "raw": "{{URL}}/timelineTemplates/invalid-id", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "invalid" + "timelineTemplates", + "invalid-id" ] } }, "response": [] }, { - "name": "failure delete challenge type timeline template 404 not found", + "name": "failure update timeline template invalid name 400", "event": [ { "listen": "test", "script": { - "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "}); " + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Accept", @@ -11653,89 +12083,31 @@ ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"name\": 1221,\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challengeTimelines/{{TYPEA_ID}}", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challengeTimelines", - "{{TYPEA_ID}}" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "8c41ee09-fd79-4adf-b766-37921756ca02", - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "id": "1102965d-ad2b-4773-aa8f-025949e9e37d", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "8d559524-f741-4e48-811e-3b391c9e1fa7", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "e5f762e7-6dce-4a61-8bf8-c301180228dd", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "protocolProfileBehavior": {} - }, - { - "name": "Challenges", - "item": [ - { - "name": "create challenge", - "item": [ - { - "name": "create challenge by admin", + "name": "failure update timeline template invalid description 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"CHALLENGE_ID1\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -11743,51 +12115,51 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Authorization", - "value": "Bearer {{admin_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [21203]\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": 11121,\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "create challenge by copilot", + "name": "failure update timeline template invalid isActive 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"CHALLENGE_ID2\", pm.response.json().id);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -11795,7 +12167,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -11810,32 +12182,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": 123,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge - duplicate terms - 400", + "name": "failure update timeline template missing name 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -11846,7 +12219,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -11866,27 +12239,28 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [20653, 20653, 20646]\n}" + "raw": "{\n\t\"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge - non-existing terms - 400", + "name": "failure update timeline template missing isActive 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -11897,7 +12271,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -11917,27 +12291,28 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [20653, 20646, 111111]\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge - negative terms ids - 400", + "name": "failure update timeline template missing phases 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -11948,7 +12323,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -11968,30 +12343,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [-20653, -20646]\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge - invalid terms ids - 400", + "name": "failure update timeline template with expired token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -11999,7 +12375,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12014,35 +12390,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [\"Invalid20653\"]\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge invalid tags", + "name": "failure update timeline template without token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -12050,7 +12427,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12061,39 +12438,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": {\"tag1\": \"tag2\"},\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge invalid status", + "name": "failure update timeline template invalid token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -12101,7 +12474,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12116,35 +12489,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"invalid\"\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge using invactive time template 400", + "name": "failure update timeline template by copilot 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -12152,7 +12526,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12167,35 +12541,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEB_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge using empty prizeSets 400", + "name": "failure update timeline template not found 404", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -12203,7 +12578,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12223,30 +12598,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"name\": \"template-1\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge using empty prizes array 400", + "name": "failure update timeline template duplicate name 409", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -12254,7 +12630,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12274,30 +12650,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": []\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"name\": \"TEMPlate-2\",\n \"description\": \"desc-1\",\n \"isActive\": true,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge invalid parameter 400", + "name": "update timeline template using m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -12305,7 +12682,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12320,35 +12697,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_timeline_templates_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": 12345,\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + "raw": "{\n\t\"name\": \"update-template-by-m2m\",\n \"description\": \"update-desc-by-m2m\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n\t \"predecessor\": \"{{PHASEA_ID}}\",\n\t \"defaultDuration\": 10000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge using empty phases 400", + "name": "failure update timeline template using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -12356,7 +12734,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Accept", @@ -12371,35 +12749,43 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"name\": \"update-template-by-m2m\",\n \"description\": \"update-desc-by-m2m\",\n \"isActive\": false,\n \"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"defaultDuration\": 20000\n }\n ]\n}\n" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] - }, + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "delete timeline template", + "item": [ { - "name": "failure create challenge missing parameter 400", + "name": "delete timeline template", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -12407,7 +12793,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12427,27 +12813,28 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge invalid settings 400", + "name": "failure delete timeline template invalid id 400", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -12458,7 +12845,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12478,30 +12865,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TYPEA_ID}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/invalid-id", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "invalid-id" ] } }, "response": [] }, { - "name": "failure create challenge invalid phases 400", + "name": "failure delete timeline template without token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -12509,7 +12897,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12520,39 +12908,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"id\": \"{{PHASEA_ID}}\",\n \t\"name\": \"inconsistent\",\n \t\"isActive\": true,\n \t\"duration\": 1000000\n },\n {\n \t\"id\": \"{{PHASED_ID}}\",\n \t\"name\": \"phase-4\",\n \t\t\"isActive\": false,\n\t \t\"duration\": 2000000\n },\n {\n \t\"id\": \"{{TYPEA_ID}}\",\n \t\"name\": \"not-found\",\n \t\"isActive\": true,\n \t\"duration\": 1000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge invalid prizeSet type 400", + "name": "failure delete timeline template with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -12560,7 +12944,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12574,36 +12958,37 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"invalid\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "faiclure reate challenge invalid prize type", + "name": "failure delete timeline template with expired token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -12611,7 +12996,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12626,32 +13011,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"invalid\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge by user 403", + "name": "failure delete timeline template by copilot 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -12662,7 +13048,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12677,36 +13063,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEMPLATEC_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEMPLATEC_ID}}" ] } }, "response": [] }, { - "name": "create challenge using m2m", + "name": "failure delete timeline template not found 404", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - " pm.environment.set(\"TEST_CHALLENGE_M2M_ID\", pm.response.json().id);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -12714,7 +13100,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12729,35 +13115,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_create}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create-m2m\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{SETTINGA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{SETTINGA_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge project not found 400", + "name": "delete timeline template using m2m token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -12765,7 +13152,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12780,32 +13167,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_timeline_templates_delete}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 10000,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, "response": [] }, { - "name": "failure create challenge user can't access specific project", + "name": "failure delete timeline template using forbidden m2m token 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", @@ -12816,7 +13204,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "Accept", @@ -12831,20 +13219,21 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_challenges_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 200,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges", + "raw": "{{URL}}/timelineTemplates/{{TEST_TEMPLATE_M2M_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges" + "timelineTemplates", + "{{TEST_TEMPLATE_M2M_ID}}" ] } }, @@ -12853,21 +13242,27 @@ ], "protocolProfileBehavior": {}, "_postman_isSubFolder": true - }, + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "ChallengeTypeTimelineTemplates", + "item": [ { - "name": "upload attachment", + "name": "create challenge type timeline template", "item": [ { - "name": "upload attachment by admin", + "name": "create challenge type timeline template", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - " pm.environment.set(\"ATTACHMENT_ID1\", pm.response.json().id);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TYPE_TEMPLATEA_ID\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -12877,6 +13272,16 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", @@ -12884,40 +13289,31 @@ } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "type": "file", - "src": "/Users/guanpeiyong/Desktop/working2/challenge-api/Verification.md" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "upload attachment by copilot", + "name": "failure create challenge type timeline template - 409 conflict", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - " pm.environment.set(\"ATTACHMENT_ID2\", pm.response.json().id);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -12927,46 +13323,48 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "type": "file", - "src": "/Users/guanpeiyong/Desktop/working2/challenge-api/Verification.md" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment by normal user 403", + "name": "failure create challenge type timeline template - 400 missing typeId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -12976,46 +13374,48 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment challenge not found 404", + "name": "failure create challenge type timeline template - 400 missing timelineTemplateId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13025,6 +13425,16 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", @@ -13032,39 +13442,31 @@ } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{TYPEA_ID}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TYPEA_ID}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment by copilot not of challenge resource 403", + "name": "failure create challenge type timeline template - 400 invalid timelineTemplateId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13074,46 +13476,48 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot2_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"invalid\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment missing token 401", + "name": "failure create challenge type timeline template - 400 invalid typeId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13122,41 +13526,49 @@ ], "request": { "method": "POST", - "header": [], + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"invalid\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment wrong file name 400", + "name": "failure create challenge type timeline template - 404 with timelineTemplateId does not exist", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -13166,6 +13578,16 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", @@ -13173,40 +13595,31 @@ } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "wrong", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"a69033a4-4f18-4765-addc-f48cf61176d9\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "upload attachment using m2m", + "name": "failure create challenge type timeline template - 404 with typeId does not exist", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - " pm.environment.set(\"TEST_ATTACHMENT_M2M_ID\", pm.response.json().id);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -13216,46 +13629,48 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_attachments_create}}" + "value": "Bearer {{admin_token}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"a69033a4-4f18-4765-addc-f48cf61176d9\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}", - "attachments" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure upload attachment using forbidden m2m 403", + "name": "failure create challenge type timeline template - 401 expired token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -13265,53 +13680,48 @@ "request": { "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{expire_token}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "attachment", - "value": "", - "type": "file" - } - ] + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}", - "attachments" + "challengeTimelines" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "download attachment", - "item": [ + }, { - "name": "download attachment by admin", + "name": "failure create challenge type timeline template - 401 without token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -13319,39 +13729,45 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { - "key": "Authorization", + "key": "Accept", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments", - "{{ATTACHMENT_ID1}}" + "challengeTimelines" ] } }, "response": [] }, { - "name": "download attachment by copilot", + "name": "failure create challenge type timeline template - 401 invalid token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -13359,39 +13775,50 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer invalid" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments", - "{{ATTACHMENT_ID2}}" + "challengeTimelines" ] } }, "response": [] }, { - "name": "download attachment by challenge registrant", + "name": "failure create challenge type timeline template - 403 by user", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -13399,39 +13826,50 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", "value": "Bearer {{user_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments", - "{{ATTACHMENT_ID2}}" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure download attachment challenge id mismatch 400", + "name": "create challenge type timeline template using m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});" ], "type": "text/javascript" @@ -13439,39 +13877,50 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_full}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + }, "url": { - "raw": "{{URL}}/challenges/{{TYPEA_ID}}/attachments/{{ATTACHMENT_ID1}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TYPEA_ID}}", - "attachments", - "{{ATTACHMENT_ID1}}" + "challengeTimelines" ] } }, "response": [] }, { - "name": "failure download attachment by expired token 401", + "name": "failure create challenge type timeline template using forbidden m2m 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "09e1d09d-b72f-4809-ac29-c458b90cb631", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -13479,39 +13928,79 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{expire_token}}" + "value": "Bearer {{m2m_read}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments", - "{{ATTACHMENT_ID1}}" + "challengeTimelines" ] } }, "response": [] - }, + } + ], + "event": [ { - "name": "failure download attachment by invalid token 401", - "event": [ - { - "listen": "test", + "listen": "prerequest", + "script": { + "id": "13e2f43a-e4f7-4eb9-b2f1-ac9e6bf8fe8b", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "52d9a4b4-63e6-4050-8055-cebfad0f852f", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "search challenge type timeline templates", + "item": [ + { + "name": "search challenge type timeline templates by admin", + "event": [ + { + "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -13521,37 +14010,54 @@ "request": { "method": "GET", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer invalid" + "value": "Bearer {{admin_token}}" } ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "raw": "{{URL}}/challengeTimelines?typeId={{TYPEA_ID}}&timelineTemplateId={{TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}", - "attachments", - "{{ATTACHMENT_ID1}}" + "challengeTimelines" + ], + "query": [ + { + "key": "typeId", + "value": "{{TYPEA_ID}}" + }, + { + "key": "timelineTemplateId", + "value": "{{TEMPLATEA_ID}}" + } ] } }, "response": [] }, { - "name": "failure download attachment by none challenge registrant 403", + "name": "search challenge type timeline templates by m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -13561,37 +14067,56 @@ "request": { "method": "GET", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot2_token}}" + "value": "Bearer {{m2m_read}}" } ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "raw": "{{URL}}/challengeTimelines", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments", - "{{ATTACHMENT_ID2}}" + "challengeTimelines" + ], + "query": [ + { + "key": "typeId", + "value": "{{TYPEA_ID}}", + "disabled": true + }, + { + "key": "timelineTemplateId", + "value": "{{TEMPLATEA_ID}}", + "disabled": true + } ] } }, "response": [] }, { - "name": "failure download attachment by anonymous user 401", + "name": "failure search challenge type timeline templates - 400 invalid param", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13600,32 +14125,56 @@ ], "request": { "method": "GET", - "header": [], + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_read}}" + } + ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "raw": "{{URL}}/challengeTimelines?other={{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}", - "attachments", - "{{ATTACHMENT_ID2}}" + "challengeTimelines" + ], + "query": [ + { + "key": "other", + "value": "{{TYPEA_ID}}" + }, + { + "key": "timelineTemplateId", + "value": "{{TEMPLATEA_ID}}", + "disabled": true + } ] } }, "response": [] }, { - "name": "download attachment using m2m", + "name": "failure search challenge type timeline templates - 400 invalid typeId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13635,37 +14184,50 @@ "request": { "method": "GET", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_attachments_read}}" + "value": "Bearer {{m2m_read}}" } ], "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments/{{TEST_ATTACHMENT_M2M_ID}}", + "raw": "{{URL}}/challengeTimelines?typeId=123", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}", - "attachments", - "{{TEST_ATTACHMENT_M2M_ID}}" + "challengeTimelines" + ], + "query": [ + { + "key": "typeId", + "value": "123" + } ] } }, "response": [] }, { - "name": "failure download attachment using forbidden m2m 403", + "name": "failure search challenge type timeline templates - 400 invalid timelineTemplateId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "7fbd663d-76fb-4c4d-b7b6-0baf9ca6b86e", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -13675,22 +14237,35 @@ "request": { "method": "GET", "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_read}}" + "value": "Bearer {{m2m_read}}" } ], "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments/{{TEST_ATTACHMENT_M2M_ID}}", + "raw": "{{URL}}/challengeTimelines?timelineTemplateId=12321", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}", - "attachments", - "{{TEST_ATTACHMENT_M2M_ID}}" + "challengeTimelines" + ], + "query": [ + { + "key": "timelineTemplateId", + "value": "12321" + } ] } }, @@ -13701,7 +14276,7 @@ { "listen": "prerequest", "script": { - "id": "22913a87-9231-4269-a929-a3f5eaa1e265", + "id": "d84e499b-0461-4d62-8d14-5be4e0b2227e", "type": "text/javascript", "exec": [ "" @@ -13711,7 +14286,7 @@ { "listen": "test", "script": { - "id": "0bf2e29d-7be3-495d-b547-b32adeb54293", + "id": "8f85a339-16dc-4f38-a0c9-ec98e9eb023b", "type": "text/javascript", "exec": [ "" @@ -13723,15 +14298,15 @@ "_postman_isSubFolder": true }, { - "name": "update challenge", + "name": "get challenge type timeline template", "item": [ { - "name": "update challenge 1 by admin", + "name": "get challenge type timeline template by admin", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -13742,7 +14317,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -13760,30 +14335,26 @@ "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [21343, 20723, 20645]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge 1 with attachment by M2M", + "name": "get challenge type timeline template by m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", @@ -13794,7 +14365,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -13809,36 +14380,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_update}}" + "value": "Bearer {{m2m_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge 1 with winners by admin", + "name": "failure get challenge type timeline template 403 using user token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -13846,7 +14413,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -13861,36 +14428,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{user_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge 2 by copilot", + "name": "failure get challenge type timeline template 403 using forbidden m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -13898,7 +14461,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -13913,36 +14476,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_challenges_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 4\n\t\t}\n\t],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\"]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge remove default terms - 400", + "name": "failure get challenge type timeline template 401 expired token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -13950,7 +14509,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -13965,36 +14524,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{expire_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [20723, 20645]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge duplicate terms - 400", + "name": "failure get challenge type timeline template 401 invalid token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -14002,7 +14557,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -14017,36 +14572,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [21343, 20723, 20645, 20645]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge terms does not exist - 400", + "name": "failure get challenge type timeline template 401 without token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -14054,7 +14605,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -14065,40 +14616,31 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [21343, 20723, 20645, 12345]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge invalid groups 400", + "name": "failure get challenge type timeline template 404 not found", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -14106,7 +14648,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -14121,36 +14663,32 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"],\n\t\"groups\": \"group1 group2\"\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{PHASEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{PHASEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge attachment not found 404", + "name": "failure get challenge type timeline template 400 invalid id", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "3e3dd07c-3ce6-47fe-86eb-a0a01ea1cfec", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -14158,7 +14696,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "Accept", @@ -14173,36 +14711,61 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_read}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{TYPEA_ID}}\"]\n}" - }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/invalid", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "invalid" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "a27c8d06-eb5f-4475-9d7b-7aae18e68bfe", + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "failure update challenge invalid parameter 400", + "listen": "test", + "script": { + "id": "b1bc17ef-bb5c-4d0f-a8a9-e7159bde6d7f", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "update challenge type timeline template", + "item": [ + { + "name": "update challenge type timeline template by admin", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14230,31 +14793,31 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"invalid\": 123,\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge by different copilot 403", + "name": "update challenge type timeline template by m2m", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14277,36 +14840,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot2_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge by user 403", + "name": "failure update challenge type timeline template without token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -14325,40 +14888,35 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{user_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge not found 404", + "name": "failure update challenge type timeline template with invalid token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -14381,36 +14939,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"termsIds\": [21343, 20723, 20645]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TYPEA_ID}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge using m2m token", + "name": "failure update challenge type timeline template with expire token 401", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});" ], "type": "text/javascript" @@ -14433,36 +14991,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenges_update}}" + "value": "Bearer {{expire_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-update-m2m\",\n\t\"description\": \"test-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge using forbidden m2m token 403", + "name": "update challenge type timeline template by m2m Copy Copy Copy", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14485,33 +15043,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_attachments_read}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-update-m2m\",\n\t\"description\": \"test-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge project not found 400", + "name": "failure update challenge type timeline template 400 unexpected field", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -14537,36 +15095,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 10000,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\",\n \"other\": 123\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge user can't access the project 403", + "name": "failure update challenge type timeline template 400 missing timelineTemplateId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -14589,36 +15147,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 200,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\"]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "update challenge 1 with winners by admin Copy", + "name": "failure update challenge type timeline template 400 missing typeId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -14641,33 +15199,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + "raw": "{\n\t\"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge from active to completed status", + "name": "failure update challenge type timeline template 400 invalid typeId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -14693,33 +15251,33 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\"\n}" + "raw": "{\n\t\"typeId\": [\"abc\"],\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge with winners - Duplicate member with placement", + "name": "failure update challenge type timeline template 400 invalid timelineTemplateId", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -14745,36 +15303,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": [\"abc\"]\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge with winners array - same member with multiple placements", + "name": "failure update challenge type timeline template 404 timelineTemplateId doesn't exist", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -14797,36 +15355,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"a69033a4-4f18-4765-addc-f48cf61176d9\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge with winners array - multiple members with one placement", + "name": "failure update challenge type timeline template 404 typeId doesn't exist Copy", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -14849,36 +15407,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 1\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + "raw": "{\n \"typeId\": \"a69033a4-4f18-4765-addc-f48cf61176d9\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure update challenge with empty winners array", + "name": "failure update challenge type timeline template by user 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -14901,43 +15459,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{user_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "partial update challenge", - "item": [ + }, { - "name": "partial update challenge 1 by admin", + "name": "failure update challenge type timeline template by forbidden m2m token 403", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -14945,7 +15496,7 @@ } ], "request": { - "method": "PATCH", + "method": "PUT", "header": [ { "key": "Accept", @@ -14960,36 +15511,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"legacyId\": 789789\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "partial update challenge 1 terms by admin", + "name": "failure update challenge type timeline template 404 not found", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});" ], "type": "text/javascript" @@ -14997,7 +15548,7 @@ } ], "request": { - "method": "PATCH", + "method": "PUT", "header": [ { "key": "Accept", @@ -15012,36 +15563,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"termsIds\": [21343, 20723, 20653]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEA_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEB_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPEA_ID}}" ] } }, "response": [] }, { - "name": "partial update challenge 1 with winners by admin", + "name": "failure update challenge type timeline template 409 conflict", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "4ea1db72-9445-4dae-a372-fcd7c8c9de80", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 409\", function () {", + " pm.response.to.have.status(409);", "});" ], "type": "text/javascript" @@ -15049,7 +15600,7 @@ } ], "request": { - "method": "PATCH", + "method": "PUT", "header": [ { "key": "Accept", @@ -15064,44 +15615,73 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_update}}" } ], "body": { "mode": "raw", - "raw": "{\n\t \"winners\": [\n {\n \"userId\": 12345678,\n \"handle\": \"thomaskranitsas\",\n \"placement\": 1\n },\n {\n \"userId\": 3456789,\n \"handle\": \"tonyy\",\n \"placement\": 2\n }\n ]\n}" + "raw": "{\n\t\"typeId\": \"{{TYPEB_ID}}\",\n \"timelineTemplateId\": \"{{TEMPLATEA_ID}}\"\n}\n" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "bbcd012f-421d-47ac-a81a-8f94afc23f6f", + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "partial update challenge 2 by copilot", + "listen": "test", + "script": { + "id": "df48988e-0120-4a2b-a1b4-61e5c1346a1c", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "delete challenge type timeline template", + "item": [ + { + "name": "delete challenge type timeline template", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});" + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15116,44 +15696,44 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "partial update to endDate", + "name": "failure delete challenge type timeline template 401 missing token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15164,48 +15744,43 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 2000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000\n }\n ]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure - remove default terms - 400", + "name": "failure delete challenge type timeline template 401 invalid token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});" + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15219,45 +15794,45 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer invalid", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"termsIds\": [20653]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure - add non-existing terms - 400", + "name": "failure delete challenge type timeline template 401 expire token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});" + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15271,37 +15846,37 @@ }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{expire_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"termsIds\": [21343, 20723, 20653, 8888]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure - add duplicate terms - 400", + "name": "failure delete challenge type timeline template 403 forbidden", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -15309,7 +15884,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15324,36 +15899,36 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{m2m_read}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"termsIds\": [21343, 20723, 20653, 20723]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure partial update challenge duplicate groups 400", + "name": "failure delete challenge type timeline template 403 using user token", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});" ], "type": "text/javascript" @@ -15361,7 +15936,7 @@ } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15376,44 +15951,44 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{user_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 5000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 6000000\n }\n\t],\n\t\"tags\": [\"tag1\"],\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"groups\": [\"g1\", \"g1\"],\n\t\"attachmentIds\": []\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/{{TYPE_TEMPLATEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "{{TYPE_TEMPLATEA_ID}}" ] } }, "response": [] }, { - "name": "failure partial update challenge null group 400", + "name": "failure delete challenge type timeline template 400 invalid id", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", - "});" + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15433,39 +16008,39 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 5000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 6000000\n }\n\t],\n\t\"tags\": [\"tag1\"],\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"groups\": [null],\n\t\"attachmentIds\": []\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challengeTimelines/invalid", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challengeTimelines", + "invalid" ] } }, "response": [] }, { - "name": "failure partial update challenge by different copilot 403", + "name": "failure delete challenge type timeline template 404 not found", "event": [ { "listen": "test", "script": { - "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "id": "e547ddc3-44a5-413e-a9e7-f98bb2262398", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});" + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "}); " ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "DELETE", "header": [ { "key": "Accept", @@ -15480,36 +16055,94 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot2_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + "raw": "" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challengeTimelines/{{TYPEA_ID}}", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challengeTimelines", + "{{TYPEA_ID}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "8c41ee09-fd79-4adf-b766-37921756ca02", + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "failure partial update challenge not found 404", + "listen": "test", + "script": { + "id": "1102965d-ad2b-4773-aa8f-025949e9e37d", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "8d559524-f741-4e48-811e-3b391c9e1fa7", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "e5f762e7-6dce-4a61-8bf8-c301180228dd", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "Challenges", + "item": [ + { + "name": "create challenge", + "item": [ + { + "name": "create challenge by admin", "event": [ { "listen": "test", "script": { "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"CHALLENGE_ID1\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -15517,51 +16150,51 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{admin_token}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\"\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TYPEA_ID}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge invalid parameter 400", + "name": "create challenge by copilot", "event": [ { "listen": "test", "script": { "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"CHALLENGE_ID2\", pm.response.json().id);", "});" ], "type": "text/javascript" @@ -15569,7 +16202,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15584,36 +16217,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{admin_token}}" + "value": "Bearer {{copilot1_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"invalid\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\"\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge by user 403", + "name": "failure create challenge - duplicate terms - 400", "event": [ { "listen": "test", "script": { "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -15621,7 +16253,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15636,36 +16268,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [\"13bbb3cb-6779-4dc8-9787-26411dfb7925\", \"13bbb3cb-6779-4dc8-9787-26411dfb7925\", \"fb7e4a66-03d3-4918-b328-b1f277b0590b\"]\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge using forbidden m2m token 403", + "name": "failure create challenge - non-existing terms - 400", "event": [ { "listen": "test", "script": { "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -15673,7 +16304,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15688,28 +16319,27 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{m2m_challenge_attachments_read}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"new-update-m2m\",\n\t\"description\": \"patch-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [\"13bbb3cb-6779-4dc8-9787-26411dfb7925\", \"fb7e4a66-03d3-4918-b328-b1f277b0590b\", \"fb7e4a66-03d3-4918-b328-b1f288b0590b\"]\n}" }, "url": { - "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TEST_CHALLENGE_M2M_ID}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge project not found", + "name": "failure create challenge - negative terms ids - 400", "event": [ { "listen": "test", @@ -15725,7 +16355,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15740,36 +16370,35 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"],\n\t\"projectId\": 1000\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [-20653, -20646]\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge user can't access specific project", + "name": "failure create challenge - invalid terms ids - 400", "event": [ { "listen": "test", "script": { "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -15777,7 +16406,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15792,28 +16421,27 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{copilot1_token}}" + "value": "Bearer {{admin_token}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"],\n\t\"projectId\": 200\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"privateDescription\": \"private test description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"termsIds\": [\"Invalid20653\"]\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge from active to completed status", + "name": "failure create challenge invalid tags", "event": [ { "listen": "test", @@ -15829,7 +16457,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15849,23 +16477,22 @@ ], "body": { "mode": "raw", - "raw": "{\n \"status\": \"Active\"\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": {\"tag1\": \"tag2\"},\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge - Duplicate member with placement", + "name": "failure create challenge invalid status", "event": [ { "listen": "test", @@ -15881,7 +16508,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15901,23 +16528,22 @@ ], "body": { "mode": "raw", - "raw": "{\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t}\n\t]\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"status\": \"invalid\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge - same member with multiple placements", + "name": "failure create challenge using invactive time template 400", "event": [ { "listen": "test", @@ -15933,7 +16559,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -15953,23 +16579,22 @@ ], "body": { "mode": "raw", - "raw": "{\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 2\n\t\t}\n\t]\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEB_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"status\": \"Draft\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge - multiple members with one placement", + "name": "failure create challenge using empty prizeSets 400", "event": [ { "listen": "test", @@ -15985,7 +16610,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -16005,23 +16630,22 @@ ], "body": { "mode": "raw", - "raw": "{\n \t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 1\n\t\t}\n\t]\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "failure partial update challenge - with empty winners array", + "name": "failure create challenge using empty prizes array 400", "event": [ { "listen": "test", @@ -16037,7 +16661,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Accept", @@ -16057,38 +16681,30 @@ ], "body": { "mode": "raw", - "raw": "{\n \"winners\": []\n}" + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": []\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "get challenge", - "item": [ + }, { - "name": "get challenge 1 by anonymous user", + "name": "failure create challenge invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "c1b8d8ca-64df-494c-9b8a-8507058e8692", + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16096,42 +16712,101 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": 12345,\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge using empty phases 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID1}}" + "challenges" ] } }, "response": [] }, { - "name": "get challenge 2 by copilot", + "name": "failure create challenge missing parameter 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16139,7 +16814,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -16153,33 +16828,36 @@ }, { "key": "Authorization", - "value": "Bearer {{copilot1_token}}", - "type": "text" + "type": "text", + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t]\n}" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" ] } }, "response": [] }, { - "name": "get challenge 2 by admin", + "name": "failure create challenge invalid settings 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16187,7 +16865,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -16205,29 +16883,32 @@ "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TYPEA_ID}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"status\": \"Draft\"\n}" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" ] } }, "response": [] }, { - "name": "get challenge 2 by user without group access 403", + "name": "failure create challenge invalid phases 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16235,7 +16916,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", @@ -16250,29 +16931,5054 @@ { "key": "Authorization", "type": "text", - "value": "Bearer {{user_token}}" + "value": "Bearer {{admin_token}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"id\": \"{{PHASEA_ID}}\",\n \t\"name\": \"inconsistent\",\n \t\"isActive\": true,\n \t\"duration\": 1000000\n },\n {\n \t\"id\": \"{{PHASED_ID}}\",\n \t\"name\": \"phase-4\",\n \t\t\"isActive\": false,\n\t \t\"duration\": 2000000\n },\n {\n \t\"id\": \"{{TYPEA_ID}}\",\n \t\"name\": \"not-found\",\n \t\"isActive\": true,\n \t\"duration\": 1000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Code\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + }, "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge invalid prizeSet type 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"invalid\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "faiclure reate challenge invalid prize type", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": 1234321,\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\",\n\t\"status\": \"Draft\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge by user 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge using forbidden m2m token 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_read}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge with invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge without token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "create challenge using m2m", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + " pm.environment.set(\"TEST_CHALLENGE_M2M_ID\", pm.response.json().id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_create}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create-m2m\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge project not found 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 10000,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + }, + { + "name": "failure create challenge user can't access specific project", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID2}}\",\n\t\"track\": \"test-track-1\",\n\t\"name\": \"test-create-copilot\",\n\t\"description\": \"test-description\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value3\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID4}}\",\n\t\t\t\"value\": \"value4\"\n\t\t}\n\t],\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 200,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"groups\": [\"group1\", \"group2\"],\n\t\"startDate\": \"2019-06-22T16:28:39.882Z\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "upload attachment", + "item": [ + { + "name": "upload attachment by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " pm.environment.set(\"ATTACHMENT_ID1\", pm.response.json().id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "type": "file", + "src": "/Users/guanpeiyong/Desktop/working2/challenge-api/Verification.md" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "upload attachment by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " pm.environment.set(\"ATTACHMENT_ID2\", pm.response.json().id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "type": "file", + "src": "/Users/guanpeiyong/Desktop/working2/challenge-api/Verification.md" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment by normal user 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment challenge not found 404", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{TYPEA_ID}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TYPEA_ID}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment by copilot not of challenge resource 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot2_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment missing token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer invalid", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{expire_token}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment wrong file name 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "wrong", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "upload attachment using m2m", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " pm.environment.set(\"TEST_ATTACHMENT_M2M_ID\", pm.response.json().id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_attachments_create}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "type": "file", + "src": "/Users/zhulizhong/github/topcoder/topcoder-platform/challenge-api/Verification.md" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}", + "attachments" + ] + } + }, + "response": [] + }, + { + "name": "failure upload attachment using forbidden m2m 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "attachment", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}", + "attachments" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "download attachment", + "item": [ + { + "name": "download attachment by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments", + "{{ATTACHMENT_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "download attachment by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments", + "{{ATTACHMENT_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "download attachment by challenge registrant", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments", + "{{ATTACHMENT_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment challenge id mismatch 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{TYPEA_ID}}/attachments/{{ATTACHMENT_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TYPEA_ID}}", + "attachments", + "{{ATTACHMENT_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment invalid attachment id 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/invalid", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments", + "invalid" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment by expired token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments", + "{{ATTACHMENT_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment by invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{ATTACHMENT_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments", + "{{ATTACHMENT_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment by none challenge registrant 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot2_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments", + "{{ATTACHMENT_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment by anonymous user 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}/attachments/{{ATTACHMENT_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}", + "attachments", + "{{ATTACHMENT_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "download attachment using m2m", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_attachments_read}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments/{{TEST_ATTACHMENT_M2M_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}", + "attachments", + "{{TEST_ATTACHMENT_M2M_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment using forbidden m2m 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}/attachments/{{TEST_ATTACHMENT_M2M_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}", + "attachments", + "{{TEST_ATTACHMENT_M2M_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure download attachment missing attachment id 404", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}/attachments/{{SETTINGA_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}", + "attachments", + "{{SETTINGA_ID}}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "22913a87-9231-4269-a929-a3f5eaa1e265", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "0bf2e29d-7be3-495d-b547-b32adeb54293", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "update challenge", + "item": [ + { + "name": "update challenge 1 by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "update challenge 1 with attachment by M2M", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_update}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "update challenge 1 with winners by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "update challenge 2 by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 4\n\t\t}\n\t],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge remove default terms - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge duplicate terms - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge terms does not exist - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\", \"28841de8-2f42-486f-beac-21d46a823ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge invalid groups 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"],\n\t\"groups\": \"group1 group2\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge attachment not found 404", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{TYPEA_ID}}\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge invalid parameter 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"invalid\": 123,\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID1}}\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge by different copilot 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot2_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge by user 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge without token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge not found 404", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TYPEA_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "update challenge using m2m token", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_update}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-update-m2m\",\n\t\"description\": \"test-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge using forbidden m2m token 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_attachments_read}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-update-m2m\",\n\t\"description\": \"test-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge project not found 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 10000,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge user can't access the project 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-track-1\",\n\t\"name\": \"update-name-1\",\n\t\"description\": \"update-description-1\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n {\n \"phaseId\": \"{{PHASEA_ID}}\",\n \"duration\": 1000000\n },\n {\n \"phaseId\": \"{{PHASEB_ID}}\",\n \"duration\": 2000000\n }\n ],\n \"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"description\": \"desc\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 500\n },\n {\n \"description\": \"desc-second\",\n \"type\": \"second place\",\n \"value\": 250\n }\n ]\n }\n ],\n\t\"reviewType\": \"review type 222\",\n\t\"tags\": [\"tag3\", \"tag4\"],\n\t\"projectId\": 200,\n\t\"forumId\": 456456,\n\t\"status\": \"Active\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\"],\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "update challenge 1 with winners by admin Copy", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge from active to completed status", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Active\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with winners - Duplicate member with placement", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with winners array - same member with multiple placements", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 2\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with winners array - multiple members with one placement", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 1\n\t\t}\n\t],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\",\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure update challenge with empty winners array", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"test-create\",\n\t\"description\": \"test-description\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 600\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 300\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"winners\": [],\n\t\"reviewType\": \"review type 2\",\n\t\"tags\": [\"tag1\", \"tag3\", \"tag4\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456456,\n\t\"legacyId\": 112233,\n\t\"status\": \"Completed\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "partial update challenge", + "item": [ + { + "name": "partial update challenge 1 by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"legacyId\": 789789\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "partial update challenge 1 terms by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "partial update challenge 1 with winners by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t \"winners\": [\n {\n \"userId\": 12345678,\n \"handle\": \"thomaskranitsas\",\n \"placement\": 1\n },\n {\n \"userId\": 3456789,\n \"handle\": \"tonyy\",\n \"placement\": 2\n }\n ]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "partial update challenge 2 by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID3}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "partial update to endDate", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 2000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 10000\n }\n ]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure - remove default terms - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"termsIds\": [\"13bbb3cb-6779-4dc8-9787-26411dfb7925\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure - add non-existing terms - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\", \"28841de8-2f42-486f-beac-21d46a732ab6\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure - add duplicate terms - 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"termsIds\": [\"0fcb41d1-ec7c-44bb-8f3b-f017a61cd708\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\", \"28841de8-2f42-486f-beac-21d46a832ab6\", \"be0652ae-8b28-4e91-9b42-8ad00b31e9cb\"]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge duplicate groups 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 5000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 6000000\n }\n\t],\n\t\"tags\": [\"tag1\"],\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"groups\": [\"g1\", \"g1\"],\n\t\"attachmentIds\": []\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge null group 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 5000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 6000000\n }\n\t],\n\t\"tags\": [\"tag1\"],\n\t\"forumId\": 456456,\n\t\"status\": \"Completed\",\n\t\"groups\": [null],\n\t\"attachmentIds\": []\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge by different copilot 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot2_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge not found 404", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TYPEA_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge invalid parameter 400", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"invalid\": \"{{TEST_TYPE_ID4}}\",\n\t\"track\": \"update-new-track\",\n\t\"name\": \"update-name\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge by user 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge without token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge with invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge with expire token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{expire_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge using forbidden m2m token 403", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_attachments_read}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"typeId\": \"{{TEST_TYPE_ID1}}\",\n\t\"track\": \"test-track\",\n\t\"name\": \"new-update-m2m\",\n\t\"description\": \"patch-update-m2m\",\n\t\"timelineTemplateId\": \"{{TEMPLATEA_ID}}\",\n\t\"phases\": [\n\t\t{\n \t\"phaseId\": \"{{PHASEA_ID}}\",\n \t\"duration\": 1000000\n },\n {\n \t\"phaseId\": \"{{PHASEB_ID}}\",\n\t \t\"duration\": 2000000\n }\n\t],\n\t\"prizeSets\": [\n\t\t{\n\t\t\t\"type\": \"Challenge prizes\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"prizes\": [\n\t\t {\n\t\t \"description\": \"desc-first\",\n\t\t \"type\": \"first place\",\n\t\t \"value\": 500\n\t\t },\n\t\t {\n\t\t \"description\": \"desc-second\",\n\t\t \"type\": \"second place\",\n\t\t \"value\": 250\n\t\t }\n\t\t ]\n\t\t}\n\t],\n\t\"reviewType\": \"review type\",\n\t\"tags\": [\"tag1\", \"tag2\"],\n\t\"projectId\": 123,\n\t\"forumId\": 456,\n\t\"status\": \"Draft\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{TEST_CHALLENGE_M2M_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TEST_CHALLENGE_M2M_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge project not found", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"],\n\t\"projectId\": 1000\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge user can't access specific project", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"update-new-name-1\",\n\t\"challengeSettings\": [\n\t\t{\n\t\t\t\"type\": \"{{TEST_SETTING_ID5}}\",\n\t\t\t\"value\": \"value5\"\n\t\t}\n\t],\n\t\"prizeSets\": [\n {\n \"type\": \"Challenge prizes\",\n \"prizes\": [\n {\n \"description\": \"desc-first\",\n \"type\": \"first place\",\n \"value\": 100\n }\n ]\n }\n ],\n\t\"status\": \"Completed\",\n\t\"attachmentIds\": [\"{{ATTACHMENT_ID2}}\"],\n\t\"groups\": [\"group1\", \"group2\", \"group3\", \"group4\"],\n\t\"projectId\": 200\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge from active to completed status", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"status\": \"Active\"\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge - Duplicate member with placement", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge - same member with multiple placements", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 2\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge - multiple members with one placement", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \t\"winners\": [\n\t\t{\n\t\t\t\"userId\": 12345678,\n\t\t\t\"handle\": \"thomaskranitsas\",\n\t\t\t\"placement\": 1\n\t\t},\n\t\t{\n\t\t\t\"userId\": 3456789,\n\t\t\t\"handle\": \"tonyj\",\n\t\t\t\"placement\": 1\n\t\t}\n\t]\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "failure partial update challenge - with empty winners array", + "event": [ + { + "listen": "test", + "script": { + "id": "03483bad-dfb2-45d1-bf42-35dd3bd46dad", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"winners\": []\n}" + }, + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "get challenge", + "item": [ + { + "name": "get challenge 1 by anonymous user", + "event": [ + { + "listen": "test", + "script": { + "id": "c1b8d8ca-64df-494c-9b8a-8507058e8692", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID1}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge 2 by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{copilot1_token}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge 2 by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge 2 by user without group access 403", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "failure get challenge invalid id 400", + "event": [ + { + "listen": "test", + "script": { + "id": "d24e0eab-d954-4abb-8444-8ef159337f07", + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challenges/invalid-id", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "invalid-id" + ] + } + }, + "response": [] + }, + { + "name": "failure get challenge not found 404", + "event": [ + { + "listen": "test", + "script": { + "id": "d24e0eab-d954-4abb-8444-8ef159337f07", + "exec": [ + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{TYPEA_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge using m2m token with read scope", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenges_read}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge 2 using m2m token without scope", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200)", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{m2m_challenge_attachments_read}}" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + } + }, + "response": [] + }, + { + "name": "get challenge 2 using invalid token", + "event": [ + { + "listen": "test", + "script": { + "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "url": { + "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges", + "{{CHALLENGE_ID2}}" + ] + }, + "description": "it will be consided as anonymous user" + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "search challenge", + "item": [ + { + "name": "search challenge by admin", + "event": [ + { + "listen": "test", + "script": { + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "Bearer {{admin_token}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/challenges?page=1&perPage=10&id={{CHALLENGE_ID1}}&track=track&name=TEST&description=test&reviewType=review type&tag=tag3&projectId=123&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&updatedDateStart=2017-02-22T00:00:00Z&updatedDateEnd=2028-02-22T00:00:00Z&createdBy=Tonyj&updatedBy=Tonyj&memberId=40309246", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "perPage", + "value": "10" + }, + { + "key": "id", + "value": "{{CHALLENGE_ID1}}" + }, + { + "key": "track", + "value": "track" + }, + { + "key": "name", + "value": "TEST" + }, + { + "key": "description", + "value": "test" + }, + { + "key": "reviewType", + "value": "review type" + }, + { + "key": "tag", + "value": "tag3" + }, + { + "key": "projectId", + "value": "123" + }, + { + "key": "createdDateStart", + "value": "2017-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z" + }, + { + "key": "updatedDateStart", + "value": "2017-02-22T00:00:00Z" + }, + { + "key": "updatedDateEnd", + "value": "2028-02-22T00:00:00Z" + }, + { + "key": "createdBy", + "value": "Tonyj" + }, + { + "key": "updatedBy", + "value": "Tonyj" + }, + { + "key": "memberId", + "value": "40309246" + } + ] + } + }, + "response": [] + }, + { + "name": "search challenge by copilot", + "event": [ + { + "listen": "test", + "script": { + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&memberId=40309246", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "createdBy", + "value": "TonyJ", + "disabled": true + }, + { + "key": "createdDateStart", + "value": "2017-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z" + }, + { + "key": "memberId", + "value": "40309246" + } + ] + } + }, + "response": [] + }, + { + "name": "search challenge by copilot using another memberId", + "event": [ + { + "listen": "test", + "script": { + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{copilot1_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&memberId=151743", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "createdBy", + "value": "TonyJ", + "disabled": true + }, + { + "key": "createdDateStart", + "value": "2017-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z" + }, + { + "key": "memberId", + "value": "151743" + } + ] + } + }, + "response": [] + }, + { + "name": "search challenge by normal user", + "event": [ + { + "listen": "test", + "script": { + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "createdBy", + "value": "TonyJ", + "disabled": true + }, + { + "key": "createdDateStart", + "value": "2017-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z" + } + ] + } + }, + "response": [] + }, + { + "name": "search challenge by anonymous user", + "event": [ + { + "listen": "test", + "script": { + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challenges?perPage=100", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ + { + "key": "createdBy", + "value": "TonyJ", + "disabled": true + }, + { + "key": "createdDateStart", + "value": "2017-02-22T00:00:00Z", + "disabled": true + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z", + "disabled": true + }, + { + "key": "perPage", + "value": "100" + } ] } }, "response": [] }, { - "name": "failure get challenge invalid id 400", + "name": "failure search challenge invalid date 400", "event": [ { "listen": "test", "script": { - "id": "d24e0eab-d954-4abb-8444-8ef159337f07", + "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -16297,28 +22003,46 @@ } ], "url": { - "raw": "{{URL}}/challenges/invalid-id", + "raw": "{{URL}}/challenges?perPage=10&createdDateStart=abc&createdDateEnd=2022-03-22T00:00:00Z", "host": [ "{{URL}}" ], "path": [ - "challenges", - "invalid-id" + "challenges" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "createdBy", + "value": "TonyJ", + "disabled": true + }, + { + "key": "createdDateStart", + "value": "abc" + }, + { + "key": "createdDateEnd", + "value": "2022-03-22T00:00:00Z" + } ] } }, "response": [] }, { - "name": "failure get challenge not found 404", + "name": "failure search challenge invalid parameter 400", "event": [ { "listen": "test", "script": { - "id": "d24e0eab-d954-4abb-8444-8ef159337f07", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16340,28 +22064,33 @@ } ], "url": { - "raw": "{{URL}}/challenges/{{TYPEA_ID}}", + "raw": "{{URL}}/challenges?invalid=test-", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{TYPEA_ID}}" + "challenges" + ], + "query": [ + { + "key": "invalid", + "value": "test-" + } ] } }, "response": [] }, { - "name": "get challenge using m2m token with read scope", + "name": "failure search challenge invalid parameter typeId 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16380,36 +22109,36 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenges_read}}" } ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges?typeId=111", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" + ], + "query": [ + { + "key": "typeId", + "value": "111" + } ] } }, "response": [] }, { - "name": "failure get challenge 2 using m2m token without scope 403", + "name": "failure search challenge invalid parameter id 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16428,36 +22157,36 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{m2m_challenge_attachments_read}}" } ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges?id=test-", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" + ], + "query": [ + { + "key": "id", + "value": "test-" + } ] } }, "response": [] }, { - "name": "failure get challenge 2 using invalid token 403", + "name": "failure search challenge invalid parameter timelineTemplateId 400", "event": [ { "listen": "test", "script": { - "id": "0a63d8e6-2604-4836-9d3a-1f4f5b099305", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16476,44 +22205,36 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer invalid" } ], "url": { - "raw": "{{URL}}/challenges/{{CHALLENGE_ID2}}", + "raw": "{{URL}}/challenges?timelineTemplateId=test-", "host": [ "{{URL}}" ], "path": [ - "challenges", - "{{CHALLENGE_ID2}}" + "challenges" + ], + "query": [ + { + "key": "timelineTemplateId", + "value": "test-" + } ] - }, - "description": "it will be consided as anonymous user" + } }, "response": [] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - }, - { - "name": "search challenge", - "item": [ + }, { - "name": "search challenge by admin", + "name": "failure search challenge invalid parameter projectId 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16525,22 +22246,17 @@ "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "type": "text", + "value": "application/json" }, { "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Authorization", - "value": "Bearer {{admin_token}}", - "type": "text" + "type": "text", + "value": "application/json" } ], "url": { - "raw": "{{URL}}/challenges?page=1&perPage=10&id={{CHALLENGE_ID1}}&track=track&name=TEST&description=test&reviewType=review type&tag=tag3&projectId=123&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&updatedDateStart=2017-02-22T00:00:00Z&updatedDateEnd=2028-02-22T00:00:00Z&createdBy=Tonyj&updatedBy=Tonyj&memberId=40309246", + "raw": "{{URL}}/challenges?projectId=test-", "host": [ "{{URL}}" ], @@ -16548,69 +22264,9 @@ "challenges" ], "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "perPage", - "value": "10" - }, - { - "key": "id", - "value": "{{CHALLENGE_ID1}}" - }, - { - "key": "track", - "value": "track" - }, - { - "key": "name", - "value": "TEST" - }, - { - "key": "description", - "value": "test" - }, - { - "key": "reviewType", - "value": "review type" - }, - { - "key": "tag", - "value": "tag3" - }, { "key": "projectId", - "value": "123" - }, - { - "key": "createdDateStart", - "value": "2017-02-22T00:00:00Z" - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z" - }, - { - "key": "updatedDateStart", - "value": "2017-02-22T00:00:00Z" - }, - { - "key": "updatedDateEnd", - "value": "2028-02-22T00:00:00Z" - }, - { - "key": "createdBy", - "value": "Tonyj" - }, - { - "key": "updatedBy", - "value": "Tonyj" - }, - { - "key": "memberId", - "value": "40309246" + "value": "test-" } ] } @@ -16618,15 +22274,15 @@ "response": [] }, { - "name": "search challenge by copilot", + "name": "failure search challenge invalid parameter forumId 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16644,43 +22300,21 @@ { "key": "Content-Type", "type": "text", - "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{copilot1_token}}" - } - ], - "url": { - "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&memberId=40309246", - "host": [ - "{{URL}}" - ], - "path": [ - "challenges" - ], - "query": [ - { - "key": "perPage", - "value": "10" - }, - { - "key": "createdBy", - "value": "TonyJ", - "disabled": true - }, - { - "key": "createdDateStart", - "value": "2017-02-22T00:00:00Z" - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z" - }, + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challenges?forumId=test-", + "host": [ + "{{URL}}" + ], + "path": [ + "challenges" + ], + "query": [ { - "key": "memberId", - "value": "40309246" + "key": "forumId", + "value": "test-" } ] } @@ -16688,15 +22322,15 @@ "response": [] }, { - "name": "search challenge by copilot using another memberId", + "name": "failure search challenge invalid parameter legacyId 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16715,15 +22349,10 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{copilot1_token}}" } ], "url": { - "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z&memberId=151743", + "raw": "{{URL}}/challenges?legacyId=test-", "host": [ "{{URL}}" ], @@ -16732,25 +22361,8 @@ ], "query": [ { - "key": "perPage", - "value": "10" - }, - { - "key": "createdBy", - "value": "TonyJ", - "disabled": true - }, - { - "key": "createdDateStart", - "value": "2017-02-22T00:00:00Z" - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z" - }, - { - "key": "memberId", - "value": "151743" + "key": "legacyId", + "value": "test-" } ] } @@ -16758,15 +22370,15 @@ "response": [] }, { - "name": "search challenge by normal user", + "name": "failure search challenge invalid parameter status 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16785,15 +22397,10 @@ "key": "Content-Type", "type": "text", "value": "application/json" - }, - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{user_token}}" } ], "url": { - "raw": "{{URL}}/challenges?perPage=10&createdDateStart=2017-02-22T00:00:00Z&createdDateEnd=2022-03-22T00:00:00Z", + "raw": "{{URL}}/challenges?status=status-", "host": [ "{{URL}}" ], @@ -16802,21 +22409,8 @@ ], "query": [ { - "key": "perPage", - "value": "10" - }, - { - "key": "createdBy", - "value": "TonyJ", - "disabled": true - }, - { - "key": "createdDateStart", - "value": "2017-02-22T00:00:00Z" - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z" + "key": "status", + "value": "status-" } ] } @@ -16824,15 +22418,15 @@ "response": [] }, { - "name": "search challenge by anonymous user", + "name": "failure search challenge invalid parameter gitRepoURL 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -16854,7 +22448,7 @@ } ], "url": { - "raw": "{{URL}}/challenges?perPage=100", + "raw": "{{URL}}/challenges?gitRepoURL=test-", "host": [ "{{URL}}" ], @@ -16863,23 +22457,8 @@ ], "query": [ { - "key": "createdBy", - "value": "TonyJ", - "disabled": true - }, - { - "key": "createdDateStart", - "value": "2017-02-22T00:00:00Z", - "disabled": true - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z", - "disabled": true - }, - { - "key": "perPage", - "value": "100" + "key": "gitRepoURL", + "value": "test-" } ] } @@ -16887,12 +22466,12 @@ "response": [] }, { - "name": "failure search challenge invalid date 400", + "name": "failure search challenge invalid parameter currentPhaseId 400", "event": [ { "listen": "test", "script": { - "id": "0f5c58f0-3b8c-4a8a-a6c8-2df8bd6d2cf0", + "id": "475c83d7-16fa-4e68-a5ce-5021b0ba1af2", "exec": [ "pm.test(\"Status code is 400\", function () {", " pm.response.to.have.status(400);", @@ -16917,7 +22496,7 @@ } ], "url": { - "raw": "{{URL}}/challenges?perPage=10&createdDateStart=abc&createdDateEnd=2022-03-22T00:00:00Z", + "raw": "{{URL}}/challenges?currentPhaseId=test-", "host": [ "{{URL}}" ], @@ -16926,21 +22505,8 @@ ], "query": [ { - "key": "perPage", - "value": "10" - }, - { - "key": "createdBy", - "value": "TonyJ", - "disabled": true - }, - { - "key": "createdDateStart", - "value": "abc" - }, - { - "key": "createdDateEnd", - "value": "2022-03-22T00:00:00Z" + "key": "currentPhaseId", + "value": "test-" } ] } @@ -16948,7 +22514,7 @@ "response": [] }, { - "name": "failure search challenge invalid parameter 400", + "name": "failure search challenge invalid parameter memberId 400", "event": [ { "listen": "test", @@ -16978,7 +22544,7 @@ } ], "url": { - "raw": "{{URL}}/challenges?invalid=test-", + "raw": "{{URL}}/challenges?memberId=test-", "host": [ "{{URL}}" ], @@ -16987,7 +22553,7 @@ ], "query": [ { - "key": "invalid", + "key": "memberId", "value": "test-" } ] @@ -17499,6 +23065,139 @@ }, "response": [] }, + { + "name": "failure search without token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "f9f7cf4a-e004-4e2a-a045-19993336fb11", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/challengeAuditLogs?challengeId={{CHALLENGE_ID1}}&fieldName=n&createdDateStart=2019-02-22T00:00:00Z&createdDateEnd=2019-03-22T00:00:00Z&createdBy=tonyj", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeAuditLogs" + ], + "query": [ + { + "key": "challengeId", + "value": "{{CHALLENGE_ID1}}" + }, + { + "key": "fieldName", + "value": "n" + }, + { + "key": "createdDateStart", + "value": "2019-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2019-03-22T00:00:00Z" + }, + { + "key": "createdBy", + "value": "tonyj" + } + ] + } + }, + "response": [] + }, + { + "name": "failure search with invalid token 401", + "event": [ + { + "listen": "test", + "script": { + "id": "f9f7cf4a-e004-4e2a-a045-19993336fb11", + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/json" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid" + } + ], + "url": { + "raw": "{{URL}}/challengeAuditLogs?challengeId={{CHALLENGE_ID1}}&fieldName=n&createdDateStart=2019-02-22T00:00:00Z&createdDateEnd=2019-03-22T00:00:00Z&createdBy=tonyj", + "host": [ + "{{URL}}" + ], + "path": [ + "challengeAuditLogs" + ], + "query": [ + { + "key": "challengeId", + "value": "{{CHALLENGE_ID1}}" + }, + { + "key": "fieldName", + "value": "n" + }, + { + "key": "createdDateStart", + "value": "2019-02-22T00:00:00Z" + }, + { + "key": "createdDateEnd", + "value": "2019-03-22T00:00:00Z" + }, + { + "key": "createdBy", + "value": "tonyj" + } + ] + } + }, + "response": [] + }, { "name": "failure search invalid parameter 400", "event": [ @@ -17826,4 +23525,4 @@ } ], "protocolProfileBehavior": {} -} \ No newline at end of file +} diff --git a/docs/topcoder-challenge-api.postman_environment.json b/docs/topcoder-challenge-api.postman_environment.json index 2a042da5..268d4d56 100644 --- a/docs/topcoder-challenge-api.postman_environment.json +++ b/docs/topcoder-challenge-api.postman_environment.json @@ -1,5 +1,5 @@ { - "id": "6534b286-bf4c-4a61-8ae8-8179190ecbe2", + "id": "e2000d9a-93af-4fb0-94e5-2c633c539422", "name": "topcoder-challenge-api", "values": [ { @@ -9,17 +9,17 @@ }, { "key": "user_token", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJkZW5pcyIsImV4cCI6MTU4MjgwMDE2OSwidXNlcklkIjoiMjUxMjgwIiwiaWF0IjoxNTQ5Nzk5NTY5LCJlbWFpbCI6ImVtYWlsQGRvbWFpbi5jb20ueiIsImp0aSI6IjljNDUxMWM1LWMxNjUtNGExYi04OTllLWI2NWFkMGUwMmI1NSJ9.rYOYAZaM9P8c4jwbn7tC4YTSvs0MfO_5ZCMseJ-aqsM", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJkZW5pcyIsImV4cCI6MTY0MjgwMDE2OSwidXNlcklkIjoiMjUxMjgwIiwiaWF0IjoxNTQ5Nzk5NTY5LCJlbWFpbCI6ImVtYWlsQGRvbWFpbi5jb20ueiIsImp0aSI6IjljNDUxMWM1LWMxNjUtNGExYi04OTllLWI2NWFkMGUwMmI1NSJ9.-SUfkKUhxNgLVFNRhCsk1wsm9J9tZHqek2_OlFqrZPw", "enabled": true }, { "key": "copilot1_token", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90IiwiQ29ubmVjdCBTdXBwb3J0Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJHaG9zdGFyIiwiZXhwIjoxNTgyODAwMDc3LCJ1c2VySWQiOiIxNTE3NDMiLCJpYXQiOjE1NDk3OTk0NzcsImVtYWlsIjoiZW1haWxAZG9tYWluLmNvbS56IiwianRpIjoiMTJjMWMxMGItOTNlZi00NTMxLTgzMDUtYmE2NjVmYzRlMWI0In0.Y3SsmT-C21ahWrQQgd2SALDBgC_4qKyrWXesc2cB1Ys", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90IiwiQ29ubmVjdCBTdXBwb3J0Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJHaG9zdGFyIiwiZXhwIjoxNjQyODAwMDc3LCJ1c2VySWQiOiIxNTE3NDMiLCJpYXQiOjE1NDk3OTk0NzcsImVtYWlsIjoiZW1haWxAZG9tYWluLmNvbS56IiwianRpIjoiMTJjMWMxMGItOTNlZi00NTMxLTgzMDUtYmE2NjVmYzRlMWI0In0.EvMG0xEACr9KWffPto50P0kNI51nKbuRicXjldMNN5Q", "enabled": true }, { "key": "copilot2_token", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJob2hvc2t5IiwiZXhwIjoxNTgxNzkyMzcwLCJ1c2VySWQiOiIxNjA5NjgyMyIsImlhdCI6MTU0OTc5MTc3MCwiZW1haWwiOiJlbWFpbEBkb21haW4uY29tLnoiLCJqdGkiOiJmMWU2MTNiZS1kNWI5LTQyMzEtYmFhZS1lZTlmMmQyMjcyMzQifQ.C58nUJ2rb0E5fI3xL34W_qrw7zldrMw4YMjcNA5CuZc", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJjb3BpbG90Il0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJob2hvc2t5IiwiZXhwIjoxNjQxNzkyMzcwLCJ1c2VySWQiOiIxNjA5NjgyMyIsImlhdCI6MTU0OTc5MTc3MCwiZW1haWwiOiJlbWFpbEBkb21haW4uY29tLnoiLCJqdGkiOiJmMWU2MTNiZS1kNWI5LTQyMzEtYmFhZS1lZTlmMmQyMjcyMzQifQ.9uo3TR6Zo3L05r-zveJKiavYYG-JnJPusZUBb9MZY34", "enabled": true }, { @@ -54,7 +54,7 @@ }, { "key": "m2m_token", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUyMTE5NDQ4LCJleHAiOjE1ODIyMDU4NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dXNlcl9wcm9maWxlcyBhbGw6d3JpdGU6dXNlcl9wcm9maWxlcyB3cml0ZTp1c2VyX3Byb2ZpbGVzIHJlYWQ6Y2hhbGxlbmdlcyByZWFkOmdyb3VwcyB1cGRhdGU6c3VibWlzc2lvbiByZWFkOnN1Ym1pc3Npb24gY3JlYXRlOnN1Ym1pc3Npb24gcmVhZDpyZXZpZXdfdHlwZSB1cGRhdGU6cmV2aWV3X3N1bW1hdGlvbiByZWFkOnJldmlld19zdW1tYXRpb24gZGVsZXRlOnJldmlld19zdW1tYXRpb24gY3JlYXRlOnJldmlld19zdW1tYXRpb24gYWxsOnJldmlld19zdW1tYXRpb24gdXBkYXRlOnJldmlldyByZWFkOnJldmlldyBkZWxldGU6cmV2aWV3IGNyZWF0ZTpyZXZpZXcgYWxsOnJldmlldyB3cml0ZTpidXNfYXBpIHJlYWQ6dXNlcl9wcm9maWxlcyByZWFkOnJvbGVzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.DA9HQvYY-bye_4KfAfJTQVAusbGFNXd7ab2p55KZeh8", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUyMTE5NDQ4LCJleHAiOjE2NDIyMDU4NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dXNlcl9wcm9maWxlcyBhbGw6d3JpdGU6dXNlcl9wcm9maWxlcyB3cml0ZTp1c2VyX3Byb2ZpbGVzIHJlYWQ6Y2hhbGxlbmdlcyByZWFkOmdyb3VwcyB1cGRhdGU6c3VibWlzc2lvbiByZWFkOnN1Ym1pc3Npb24gY3JlYXRlOnN1Ym1pc3Npb24gcmVhZDpyZXZpZXdfdHlwZSB1cGRhdGU6cmV2aWV3X3N1bW1hdGlvbiByZWFkOnJldmlld19zdW1tYXRpb24gZGVsZXRlOnJldmlld19zdW1tYXRpb24gY3JlYXRlOnJldmlld19zdW1tYXRpb24gYWxsOnJldmlld19zdW1tYXRpb24gdXBkYXRlOnJldmlldyByZWFkOnJldmlldyBkZWxldGU6cmV2aWV3IGNyZWF0ZTpyZXZpZXcgYWxsOnJldmlldyB3cml0ZTpidXNfYXBpIHJlYWQ6dXNlcl9wcm9maWxlcyByZWFkOnJvbGVzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.Q-IV0XFunyZtRo7dFkK1R9vx7RsTJny3M8t7lCLIDPk", "enabled": true }, { @@ -164,97 +164,97 @@ }, { "key": "m2m_challenges_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZXMgYWxsOmNoYWxsZW5nZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.u03WwiZdEvVfDqG30EQhp5HnlQKmgE-T0x06sSe-ZzU", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZXMgYWxsOmNoYWxsZW5nZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.lCdI9MoI7xe3fQ3VM9ZuccH8VY1xaknBTPel7GmqxXg", "enabled": true }, { "key": "m2m_challenges_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.i3OsNVmEDvfU7K4XpNkj0p3i-iDUKHG-2I6-tXrKlMY", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.5jrCnGH00i6cxDyY_nSKmvNGI-yd_niA9jMN43P5z70", "enabled": true }, { "key": "m2m_challenges_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.MDIhaeUHz6LMV1oGa4hehlXznXjTFjfK89OE3AiVzjY", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.dN4uHhmPN33ljY2YSZmndxAnSXaowQaYENiPL5wjDvc", "enabled": true }, { "key": "m2m_challenge_types_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2VfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.4M706EYL5tMB8Dg6T05SEMV1oMaRfm7ChnJvJQzoc74", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2VfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.Njg1n3o0I8J9aa6y8xdiwfZFIGH2rJmW-7vKv3kXg5I", "enabled": true }, { "key": "m2m_challenge_types_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2VfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.LJmlSbDITIx1x3ZdxglQzUW6WXjjKp2vQ4qQmYMdl6M", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2VfdHlwZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.mEjV3klV9EQB0lYrUdx2ky-kTaVU7hlZcTHAQYa974k", "enabled": true }, { "key": "m2m_challenge_settings_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9zZXR0aW5ncyBhbGw6Y2hhbGxlbmdlX3NldHRpbmdzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.36ZfBKgaDOUa-qGsVJb5Cw0q3oJ96ZSVDtkhfsYuqQc", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9zZXR0aW5ncyBhbGw6Y2hhbGxlbmdlX3NldHRpbmdzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.4aQiQZ4zf_Dj1DxAwpiAJZz-rwHflLtw6V77aeQFiw4", "enabled": true }, { "key": "m2m_challenge_settings_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.M9KLgUBcimBOXf3tQgEQNIh6vC7gzsFL-Lu-5jaCCzI", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.yop9LoMiQhpk5KD7hE6N1zL121J0LygCGv-ODRUOltY", "enabled": true }, { "key": "m2m_challenge_settings_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.XKl4006dakroI_3h87kuxippwU-BMQdSvvvNewxhRQ0", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.4vZsCHKu0ENcuG4ZpYy6s-pJh6_fTMMwmvWE0Rx-YVA", "enabled": true }, { "key": "m2m_challenge_audit_logs_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9hdWRpdF9sb2dzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.SjJOg2r6pW4ziujLFJHMLl02tuBm5waa7c4OTkYTckg", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9hdWRpdF9sb2dzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.pWfWhG1Ngv1T03B1NLCHeCwBTxACcCWysL0gNLlixG8", "enabled": true }, { "key": "m2m_challenge_phases_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9waGFzZXMgYWxsOmNoYWxsZW5nZV9waGFzZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.4yoJzjUCb2O94-G0Mn7emfJWRaoYc6tkpPfSaLf8uaE", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9waGFzZXMgYWxsOmNoYWxsZW5nZV9waGFzZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.p6chyXJfu_MhLCusS8OR6LpUPMUrVAOg3ORlPg_GN7A", "enabled": true }, { "key": "m2m_challenge_phases_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.ZuXRA1ia9meFxW5rhIR-VGwrXkrRBAz9pLEx7i4-cvs", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.eRTCL9QS0S-Gwk1A27xKjNvy7VhN51tOIX6nRy-daT4", "enabled": true }, { "key": "m2m_challenge_phases_delete", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJkZWxldGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.Ozt5SiL2A00dhiCLg8963dQDpTWfikStPDB0gpf60WM", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJkZWxldGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.p9vPmO-poXEFxgA7bLNBs9fKoLlDrLPZlpbM1WDiTb0", "enabled": true }, { "key": "m2m_challenge_phases_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.NQKOMe4GEawWuScfvHwl-zfSg5sfL3KD8Hfe99mz1Ao", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.TuCYJTWarBPGV7JMeGhVEEpTKhwXHCxGvl8I0FZVZVw", "enabled": true }, { "key": "m2m_timeline_templates_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOnRpbWVsaW5lX3RlbXBsYXRlcyBhbGw6dGltZWxpbmVfdGVtcGxhdGVzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.HlBPA0M9t5-_2nOjOJXDGjE-9z8p4w8-7A7PagTFuS4", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOnRpbWVsaW5lX3RlbXBsYXRlcyBhbGw6dGltZWxpbmVfdGVtcGxhdGVzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.NZiFiua2_5DnYOZCKKPmkeP4xS0z06Vm8c2bxybJQ80", "enabled": true }, { "key": "m2m_timeline_templates_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.3G3mKh_4NUi11-Bl2BkEI0xt7TzWcUpeRyrKKDvsBdA", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.wLTdLtHg_T9_gWcY8_gjV_hh3_RnISHqIpnM-TjbIs0", "enabled": true }, { "key": "m2m_timeline_templates_delete", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJkZWxldGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.K6NUc8ra5HfbE1Kq6Wz0X1uva88i9BDPVnxbIXJixLc", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJkZWxldGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.L8YkMmEH786j-DLm4X8FKlr836Wh_y-wuCLPHA9_aKE", "enabled": true }, { "key": "m2m_timeline_templates_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.nm55UrOflneE1Nlch3xKvCUT_038TbTAh_vEBAU8bAU", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDp0aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.qZBv5H905pTfKm2ISfhXVZ7ZJBLqT4eo_6XUlKNt-uo", "enabled": true }, { "key": "m2m_challenge_attachments_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9hdHRhY2htZW50cyBhbGw6Y2hhbGxlbmdlX2F0dGFjaG1lbnRzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.IfJKxmfiiSTdlrf_GUmWut50Y8X0tyaSJIjHHBjBqjM", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZV9hdHRhY2htZW50cyBhbGw6Y2hhbGxlbmdlX2F0dGFjaG1lbnRzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.19Ntb7Z0YnNwtS-_P79UmIaTb6AsFb0L5NdA9tQNhJw", "enabled": true }, { "key": "m2m_challenge_attachments_create", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX2F0dGFjaG1lbnRzIGFsbDpjaGFsbGVuZ2VfYXR0YWNobWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.bjBaMkWFPaWKDKq7SynvjUWH76eiMAWbkiU1Js5j5vc", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlX2F0dGFjaG1lbnRzIGFsbDpjaGFsbGVuZ2VfYXR0YWNobWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.9w-HPsR3XQtFIu_gSSLXHp1KhetgsxKikoa4ChWF4L8", "enabled": true }, { @@ -289,17 +289,17 @@ }, { "key": "m2m_full", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJhbGw6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MgcmVhZDpjaGFsbGVuZ2VfYXVkaXRfbG9ncyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDpjaGFsbGVuZ2VfYXR0YWNobWVudHMgYWxsOmNoYWxsZW5nZV90eXBlX3RpbWVsaW5lX3RlbXBsYXRlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.QcWNQo4dARkdZD7sBfd-JwxEIs5lHhQDs8koWLTVSQw", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJhbGw6Y2hhbGxlbmdlcyBhbGw6Y2hhbGxlbmdlX3R5cGVzIGFsbDpjaGFsbGVuZ2Vfc2V0dGluZ3MgcmVhZDpjaGFsbGVuZ2VfYXVkaXRfbG9ncyBhbGw6Y2hhbGxlbmdlX3BoYXNlcyBhbGw6dGltZWxpbmVfdGVtcGxhdGVzIGFsbDpjaGFsbGVuZ2VfYXR0YWNobWVudHMgYWxsOmNoYWxsZW5nZV90eXBlX3RpbWVsaW5lX3RlbXBsYXRlcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.awnxYbm_pXBG6oFZ_GL5yEynyIs1XFkZYxqejWDwHcA", "enabled": true }, { "key": "m2m_read", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZXMgcmVhZDpjaGFsbGVuZ2VfdHlwZXMgcmVhZDpjaGFsbGVuZ2Vfc2V0dGluZ3MgcmVhZDpjaGFsbGVuZ2VfYXVkaXRfbG9ncyByZWFkOmNoYWxsZW5nZV9waGFzZXMgcmVhZDp0aW1lbGluZV90ZW1wbGF0ZXMgcmVhZDpjaGFsbGVuZ2VfYXR0YWNobWVudHMgcmVhZDpjaGFsbGVuZ2VfdHlwZV90aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ._wkg-agDPSJSNlBFe6vQ5yQSlJUA4dRYuN1yb8Nlgjo", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZXMgcmVhZDpjaGFsbGVuZ2VfdHlwZXMgcmVhZDpjaGFsbGVuZ2Vfc2V0dGluZ3MgcmVhZDpjaGFsbGVuZ2VfYXVkaXRfbG9ncyByZWFkOmNoYWxsZW5nZV9waGFzZXMgcmVhZDp0aW1lbGluZV90ZW1wbGF0ZXMgcmVhZDpjaGFsbGVuZ2VfYXR0YWNobWVudHMgcmVhZDpjaGFsbGVuZ2VfdHlwZV90aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.42z45gBlNrmNnMWotizgQJxSLh8G_3gf2BWoqQJSvjM", "enabled": true }, { "key": "m2m_update", - "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE1ODA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlcyB1cGRhdGU6Y2hhbGxlbmdlcyBjcmVhdGU6Y2hhbGxlbmdlX3R5cGVzIHVwZGF0ZTpjaGFsbGVuZ2VfdHlwZXMgY3JlYXRlOmNoYWxsZW5nZV9zZXR0aW5ncyB1cGRhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGNyZWF0ZTpjaGFsbGVuZ2VfcGhhc2VzIHVwZGF0ZTpjaGFsbGVuZ2VfcGhhc2VzIGRlbGV0ZTpjaGFsbGVuZ2VfcGhhc2VzIGNyZWF0ZTp0aW1lbGluZV90ZW1wbGF0ZXMgdXBkYXRlOnRpbWVsaW5lX3RlbXBsYXRlcyBkZWxldGU6dGltZWxpbmVfdGVtcGxhdGVzIGNyZWF0ZTpjaGFsbGVuZ2VfYXR0YWNobWVudHMgY3JlYXRlOmNoYWxsZW5nZV90eXBlX3RpbWVsaW5lX3RlbXBsYXRlcyB1cGRhdGU6Y2hhbGxlbmdlX3R5cGVfdGltZWxpbmVfdGVtcGxhdGVzIGRlbGV0ZTpjaGFsbGVuZ2VfdHlwZV90aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.8AnqJQ3_JkBVKPPPlKBx4SiN-WtlUqIGXzgvse7N0hg", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjE2NDA5OTI3ODgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6Y2hhbGxlbmdlcyB1cGRhdGU6Y2hhbGxlbmdlcyBjcmVhdGU6Y2hhbGxlbmdlX3R5cGVzIHVwZGF0ZTpjaGFsbGVuZ2VfdHlwZXMgY3JlYXRlOmNoYWxsZW5nZV9zZXR0aW5ncyB1cGRhdGU6Y2hhbGxlbmdlX3NldHRpbmdzIGNyZWF0ZTpjaGFsbGVuZ2VfcGhhc2VzIHVwZGF0ZTpjaGFsbGVuZ2VfcGhhc2VzIGRlbGV0ZTpjaGFsbGVuZ2VfcGhhc2VzIGNyZWF0ZTp0aW1lbGluZV90ZW1wbGF0ZXMgdXBkYXRlOnRpbWVsaW5lX3RlbXBsYXRlcyBkZWxldGU6dGltZWxpbmVfdGVtcGxhdGVzIGNyZWF0ZTpjaGFsbGVuZ2VfYXR0YWNobWVudHMgY3JlYXRlOmNoYWxsZW5nZV90eXBlX3RpbWVsaW5lX3RlbXBsYXRlcyB1cGRhdGU6Y2hhbGxlbmdlX3R5cGVfdGltZWxpbmVfdGVtcGxhdGVzIGRlbGV0ZTpjaGFsbGVuZ2VfdHlwZV90aW1lbGluZV90ZW1wbGF0ZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.a4F8HJc2mH6jDwghLO9UQku2aj0K003Ry3OCmeafuqI", "enabled": true }, { @@ -309,6 +309,6 @@ } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2020-02-27T18:04:41.183Z", - "_postman_exported_using": "Postman/7.19.1" + "_postman_exported_at": "2020-03-23T08:00:10.994Z", + "_postman_exported_using": "Postman/7.13.0" } \ No newline at end of file diff --git a/mock-api/app.js b/mock-api/app.js index 75342d62..784f28ba 100755 --- a/mock-api/app.js +++ b/mock-api/app.js @@ -70,7 +70,7 @@ app.get('/v5/projects/:projectId', (req, res) => { if (projectId === '111' || projectId === '123' || projectId === '112233') { res.json({ projectId, - terms: [21343, 20723] + terms: ['0fcb41d1-ec7c-44bb-8f3b-f017a61cd708', 'be0652ae-8b28-4e91-9b42-8ad00b31e9cb'] }) } else if (projectId === '200') { res.status(403).send({ @@ -126,51 +126,51 @@ app.get('/v5/terms/:termId', (req, res) => { winston.info(`Get terms of use details, termsId = ${termId}`) const terms = { - 21343: { - id: 21343, + '0fcb41d1-ec7c-44bb-8f3b-f017a61cd708': { + id: '0fcb41d1-ec7c-44bb-8f3b-f017a61cd708', title: 'Competition Non-Disclosure Agreement', url: '', text: 'docusign NDA', docusignTemplateId: '0c5b7081-1fff-4484-a20f-824c97a03b9b', agreeabilityType: 'DocuSignable' }, - 21203: { - id: 21203, + '8a0207fc-ac9b-47e7-af1b-81d1ccaf0afc': { + id: '8a0207fc-ac9b-47e7-af1b-81d1ccaf0afc', title: 'Non-Agreeable Terms Test', url: 'www.example.com', text: 'You will need to request access to join these challenges. Please email support@topcoder.com to request access.', agreeabilityType: 'Non-electronically-agreeable' }, - 21213: { - id: 21213, + '453c7c5c-c872-4672-9e78-5162d70903d3': { + id: '453c7c5c-c872-4672-9e78-5162d70903d3', title: 'test 1', url: '', text: 'sf sfsfsdfsd sdf', agreeabilityType: 'Electronically-agreeable' }, - 20645: { - id: 20645, + '28841de8-2f42-486f-beac-21d46a832ab6': { + id: '28841de8-2f42-486f-beac-21d46a832ab6', title: '2008 TCO Marathon Match Competition Official Rules', url: 'http://topcoder.com/mm-terms', text: 'Marathon Competition Official Rules and Regulations', agreeabilityType: 'Electronically-agreeable' }, - 20646: { - id: 20646, + 'fb7e4a66-03d3-4918-b328-b1f277b0590b': { + id: 'fb7e4a66-03d3-4918-b328-b1f277b0590b', title: '2008 TCO Studio Competition Rules', url: 'http://topcoder.com/studio-terms', text: 'Studio Design Official Rules and Regulations', agreeabilityType: 'Electronically-agreeable' }, - 20653: { - id: 20653, + '13bbb3cb-6779-4dc8-9787-26411dfb7925': { + id: '13bbb3cb-6779-4dc8-9787-26411dfb7925', title: 'Open AIM Developer Challenge Rules', url: 'http://topcoder.com/open-aim-terms', text: 'OPEN AIM DEVELOPER CHALLENGE, POWERED BY TOPCODER - Powered by Topcoder', agreeabilityType: 'Electronically-agreeable' }, - 20723: { - id: 20723, + 'be0652ae-8b28-4e91-9b42-8ad00b31e9cb': { + id: 'be0652ae-8b28-4e91-9b42-8ad00b31e9cb', title: 'Subcontractor Services Agreement 2009-09-02', url: 'http://www.topcoder.com/i/terms/Subcontractor+Services+Agreement+2009-09-02.pdf', text: 'Subcontractor Services Agreement 2009-09-02. This agreement is unavailable in text format. Please download the PDF to read its contents', @@ -178,7 +178,7 @@ app.get('/v5/terms/:termId', (req, res) => { } } - if(!_.isUndefined(terms[termId])) { + if (!_.isUndefined(terms[termId])) { winston.info(`Terms details : ${JSON.stringify(terms[termId])}`) res.json(terms[termId]) } else { @@ -193,7 +193,7 @@ app.use((req, res) => { app.use((err, req, res, next) => { winston.error(err) res.status(500).json({ - error: err.message, + error: err.message }) })