Skip to content

Add investment reconciliation workflow - #154

Open
sahilsk11 wants to merge 1 commit into
masterfrom
codex/reconciliation-api
Open

Add investment reconciliation workflow#154
sahilsk11 wants to merge 1 commit into
masterfrom
codex/reconciliation-api

Conversation

@sahilsk11

Copy link
Copy Markdown
Owner

Summary

  • add cron-secret-protected reconciliation preview and apply APIs
  • persist immutable broker, ledger, and proposed-adjustment snapshots
  • revalidate snapshots before applying and return 409 when stale
  • repair shortages proportionally through new audit-linked holdings versions
  • report excess broker inventory without assigning it to investments
  • expose LIQUIDATION_BLOCKED for failed/canceled liquidation sells

API

  • POST /internal/reconciliation/preview
  • POST /internal/reconciliation/:reconciliationRunID/apply

Reconciliation never places broker orders. A subsequent normal rebalance acts on the corrected ledger.

Verification

  • ALPHA_ENV=test go test ./... -count=1
  • go test ./integration-tests -run TestReconciliationPreviewAndApply -count=1
  • make db-models-check
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec50e504-7587-4435-b122-e01c58987eb8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant