Add inflight_commit_date for time-based auto-commit of inflight transactions#279
Open
rafaelcarvalhocaetano wants to merge 1 commit intoblnkfinance:mainfrom
Open
Conversation
…mmit - add InflightCommitDate field to Transaction model and RecordTransaction API model - validate and parse inflight_commit_date format in ToTransaction - add queueInflightCommit and QueueInflightCommit following queueInflightExpiry pattern - wire QueueInflightCommit in QueueTransaction when inflight_commit_date is set - add InflightCommitQueue to QueueConfig with BLNK_QUEUE_INFLIGHT_COMMIT env support - add tests for validation, conversion, and queue enqueue behavior Author: Rafael Carvalho
28dd46d to
ee61ff9
Compare
Collaborator
|
Thank you for the PR @rafaelcarvalhocaetano, reviewing |
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.
Closes #277
What
Introduces
inflight_commit_dateas a new parameter for inflight transactions, enabling guaranteed future settlements without requiring an external commit command.Why
The existing
scheduled_fordoes not lock funds at creation time, andinflightrequires a manual commit. This feature combines both: reserves the balance immediately and automatically commits at a specified future date.Changes
model/transaction.go: addedInflightCommitDatefield to theTransactionstructapi/model/transaction.go: addedinflight_commit_dateto theRecordTransactionAPI modelapi/model/model.go: added date format validation forinflight_commit_dateand parsing inToTransactionqueue.go: addedqueueInflightCommitandQueueInflightCommit, following the same pattern asqueueInflightExpirytransaction.go: wiresQueueInflightCommitinQueueTransactionwheninflight_commit_dateis setconfig/config.go: addedInflightCommitQueuetoQueueConfigandLockWaitTimeoutdefault handlingTests
api/model/model_test.go: validation andToTransactionconversion forinflight_commit_dateconfig/config_test.go: default and already-duration cases forLockWaitTimeoutqueue_test.go: skips enqueue when date is zero; enqueues task when date is set