import {
  FEATURE_REGISTRY,
  FLOW_REGISTRY,
  TAGS_REGISTRY,
  COVERAGE_SUMMARY
} from "@nextsparkjs/registries/testing-registry";
class FeatureService {
  // ===========================================================================
  // FEATURE QUERIES
  // ===========================================================================
  /**
   * Get a feature by key
   */
  static getFeature(key) {
    return FEATURE_REGISTRY[key];
  }
  /**
   * Get all features
   */
  static getAllFeatures() {
    return Object.values(FEATURE_REGISTRY);
  }
  /**
   * Get features by category
   */
  static getFeaturesByCategory(category) {
    return Object.values(FEATURE_REGISTRY).filter((f) => f.category === category);
  }
  /**
   * Get features without test coverage
   */
  static getFeaturesWithoutTests() {
    return Object.values(FEATURE_REGISTRY).filter((f) => !f.testing.hasTests);
  }
  /**
   * Get features with test coverage
   */
  static getFeaturesWithTests() {
    return Object.values(FEATURE_REGISTRY).filter((f) => f.testing.hasTests);
  }
  /**
   * Check if a feature exists
   */
  static hasFeature(key) {
    return key in FEATURE_REGISTRY;
  }
  /**
   * Get feature tag from key
   */
  static getFeatureTag(key) {
    return `@feat-${key}`;
  }
  // ===========================================================================
  // FLOW QUERIES
  // ===========================================================================
  /**
   * Get a flow by key
   */
  static getFlow(key) {
    return FLOW_REGISTRY[key];
  }
  /**
   * Get all flows
   */
  static getAllFlows() {
    return Object.values(FLOW_REGISTRY);
  }
  /**
   * Get flows by category
   */
  static getFlowsByCategory(category) {
    return Object.values(FLOW_REGISTRY).filter((f) => f.category === category);
  }
  /**
   * Get critical path flows
   */
  static getCriticalFlows() {
    return Object.values(FLOW_REGISTRY).filter((f) => f.criticalPath);
  }
  /**
   * Get flows without test coverage
   */
  static getFlowsWithoutTests() {
    return Object.values(FLOW_REGISTRY).filter((f) => !f.testing.hasTests);
  }
  /**
   * Check if a flow exists
   */
  static hasFlow(key) {
    return key in FLOW_REGISTRY;
  }
  /**
   * Get flow tag from key
   */
  static getFlowTag(key) {
    return `@flow-${key}`;
  }
  // ===========================================================================
  // TAG QUERIES
  // ===========================================================================
  /**
   * Get all tags in a category
   */
  static getTagsByCategory(category) {
    return TAGS_REGISTRY[category];
  }
  /**
   * Get all feature tags
   */
  static getFeatureTags() {
    return TAGS_REGISTRY.features;
  }
  /**
   * Get all flow tags
   */
  static getFlowTags() {
    return TAGS_REGISTRY.flows;
  }
  // ===========================================================================
  // COVERAGE QUERIES
  // ===========================================================================
  /**
   * Get coverage summary
   */
  static getCoverageSummary() {
    return COVERAGE_SUMMARY;
  }
  /**
   * Get feature coverage percentage
   */
  static getFeatureCoveragePercent() {
    const { total, withTests } = COVERAGE_SUMMARY.features;
    return total > 0 ? Math.round(withTests / total * 100) : 0;
  }
  /**
   * Get flow coverage percentage
   */
  static getFlowCoveragePercent() {
    const { total, withTests } = COVERAGE_SUMMARY.flows;
    return total > 0 ? Math.round(withTests / total * 100) : 0;
  }
}
export {
  FeatureService
};
