import type { AppState } from '@domain/ports/StateRepository';
import type { Enclos } from '@domain/entities/Enclos';

export interface GetEnclosDetailQuery { type: 'get-enclos-detail'; enclosId: number; }

export function createGetEnclosDetailHandler(state: AppState) {
  return (query: GetEnclosDetailQuery): Enclos | null => {
    return state.enclos.find(e => e.id === query.enclosId) ?? null;
  };
}
