Add omit_import_id parameter to webhook classes#18
Open
deanlongstaff wants to merge 2 commits intosyncforynab:masterfrom
Open
Add omit_import_id parameter to webhook classes#18deanlongstaff wants to merge 2 commits intosyncforynab:masterfrom
omit_import_id parameter to webhook classes#18deanlongstaff wants to merge 2 commits intosyncforynab:masterfrom
Conversation
Add a new `omit_import_id` parameter to Monzo and Starling webhook classes to support creating user-entered transactions instead of imported transactions. When `omit_import_id: true`: - TransactionCreator receives nil as import_id - YNAB API treats transaction as user-entered - Transaction becomes eligible for matching against future imports This satisfies YNAB API requirements where omitted/null `import_id` creates user-entered transactions that can be matched against imported transactions with same amount and date (±10 days). This allows the use of the direct import feature alongside webhooks. Changes: - F2ynab::Webhooks::Monzo: Added `omit_import_id` parameter and conditional logic - F2ynab::Webhooks::Starling: Added `omit_import_id` parameter and conditional logic - Both classes default to `omit_import_id: false` to maintain existing behaviour
0c12bc5 to
16adb0a
Compare
… when nil If `import_id` is present but `nill` in the request payload, the transaction is created with an `import_id` of an empty string. This then causes a 409 response for subsequent transactions. Now fully omitting the property from the request when not present.
16adb0a to
d7154ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a new
omit_import_idparameter to Monzo and Starling webhook classes to support creating user-entered transactions instead of imported transactions.When
omit_import_id: true:This satisfies YNAB API requirements where omitted/null
import_idcreates user-entered transactions that can be matched against imported transactions with same amount and date (±10 days). This allows the use of the direct import feature alongside webhooks.Changes:
omit_import_idparameter and conditional logicomit_import_idparameter and conditional logicomit_import_id: falseto maintain existing behaviour