Allow to automatically deposit into (i.e. re-charge) accounts by bank transactions

Up until this point, one of the biggest manual chores with PoolPay is updating accounts if people deposit money either in cash or by sending it via a bank transfer.

To ensure that PoolPay will thrive even once the original author is gone, this MR automates a lot of that process. It will require a few trusted gophers in the pool, who regularly do the following:

Gopher instructions

See docs/deposits.md.

Jakob instructions

More or less: Run this in the poolpay repo:

uv run -m poolpay.fints sync
uv run -m poolpay.fints export --encrypt --sign > ../c2/messages.jsonl.age 2> ../c2/messages.jsonl.age.minisig

Then commit and push in the c2 repo.

Main changes

  • Restructure wire server
    • Basic unit is now the Packet
    • Packets can be decoded into Messages, which have semantics and validation to them (via subclasses).
  • Add Director#message_received method
    • Supports UpdateBalanceMessage which will update the account balance of a person
  • Add MessageReceipt class to persistence which prevents the same message being applied twice (in the concrete case: prevents the same transaction to be deposited into an account twice).
  • Add wire.ingest module, which takes a set of (potentially signed, potentially encrypted) messages and posts them to the Wire server

Unrelated changes

  • Exclude scripts/ dir from Ruff formatting
  • Improve type hints for generic model base classes (with regard to which types and instances are produced)
Edited by Jakob Moser

Merge request reports

Loading