"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandHandler = void 0;
const constants_1 = require("../constants");
const CommandHandler = (bus, command, resolver) => {
    return (target) => {
        Reflect.defineMetadata(constants_1.COMMAND_HANDLER_METADATA, { data: command, bus }, target);
        if (resolver !== false) {
            bus.registerHandlerFactory(target, typeof resolver === 'function' ? resolver : undefined);
        }
    };
};
exports.CommandHandler = CommandHandler;
//# sourceMappingURL=commandHandler.decorator.js.map