JustUtahCoders / utahexpungements.org

The frontend code for utahexpungements.org
MIT License
11 stars 19 forks source link

add class b misdemeanor flag #161

Closed joevus closed 4 years ago

joevus commented 4 years ago

Addresses https://github.com/JustUtahCoders/utahexpungements.org/issues/141

I just put this up real quick, still need to review it, but thought I'd put it up here to get some eyes on it to make sure I'm going the right direction.

@benschinn are there any tests I should run to make sure nothing broke? @tuckersamuelsen does a "Class B Misdemeanor" always show up with this capitalization?

Also, I'm first counting the charges to check that there are 4 or more. Then I loop through the charges to see if there are at least 3 that are Class B. The description says to check the convictions rather than charges so wanted to check if I'm doing that right.

schinns commented 4 years ago

As far as tests, the CI runs tests, so if any existing tests fail you should know. You bring up a great point though, we might want unit tests for our flag utils.

tuckersamuelsen commented 4 years ago

Addresses #141

I just put this up real quick, still need to review it, but thought I'd put it up here to get some eyes on it to make sure I'm going the right direction.

@benschinn are there any tests I should run to make sure nothing broke? @tuckersamuelsen does a "Class B Misdemeanor" always show up with this capitalization?

Also, I'm first counting the charges to check that there are 4 or more. Then I loop through the charges to see if there are at least 3 that are Class B. The description says to check the convictions rather than charges so wanted to check if I'm doing that right.

@joevus to my knowledge, yes. Are you looking within 1 docket? If yes, you'll only have to confirm the presence of a Misdemeanor B, and not add up charges. It doesn't count multiple charges as multiple convictions, if that makes sense.

joevus commented 4 years ago

@tuckersamuelsen Yes, I believe this is checking only one docket. So now I've changed the code to check for at least one charge with a class b misdemeanor on 1 docket. I guess the checking if there are 3 convictions will come later after they upload multiple dockets.

@lukeschunk the code changed since I don't have to count class b misdemeanor charges anymore per @tuckersamuelsen's comment. Using a forEach method, but happy to take any suggestions to clean it up.