diff --git a/src/command-bus.ts b/src/command-bus.ts index b2346571..74d1912a 100644 --- a/src/command-bus.ts +++ b/src/command-bus.ts @@ -49,11 +49,6 @@ export class CommandBus this._publisher = _publisher; } - private getCommandName(command: Type): string { - const { constructor } = Object.getPrototypeOf(command); - return constructor.name as string; - } - /** * Executes a command. * @param command The command to execute. @@ -103,6 +98,11 @@ export class CommandBus return commandMetadata.id; } + private getCommandName(command: Type): string { + const { constructor } = Object.getPrototypeOf(command); + return constructor.name as string; + } + private reflectCommandId(handler: CommandHandlerType): string | undefined { const command: Type = Reflect.getMetadata( COMMAND_HANDLER_METADATA,