import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from '../auth/auth.module';
import { ThirdPartyModule } from '../third-party/third-party.module';
import { Course } from '../third-party/entities/course.entity';
import { OrderAction } from './entities/order-action.entity';
import { OrderFulfillment } from './entities/order-fulfillment.entity';
import { OrderItem } from './entities/order-item.entity';
import { Order } from './entities/order.entity';
import { ThirdPartyOrder } from './entities/third-party-order.entity';
import { OrdersController } from './orders.controller';
import { OrdersThirdPartyAdminController } from './orders-third-party-admin.controller';
import { OrdersThirdPartySyncTask } from './orders-third-party-sync.task';
import { OrdersService } from './orders.service';

@Module({
  imports: [
    AuthModule,
    ThirdPartyModule,
    TypeOrmModule.forFeature([
      Course,
      Order,
      OrderItem,
      OrderFulfillment,
      OrderAction,
      ThirdPartyOrder,
    ]),
  ],
  controllers: [OrdersController, OrdersThirdPartyAdminController],
  providers: [OrdersService, OrdersThirdPartySyncTask],
  exports: [OrdersService],
})
export class OrdersModule {}
