# ListPartnerIdentificationsByPartner

## Overview

ListPartnerIdentificationsByPartner retrieves all identification records belonging to a given partner. This supports downstream modules and compliance workflows (tax reporting, KYC, duplicate detection) that need to view or verify all identification documents attached to a partner.

## Business Rules

- Accepts `{ partnerId, type? }` as input
- When `type` is provided, returns only identification records of that type for the partner
- When `type` is omitted, returns all identification records for the partner regardless of type
- Returns an empty array when the partner has no identification records (or none of the requested type) — not an error
- Results include identifications regardless of their validity period (expired, active, or not yet valid)
- Reading identifications is permitted regardless of partner status (DRAFT, ACTIVE, or INACTIVE)

## Process Flow

```mermaid
flowchart TD
    A[Receive input] --> B{type provided?}
    B -->|Yes| C[SELECT from PartnerIdentification where partnerId = input.partnerId AND type = input.type]
    B -->|No| D[SELECT from PartnerIdentification where partnerId = input.partnerId]
    C --> E[Return matching identification records]
    D --> E
```

## External Dependencies

- None

## Error Scenarios

- No explicit error — returns an empty array when no identification records match the criteria

## Test Cases

- returns all identification records for a partner with multiple identifications
- returns only TAX_ID records when type filter is provided
- returns empty array when partner has no identification records
- returns empty array when partner has no identifications of the requested type
- includes identifications regardless of validity period
