/**
 * Mock gate configurations for integration testing
 */

export interface QualityGateConfig {
  id: string;
  workspaceId: string;
  name: string;
  description: string;
  isActive: boolean;
  isDefault: boolean;
  gates: Record<string, unknown>;
  createdAt: Date;
  updatedAt: Date;
}

export const MOCK_GATE_CONFIGS = {
  default: {
    id: "config-default",
    workspaceId: "workspace-1",
    name: "Default Quality Gates",
    description: "Standard quality gates for all tasks",
    isActive: true,
    isDefault: true,
    gates: {
      build: {
        enabled: true,
        required: true,
        command: "pnpm build",
        timeout: 300000,
      },
      lint: {
        enabled: true,
        required: true,
        command: "pnpm lint",
        timeout: 120000,
      },
      test: {
        enabled: true,
        required: true,
        command: "pnpm test",
        timeout: 300000,
      },
      coverage: {
        enabled: true,
        required: false,
        command: "pnpm test:coverage",
        timeout: 300000,
        threshold: 85,
      },
    },
    createdAt: new Date("2026-01-01T00:00:00Z"),
    updatedAt: new Date("2026-01-01T00:00:00Z"),
  } as QualityGateConfig,

  strict: {
    id: "config-strict",
    workspaceId: "workspace-1",
    name: "Strict Quality Gates",
    description: "Strict quality gates for critical features",
    isActive: true,
    isDefault: false,
    gates: {
      build: {
        enabled: true,
        required: true,
        command: "pnpm build",
        timeout: 300000,
      },
      lint: {
        enabled: true,
        required: true,
        command: "pnpm lint",
        timeout: 120000,
      },
      test: {
        enabled: true,
        required: true,
        command: "pnpm test",
        timeout: 300000,
      },
      coverage: {
        enabled: true,
        required: true,
        command: "pnpm test:coverage",
        timeout: 300000,
        threshold: 90,
      },
      typecheck: {
        enabled: true,
        required: true,
        command: "pnpm typecheck",
        timeout: 180000,
      },
      security: {
        enabled: true,
        required: true,
        command: "pnpm audit",
        timeout: 120000,
      },
    },
    createdAt: new Date("2026-01-01T00:00:00Z"),
    updatedAt: new Date("2026-01-01T00:00:00Z"),
  } as QualityGateConfig,

  minimal: {
    id: "config-minimal",
    workspaceId: "workspace-1",
    name: "Minimal Quality Gates",
    description: "Minimal quality gates for rapid iteration",
    isActive: true,
    isDefault: false,
    gates: {
      build: {
        enabled: true,
        required: true,
        command: "pnpm build",
        timeout: 300000,
      },
      lint: {
        enabled: true,
        required: false,
        command: "pnpm lint",
        timeout: 120000,
      },
      test: {
        enabled: false,
        required: false,
        command: "pnpm test",
        timeout: 300000,
      },
    },
    createdAt: new Date("2026-01-01T00:00:00Z"),
    updatedAt: new Date("2026-01-01T00:00:00Z"),
  } as QualityGateConfig,

  customGates: {
    id: "config-custom",
    workspaceId: "workspace-1",
    name: "Custom Quality Gates",
    description: "Custom quality gates with non-standard checks",
    isActive: true,
    isDefault: false,
    gates: {
      build: {
        enabled: true,
        required: true,
        command: "pnpm build",
        timeout: 300000,
      },
      "custom-e2e": {
        enabled: true,
        required: true,
        command: "pnpm test:e2e",
        timeout: 600000,
      },
      "custom-integration": {
        enabled: true,
        required: false,
        command: "pnpm test:integration",
        timeout: 480000,
      },
      "custom-performance": {
        enabled: true,
        required: false,
        command: "pnpm test:perf",
        timeout: 300000,
      },
    },
    createdAt: new Date("2026-01-01T00:00:00Z"),
    updatedAt: new Date("2026-01-01T00:00:00Z"),
  } as QualityGateConfig,
};
