Skip to content

Commit

Permalink
Merge pull request #1733 from emko-274/summary_pdf_to_zip
Browse files Browse the repository at this point in the history
changes to downloadables and relevant tests
  • Loading branch information
emko-274 authored Jul 26, 2024
2 parents 18d73bf + 0129968 commit aff5f38
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 31 deletions.
15 changes: 9 additions & 6 deletions src/backend/expungeservice/charge_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,17 @@ def _sex_crime(statute):
return AmbiguousChargeTypeWithQuestion([SexCrime()])
elif statute in SexCrime.romeo_and_juliet_exceptions:
question_string = """
Select "Yes" if ALL of the following are true:
1. The victim's lack of consent was solely due to age (statutory rape) AND
2. You were under 23 years old when the act occurred AND
3. The victim was less than five years younger than you when the act occurred
Select "No" if all of the following are true:
1. Are you required to report as a sex offender?
2. Do you have any charges that are not eligible for expungement?
3. Is your sex offense conviction a Class A or Class B Felony?
If your answer to ALL 3 of these questions is "NO", this charge may be eligible for expungement.
"""
options = {
"Yes (Rare, contact [email protected])": RomeoAndJulietNMASexCrime(),
"No": RomeoAndJulietIneligibleSexCrime(),
"Yes": RomeoAndJulietIneligibleSexCrime(),
"No (Rare, contact [email protected])": RomeoAndJulietNMASexCrime(),
}
return ChargeClassifier._build_ambiguous_charge_type_with_question(question_string, options)

Expand Down
1 change: 1 addition & 0 deletions src/backend/expungeservice/models/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Case(OeciCase):

def has_eligible_conviction(self):
eligible_charges, ineligible_charges = Case.partition_by_eligibility(self.charges)
#add needs more analysis charges if made eligible
dismissals, convictions = Case.categorize_charges(eligible_charges)
return len(convictions) > 0

Expand Down
7 changes: 5 additions & 2 deletions src/backend/expungeservice/pdf/markdown_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def to_markdown(record: Dict, header: Optional[str] = None, aliases: List[Dict]
for x in record["summary"]["charges_grouped_by_eligibility_and_case"]
if x[0] == "Eligible Now If Balance Paid"
]

county_fines = [x for x in record["summary"]["county_fines"]]
eligible_charges_by_date = record["summary"]["charges_grouped_by_eligibility_and_case"]
future_eligible_charges = [
(key, eligible_charges_for_date)
Expand All @@ -35,7 +37,8 @@ def to_markdown(record: Dict, header: Optional[str] = None, aliases: List[Dict]
ineligible_case_charges=ineligible_case_charges,
eligible_if_paid_case_charges=eligible_if_paid_case_charges,
future_eligible_charges=sorted(future_eligible_charges, key=MarkdownRenderer._sort_future_eligible),
needs_more_analysis_charges=needs_more_analysis_charges
needs_more_analysis_charges=needs_more_analysis_charges,
county_fines = county_fines,
)

@staticmethod
Expand Down Expand Up @@ -72,4 +75,4 @@ def _sort_future_eligible(group):
return date.isoformat()
except ValueError:
pass
return label
return label
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ Name: {{ name }}
{% endif %}

## PLEASE READ THIS

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.

{% if has_open_cases %}
<b>You have open charges. You are not eligible to expunge ANY records, including old charges, while you have open charges.</b>
{% endif %}
Expand Down Expand Up @@ -55,7 +51,6 @@ These convictions are not eligible for expungement at any time under the current
{% include 'partials/case.md.j2' %}
{% endfor %}
{% endif %}

{% if eligible_if_paid_case_charges | count > 0 %}
## Charges Eligible Now If Balance Paid
These convictions are eligible as soon as the balance of fines on the case is paid.
Expand Down Expand Up @@ -86,3 +81,17 @@ Additionally, you have charges for which the online records do not contain enoug
{% include 'partials/case.md.j2' %}
{% endfor %}
{% endif %}
{% if county_fines | count > 0 %}
## Balance Due by County
{% for county in county_fines %}
{% if county['case_fines'] | length > 0 %}
{{county['county_name']}}
{% for fine in county['case_fines'] %}
{{fine['case_number']}} - {{fine['balance']}}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.
6 changes: 3 additions & 3 deletions src/backend/tests/models/charge_types/test_sex_crimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def test_sex_crimes_with_romeo_and_juliet_exception(sex_crimes_statute):
name="Generic", statute=sex_crimes_statute, level="Misdemeanor Class A", disposition=Dispositions.CONVICTED
)
type_eligibility = RecordMerger.merge_type_eligibilities(charges)
assert isinstance(charges[0].charge_type, RomeoAndJulietNMASexCrime)
assert isinstance(charges[1].charge_type, RomeoAndJulietIneligibleSexCrime)
assert isinstance(charges[1].charge_type, RomeoAndJulietNMASexCrime)
assert isinstance(charges[0].charge_type, RomeoAndJulietIneligibleSexCrime)
assert type_eligibility.status is EligibilityStatus.INELIGIBLE
assert (
type_eligibility.reason
== "Young Offender Sex Crime, Needs More Analysis – Possibly meets requirements under 137.225(6)(f) - Email [email protected] with subject line '6F' for free and confidential further analysis OR Young Offender Sex Crime, Ineligible – Fails to meet requirements under 137.225(6)(f)"
== "Young Offender Sex Crime, Ineligible – Fails to meet requirements under 137.225(6)(f) OR Young Offender Sex Crime, Needs More Analysis – Possibly meets requirements under 137.225(6)(f) - Email [email protected] with subject line '6F' for free and confidential further analysis"
)
11 changes: 6 additions & 5 deletions src/backend/tests/pdf/expected/custom_header.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

## PLEASE READ THIS

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.


### Assumptions
<b>1) Successful completion of court requirements</b> &nbsp; If you are currently on probation or conditional discharge, the analysis below assumes that you will successfully complete those requirements.

Expand All @@ -24,7 +20,6 @@ If the above assumptions are not true for you and you would like an updated anal
## Charges Eligible Now
You are not currently eligible to expunge any charges.


## Charges Eligible Now If Balance Paid
These convictions are eligible as soon as the balance of fines on the case is paid.

Expand All @@ -33,3 +28,9 @@ These convictions are eligible as soon as the balance of fines on the case is pa
- CASEJD1: Possession of Cocaine (DISMISSED) Charged Feb 17, 2009


## Balance Due by County
Multnomah
CASEJD1 - 529.08

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.
11 changes: 6 additions & 5 deletions src/backend/tests/pdf/expected/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ Name: JOHN DOE

## PLEASE READ THIS

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.


### Assumptions
<b>1) Successful completion of court requirements</b> &nbsp; If you are currently on probation or conditional discharge, the analysis below assumes that you will successfully complete those requirements.

Expand All @@ -27,7 +23,6 @@ If the above assumptions are not true for you and you would like an updated anal
## Charges Eligible Now
You are not currently eligible to expunge any charges.


## Charges Eligible Now If Balance Paid
These convictions are eligible as soon as the balance of fines on the case is paid.

Expand All @@ -36,3 +31,9 @@ These convictions are eligible as soon as the balance of fines on the case is pa
- CASEJD1: Possession of Cocaine (DISMISSED) Charged Feb 17, 2009


## Balance Due by County
Multnomah
CASEJD1 - 529.08

### Disclaimer:
RecordSponge is not your lawyer. The results below should be used as a guide only. If you are relying on this information to expunge your record, please email [email protected] for free consultation.
2 changes: 1 addition & 1 deletion src/backend/tests/pdf/test_markdown_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def example_record():
"CASEJD1": CaseDetails.CASE_WITH_REVOKED_PROBATION,
},
)

def test_render_markdown(example_record):
record_summary = RecordSummarizer.summarize(example_record, {})
record = json.loads(json.dumps(record_summary, cls=ExpungeModelEncoder))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ Array [
<p
className="tc fw7 white mw7 mh4"
>
Over 10,000 analyses delivered as of January 2023
Over 20,000 analyses delivered as of July 2024
</p>
</div>
</div>
Expand Down Expand Up @@ -1764,7 +1764,7 @@ Array [
<p
className="mw7 lh-copy tc center mb3"
>
Having performed expungement analysis both with and without the assistance of RecordSponge, I know that this program vastly decreases the time needed to perform expungement analysis, and vastly increases the number of people we can assist with expungements.
Having performed expungement analysis both with and without the assistance of RecordSponge, I know that this program vastly decreases the time to perform expungement analysis, and vastly increases the number of people we can assist with expungements.
</p>
<footer
className="mw7 tc center fw6 f5-ns mb5"
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/components/Landing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Landing extends React.Component {
<PartnerTable />
<span className="db w4 center bb bw2 b--blue mb3"></span>
<p className="tc fw7 white mw7 mh4">
Over 10,000 analyses delivered as of January 2023
Over 20,000 analyses delivered as of July 2024
</p>
</div>
</div>
Expand Down Expand Up @@ -175,7 +175,7 @@ class Landing extends React.Component {
<p className="mw7 lh-copy tc center mb3">
Having performed expungement analysis both with and
without the assistance of RecordSponge, I know that this
program vastly decreases the time needed to perform
program vastly decreases the time to perform
expungement analysis, and vastly increases the number of
people we can assist with expungements.
</p>
Expand Down

0 comments on commit aff5f38

Please sign in to comment.