Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Implement an object-oriented structure #11

Open
cmenon12 opened this issue Apr 7, 2022 · 0 comments
Open

Implement an object-oriented structure #11

cmenon12 opened this issue Apr 7, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@cmenon12
Copy link
Owner

cmenon12 commented Apr 7, 2022

Classes should be created for:

  • Transaction - this should be for a sheet transaction because this is what we use most. Include methods for:

    • Comparing with a Plaid transaction, need to be careful with this in case of two identical ones on the same day, include parameter for ID.
    • Importing a Plaid transaction.
    • Updating with a Plaid transaction, need to be careful with IDs & dates.
    • Exporting to a range (one row)
    • Static method to map attributes to header names.
  • Account - include totals reported by Plaid but not transactions.

  • SubCategory - a subcategory

  • ParentCategory - one of the top-level ones. Include methods to get and set subcategories.

Use JavaScript dates throughout. Need to include required getters and setters for objects. The 'last mile' of writing to the sheet should be handled procedurally, but these classes should prepare the data for it. Think carefully about headers.

Need to implement more IDs (pending and transaction) to maybe make updating more effective. Think carefully about dates, IDs, and updating with new transactions (need to look at how this is currently implemented). Fixing the broken updates when the access token changes is out of scope here (see #10).

Object classes should be defined in a separate file. Don't make any changes to the sheet (but do include additional fields that might be useful later). This should not change how it works for the end-user (we're not improving anything), merely the backend structure to make it more extendable and maintainable.

See https://github.com/cmenon12/contemporary-choir/blob/main/google-apps-scripts/the-new-ledger/ledger-checker-classes.gs for an example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant