summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jimbrella/routine.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/jimbrella/routine.py b/jimbrella/routine.py
index a4ad638..33c48dc 100644
--- a/jimbrella/routine.py
+++ b/jimbrella/routine.py
@@ -112,7 +112,7 @@ def sync_database(takeaway: JForm, giveback: JForm, db: Database, admin: AdminLo
)
-def process_overdue(db: Database):
+def process_overdue(db: Database, admin: AdminLog):
overdue = Database.find_overdue(db.read())
# mark and log umbrellas that were not, but just became overdue
for umb in filter(lambda u: u["status"] == "lent", overdue):
@@ -124,6 +124,16 @@ def process_overdue(db: Database):
umb["tenant_id"],
umb["tenant_phone"],
)
+ admin.log(
+ "OVERDUE",
+ {
+ "key": umb["serial"],
+ "name": umb["tenant_name"],
+ "phone": umb["tenant_phone"],
+ "id": umb["tenant_id"],
+ "email": "",
+ },
+ )
if __name__ == "__main__":
@@ -132,3 +142,4 @@ if __name__ == "__main__":
db = Database(DATABASE_PATH)
admin_log = AdminLog(ADMIN_LOG_PATH)
sync_database(takeaway, giveback, db, admin_log)
+ process_overdue(db, admin_log)