bloom-housing / bloom

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

Add new backend fields to be able to validate user input on required listing management fields #1791

Open emilyjablonski opened 3 years ago

emilyjablonski commented 3 years ago

The issue here is form fields where we are toggling the answer on some other listing field will make it hard to validate required fields in listings management on the backend

Existing optional fields (according to #1542, we might need a more specific list)

If any of the above fields end up being required, we would need a flag to indicate if the user said "no" to any of them otherwise the backend would not know how to validate.

Existing maybe-required fields (I currently don't have a list of what is required within the unit form)

New additions for application types

Since three of these new questions are required, we definitely at least need new fields for "digitalApplication", "paperApplication", and "referralOpportunity". Currently the backend can validate the required-ness fine if we say yes and fill in the application methods but not if we say no.

Since not all of these fields are required so we don't have the need to validate them on the backend, it seems like we don't need to add flags for all of them. None of the existing ones (apart from maybe the one on the unit form, which idk what’s required there) are required and it seems like those might be okay as-is, but we could also consider adding flags for those and it would simplify the frontend form.

seanmalbert commented 3 years ago

I think the main question, which you raised, is that if a user clicks "Yes" to any of them, regardless of the fields behind them being required, do we want to then say that they have to add that optional field?

If the answer is no, then we can just add the three fields you specified, but if the answer is yes, then we should add all of them. I think we should go with the easiest one first, which is to just add the three you call out. If we find during implementation that it would be easier to add all of them, then we can adjust then.