# SetDefaultPartnerBankAccount

## Permission Scope

partnerDetail

## Overview

setDefaultPartnerBankAccount designates a specific bank account as the default for its partner. The previous default bank account for the same partner is automatically unset. This ensures that each partner has at most one default bank account at any time, which is used as the preferred account for financial transactions.

## Business Rules

- Bank account must exist in the system
- The previous default bank account for the same partner is automatically unset
- Each partner can have at most one default bank account

## Process Flow

```mermaid
flowchart TD
    A[Receive set default request] --> B{Bank account exists?}
    B -->|No| C[Return error: bank account not found]
    B -->|Yes| D{Partner has existing default?}
    D -->|Yes| E[Unset previous default]
    E --> F[Set new default bank account]
    D -->|No| F
    F --> G[Return updated bank account]
```

## External Dependencies

- None

## Error Scenarios

- **BANK_ACCOUNT_NOT_FOUND**: Specified bank account ID does not exist

## Test Cases

- sets account as default
- unsets previous default account
- returns error when account not found
