Skip to content

Commit

Permalink
Updated Postman tests for project fiscals
Browse files Browse the repository at this point in the history
  • Loading branch information
agordon-vivid committed Jan 8, 2025
1 parent 545bf8f commit ef75817
Showing 1 changed file with 210 additions and 0 deletions.
210 changes: 210 additions & 0 deletions postman/Prevention.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,133 @@
},
"response": []
},
{
"name": "Create Project Fiscal",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// Parse the response JSON",
"const response = pm.response.json();",
"",
"// Check if the access token exists in the response",
"if (response.projectPlanFiscalGuid) {",
" // Save the token to an environment variable",
" pm.environment.set(\"projectPlanFiscalGuid\", response.projectPlanFiscalGuid);",
" console.log(\"Project Fiscl Guid saved successfully!\");",
"} else {",
" console.error(\"Failed to set project Fiscal guid:\", response);",
"}"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"projectGuid\": \"{{projectGuid}}\",\n \"activityCategoryCode\": \"TACT_PLAN\",\n \"fiscalYear\": 2023,\n \"projectPlanStatusCode\": \"ACTIVE\",\n \"planFiscalStatusCode\": \"PLANNED\",\n \"projectFiscalName\": \"Fiscal Project 1\",\n \"projectFiscalDescription\": \"This is a test project fiscal description.\",\n \"businessAreaComment\": \"Test comment\",\n \"estimatedClwrrAllocAmount\": 1000.00,\n \"totalCostEstimateAmount\": 2000.00,\n \"fiscalFundingRequestAmount\": 1500.00,\n \"fiscalAllocatedAmount\": 1200.00,\n \"fiscalAncillaryFundAmount\": 300.00,\n \"fiscalPlannedProjectSizeHa\": 10.5,\n \"fiscalPlannedCostPerHaAmt\": 500.00,\n \"fiscalReportedSpendAmount\": 0.00,\n \"fiscalActualAmount\": 0.00,\n \"fiscalCompletedSizeHa\": 0.0,\n \"fiscalActualCostPerHaAmt\": 0.0,\n \"firstNationsDelivPartInd\": true,\n \"firstNationsEngagementInd\": false,\n \"firstNationsPartner\": \"Test Partner\",\n \"resultsNumber\": \"RN123456\",\n \"resultsOpeningId\": \"RO12345\",\n \"resultsContactEmail\": \"[email protected]\",\n \"submittedByName\": \"Test User\",\n \"submittedByUserGuid\": \"123e4567-e89\",\n \"submittedByUserUserid\": \"testuser\",\n \"submissionTimestamp\": \"2024-01-01T12:00:00Z\",\n \"isApprovedInd\": true,\n \"isDelayedInd\": false\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{LOCAL_API_URL}}/projectFiscals",
"host": [
"{{LOCAL_API_URL}}"
],
"path": [
"projectFiscals"
]
}
},
"response": []
},
{
"name": "Update Project Fiscal",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"projectPlanFiscalGuid\": \"{{projectPlanFiscalGuid}}\",\n \"projectGuid\": \"{{projectGuid}}\",\n \"activityCategoryCode\": \"RX_DEV\",\n \"fiscalYear\": 2024,\n \"projectPlanStatusCode\": \"ACTIVE\",\n \"planFiscalStatusCode\": \"PLANNED\",\n \"projectFiscalName\": \"Fiscal Project 1\",\n \"projectFiscalDescription\": \"This is a test project fiscal description.\",\n \"businessAreaComment\": \"Test comment\",\n \"estimatedClwrrAllocAmount\": 1000.00,\n \"totalCostEstimateAmount\": 2000.00,\n \"fiscalFundingRequestAmount\": 1500.00,\n \"fiscalAllocatedAmount\": 1200.00,\n \"fiscalAncillaryFundAmount\": 300.00,\n \"fiscalPlannedProjectSizeHa\": 10.5,\n \"fiscalPlannedCostPerHaAmt\": 500.00,\n \"fiscalReportedSpendAmount\": 0.00,\n \"fiscalActualAmount\": 0.00,\n \"fiscalCompletedSizeHa\": 0.0,\n \"fiscalActualCostPerHaAmt\": 0.0,\n \"firstNationsDelivPartInd\": true,\n \"firstNationsEngagementInd\": false,\n \"firstNationsPartner\": \"Test Partner\",\n \"resultsNumber\": \"RN123456\",\n \"resultsOpeningId\": \"RO12345\",\n \"resultsContactEmail\": \"[email protected]\",\n \"submittedByName\": \"Test User\",\n \"submittedByUserGuid\": \"123e4567-e89\",\n \"submittedByUserUserid\": \"testuser\",\n \"submissionTimestamp\": \"2024-01-01T12:00:00Z\",\n \"isApprovedInd\": true,\n \"isDelayedInd\": false\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{LOCAL_API_URL}}/projectFiscals/{{projectPlanFiscalGuid}}",
"host": [
"{{LOCAL_API_URL}}"
],
"path": [
"projectFiscals",
"{{projectPlanFiscalGuid}}"
]
}
},
"response": []
},
{
"name": "GET Projects",
"request": {
Expand Down Expand Up @@ -518,6 +645,89 @@
},
"response": []
},
{
"name": "Get ProjectFiscal",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{LOCAL_API_URL}}/projectFiscals/{{projectPlanFiscalGuid}}",
"host": [
"{{LOCAL_API_URL}}"
],
"path": [
"projectFiscals",
"{{projectPlanFiscalGuid}}"
]
}
},
"response": []
},
{
"name": "Get ProjectFiscals",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{LOCAL_API_URL}}/projectFiscals",
"host": [
"{{LOCAL_API_URL}}"
],
"path": [
"projectFiscals"
]
}
},
"response": []
},
{
"name": "Delete Project Fiscal",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"url": {
"raw": "{{LOCAL_API_URL}}/projectFiscals/{{projectPlanFiscalGuid}}",
"host": [
"{{LOCAL_API_URL}}"
],
"path": [
"projectFiscals",
"{{projectPlanFiscalGuid}}"
]
}
},
"response": []
},
{
"name": "Delete Project",
"request": {
Expand Down

0 comments on commit ef75817

Please sign in to comment.