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';
import { EntitlementStatusFeatureExtractor } from './entitlement-status.feature';
import { RfmFeatureExtractor } from './rfm.feature';

/**
 * FeatureRegistry — 收集所有规则路径的 PersonaFeature 提取器。
 *
 * v1 起步 4 个:value / treatment_chain_status / recall_risk / do_not_contact_status。
 * + entitlement_status 权益身份(商保/医保,事实投影型,史+最近日期)。
 * 单个 extractor 抛错不影响其余 — PersonaService 整体记 partial(orchestration log)。
 */
@Injectable()
export class FeatureRegistry {
  readonly extractors: FeatureExtractor[];

  constructor(
    value: ValueFeatureExtractor,
    chain: TreatmentChainStatusFeatureExtractor,
    risk: RecallRiskFeatureExtractor,
    dnc: DoNotContactStatusFeatureExtractor,
    entitlement: EntitlementStatusFeatureExtractor,
    rfm: RfmFeatureExtractor,
  ) {
    // rfm(统计层)additive 加入;下一步翻转 scorer 读 rfm.data 后,推翻 value/chain/risk
    this.extractors = [value, chain, risk, dnc, entitlement, rfm];
  }
}
