import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PalmOilService } from './palm-oil.service';
import { VisionGateway } from './vision.gateway';
import { History } from './entities/history.entity';
import { SCANNER_TOKEN } from './providers/scanner.interface';
import { OnnxWasmProvider } from './providers/onnx-wasm.provider';

console.log('🔧 Inference backend: onnx-wasm (Android/Termux)');

@Module({
  imports: [TypeOrmModule.forFeature([History])],
  controllers: [],
  providers: [
    PalmOilService,
    VisionGateway,
    { provide: SCANNER_TOKEN, useClass: OnnxWasmProvider },
  ],
  exports: [PalmOilService],
})
export class PalmOilModule {}
