Page MenuHomePhabricator

Create API endpoints for updating/deleting/getting grant ID
Closed, ResolvedPublic

Description

Acceptance criteria

  • Organizers should be able to add the grant ID to an event using the API
    • The organizer should be able to add the numbers of the grant ID only, e.g., 1234-1234
  • When the organizer sends the request, we should validate that the grant ID is valid.
    • If it is valid, the change should be made
    • If it is invalid, the organizer should receive a error message, which reads: "The Grant ID you entered is invalid."
    • If there is an error due to the Fluxx API, the user should see the following message: "Fluxx is currently unable to validate this Grant ID. Try again in a few minutes."
  • The organizer should be able to edit the grant ID via the API
  • The organizer should be able to delete the grant ID via the API
    • The same validation logic applies to editing grant ID as it does to first entering the grant ID
  • The organizer should be able to obtain the current grant ID for an event by using the API.
  • The API documentation should be created for the following endpoints:
    • Edit grant ID
    • Delete grant ID
    • Get grant ID

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptSep 21 2023, 3:53 PM

Change 969799 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Add hooks

https://gerrit.wikimedia.org/r/969799

Pivoted this to provide new API for updating grant IDs rather than hooks

Change 969799 abandoned by Daimona Eaytoy:

[mediawiki/extensions/CampaignEvents@master] Add hooks

Reason:

Superseded by I2e859edaf922234801339ab489822423273097c9

https://gerrit.wikimedia.org/r/969799

Change 973208 had a related patch set uploaded (by Daimona Eaytoy; author: Mhorsey):

[mediawiki/extensions/WikimediaCampaignEvents@master] Add new endpoints

https://gerrit.wikimedia.org/r/973208

Daimona renamed this task from Hooks for the enable/edit/get registration API endpoints, analogous to those for the special pages to Create API endpoints for updating/deleting/getting grant ID.Nov 21 2023, 2:41 PM

Change 976240 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/WikimediaCampaignEvents@master] Add endpoint for obtaining grant ID

https://gerrit.wikimedia.org/r/976240

Change 973208 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCampaignEvents@master] Add new endpoints

https://gerrit.wikimedia.org/r/973208

Change 976240 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCampaignEvents@master] Add endpoint for obtaining grant ID

https://gerrit.wikimedia.org/r/976240

โœ… Organizers should be able to add the grant ID to an event using the API

Screenshot 2023-12-01 at 2.14.14 PM.png (1ร—2 px, 238 KB)


โœ… The organizer should be able to add the numbers of the grant ID only, e.g., 1234-1234

Any letters I put in with the test grant IDs were not accepted:

numbers onlyletters / numbers
Screenshot 2023-12-01 at 2.50.18 PM.png (1ร—1 px, 182 KB)
Screenshot 2023-12-01 at 2.50.54 PM.png (1ร—1 px, 247 KB)

When the organizer sends the request, we should validate that the grant ID is valid.
โœ… If it is valid, the change should be made

Screenshot 2023-12-01 at 2.50.18 PM.png (1ร—1 px, 182 KB)

โœ… If it is invalid, the organizer should receive a error message, which reads: "The Grant ID you entered is invalid."
Screenshot 2023-12-01 at 2.51.38 PM.png (1ร—1 px, 244 KB)

โœ… If there is an error due to the Fluxx API, the user should see the following message: "Fluxx is currently unable to validate this Grant ID. Try again in a few minutes."
Screenshot 2023-12-01 at 4.09.30 PM.png (1ร—2 px, 283 KB)


โœ… The organizer should be able to edit the grant ID via the API

Screenshot 2023-12-01 at 3.01.50 PM.png (1ร—1 px, 178 KB)


โœ… The organizer should be able to delete the grant ID via the API

Screenshot 2023-12-01 at 3.03.09 PM.png (1ร—2 px, 208 KB)


โœ… The same validation logic applies to editing grant ID as it does to first entering the grant ID
This works the same for a new event the first time entering in the grant ID as it does to editing an event

editing the grant IDfirst entering the grant ID
Screenshot 2023-12-01 at 3.14.20 PM.png (1ร—2 px, 205 KB)
Screenshot 2023-12-01 at 4.04.15 PM.png (898ร—2 px, 176 KB)

โœ… The organizer should be able to obtain the current grant ID for an event by using the API.

Screenshot 2023-12-01 at 3.08.43 PM.png (1ร—2 px, 199 KB)


The API documentation should be created for the following endpoints:

  • โœ… Edit grant ID
  • โœ… Delete grant ID
  • โœ… Get grant ID