import { Module } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { StripeService } from "./stripe.service";
import { StripeController } from "./stripe.controller";
import { StripeWebhookController } from "./stripe.webhook.controller";
import { Users, UsersSchema } from "src/schema/users.schema";
import {
  PaymentDetails,
  PaymentDetailsSchema,
} from "src/schema/user-payment-details.schema";
import { MongooseModule } from "@nestjs/mongoose";
import { UserDevicesService } from "src/user-devices/user-devices.service";
import { JwtUtilsService } from "src/common/service/jwt-util.service";
import {
  NotificationSchema,
  Notification,
} from "src/schema/notificatiom.schema";
import { Invoice, InvoiceSchema } from "src/schema/invoice.schema";
import { AlertsService } from "src/alerts/alerts.service";
import { FirebaseProvider } from "src/common/firebase/firebase.provider";
import { AlertsModule } from "src/alerts/alerts.module";
import { ResponseService } from "src/common/service/response.service";

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: Users.name, schema: UsersSchema },
      { name: Notification.name, schema: NotificationSchema },
      { name: PaymentDetails.name, schema: PaymentDetailsSchema },
      { name: Invoice.name, schema: InvoiceSchema },
    ]),
    AlertsModule
  ],
  controllers: [StripeController, StripeWebhookController],
  providers: [
    StripeService,
    ConfigService,
    JwtUtilsService,
    ResponseService
    // AlertsService,
    // FirebaseProvider,
    // UserDevicesService,
  ],
  exports: [
    StripeService, // used by InvoicesModule
  ],
})
export class StripeModule {}
