Skip to content

feat: Bank Account Update Request DocType + approval endpoints [ENG-509]#51

Merged
islandbitcoin merged 2 commits into
mainfrom
jabariennis/eng-509-bank-account-update-flow-let-users-edit-their-approved
Jul 13, 2026
Merged

feat: Bank Account Update Request DocType + approval endpoints [ENG-509]#51
islandbitcoin merged 2 commits into
mainfrom
jabariennis/eng-509-bank-account-update-flow-let-users-edit-their-approved

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

What & why

Admin / ERPNext side of ENG-509 — the DocType the flash backend writes to, plus the approve/reject endpoints. (Companion PRs in flash and flash-mobile.)

Changes

  • New Bank Account Update Request DocType (party, bank_account, status, proposed bank_name / bank_branch / account_type / account_number / currency, support_note) + controller.
  • approve_bank_account_update_request — patches the linked Bank Account in place, preserving the doc name and is_default so in-flight cashout offers / Cashout docs keep resolving. Re-verifies ownership (party), rejects duplicate bank_account_no and incomplete requests, closes sibling Pending requests, and audit-logs the old→new diff.
  • reject_bank_account_update_request — marks Rejected with a support note.

Invariants

  • In-place patch — the Bank Account doc name and is_default are never changed (delete+recreate would orphan cashout offers that reference the account by name).
  • Ownership re-checked at approval (mirror of Cashout.validate).
  • One winner — approval closes other still-open requests for the same account so a stale duplicate can't later revert it.

Testing

ruff check ✓ · ruff format --check ✓ · DocType JSON parses ✓ · contract test test_bank_account_update_request_page_contract.py (incl. in-place-patch identity + incomplete-guard/supersede assertions) ✓.

Note

The admin review surface is the standard Frappe DocType list/form plus these endpoints. A dedicated side-by-side old/new diff workspace page is a follow-up.

🤖 Generated with Claude Code

Admin side of the update-approved-bank-account flow. Adds the ERPNext
DocType the flash backend writes to, plus the approve/reject endpoints.

- New "Bank Account Update Request" DocType (party, bank_account, status,
  proposed bank/branch/type/number/currency, support_note) + controller.
- approve_bank_account_update_request: patches the Bank Account IN PLACE,
  preserving the doc name and is_default (cashout offers reference the name);
  re-verifies ownership, rejects duplicate account numbers and incomplete
  requests, closes sibling Pending requests, and audit-logs the old->new diff.
- reject_bank_account_update_request: marks Rejected with a support note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear

linear Bot commented Jul 13, 2026

Copy link
Copy Markdown

ENG-509

@islandbitcoin

Copy link
Copy Markdown
Contributor Author

Part of ENG-509 — this change spans three repos:

Merge order: flash#444 first (it defines the GraphQL contract), then the other two — the mobile change depends on the backend field to work end-to-end.

…-509]

The completeness guard checked only bank_name and account_number; approval
then wrote bank_branch/account_type onto the live Bank Account, so a request
with an empty branch or type (e.g. created directly in Frappe) could blank
those on the account cashouts settle to. Guard all four proposed fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@islandbitcoin
islandbitcoin merged commit 4f1dbb6 into main Jul 13, 2026
1 check passed
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