openedx / edx-enterprise

GNU Affero General Public License v3.0
43 stars 46 forks source link

feat: add failed statuses for groups #2159

Closed katrinan029 closed 2 months ago

katrinan029 commented 2 months ago

Currently, the frontend lacks the data to show failed statuses from both Braze and internal API errors. This work introduces two new failed statuses, email_error and internal_api_error, and incorporates an additional field errored_at into the EnterpriseGroupMembership model.

Additionally, a new method has been implemented to allow for patch requests to the endpoint api/v1/enterprise-group/<group_uuid>/learners/. This method allows updating group membership records for email errors that occur in enterprise-access. That related PR can be found here: https://github.com/openedx/enterprise-access/pull/501

https://2u-internal.atlassian.net/browse/ENT-9040

Testing the endpoint locally

  1. checkout both branches knguyen2/ent-9040 and https://github.com/openedx/enterprise-access/pull/501
  2. create an enterprise group at http://localhost:18000/admin/enterprise/enterprisegroup/
  3. create a group membership http://localhost:18000/admin/enterprise/enterprisegroupmembership/
  4. from postman, send a patch request with body (raw) to http://localhost:18000/enterprise/api/v1/enterprise-group/<group_uuid>/learners/: { "learner": "edx@exampl.com", "status": "internal_api_error" }
  5. confirm that the status was updated at the endpoing http://localhost:18000/enterprise/api/v1/enterprise-group/<group_uuid>/learners/

Merge checklist:

Post merge: