Removes additional bank/all options from the transactions export command
line.
Deletes the brief lived CSV class.
This patch start using pickle for simple export/import, other options
can be added later. An issue with the .csv is the lack of a Null field.
Moves logic to Manager, it is simple enough.
Each children is essentually a type of transaction. We currently have:
- bank transactions
- money transactions
- split transactions
The table inheritance is implemented as a single table, with a
polymorphic type and Null columns.
Adds a IsSplit interface, which will later be used for the category
views, so as to not repeat transactions.
from the Manager POV and the update on the argparses.
Also clears unnecessary methods from the DB client interface.
Better assert information on the __main__.py
- Update the download, token and eua cli with the new operations
- Change the bank and nordigen cli to be more in line with the other
add/modify/remove operations. Also update manager logic.
- Fix some model.py leftovers
- Add __lt__ to Transaction to enable sorting
- Remove universal from child argparsers
Sometimes transctions are directly related to one another w/o being of
an equal value, e.g. someone pays for the meal w/ the CC, and everyone
pays him/her.
Clear leftover __repr__ methods in the model classes, the dataclass
decorator will create those automatically.
Tags will work as additional categories to filter/organize by. It makes
sense they can also be rule based.
Since rules are common to both categories and tags, reorganize the
classes in the model. It doesn't affect the DB.
Uses the rules defined for each category to classify each transaction.
Fixes the categorize command, which was broken from previous refactors.
Swaps str type on the categories_rules date to date.
The Manager doesn't need to know that it was called from the CLI, so it
now is initialized with the database and performs an action, based on
the operation it receives and its parameters.
The work isn't finished, some Manager actions are still based on the CLI
arguments.
The CLI logic and creation of parameters to pass to the manager have
been moved to the __main__.py file, which brings it to line to the
program being called as a package from the command line.
Implements the argument parser, the manager logic and the DB client
methods.
Encapsulates the DbClient connection under the _db attribute on the
manager.
Adds verbose option to enable ORM increased logging.
Move all BL to the manager. The ArgParser now only parses the CLI
arguments and creates a command which contains which command was run. In
turn, this information is passed to the manager, which will run the
appropriate business logic.
This will make it easier to add new options, separating the parsing of
the CLI options from the implementation of the logic. It also simplifies
any future effort in adding a different input (e.g. GUI).
Warning: some function were commented out, this is only a tracer bullet.
Categorizer will work directly on ORM classes, which will cleanup the
code, since changes will automatically be persisted when change the
objects.
Adds wrapper session class inside the DbClient for the manager to use.
The manager will have to have some DB session knowledge, which adds some
unfortunate coupling.
Removes some unnecessary relations between tables that were added by
mistake.
category CLI option now uses the manager.
Can now download from all banks registered on the banks/nordigen table
and write to the PostgresSQL DB (or any DB, since we're now agnostic).
Commented out most of the managers functions until the integration with
the new DB client is complete.
Set Optional relationships. Remove the DB types as dataclasses, it only
increased the verbosity of the types w/o much going for it.
Change the name Original to Transaction, since the type is the
placeholder for the rest of the transaction information.
When the credit card was correct but the bank was wrong, it was
difficul to accertain which one was wrong. Not when one fails, it will
also log what are the available options.
A bank had an offset on the date of the transactions...
It also passes the interal Bank type to the converter, to access it's
additional options before converting.
The __conform__ can´t generate a tuple from the class, but it is still
worth to use the DB intermediate types for cleaner code. So add tuple()
method the the DBTransaction and use it when writing to the DB.
The period will only apply after the transactions have been received,
since if sent on the request, credit cards seem to use the value date
instead of the booking date, rendering the feature useless.
Also adds some robustness to the download of the transactions, by adding
a retry in case of timeout.
There is now the possibility to download the transactions for all banks
in the banks table in the DB.
`NordigenInput` parse method fully functional, and entire chain from
downloading to parsing (simple w/ converter) to writing to DB.
DbTransaction type added __conform__ to simplify writes to DB.
Get bank methods added to both `Manager` and `DatabaseClient`.
Warning: csv parser most likely not working at this point.
Issues #16 and #17