import { Injectable } from '@nestjs/common';
import { StripeModule } from 'src/common/services/payment-gateway/stripe/stripe.module';
import { StripeServices } from 'src/common/services/payment-gateway/stripe/stripe.service';
import { CampaignService } from '../campaign/campaign.services';
import { WhatsAppServices } from 'src/common/services/whatsapp/whatsapp.service';
@Injectable()
export class WebhookService {
    constructor(
        private stripeServices: StripeServices,
        private campaignService: CampaignService,
        private whatsappServices: WhatsAppServices,
    ) {
    }

    async stripeWebhook(request: any) {
        return await this.stripeServices.webhook(request)
    }
    async whatsappWebhook(request: any) {
        return await this.whatsappServices.webhook(request)
    }

    async cometChatWebhook(request: any) {
        // Handle CometChat webhook logic here
        this.campaignService.cometChatWebhook(request.body?.data?.message);
        return true;
    }

    async tiktok(subscriptionCreated) {

    }
}
