# GetPartnerRole

## Overview

GetPartnerRole retrieves a role assignment by partnerId and role. This serves as the lookup for idempotency checks in assignRole and removeRole commands.

## Business Rules

- Accepts `{ partnerId, role }` as input — retrieves by the composite key of partner and role
- Returns the full PartnerRole record or null if no matching assignment is found
- Used to determine whether a role is already assigned before assigning, or still assigned before removing

## Process Flow

```mermaid
flowchart TD
    A[Receive input] --> B[SELECT from PartnerRole where partnerId = input.partnerId AND role = input.role]
    B --> C{Role found?}
    C -->|Yes| D[Return role record]
    C -->|No| E[Return null]
```

## External Dependencies

- None

## Error Scenarios

- **ROLE_NOT_FOUND**: No role assignment matches the given partnerId and role — caller receives null

## Test Cases

- returns role when found
- returns null when role not found
