mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-17 06:11:27 +01:00
Provider registry modeled after automatic exchange rates: each provider declares its own settings fields, rendered dynamically in the service form. Lunch Flow is the first provider. - Map provider accounts to WYGIWYH accounts with a start date and an optional currency filter - Hourly task syncs due services; manual sync from the list - Deduplicates through Transaction.internal_id, optionally matching transactions already entered by hand - Per account errors and provider reported connection problems Refs #498
18 lines
523 B
Python
18 lines
523 B
Python
from procrastinate.contrib.django import app
|
|
|
|
from apps.bank_sync.models import BankSyncService
|
|
from apps.bank_sync.sync import sync_due_services, sync_service
|
|
|
|
|
|
@app.periodic(cron="0 * * * *")
|
|
@app.task(lock="bank_sync", name="automatic_bank_sync")
|
|
def automatic_bank_sync(timestamp=None):
|
|
sync_due_services()
|
|
|
|
|
|
@app.task(lock="bank_sync", name="manual_bank_sync")
|
|
def manual_bank_sync(service_id: int):
|
|
service = BankSyncService.objects.filter(id=service_id).first()
|
|
if service:
|
|
sync_service(service)
|