# GetEventCategoryBinding

## Overview

GetEventCategoryBinding returns the catalog row that binds a single `eventType` to its NotificationCategory, transactional flag, and default channel set. The dispatcher invokes this lookup at the start of every dispatch to determine whether preference filtering applies (transactional events bypass it) and which channels to fan out to when the recipient has no preference rows. A null result means the eventType is absent from the host-seeded Event Catalog and the dispatcher will surface `CATEGORY_NOT_FOUND` downstream.

## Business Rules

- Accepts a single lookup parameter: `{ eventType }`
- Returns null when the eventType is not present in the host-seeded Event Catalog
- Returned row carries `eventType`, `categoryId`, `transactional` (boolean), and `defaultChannels[]`
- The catalog is seeded by the host application (the module ships an empty seed scaffold) and is immutable at runtime; the binding cannot be edited via this query
- Each `eventType` maps to exactly one NotificationCategory — the row is unique by `eventType`

## Process Flow

```mermaid
flowchart TD
    A[Receive eventType] --> B[Load EventCategoryBinding by eventType]
    B --> C{Row found?}
    C -->|No| D[Return null]
    C -->|Yes| E[Return binding with categoryId, transactional, defaultChannels]
```

## External Dependencies

- None

## Error Scenarios

- **NO_MATCH**: No matching row exists for the supplied input; null or empty result is returned

> Returning `NO_MATCH` is a normal empty/null result rather than a thrown error — the query returns the null/empty value and does not raise `NoMatchError`.

## Test Cases

- returns the binding when found by eventType
- returns null when the eventType is not present in the catalog
- returns `transactional = true` for transactional events (host-seeded examples: INVOICE_APPROVED, SUPPLIER_SUSPENDED)
- returns `transactional = false` for optional events (host-seeded examples: ANNOUNCEMENT_PUBLISHED, RFQ_PUBLISHED)
- returns the host-seeded `defaultChannels[]` array on the row
