Skip to content

feat: implement unlink connected bank account API#499

Merged
codeZe-us merged 1 commit into
SafeVault:devfrom
AdityaK9822:feat/unlink-bank-account
Jun 1, 2026
Merged

feat: implement unlink connected bank account API#499
codeZe-us merged 1 commit into
SafeVault:devfrom
AdityaK9822:feat/unlink-bank-account

Conversation

@AdityaK9822
Copy link
Copy Markdown
Contributor

Closes #488

Description

This PR implements the API endpoint to safely unlink a connected fiat bank account from an
employee's profile within an organization.

Instead of a hard deletion, this implementation uses a "soft-delete" approach by tracking when
a bank account was unlinked, ensuring that historical transaction references and audit trails
are preserved.

Changes

  • Database: Added bankAccountDeletedAt timestamp to the employees table in
    src/server/db/schema.ts.
  • Service Layer:
    • Implemented unlinkBankAccount in BankAccountService to mark accounts as unlinked.
    • Updated getEmployeeAccount to filter out accounts that have been unlinked.
  • API: Created a new DELETE endpoint at /api/v1/finance/accounts/[id] that verifies the
    authenticated user's organization ownership before unlinking the account.

Verification

  • Verified that DELETE requests for employees outside the user's organization are rejected
    with a 403.
  • Verified that unlinked accounts are no longer returned by the account retrieval API.
  • Confirmed that the process preserves the employee record and does not impact the
    fiatTransactions table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@AdityaK9822 is attempting to deploy a commit to the vestroll's projects Team on Vercel.

A member of the Team first needs to authorize it.

@codeZe-us
Copy link
Copy Markdown
Contributor

@AdityaK9822 PR should point to dev branch not main branch

@AdityaK9822 AdityaK9822 changed the base branch from main to dev May 31, 2026 11:29
@AdityaK9822
Copy link
Copy Markdown
Contributor Author

AdityaK9822 commented May 31, 2026

Here, I have changed the base into dev branch

@codeZe-us codeZe-us self-requested a review June 1, 2026 16:34
@codeZe-us codeZe-us merged commit be40e86 into SafeVault:dev Jun 1, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] Unlink Connected Bank Account API

2 participants