import { Module, forwardRef } from '@nestjs/common';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { OrdersService } from './providers/orders.service';
import { OrdersController } from './controllers/orders.controller';
import { Order } from './entities/order.entity';
import { OrderItem } from './entities/order-item.entity';
import { User } from '../users/entities/user.entity';
import { Restaurant } from '../restaurants/entities/restaurant.entity';
import { Food } from '../foods/entities/food.entity';
import { UserAddress } from '../users/entities/user-address.entity';
import { PaymentMethod } from '../payments/entities/payment-method.entity';
import { CartModule } from '../cart/cart.module';
import { UtilsModule } from '../utils/utils.module';
import { AuthModule } from '../auth/auth.module';
import { PaymentsModule } from '../payments/payments.module';
import { JwtModule } from '@nestjs/jwt';
import { OrderRepository } from './repositories/order.repository';
import { OrderListeners } from './listeners/order.listeners';
import { OrdersCrone } from './crone/order.crone';
import { AdminModule } from '../admin/admin.module';
import { NotificationsModule } from '../notifications/notifications.module';
import { InventoryModule } from '../inventory/inventory.module';
import { UserModule } from '../users/user.module';
 
@Module({
  imports: [
    MikroOrmModule.forFeature([Order, OrderItem, User, Restaurant, Food, UserAddress, PaymentMethod]),
    CartModule,
    UtilsModule,
    AuthModule,
    forwardRef(() => PaymentsModule),
    JwtModule,
    AdminModule,
    NotificationsModule,
    InventoryModule,
    forwardRef(() => UserModule)
  ],
  controllers: [OrdersController],
  providers: [OrdersService, OrderRepository, OrderListeners, OrdersCrone],
  exports: [OrderRepository, OrdersService],
})
export class OrdersModule { }
