1
0

Documentation
Some checks failed
Verify Python project can be installed, loaded and have version checked / Test (push) Failing after 25s
Python Ruff Code Quality / ruff (push) Failing after 22s
Run Python tests (through Pytest) / Test (push) Failing after 30s

This commit is contained in:
Jon Michael Aanes 2024-12-02 18:11:44 +01:00
parent 9c5f3db41d
commit 7d2b192b34
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -109,25 +109,30 @@ class DepoFetcher(abc.ABC):
@enforce_typing.enforce_types
class DoubleRegister(abc.ABC):
"""Information about some movement of assets."""
@property
@abc.abstractmethod
def input(self) -> AssetAmount | None:
"""How much and what kind of asset have been placed into the depository."""
raise NotImplementedError
@property
@abc.abstractmethod
def output(self) -> AssetAmount | None:
"""How much and what kind of asset have been removed from the depository."""
raise NotImplementedError
@property
@abc.abstractmethod
def fee(self) -> AssetAmount | None:
"""How much and what kind of asset was spent as a service fee."""
raise NotImplementedError
@property
@abc.abstractmethod
def executed_time(self) -> datetime.datetime:
"""The precise point in time when the asset transaction was executed."""
raise NotImplementedError
@ -163,6 +168,15 @@ class TradeOrderDetails(DoubleRegister):
@enforce_typing.enforce_types
@dataclassabc.dataclassabc(frozen=True)
class WithdrawalDetails(DoubleRegister):
"""Information about a withdrawal of assets from a specific service.
Withdraw assets may appear in another depository as a `DepositDetails`, but
these cannot be automatically linked by `fin-depo`.
Includes both well-structured data about the order, and unstructured data
from the backend. The unstructured data might be needed for tax purposes.
"""
withdrawn: AssetAmount
fee: AssetAmount
executed_time: datetime.datetime
@ -180,6 +194,15 @@ class WithdrawalDetails(DoubleRegister):
@enforce_typing.enforce_types
@dataclassabc.dataclassabc(frozen=True)
class DepositDetails(DoubleRegister):
"""Information about a deposit of assets to a specific service.
Deposited assets may appear in another depository as a `WithdrawalDetails`, but
these cannot be automatically linked by `fin-depo`.
Includes both well-structured data about the order, and unstructured data
from the backend. The unstructured data might be needed for tax purposes.
"""
deposit: AssetAmount
fee: AssetAmount
executed_time: datetime.datetime