diff options
-rw-r--r-- | jimbrella/routine.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/jimbrella/routine.py b/jimbrella/routine.py index 3d92482..bb5fe82 100644 --- a/jimbrella/routine.py +++ b/jimbrella/routine.py @@ -63,7 +63,12 @@ def sync_jform(takeaway: JForm, giveback: JForm, db: Umbrellas, sms: SMS): sheet["id"], sheet["phone"], ) - sms.borrow_success(sheet["phone"], sheet["name"], human_datetime(sheet["date"]), sheet["key"]) + sms.borrow_success( + sheet["phone"], + sheet["name"], + human_datetime(sheet["date"]), + sheet["key"], + ) except (UmbrellaStatusError, UmbrellaNotFoundError): logging.warning( tenant_identity @@ -78,6 +83,12 @@ def sync_jform(takeaway: JForm, giveback: JForm, db: Umbrellas, sms: SMS): tenant_identity + " returned umbrella #{key} at {date_str}".format(**sheet) ) + sms.return_success( + sheet["phone"], + sheet["name"], + human_datetime(sheet["date"]), + sheet["key"], + ) except (UmbrellaStatusError, UmbrellaNotFoundError): logging.warning( tenant_identity @@ -115,6 +126,12 @@ def process_overdue(db: Umbrellas): **umb ) ) + sms.remind_overdue( + umb["tenant_phone"], + umb["tenant_name"], + human_datetime(umb["lent_at"]), + umb["id"], + ) if __name__ == "__main__": |