feature: support filtering by year for ultipro_google and stockplanconnect sources #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I organize most of my source documents by year, e.g. .../Pay
Statements/2018/2018-01-02.statement.pdf or .../Amazon
Invoices/2019/123-45678-9012.html.
For most sources, I can either use a recursive glob to pick up all the files
in the tree, or create one Source per year, and everything works fine. But for
stockplanconnect and ultipro_google, which expect to be able to translate from
a transaction in the journal to a source path based only on the document ID,
this doesn't work; if I use a recursive glob, every journal entry gets
declared invalid because the statements don't have the expected path, and if I
use one source per year-specific subdirectory, every entry ends up being
declared invalid by the sources that only expect to find documents from other
years.
This change allows the use of a separate source per year for
directory-per-year layouts, by adding a "year" parameter to these two sources,
and ignoring any journal entry from a date outside the configured year if
there is one.