import { Injectable } from '@nestjs/common';
import type { FeatureExtractor } from './feature.interface';
import { ValueFeatureExtractor } from './value.feature';
import { TreatmentChainStatusFeatureExtractor } from './treatment-chain-status.feature';
import { RecallRiskFeatureExtractor } from './recall-risk.feature';
import { DoNotContactStatusFeatureExtractor } from './do-not-contact-status.feature';

/**
 * FeatureRegistry — 收集所有规则路径的 PersonaFeature 提取器。
 *
 * v1 起步 4 个:value / treatment_chain_status / recall_risk / do_not_contact_status。
 * 单个 extractor 抛错不影响其余 — PersonaService 整体记 partial(orchestration log)。
 */
@Injectable()
export class FeatureRegistry {
  readonly extractors: FeatureExtractor[];

  constructor(
    value: ValueFeatureExtractor,
    chain: TreatmentChainStatusFeatureExtractor,
    risk: RecallRiskFeatureExtractor,
    dnc: DoNotContactStatusFeatureExtractor,
  ) {
    this.extractors = [value, chain, risk, dnc];
  }
}
