macxred / cashctrl_ledger

Implementation of the abstract pyledger.LegderEngine interface with CashCtrl accounting service.
MIT License
0 stars 0 forks source link

Class for code that violate cashctrl limitations #60

Closed AlexTheWizardL closed 3 weeks ago

AlexTheWizardL commented 2 months ago

Currently cashctrl_ledger class contains "hackish" code that violates cashctrl limitations and allows us to integrate it. Need to create another class and separate the "hackish" code only and leave simple core logic in the cashctrl_ledger class.

To separate "hackish" code while allowing it to be used within core methods, need to use inheritance pattern:

Proposed names for the new Class with "Hackish" Code:

In this example:

List of methods that should be moved to the "hackish" class:

Proposed implementation steps:

  1. Define all hackish methods before Lukas vacation.
  2. Create a new class that will inherit CashCtrlLedger class.
  3. Move hackish methods using inheritance pattern in the new class.
  4. Adapt test suits to the new hierarchy.
  5. Edit classes docstrings.
  6. Update README.md
lasuk commented 2 months ago

Proposal for the class docstring:

class CashCtrlLedger(LedgerEngine):
    """
    Implements the pyledger interface by connecting to the CashCtrl online accounting software.

    See README on https://github.com/macxred/cashctrl_ledger for overview and
    usage examples.
    """