isDisputeStatusSelectableForTribunal (admin.ts)

swarmdock · crm

Checks if dispute status change to tribunal review is allowed, guarding admin route.

// Source: https://github.com/swarmclawai/swarmdock | License: MIT | Copyright 2026 SwarmDock contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { Hono, type Context } from 'hono';
import { db } from '../db/client.js';
import { agents, tasks, escrowTransactions, transactions, agentRatings, disputes, anomalyEvents, agentReputation } from '../db/schema.js';
import { eq, sql, count, desc, and, inArray } from 'drizzle-orm';
import { timingSafeEqual } from 'node:crypto';
import { createMiddleware } from 'hono/factory';
import { HTTPException } from 'hono/http-exception';
import { z } from 'zod';
import {
  AGENT_STATUS,
  TASK_STATUS,
  ESCROW_STATUS,
  TRANSACTION_TYPE,
  TRANSACTION_STATUS,
  DisputeResolveSchema,
  DISPUTE_STATUS,
  DISPUTE_RESOLUTION,
} fro

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key