Skip to content

Commit 7176508

Browse files
Merge pull request #360 from AmericaSCORESBayArea/feat/taks-statuses
Add endpoint GET `/tasks/statuses`
2 parents ff27849 + 11afebe commit 7176508

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

docs/Scores - Salesforce Data API.postman_collection.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,6 +2404,38 @@
24042404
"description": "BODY/JSON:\n\n{ \n\"TeamSeasonName\": \"\", \n\"TeamId\": \"\", \n\"SeasonId\": \"\", \n\"SchoolSite\": \"\", \n\"Partnership\": \"\", \n\"TotalNoOfPlayers\": 0, \n\"TotalNoOfSessions\": 0, \n\"SeasonStartDate\": \"\", \n\"SeasonEndDate\": \"\", \n\"CoachSoccer\": \"\", \n\"CoachWriting\": \"\", \n\"ProgramCoordinator\": \"\", \n\"ProgramManager\": \"\" \n}"
24052405
},
24062406
"response": []
2407+
},
2408+
{
2409+
"name": "/tasks/statuses",
2410+
"request": {
2411+
"method": "GET",
2412+
"header": [
2413+
{
2414+
"key": "client_id",
2415+
"value": "{{sandbox_client_id}}"
2416+
},
2417+
{
2418+
"key": "client_secret",
2419+
"value": "{{sandbox_client_secret}}"
2420+
},
2421+
{
2422+
"key": "Origin",
2423+
"value": "Postman",
2424+
"type": "text"
2425+
}
2426+
],
2427+
"url": {
2428+
"raw": "{{base_url}}/tasks/statuses",
2429+
"host": [
2430+
"{{base_url}}"
2431+
],
2432+
"path": [
2433+
"tasks",
2434+
"statuses"
2435+
]
2436+
}
2437+
},
2438+
"response": []
24072439
}
24082440
]
24092441
}

src/main/mule/tasks.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,4 +574,19 @@ output application/json
574574
</otherwise>
575575
</choice>
576576
</flow>
577+
<flow name="get:\tasks\statuses:salesforce-data-api-config" doc:id="3988c28e-09bb-40db-a39e-b1524d410a3d" >
578+
<salesforce:describe-sobject doc:name="Describe sobject" doc:id="8d649a07-4555-4fb6-a044-bb90dd7fc44e" config-ref="Salesforce_Config" type="SCORES_Task__c"/>
579+
<ee:transform doc:name="Transform Message" doc:id="270568a7-7791-4198-ab7e-30342c2b23b6" >
580+
<ee:message >
581+
<ee:set-payload ><![CDATA[%dw 2.0
582+
output application/json
583+
---
584+
(
585+
payload.fields
586+
filter (field) -> field.name == "Task_Status__c"
587+
)[0].picklistValues
588+
map (item) -> item.value]]></ee:set-payload>
589+
</ee:message>
590+
</ee:transform>
591+
</flow>
577592
</mule>

src/main/resources/api/salesforce-data-api.raml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,4 +1331,26 @@ uses:
13311331
"Description": "This task is urgent.",
13321332
"TaskTagName": "Urgency Tag"
13331333
}
1334-
]
1334+
]
1335+
/statuses:
1336+
get:
1337+
displayName: Get Task Statuses
1338+
description: Get all possible task status values from Salesforce
1339+
responses:
1340+
200:
1341+
body:
1342+
application/json:
1343+
type: array
1344+
items:
1345+
type: string
1346+
example: ["Not Started", "In Progress", "Completed"]
1347+
400:
1348+
body:
1349+
application/json:
1350+
example:
1351+
message: Bad request
1352+
404:
1353+
body:
1354+
application/json:
1355+
example:
1356+
message: Task statuses not found

0 commit comments

Comments
 (0)