bloom-housing / bloom

Bloom is Exygy’s affordable housing platform. Bloom's goal is to be a single entry point for affordable housing seekers and a hub for application and listing management for developers.
https://bloomhousing.com
Apache License 2.0
33 stars 25 forks source link

feat: lottery expiration frontend and cron job #4184

Closed mcgarrye closed 3 months ago

mcgarrye commented 4 months ago

This PR addresses #(4058)

Description

Adds frontend logic for partner and jurisdictional admins to warn them that the lottery will expire by a certain data and to hide all date once the lottery has expired. Design/copy: https://www.figma.com/design/PAeCVANDmGdTz2Y53ouErM/Lotteries?node-id=3528-20867&t=Fn6TV5lcbTvuSqrN-0 https://www.figma.com/design/Kcsf148FqeUqMNeMo54BsW/Ad-Hoc-Feature-Enhancements?node-id=2418-16131

Creates cron job to expire lotteries. Uses an env variable to set the expiration limit in days.

Unit and E2E tests included

How Can This Be Tested/Reviewed?

Setup: add LOTTERY_DAYS_TILL_EXPIRY=45 to your api and partners env files

  1. Sign into Partners Portal and close a listing with a lottery
  2. As an admin, go to the Lottery tab of the closed listing and open the run modal. Verify that expiration statement is present at the top. Run the lottery, releasedToPartners.
  3. As a partner or jurisdictional admin, go to the Lottery tab of the closed listing with a released lottery. Publish the lottery. Verify yellow warning is present at the top of the section with the expiration date included.
  4. In the database, edit the closedAt date on the listing to 45 (or more) days ago. Or change your env variable to 0.
  5. Sign into the Swagger UI page as an admin or jurisdictional admin. Trigger the cron job with the listings/expireLotteries endpoint.
  6. Sign into the Partners Portal as a partner or jurisdictional admin, go to the Lottery tab of the closed listing with a ran lottery. Verify lottery is expired and no data is shown.

Author Checklist:

Review Process:

netlify[bot] commented 4 months ago

Deploy Preview for partners-bloom-dev ready!

Name Link
Latest commit 35e749e3d9e4080cf5931ddb5b99d3510169d12b
Latest deploy log https://app.netlify.com/sites/partners-bloom-dev/deploys/669fe77d9258cb0008d0cdd2
Deploy Preview https://deploy-preview-4184--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.

netlify[bot] commented 4 months ago

Deploy Preview for bloom-exygy-dev ready!

Name Link
Latest commit 35e749e3d9e4080cf5931ddb5b99d3510169d12b
Latest deploy log https://app.netlify.com/sites/bloom-exygy-dev/deploys/669fe77da221040008fd14a9
Deploy Preview https://deploy-preview-4184--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.