bloom-housing / bloom

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

feat: lottery endpoints #4196

Closed YazeedLoonat closed 2 months ago

YazeedLoonat commented 2 months ago

This PR addresses #4055

Description

This creates the lottery results generation endpoint and the lottery export as csv

another ticket will cover converting that export to a spreadsheet and include the preference sheets

How Can This Be Tested/Reviewed?

Author Checklist:

Review Process:

netlify[bot] commented 2 months ago

Deploy Preview for partners-bloom-dev ready!

Name Link
Latest commit b1c1acb265c7021e0675ae4e7b92df5c9cc1081f
Latest deploy log https://app.netlify.com/sites/partners-bloom-dev/deploys/6699864d0ca8950008be60f3
Deploy Preview https://deploy-preview-4196--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 2 months ago

Deploy Preview for bloom-exygy-dev ready!

Name Link
Latest commit b1c1acb265c7021e0675ae4e7b92df5c9cc1081f
Latest deploy log https://app.netlify.com/sites/bloom-exygy-dev/deploys/6699864dd49f2c0008c2c985
Deploy Preview https://deploy-preview-4196--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 2 months ago

@YazeedLoonat Do you mind filling out the PR template and adding QA notes?

emilyjablonski commented 2 months ago

On a fresh reseed I get a 500 when trying to run the lottery

const res = await this.prisma.applications.findUnique(
 BACKEND_API Inconsistent column data: Error creating UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `g` at 1
 BACKEND_API PrismaClientKnownRequestError:
 BACKEND_API Invalid `this.prisma.applications.findUnique()` invocation in
ludtkemorgan commented 2 months ago

@YazeedLoonat @emilyjablonski I got this to work by running yarn generate:client and then updating the call to the backend in lottery.tsx to be await applicationsService.lotteryGenerate({ body: { listingId: listing.id } }) (It needs "body")

YazeedLoonat commented 2 months ago

On a fresh reseed I get a 500 when trying to run the lottery

const res = await this.prisma.applications.findUnique(
 BACKEND_API Inconsistent column data: Error creating UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `g` at 1
 BACKEND_API PrismaClientKnownRequestError:
 BACKEND_API Invalid `this.prisma.applications.findUnique()` invocation in

Hey @emilyjablonski I think you may be missing migrations if you try running yarn setup instead of just the reseed are you still getting the errors?

emilyjablonski commented 2 months ago

@YazeedLoonat sorry i meant yarn setup:dev!

ludtkemorgan commented 2 months ago

@YazeedLoonat @emilyjablonski That 500 error was the error I was getting before making the change I referenced above

YazeedLoonat commented 2 months ago

Hey @ludtkemorgan ugh my bad I checked the front end and then was fiddling with the api tests when I realized it should be a put instead of a get and just didn't think to double check the ui

updated!

and in general @emilyjablonski @ludtkemorgan updates should be out and ready for ya both!

YazeedLoonat commented 2 months ago

Hey @ludtkemorgan @emilyjablonski @mcgarrye this is re-ready for 👀

YazeedLoonat commented 2 months ago

create new controller/service/module specific for lotteries move generate lottery logic there

will move export generation logic there once spreadsheet switch over happens

YazeedLoonat commented 2 months ago

hey @emilyjablonski @ludtkemorgan this is ready for ya again!

emilyjablonski commented 2 months ago

Let's do it 🫡