import { Module } from '@nestjs/common';
import { ApplicationModule } from '../application/application.module';
import { InfrastructureModule } from '../infrastructure/infrastructure.module';
import { ContributionController } from './controllers/contribution.controller';
import { SnapshotController } from './controllers/snapshot.controller';
import { HealthController } from './controllers/health.controller';
import { AdminController } from './controllers/admin.controller';
// [2026-03-04] 新增：预种卖出限制接口
import { PrePlantingRestrictionController } from './controllers/pre-planting-restriction.controller';
import { PrePlantingPrismaModule } from '../pre-planting/infrastructure/prisma/pre-planting-prisma.module';
import { SellRestrictionService } from '../pre-planting/application/services/sell-restriction.service';

@Module({
  imports: [
    ApplicationModule,
    InfrastructureModule,
    PrePlantingPrismaModule, // 提供 PrePlantingPrismaService（用于 override 表）
  ],
  controllers: [
    ContributionController,
    SnapshotController,
    HealthController,
    AdminController,
    PrePlantingRestrictionController, // 预种卖出限制接口
  ],
  providers: [
    SellRestrictionService, // 预种卖出限制判断逻辑
  ],
})
export class ApiModule {}
