# GetPrimaryContactPerson

## Overview

GetPrimaryContactPerson retrieves the primary contact person for a partner. This is used by downstream communication workflows to resolve the primary point of contact for a given business partner.

## Business Rules

- Accepts `{ partnerId }` as input — retrieves the contact person with isPrimary=true for the given partner
- Returns the ContactPerson record where isPrimary is true, or null if no primary is set
- At most one contact person per partner can be marked as primary
- Returns null when the partner has no contact persons at all

## Process Flow

```mermaid
flowchart TD
    A[Receive input] --> B[SELECT from ContactPerson where partnerId = input.partnerId AND isPrimary = true]
    B --> C{Primary contact found?}
    C -->|Yes| D[Return contact person record]
    C -->|No| E[Return null]
```

## External Dependencies

- None

## Error Scenarios

- No explicit error — returns null when no primary contact person exists

## Test Cases

- returns primary contact when one exists
- returns null when no primary is set
- returns null when partner has no contact persons
