import { injectable } from "@codemation/core"; import type { Query } from "../../application/bus/Query"; type AbstractType = abstract new (...args: any[]) => TInstance; export const queryHandlerMetadataKey = Symbol.for("codemation.infrastructure.di.QueryHandler"); export class HandlesQuery { static for, TResult>(queryType: AbstractType): ClassDecorator { return (target) => { Reflect.defineMetadata(queryHandlerMetadataKey, queryType, target); injectable()(target as never); }; } }