mirror of
https://github.com/Hestia-Homes/insight.git
synced 2026-06-08 11:17:25 +00:00
Merge pull request #19 from Hestia-Homes/feature/make_it_live_ready
upload this for khalim's demo
This commit is contained in:
commit
07ac7d3ef0
2 changed files with 6 additions and 4 deletions
|
|
@ -319,6 +319,5 @@ def open_modal(jobs_cell, revenue_cell, close_click, jobs_data, revenue_data, is
|
|||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
# TODO:
|
||||
# 1) They just need a way to check numbers via hubspot deals
|
||||
# 2) a few feedback changes from management as they need it
|
||||
# 3) Investigate why this week numbers are wrong ( i think its something to do with attempts) ( might be that the data wasn't saved till now?)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,10 @@ class jsonReader:
|
|||
return None
|
||||
if timestamp.endswith("Z"):
|
||||
timestamp = timestamp[:-1]
|
||||
dt = datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S")
|
||||
try:
|
||||
dt = datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S")
|
||||
except:
|
||||
dt = datetime.strptime(timestamp, "%Y-%m-%d")
|
||||
return dt.strftime("%Y-%m-%d")
|
||||
|
||||
def initial_setup(self):
|
||||
|
|
@ -62,9 +65,9 @@ class jsonReader:
|
|||
# Multiple attempts => multiple rows
|
||||
for attempt in deal["attempts"]:
|
||||
rows.append({
|
||||
"submission_date": self.to_date_only(deal["deal_properties"].get("submission_date")),
|
||||
"submission_date": self.to_date_only(attempt["submission_date"]),
|
||||
"hubspot_id": deal["deal_properties"]["deal_id"],
|
||||
"expected_commencement_date": deal["deal_properties"].get("expected_commencement_date"),
|
||||
"expected_commencement_date": self.to_date_only(attempt["expected_commencement_date"]),
|
||||
"work_type": product_type,
|
||||
"price": next(
|
||||
(item["price"] for item in deal["line_items"] if product_type in item["name"]),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue