macxred / pyledger

Python package to streamline the implementation and management of accounting systems.
MIT License
0 stars 0 forks source link

Refactor `LedgerCSVDataFrameEntity` class `modify()` method #60

Closed AlexTheWizardL closed 6 days ago

AlexTheWizardL commented 1 week ago

This PR resolves Issue #58. Please review the latest comment on the issue for critical context before proceeding with the review.

Changes Implemented

  1. Enhanced Modify Logic:

    • The modification process now leverages the unique IDs associated with ledger entries.
    • Outdated rows are deleted and replaced with updated ones in a single operation.
  2. Row Order Preservation:

    • Entries are sorted based on the numeric portion of the ledger ID, ensuring consistent and logical order across all files.

Note

As discussed, the modify method in this class requires a DataFrame adhering to the LEDGER_SCHEMA, including at least the required columns. This decision reflects the interdependence between updating collective transactions and specific columns. The approach can be revisited if future requirements demand more granular updates.

codecov-commenter commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Flag Coverage Δ
unittests 83.72% <100.00%> (+0.04%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyledger/storage_entity.py 96.59% <100.00%> (+0.03%) :arrow_up:

🚨 Try these New Features: