bloom-housing / bloom

component-based web framework for affordable housing management
Apache License 2.0
34 stars 24 forks source link

feat: lotteries history log #4235

Closed emilyjablonski closed 1 month ago

emilyjablonski commented 1 month ago

This PR addresses #4052

Description

Adds the backend and hooks up the frontend for the history log for lotteries.

Also moves lottery endpoints out of the listing service and into the lottery service.

How Can This Be Tested/Reviewed?

The following events should be captured in the lottery history log:

  1. Listing closed
  2. Lottery ran
  3. Lottery re-ran
  4. Lottery released
  5. Lottery retracted
  6. Lottery published

Admins should be able to see all actions but partners cannot see run or re-run. The strings are in the Figma file at each step.

This PR captures the lottery status changes using the activity log interceptor and adds a new endpoint to return a formatted lottery history log. We needed to manipulate some of the data to understand when a lottery was run or retracted.

You can test this on the frontend with an admin user and perform all the actions, and then log-in as a partner user once the lottery is released and ensure you can only see the events you are supposed to see.

The re-run button is not currently hooked up, so I was unable to test that flow through the UI but it is covered in tests.

Author Checklist:

Review Process:

netlify[bot] commented 1 month ago

Deploy Preview for bloom-exygy-dev ready!

Name Link
Latest commit f6ebeaba39df8e8151ce4d6a28d8a8f6f7b16ea6
Latest deploy log https://app.netlify.com/sites/bloom-exygy-dev/deploys/66bce47298bcaf0008ccf459
Deploy Preview https://deploy-preview-4235--bloom-exygy-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 1 month ago

Deploy Preview for partners-bloom-dev ready!

Name Link
Latest commit f6ebeaba39df8e8151ce4d6a28d8a8f6f7b16ea6
Latest deploy log https://app.netlify.com/sites/partners-bloom-dev/deploys/66bce472b8526500086e4af4
Deploy Preview https://deploy-preview-4235--partners-bloom-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

mcgarrye commented 1 month ago

Is there a reason we don't want to include Expired in the history log?

Update: after looking at the code it seems 'Errored' will appear in the log