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

Implement an object-oriented structure #11

@cmenon12

Description

@cmenon12

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions