Skip to content

Add inflight_commit_date for time-based auto-commit of inflight transactions#279

Open
rafaelcarvalhocaetano wants to merge 1 commit intoblnkfinance:mainfrom
rafaelcarvalhocaetano:feat/inflight-commit-date
Open

Add inflight_commit_date for time-based auto-commit of inflight transactions#279
rafaelcarvalhocaetano wants to merge 1 commit intoblnkfinance:mainfrom
rafaelcarvalhocaetano:feat/inflight-commit-date

Conversation

@rafaelcarvalhocaetano
Copy link
Copy Markdown

Closes #277

What

Introduces inflight_commit_date as a new parameter for inflight transactions, enabling guaranteed future settlements without requiring an external commit command.

Why

The existing scheduled_for does not lock funds at creation time, and inflight requires a manual commit. This feature combines both: reserves the balance immediately and automatically commits at a specified future date.

Changes

  • model/transaction.go: added InflightCommitDate field to the Transaction struct
  • api/model/transaction.go: added inflight_commit_date to the RecordTransaction API model
  • api/model/model.go: added date format validation for inflight_commit_date and parsing in ToTransaction
  • queue.go: added queueInflightCommit and QueueInflightCommit, following the same pattern as queueInflightExpiry
  • transaction.go: wires QueueInflightCommit in QueueTransaction when inflight_commit_date is set
  • config/config.go: added InflightCommitQueue to QueueConfig and LockWaitTimeout default handling

Tests

  • api/model/model_test.go: validation and ToTransaction conversion for inflight_commit_date
  • config/config_test.go: default and already-duration cases for LockWaitTimeout
  • queue_test.go: skips enqueue when date is zero; enqueues task when date is set

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

…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
@jerry-enebeli
Copy link
Copy Markdown
Collaborator

Thank you for the PR @rafaelcarvalhocaetano, reviewing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Guaranteed Future Settlements (Time-based Auto-commit)

3 participants