/** * Replace this with search, store, or any new function. * Must be idempotent: the same correlationId may be redelivered. * * @param {object} msg * @returns {Promise|object} */ export function handle(msg = {}) { const correlationId = msg.correlationId || msg.traceId; if (!correlationId) { throw new Error('correlationId or traceId is required'); } return { ok: true, correlationId, echo: msg.payload ?? msg, processedAt: new Date().toISOString(), note: 'Template handler — replace handle() in src/handle.js', }; }