|
1 | 1 | {
|
2 | 2 | "info": {
|
3 |
| - "_postman_id": "3eba12ae-a066-4d5a-bdd5-3121377e476b", |
| 3 | + "_postman_id": "4c51e04b-42d3-4c9f-bf08-af02f51f7756", |
4 | 4 | "name": "Project API",
|
5 | 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
6 | 6 | },
|
|
4577 | 4577 | {
|
4578 | 4578 | "name": "Project Phase",
|
4579 | 4579 | "item": [
|
| 4580 | + { |
| 4581 | + "name": "Before Start", |
| 4582 | + "item": [ |
| 4583 | + { |
| 4584 | + "name": "Create project type", |
| 4585 | + "event": [ |
| 4586 | + { |
| 4587 | + "listen": "test", |
| 4588 | + "script": { |
| 4589 | + "exec": [ |
| 4590 | + "pm.test(\"Status code is 201\", function () {", |
| 4591 | + " pm.response.to.have.status(201);", |
| 4592 | + " if(pm.response.status === \"Created\") {", |
| 4593 | + " const response = pm.response.json()", |
| 4594 | + " pm.environment.set(\"projectTypeId\", response.key);", |
| 4595 | + " }", |
| 4596 | + "});" |
| 4597 | + ], |
| 4598 | + "type": "text/javascript" |
| 4599 | + } |
| 4600 | + } |
| 4601 | + ], |
| 4602 | + "request": { |
| 4603 | + "method": "POST", |
| 4604 | + "header": [ |
| 4605 | + { |
| 4606 | + "key": "Content-Type", |
| 4607 | + "value": "application/json" |
| 4608 | + }, |
| 4609 | + { |
| 4610 | + "key": "Authorization", |
| 4611 | + "value": "Bearer {{jwt-token}}" |
| 4612 | + } |
| 4613 | + ], |
| 4614 | + "body": { |
| 4615 | + "mode": "raw", |
| 4616 | + "raw": "{\r\n \"key\": \"new key\",\r\n \"displayName\": \"new displayName\",\r\n \"icon\": \"http://example.com/icon4.ico\",\r\n \t\"question\": \"question 4\",\r\n \t\"info\": \"info 4\",\r\n \t\"aliases\": [\"key-41\", \"key_42\"],\r\n \t\"metadata\": {}\r\n }" |
| 4617 | + }, |
| 4618 | + "url": { |
| 4619 | + "raw": "{{api-url}}/projects/metadata/projectTypes", |
| 4620 | + "host": [ |
| 4621 | + "{{api-url}}" |
| 4622 | + ], |
| 4623 | + "path": [ |
| 4624 | + "projects", |
| 4625 | + "metadata", |
| 4626 | + "projectTypes" |
| 4627 | + ] |
| 4628 | + } |
| 4629 | + }, |
| 4630 | + "response": [] |
| 4631 | + }, |
| 4632 | + { |
| 4633 | + "name": "Create project", |
| 4634 | + "event": [ |
| 4635 | + { |
| 4636 | + "listen": "test", |
| 4637 | + "script": { |
| 4638 | + "exec": [ |
| 4639 | + "pm.test(\"Status code is 201\", function () {", |
| 4640 | + " pm.response.to.have.status(201);", |
| 4641 | + " if(pm.response.status === \"Created\") {", |
| 4642 | + " const response = pm.response.json()", |
| 4643 | + " pm.environment.set(\"projectId\", response.id);", |
| 4644 | + " }", |
| 4645 | + "});" |
| 4646 | + ], |
| 4647 | + "type": "text/javascript" |
| 4648 | + } |
| 4649 | + } |
| 4650 | + ], |
| 4651 | + "request": { |
| 4652 | + "method": "POST", |
| 4653 | + "header": [ |
| 4654 | + { |
| 4655 | + "key": "Authorization", |
| 4656 | + "value": "Bearer {{jwt-token}}" |
| 4657 | + }, |
| 4658 | + { |
| 4659 | + "key": "Content-Type", |
| 4660 | + "value": "application/json" |
| 4661 | + } |
| 4662 | + ], |
| 4663 | + "body": { |
| 4664 | + "mode": "raw", |
| 4665 | + "raw": "{\n\t\"name\": \"test project\",\n\t\"description\": \"Hello I am a test project\",\n\t\"type\": \"{{projectTypeId}}\"\n}" |
| 4666 | + }, |
| 4667 | + "url": { |
| 4668 | + "raw": "{{api-url}}/projects", |
| 4669 | + "host": [ |
| 4670 | + "{{api-url}}" |
| 4671 | + ], |
| 4672 | + "path": [ |
| 4673 | + "projects" |
| 4674 | + ] |
| 4675 | + }, |
| 4676 | + "description": "Valid request body. Project should be created successfully." |
| 4677 | + }, |
| 4678 | + "response": [] |
| 4679 | + }, |
| 4680 | + { |
| 4681 | + "name": "Create project member - 1", |
| 4682 | + "event": [ |
| 4683 | + { |
| 4684 | + "listen": "test", |
| 4685 | + "script": { |
| 4686 | + "exec": [ |
| 4687 | + "pm.test(\"Status code is 201\", function () {", |
| 4688 | + " pm.response.to.have.status(201);", |
| 4689 | + " if(pm.response.status === \"Created\") {", |
| 4690 | + " const response = pm.response.json()", |
| 4691 | + " pm.environment.set(\"phaseMemberId-1\", response.userId);", |
| 4692 | + " }", |
| 4693 | + "});" |
| 4694 | + ], |
| 4695 | + "type": "text/javascript" |
| 4696 | + } |
| 4697 | + } |
| 4698 | + ], |
| 4699 | + "request": { |
| 4700 | + "method": "POST", |
| 4701 | + "header": [ |
| 4702 | + { |
| 4703 | + "key": "Authorization", |
| 4704 | + "value": "Bearer {{jwt-token}}" |
| 4705 | + }, |
| 4706 | + { |
| 4707 | + "key": "Content-Type", |
| 4708 | + "value": "application/json" |
| 4709 | + } |
| 4710 | + ], |
| 4711 | + "body": { |
| 4712 | + "mode": "raw", |
| 4713 | + "raw": "{\n \"userId\": \"40158994\",\n \"role\": \"copilot\"\n}" |
| 4714 | + }, |
| 4715 | + "url": { |
| 4716 | + "raw": "{{api-url}}/projects/{{projectId}}/members", |
| 4717 | + "host": [ |
| 4718 | + "{{api-url}}" |
| 4719 | + ], |
| 4720 | + "path": [ |
| 4721 | + "projects", |
| 4722 | + "{{projectId}}", |
| 4723 | + "members" |
| 4724 | + ] |
| 4725 | + }, |
| 4726 | + "description": "If the request payload is valid, than project member should be created." |
| 4727 | + }, |
| 4728 | + "response": [] |
| 4729 | + }, |
| 4730 | + { |
| 4731 | + "name": "Create project member - 2", |
| 4732 | + "event": [ |
| 4733 | + { |
| 4734 | + "listen": "test", |
| 4735 | + "script": { |
| 4736 | + "exec": [ |
| 4737 | + "pm.test(\"Status code is 201\", function () {", |
| 4738 | + " pm.response.to.have.status(201);", |
| 4739 | + " if(pm.response.status === \"Created\") {", |
| 4740 | + " const response = pm.response.json()", |
| 4741 | + " pm.environment.set(\"phaseMemberId-2\", response.userId);", |
| 4742 | + " }", |
| 4743 | + "});" |
| 4744 | + ], |
| 4745 | + "type": "text/javascript" |
| 4746 | + } |
| 4747 | + } |
| 4748 | + ], |
| 4749 | + "request": { |
| 4750 | + "method": "POST", |
| 4751 | + "header": [ |
| 4752 | + { |
| 4753 | + "key": "Authorization", |
| 4754 | + "value": "Bearer {{jwt-token}}" |
| 4755 | + }, |
| 4756 | + { |
| 4757 | + "key": "Content-Type", |
| 4758 | + "value": "application/json" |
| 4759 | + } |
| 4760 | + ], |
| 4761 | + "body": { |
| 4762 | + "mode": "raw", |
| 4763 | + "raw": "{\n \"userId\": \"40153800\",\n \"role\": \"copilot\"\n}" |
| 4764 | + }, |
| 4765 | + "url": { |
| 4766 | + "raw": "{{api-url}}/projects/{{projectId}}/members", |
| 4767 | + "host": [ |
| 4768 | + "{{api-url}}" |
| 4769 | + ], |
| 4770 | + "path": [ |
| 4771 | + "projects", |
| 4772 | + "{{projectId}}", |
| 4773 | + "members" |
| 4774 | + ] |
| 4775 | + }, |
| 4776 | + "description": "If the request payload is valid, than project member should be created." |
| 4777 | + }, |
| 4778 | + "response": [] |
| 4779 | + } |
| 4780 | + ] |
| 4781 | + }, |
4580 | 4782 | {
|
4581 | 4783 | "name": "Create Phase",
|
4582 | 4784 | "event": [
|
|
4715 | 4917 | },
|
4716 | 4918 | "response": []
|
4717 | 4919 | },
|
| 4920 | + { |
| 4921 | + "name": "Create Phase with members", |
| 4922 | + "event": [ |
| 4923 | + { |
| 4924 | + "listen": "test", |
| 4925 | + "script": { |
| 4926 | + "exec": [ |
| 4927 | + "pm.test(\"Status code is 201\", function () {", |
| 4928 | + " pm.response.to.have.status(201);", |
| 4929 | + " pm.environment.set(\"phaseId\", pm.response.json().id);", |
| 4930 | + "});" |
| 4931 | + ], |
| 4932 | + "type": "text/javascript" |
| 4933 | + } |
| 4934 | + } |
| 4935 | + ], |
| 4936 | + "request": { |
| 4937 | + "method": "POST", |
| 4938 | + "header": [ |
| 4939 | + { |
| 4940 | + "key": "Authorization", |
| 4941 | + "value": "Bearer {{jwt-token}}" |
| 4942 | + }, |
| 4943 | + { |
| 4944 | + "key": "Content-Type", |
| 4945 | + "value": "application/json" |
| 4946 | + } |
| 4947 | + ], |
| 4948 | + "body": { |
| 4949 | + "mode": "raw", |
| 4950 | + "raw": "{\n\t\"name\": \"test project phase\",\n\t\"status\": \"active\",\n\t\"startDate\": \"2018-05-15T00:00:00\",\n\t\"endDate\": \"2018-05-16T00:00:00\",\n\t\"budget\": 20,\n\t\"details\": {\n\t\t\"aDetails\": \"a details\"\n\t},\n \"members\": [{{phaseMemberId-1}},{{phaseMemberId-2}}]\n}" |
| 4951 | + }, |
| 4952 | + "url": { |
| 4953 | + "raw": "{{api-url}}/projects/{{projectId}}/phases", |
| 4954 | + "host": [ |
| 4955 | + "{{api-url}}" |
| 4956 | + ], |
| 4957 | + "path": [ |
| 4958 | + "projects", |
| 4959 | + "{{projectId}}", |
| 4960 | + "phases" |
| 4961 | + ] |
| 4962 | + } |
| 4963 | + }, |
| 4964 | + "response": [] |
| 4965 | + }, |
4718 | 4966 | {
|
4719 | 4967 | "name": "List Phase",
|
4720 | 4968 | "request": {
|
|
5008 | 5256 | },
|
5009 | 5257 | "response": []
|
5010 | 5258 | },
|
| 5259 | + { |
| 5260 | + "name": "Update Phase with members", |
| 5261 | + "request": { |
| 5262 | + "method": "PATCH", |
| 5263 | + "header": [ |
| 5264 | + { |
| 5265 | + "key": "Authorization", |
| 5266 | + "value": "Bearer {{jwt-token}}" |
| 5267 | + }, |
| 5268 | + { |
| 5269 | + "key": "Content-Type", |
| 5270 | + "value": "application/json" |
| 5271 | + } |
| 5272 | + ], |
| 5273 | + "body": { |
| 5274 | + "mode": "raw", |
| 5275 | + "raw": "{\n\t\"name\": \"test project phase xxx\",\n\t\"status\": \"inactive\",\n\t\"startDate\": \"2018-05-14T00:00:00\",\n\t\"endDate\": \"2018-05-15T00:00:00\",\n\t\"budget\": 30,\n\t\"progress\": 15,\n\t\"details\": {\n\t\t\"message\": \"phase details\"\n\t},\n \"members\": [{{phaseMemberId-1}},{{phaseMemberId-2}}]\n}" |
| 5276 | + }, |
| 5277 | + "url": { |
| 5278 | + "raw": "{{api-url}}/projects/{{projectId}}/phases/{{phaseId}}", |
| 5279 | + "host": [ |
| 5280 | + "{{api-url}}" |
| 5281 | + ], |
| 5282 | + "path": [ |
| 5283 | + "projects", |
| 5284 | + "{{projectId}}", |
| 5285 | + "phases", |
| 5286 | + "{{phaseId}}" |
| 5287 | + ] |
| 5288 | + } |
| 5289 | + }, |
| 5290 | + "response": [] |
| 5291 | + }, |
5011 | 5292 | {
|
5012 | 5293 | "name": "Delete Phase",
|
5013 | 5294 | "request": {
|
|
0 commit comments