const metadata = {
  event: "customer_accounts.user.updated",
  persistent: false,
  id: "customer_accounts:query-index-reindex-updated"
};
async function handle(payload, ctx) {
  const userId = typeof payload?.id === "string" ? payload.id : null;
  const tenantId = typeof payload?.tenantId === "string" ? payload.tenantId : null;
  if (!userId || !tenantId) return;
  let bus = null;
  try {
    bus = ctx.resolve("eventBus");
  } catch {
    bus = null;
  }
  if (!bus) return;
  await bus.emitEvent(
    "query_index.upsert_one",
    {
      entityType: "customer_accounts:customer_user",
      recordId: userId,
      organizationId: payload.organizationId ?? null,
      tenantId,
      crudAction: "updated",
      coverageBaseDelta: 0
    },
    {
      tenantId,
      organizationId: payload.organizationId ?? null
    }
  ).catch(() => void 0);
}
export {
  handle as default,
  metadata
};
//# sourceMappingURL=search-reindex-updated.js.map
