mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-13 21:52:40 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f5b5dc679 | ||
|
|
6c44beda67 | ||
|
|
ebe0a2fe86 | ||
|
|
3cb38e2e9f | ||
|
|
ad40b2207a | ||
|
|
9402c2535b |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
||||
## 0.6.4 (2024/06/07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **sync:** Correctly calculate days left. ([6c44beda](https://github.com/elisiariocouto/leggen/commit/6c44beda672242714bab1100b1f0576cdce255ca))
|
||||
|
||||
|
||||
## 0.6.3 (2024/06/07)
|
||||
|
||||
### Features
|
||||
|
||||
- **sync:** Correctly calculate days left, based on the default 90 days period. ([3cb38e2e](https://github.com/elisiariocouto/leggen/commit/3cb38e2e9fb08e07664caa7daa9aa651262bd213))
|
||||
|
||||
|
||||
## 0.6.2 (2024/06/07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **sync:** Use timezone-aware datetime objects. ([9402c253](https://github.com/elisiariocouto/leggen/commit/9402c2535baade84128bdfd0fc314d5225bbd822))
|
||||
|
||||
|
||||
## 0.6.1 (2024/06/07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
|
||||
import click
|
||||
|
||||
@@ -25,15 +25,16 @@ def sync(ctx: click.Context):
|
||||
for r in res.get("results", []):
|
||||
account_status = REQUISITION_STATUS.get(r["status"], "UNKNOWN")
|
||||
if account_status != "LINKED":
|
||||
created_at = datetime.fromisoformat(r["created"])
|
||||
now = datetime.now()
|
||||
if (created_at - now).days <= 15:
|
||||
created_at = datetime.datetime.fromisoformat(r["created"])
|
||||
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||
days_left = 90 - (now - created_at).days
|
||||
if days_left <= 15:
|
||||
n = {
|
||||
"bank": r["institution_id"],
|
||||
"status": REQUISITION_STATUS.get(r["status"], "UNKNOWN"),
|
||||
"created_at": created_at.timestamp(),
|
||||
"requisition_id": r["id"],
|
||||
"days_left": (created_at - now).days,
|
||||
"days_left": days_left,
|
||||
}
|
||||
send_expire_notification(ctx, n)
|
||||
|
||||
@@ -55,7 +56,7 @@ def sync(ctx: click.Context):
|
||||
"amount": amount,
|
||||
"currency": balance_amount["currency"],
|
||||
"type": balance["balanceType"],
|
||||
"timestamp": datetime.now().timestamp(),
|
||||
"timestamp": datetime.datetime.now().timestamp(),
|
||||
}
|
||||
try:
|
||||
persist_balance(ctx, account, balance_document)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "leggen"
|
||||
version = "0.6.1"
|
||||
version = "0.6.4"
|
||||
description = "An Open Banking CLI"
|
||||
authors = ["Elisiário Couto <elisiario@couto.io>"]
|
||||
readme = "README.md"
|
||||
|
||||
Reference in New Issue
Block a user