# DDR-0001: Use messages/ Subpackage for E27 Message Handling

Status: Accepted  
Date: 2025-12-22  
Related ADRs: ADR-0007 (E27 API Message Layer Architecture)

## Context

The E27 Dealer API exposes a large and growing set of message domains and commands.
A flat single-file message handler (as used in the Elk M1 implementation) would grow
large and difficult to maintain for E27.

The existing E27 library was initially copied from the M1 layout, but the message
surface area for E27 is substantially larger and JSON-based.

## Decision

E27 message handling will be implemented under a dedicated `messages/` subpackage:

elkm1/elke27_lib/messages/

This subpackage will contain:
- dispatcher logic
- handler registry
- per-domain handler modules
- shared message-layer types
- a stable API inventory file

The top-level `message.py` remains as a public-facing entrypoint only.

## Rationale

- Supports large numbers of domains and commands without monolithic files
- Keeps per-domain handlers isolated and readable
- Allows incremental implementation without touching central dispatch logic
- Aligns with E27’s domain/command API model

## Consequences

- Message-related logic must live under `messages/`
- Callers should not import domain handlers directly
- Future refactors can split or merge domains without changing public APIs
