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: adding randomization tooling to export service #4159

Closed YazeedLoonat closed 4 months ago

YazeedLoonat commented 4 months ago

This PR addresses https://github.com/bloom-housing/bloom/issues/4055

Description

This adds the randomizer for lottery to the csv export it doesn't expose a way to do this, but there are unit tests to demo how it'll work

How Can This Be Tested/Reviewed?

the endpoints and stuff are coming in a part 2, this is just the randomization logic and unit tests

Author Checklist:

Review Process:

netlify[bot] commented 4 months ago

Deploy Preview for partners-bloom-dev ready!

Name Link
Latest commit 26dd612c627ad821818164d6ad5840de709cff37
Latest deploy log https://app.netlify.com/sites/partners-bloom-dev/deploys/667c4f39a6c53c0008739280
Deploy Preview https://deploy-preview-4159--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 26dd612c627ad821818164d6ad5840de709cff37
Latest deploy log https://app.netlify.com/sites/bloom-exygy-dev/deploys/667c4f39d7a5e20008d93a97
Deploy Preview https://deploy-preview-4159--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.

emilyjablonski commented 4 months ago

Have you had the opportunity to performance test this?

YazeedLoonat commented 4 months ago

Hey @emilyjablonski because of your comment I changed a few things. The biggest change is how we were inserting the application lottery order into the database. Before it was doing 1 write per application + 1 write per application where a preference was claimed

which could be A LOT of writes to the databse.

I switched it to use a createMany() call instead so now there is 1 write for all the applications, and 1 write per preference on the listing which is WAY WAY down

excellent call out!

I haven't been able to truly load test this since its not really attached to any endpoints quite yet, but that will definitely need to happen when we go to create the endpoints

YazeedLoonat commented 4 months ago

Hey @mcgarrye made updates and left you some comments back, lemme know what you think

mcgarrye commented 4 months ago

Hey @mcgarrye made updates and left you some comments back, lemme know what you think

Looks great

YazeedLoonat commented 4 months ago

Hey @ludtkemorgan made some updates per your comments, if you wanna take a lil peek and then we can switch the label and merge this in!