import { Module } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { PrePlantingClient } from './pre-planting.client';
import { PrePlantingAuthorizationInterceptor } from './pre-planting-guard.interceptor';

/**
 * 预种授权限制模块
 *
 * 注册路由级 Interceptor，仅对授权申请路由生效
 * 未合并成树的预种用户不可申请社区/省/市授权
 */
@Module({
  providers: [
    PrePlantingClient,
    PrePlantingAuthorizationInterceptor,
    {
      provide: APP_INTERCEPTOR,
      useClass: PrePlantingAuthorizationInterceptor,
    },
  ],
})
export class PrePlantingGuardModule {}
