import { JSONCodec, Msg } from 'nats';

export class NatsEventMessage {
    private readonly jsonCodec = JSONCodec();

    constructor(private message: Msg) {}

    get data(): { cmd: string; payload: any } {
        return this.message?.json();
    }

    get subject(): string {
        return this.message?.subject;
    }
}
