import { Injectable, inject, resource } from '@angular/core';
import { ApiClient } from '@shared/infrastructure/api-client';

/**
 * Infrastructure adapter for the intake policy (the scholing threshold config
 * value). Same shape as every other adapter — a signal `resource` over the
 * generated typed client — so HTTP lives in exactly one place per concern.
 */
@Injectable({ providedIn: 'root' })
export class IntakePolicyAdapter {
  private client = inject(ApiClient);

  policyResource() {
    return resource({ loader: () => this.client.policy() });
  }
}
