mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 10:08:46 +02:00
Add individual salary deposit agent tool
This commit is contained in:
@@ -17,6 +17,7 @@ from app.models.models import (
|
||||
MunicipalReceipt,
|
||||
PensionSnapshot,
|
||||
Transaction,
|
||||
TransactionType,
|
||||
WaterMeterReading,
|
||||
)
|
||||
|
||||
@@ -173,6 +174,52 @@ def test_recent_transactions_exclude_future_cuotas(bound_session):
|
||||
assert "FUTURE CUOTA:03/06" not in merchants
|
||||
|
||||
|
||||
def test_salary_deposits_returns_individual_filtered_rows(bound_session):
|
||||
bound_session.add_all(
|
||||
[
|
||||
Transaction(
|
||||
amount=Decimal("1500"),
|
||||
merchant="SALARY JULY",
|
||||
date=datetime(2026, 7, 14, 9),
|
||||
transaction_type=TransactionType.SALARY,
|
||||
reference="PAY-2026-07",
|
||||
),
|
||||
Transaction(
|
||||
amount=Decimal("1400"),
|
||||
merchant="SALARY JUNE",
|
||||
date=datetime(2026, 6, 14, 9),
|
||||
transaction_type=TransactionType.SALARY,
|
||||
),
|
||||
Transaction(
|
||||
amount=Decimal("999"),
|
||||
merchant="PURCHASE",
|
||||
date=datetime(2026, 7, 14, 10),
|
||||
),
|
||||
]
|
||||
)
|
||||
bound_session.commit()
|
||||
|
||||
out = tools.get_salary_deposits(
|
||||
start_date="2026-07-14", end_date="2026-07-15"
|
||||
)
|
||||
|
||||
json.dumps(out)
|
||||
assert out == [
|
||||
{
|
||||
"id": out[0]["id"],
|
||||
"date": "2026-07-14T09:00:00",
|
||||
"amount": 1500.0,
|
||||
"currency": "CRC",
|
||||
"merchant": "SALARY JULY",
|
||||
"source": "CREDIT_CARD",
|
||||
"bank": "BAC",
|
||||
"transaction_type": "SALARY",
|
||||
"reference": "PAY-2026-07",
|
||||
"notes": None,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_get_current_date_is_costa_rica_and_cycle_consistent():
|
||||
from app.timeutil import today_cr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user