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

/**
 * 预种提现限制模块
 *
 * 注册路由级 Interceptor，仅对提现路由生效
 * 未合并成树的预种用户不可提现
 */
@Module({
  providers: [
    PrePlantingClient,
    PrePlantingWithdrawalInterceptor,
    {
      provide: APP_INTERCEPTOR,
      useClass: PrePlantingWithdrawalInterceptor,
    },
  ],
})
export class PrePlantingGuardModule {}
