import { APP_PATHS } from "../../lib/paths";
import type { CategoryConfig, TestCaseCategoryConfig } from "../../lib/sync-check/shared";

export function appComposeCategories(root: string): CategoryConfig[] {
  return [
    {
      name: "resolver",
      sourcePattern: `${root}/${APP_PATHS.code.resolver}/*.ts`,
      docPattern: `${root}/${APP_PATHS.docs.resolver}/*.md`,
      exclusions: [/\.test\.ts$/, /^index\.ts$/],
    },
  ];
}

export function appTestCaseCategories(root: string): TestCaseCategoryConfig {
  return {
    name: "story-test-case",
    docPattern: `${root}/${APP_PATHS.docs.businessFlow}/*/${APP_PATHS.docs.story}/*.md`,
    testDir: APP_PATHS.tests.story,
  };
}

export function appE2eCategory(root: string): TestCaseCategoryConfig {
  return {
    name: "e2e-scenario",
    docPattern: `${root}/${APP_PATHS.docs.businessFlow}/*/${APP_PATHS.docs.story}/*.md`,
    testDir: `${APP_PATHS.tests.e2e}/tests`,
  };
}
