Subversion Repositories SmartDukaan

Rev

Rev 36064 | Rev 37508 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.service;

import com.spice.profitmandi.common.enumuration.MessageType;
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.common.model.SendNotificationModel;

import java.util.List;
import org.springframework.stereotype.Service;

@Service
public interface NotificationService {
        void sendNotification(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;

        void sendNotificationToAll(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;

        void sendNotificationToSystemUsers(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;

        void sendNotification(int fofoId, String campaignName, MessageType messageType, String title, String message) throws ProfitMandiBusinessException;

        void sendNotification(int fofoId, String campaignName, MessageType messageType, String title, String message, String Url) throws ProfitMandiBusinessException;

        // ── WhatsApp ──────────────────────────────────────────────────────────────
        // One method per business event, each taking the template's variables rather than a rendered
        // message. The gateway is template-first: Meta needs the variables separately, and rejects any
        // parameter containing a newline — so a formatted string cannot be passed through here at all.
        // The message wording itself lives in the approved Meta template, not in the caller.

        boolean shouldSendWhatsappMessage(String mobile);

        boolean sendWhatsappInvoice(int customerId, int fofoId, String invoiceNumber, String whatsAppNo) throws Exception;

        boolean sendPaymentLink(String mobile, String paymentLink) throws Exception;

        boolean sendOfferAnnouncement(String mobile, String offerName, String schemeType, String startDate,
                                                                  String endDate, String imageUrl) throws Exception;

        /**
         * One line per lot. The approved template has three variables, so at most three lots go out per
         * send; anything beyond that is dropped and logged rather than silently trimmed.
         */
        boolean sendBiddingLive(String mobile, List<String> lots, String mediaUrl) throws Exception;

        /** Days in default and the penalty rate are fixed copy in the template, so only these two vary. */
        boolean sendLoanDefaultAlert(String mobile, String name, String outstandingAmount) throws Exception;

        boolean sendOrderDelivered(String mobile, String airwayBillNumber) throws Exception;

        /** Post-purchase protection upsell. The approved template attaches the invoice PDF and names it. */
        boolean sendADLDWhatsappMessage(String mobile, String invoiceNumber, String mediaUrl, String fileName)
                        throws Exception;

}