fixes
This commit is contained in:
15
app.py
15
app.py
@@ -131,7 +131,7 @@ def fetch_all_projects():
|
|||||||
|
|
||||||
# List projects (all pages)
|
# List projects (all pages)
|
||||||
projects = list_all_projects(bearer)
|
projects = list_all_projects(bearer)
|
||||||
projects = projects[:250]
|
projects = projects[:]
|
||||||
|
|
||||||
# Fetch details for each
|
# Fetch details for each
|
||||||
detailed_rows = []
|
detailed_rows = []
|
||||||
@@ -151,12 +151,12 @@ def fetch_all_projects():
|
|||||||
defendant_one = next((c.get('orgContact', {}) for c in cs if "Defendant" in c.get('orgContact', {}).get('personTypes', [])), {})
|
defendant_one = next((c.get('orgContact', {}) for c in cs if "Defendant" in c.get('orgContact', {}).get('personTypes', [])), {})
|
||||||
new_file_review = fetch_form(bearer, pid, "newFileReview") or {}
|
new_file_review = fetch_form(bearer, pid, "newFileReview") or {}
|
||||||
dates_and_deadlines = fetch_form(bearer, pid, "datesAndDeadlines") or {}
|
dates_and_deadlines = fetch_form(bearer, pid, "datesAndDeadlines") or {}
|
||||||
defendants = fetch_collection(bearer, pid, "defendants") or []
|
|
||||||
service_info = fetch_collection(bearer, pid, "serviceInfo") or []
|
service_info = fetch_collection(bearer, pid, "serviceInfo") or []
|
||||||
property_info = fetch_form(bearer, pid, "propertyInfo")
|
property_info = fetch_form(bearer, pid, "propertyInfo")
|
||||||
project_overview = fetch_form(bearer, pid, "projectOverview")
|
|
||||||
matter_overview = fetch_form(bearer, pid, "matterOverview")
|
matter_overview = fetch_form(bearer, pid, "matterOverview")
|
||||||
fees_and_costs = fetch_form(bearer, pid, "feesAndCosts") or {}
|
fees_and_costs = fetch_form(bearer, pid, "feesAndCosts") or {}
|
||||||
|
property_contacts = fetch_form(bearer, pid, "propertyContacts") or {}
|
||||||
|
pprint(property_contacts)
|
||||||
lease_info_np = fetch_form(bearer, pid, "leaseInfoNP") or {}
|
lease_info_np = fetch_form(bearer, pid, "leaseInfoNP") or {}
|
||||||
|
|
||||||
completed_tasks = [{"description": x.get("body") ,
|
completed_tasks = [{"description": x.get("body") ,
|
||||||
@@ -235,8 +235,8 @@ def fetch_all_projects():
|
|||||||
date_possession_recovered = convert_to_pacific_time(dates_and_deadlines.get("datePossessionRecovered")) or ''
|
date_possession_recovered = convert_to_pacific_time(dates_and_deadlines.get("datePossessionRecovered")) or ''
|
||||||
|
|
||||||
# Extract attorney fees and costs
|
# Extract attorney fees and costs
|
||||||
attorney_fees = fees_and_costs.get("attorneyFeesTotal") or ''
|
attorney_fees = fees_and_costs.get("totalAttorneysFees") or ''
|
||||||
costs = fees_and_costs.get("costs") or ''
|
costs = fees_and_costs.get("totalCosts") or ''
|
||||||
|
|
||||||
row = {
|
row = {
|
||||||
"client": c.get("firstName"),
|
"client": c.get("firstName"),
|
||||||
@@ -405,7 +405,7 @@ def list_all_projects(bearer: str):
|
|||||||
offset = 0
|
offset = 0
|
||||||
# TODO we probably need to sync the data with fierbase
|
# TODO we probably need to sync the data with fierbase
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while len(results) < 250:
|
while True:
|
||||||
cnt = len(results)
|
cnt = len(results)
|
||||||
print(f"list try {tries}, starting at {offset}, previous count {last_count}, currently at {cnt}")
|
print(f"list try {tries}, starting at {offset}, previous count {last_count}, currently at {cnt}")
|
||||||
tries += 1
|
tries += 1
|
||||||
@@ -424,8 +424,6 @@ def list_all_projects(bearer: str):
|
|||||||
results.extend(items)
|
results.extend(items)
|
||||||
has_more = page.get("hasMore")
|
has_more = page.get("hasMore")
|
||||||
last_count = page.get("count")
|
last_count = page.get("count")
|
||||||
from pprint import pprint
|
|
||||||
pprint(page)
|
|
||||||
if not has_more:
|
if not has_more:
|
||||||
break
|
break
|
||||||
# Safety valve
|
# Safety valve
|
||||||
@@ -457,7 +455,6 @@ def fetch_project_team(bearer: str, project_id_native: int):
|
|||||||
r = requests.get(url, headers=headers, timeout=30)
|
r = requests.get(url, headers=headers, timeout=30)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
pprint( r.json().get('items') or [])
|
|
||||||
return r.json().get('items') or []
|
return r.json().get('items') or []
|
||||||
|
|
||||||
def fetch_project_tasks(bearer: str, project_id_native: int):
|
def fetch_project_tasks(bearer: str, project_id_native: int):
|
||||||
|
|||||||
9
main.tf
9
main.tf
@@ -92,6 +92,10 @@ resource "google_firestore_database" "main_firestore" {
|
|||||||
resource "google_identity_platform_config" "main_config" {
|
resource "google_identity_platform_config" "main_config" {
|
||||||
provider = google-beta
|
provider = google-beta
|
||||||
project = google_project.main_project.project_id
|
project = google_project.main_project.project_id
|
||||||
|
multi_tenant {
|
||||||
|
allow_tenants = false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Auto-deletes anonymous users
|
# Auto-deletes anonymous users
|
||||||
autodelete_anonymous_users = true
|
autodelete_anonymous_users = true
|
||||||
@@ -162,6 +166,11 @@ EOF
|
|||||||
|
|
||||||
project = google_project.main_project.project_id
|
project = google_project.main_project.project_id
|
||||||
}
|
}
|
||||||
|
resource "google_firebaserules_release" "primary" {
|
||||||
|
name = "cloud.firestore"
|
||||||
|
project = google_project.main_project.project_id
|
||||||
|
ruleset_name = "projects/${google_project.main_project.project_id}/rulesets/${google_firebaserules_ruleset.primary.name}"
|
||||||
|
}
|
||||||
|
|
||||||
# Output the project ID and name
|
# Output the project ID and name
|
||||||
output "project_id" {
|
output "project_id" {
|
||||||
|
|||||||
Reference in New Issue
Block a user