import { Module } from '@nestjs/common';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { CartService } from './providers/cart.service';
import { CartController } from './controllers/cart.controller';
import { Food } from '../foods/entities/food.entity';
import { Restaurant } from '../restaurants/entities/restaurant.entity';
import { PaymentMethod } from '../payments/entities/payment-method.entity';
import { UserAddress } from '../users/entities/user-address.entity';
import { User } from '../users/entities/user.entity';
import { Delivery } from '../delivery/entities/delivery.entity';
import { Order } from '../orders/entities/order.entity';
import { AuthModule } from '../auth/auth.module';
import { UserModule } from '../users/user.module';
import { JwtModule } from '@nestjs/jwt';
import { UtilsModule } from '../utils/utils.module';
import { CouponModule } from '../coupons/coupon.module';
import { CartRepository } from './repositories/cart.repository';
import { CartValidationService } from './providers/cart-validation.service';
import { CartCalculationService } from './providers/cart-calculation.service';
import { CartItemService } from './providers/cart-item.service';
import { PointTransaction } from '../users/entities/point-transaction.entity';
import { WalletTransaction } from '../users/entities/wallet-transaction.entity';

@Module({
  imports: [
    MikroOrmModule.forFeature([
      Food,
      Restaurant,
      PaymentMethod,
      UserAddress,
      User,
      PointTransaction,
      WalletTransaction,
      Delivery,
      Order,
    ]),
    AuthModule,
    UserModule,
    JwtModule,
    UtilsModule,
    CouponModule,
  ],
  controllers: [CartController],
  providers: [
    CartService,
    CartRepository,
    CartValidationService,
    CartCalculationService,
    CartItemService,
  ],
  exports: [CartService],
})
export class CartModule { }
