This commit is contained in:
2025-11-05 20:13:00 -08:00
parent 81d9462ee4
commit 81a1a32eb3
2 changed files with 182 additions and 96 deletions

91
app.py
View File

@@ -102,7 +102,7 @@ def fetch_all_projects():
# List projects (all pages)
projects = list_all_projects(bearer)
# todo, only 10 projects
projects = projects[:10]
projects = projects[:50]
# Fetch details for each
detailed_rows = []
@@ -129,8 +129,68 @@ def fetch_all_projects():
property_info = fetch_form(bearer, pid, "propertyInfo")
project_overview = fetch_form(bearer, pid, "projectOverview")
matter_overview = fetch_form(bearer, pid, "matterOverview")
fees_and_costs = fetch_form(bearer, pid, "feesAndCosts") or {}
lease_info_np = fetch_form(bearer, pid, "leaseInfoNP") or {}
completed_tasks = [x.get("body") for x in fetch_project_tasks(bearer, pid).get("items") if x.get("isCompleted")]
pending_tasks = [x.get("body") for x in fetch_project_tasks(bearer, pid).get("items") if not x.get("isCompleted")]
# Extract notice service and expiration dates
notice_service_date = new_file_review.get("noticeServiceDate") or ''
notice_expiration_date = new_file_review.get("noticeExpirationDate") or ''
# Extract daily rent damages
daily_rent_damages = lease_info_np.get("dailyRentDamages") or dates_and_deadlines.get("dailyRentDamages") or ''
# Extract default date
default_date = dates_and_deadlines.get("defaultDate") or ''
# Extract motion hearing dates
demurrer_hearing_date = dates_and_deadlines.get("demurrerHearingDate") or ''
motion_to_strike_hearing_date = dates_and_deadlines.get("mTSHearingDate") or ''
motion_to_quash_hearing_date = dates_and_deadlines.get("mTQHearingDate") or ''
other_motion_hearing_date = dates_and_deadlines.get("otherMotion1HearingDate") or ''
pprint(dates_and_deadlines)
# Extract MSC details
msc_date = dates_and_deadlines.get("mSCDate") or ''
msc_time = dates_and_deadlines.get("mSCTime") or ''
msc_address = dates_and_deadlines.get("mSCAddress") or ''
msc_div_dept_room = dates_and_deadlines.get("mSCDeptDiv") or ''
# Extract trial details
trial_date = dates_and_deadlines.get("trialDate") or ''
trial_time = dates_and_deadlines.get("trialTime") or ''
trial_address = dates_and_deadlines.get("trialAddress") or ''
trial_div_dept_room = dates_and_deadlines.get("trialDeptDivRoom") or ''
# Extract final result of trial/MSC
final_result = dates_and_deadlines.get("finalResultOfTrialMSCCa") or ''
# Extract settlement details
date_of_settlement = dates_and_deadlines.get("dateOfStipulation") or ''
final_obligation = dates_and_deadlines.get("finalObligationUnderTheStip") or ''
def_comply_stip = dates_and_deadlines.get("defendantsComplyWithStip") or ''
# Extract judgment and writ details
judgment_date = dates_and_deadlines.get("dateOfJudgment") or ''
writ_issued_date = dates_and_deadlines.get("writIssuedDate") or ''
# Extract lockout and stay details
scheduled_lockout = dates_and_deadlines.get("sheriffScheduledDate") or ''
oppose_stays = dates_and_deadlines.get("opposeStays") or ''
# Extract premises safety and entry code
premises_safety = new_file_review.get("lockoutSafetyIssuesOrSpecialCareIssues") or ''
matter_gate_code = property_info.get("propertyEntryCodeOrInstructions") or ''
# Extract possession recovered date
date_possession_recovered = dates_and_deadlines.get("datePossessionRecovered") or ''
# Extract attorney fees and costs
attorney_fees = fees_and_costs.get("attorneyFeesTotal") or ''
costs = fees_and_costs.get("costs") or ''
row = {
"client": c.get("firstName"),
"matter_description": p.get("projectName"),
@@ -147,6 +207,35 @@ def fetch_all_projects():
"phase_name": p.get("phaseName"),
"completed_tasks": completed_tasks,
"pending_tasks": pending_tasks,
"notice_service_date": notice_service_date,
"notice_expiration_date": notice_expiration_date,
"daily_rent_damages": daily_rent_damages,
"default_date": default_date,
"demurrer_hearing_date": demurrer_hearing_date,
"motion_to_strike_hearing_date": motion_to_strike_hearing_date,
"motion_to_quash_hearing_date": motion_to_quash_hearing_date,
"other_motion_hearing_date": other_motion_hearing_date,
"msc_date": msc_date,
"msc_time": msc_time,
"msc_address": msc_address,
"msc_div_dept_room": msc_div_dept_room,
"trial_date": trial_date,
"trial_time": trial_time,
"trial_address": trial_address,
"trial_div_dept_room": trial_div_dept_room,
"final_result": final_result,
"date_of_settlement": date_of_settlement,
"final_obligation": final_obligation,
"def_comply_stip": def_comply_stip,
"judgment_date": judgment_date,
"writ_issued_date": writ_issued_date,
"scheduled_lockout": scheduled_lockout,
"oppose_stays": oppose_stays,
"premises_safety": premises_safety,
"matter_gate_code": matter_gate_code,
"date_possession_recovered": date_possession_recovered,
"attorney_fees": attorney_fees,
"costs": costs,
"service_attempt_date_1": next(iter(service_info), {}).get('serviceDate'),
"contacts": cs,