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.NotificationTargetCriteria;import com.spice.profitmandi.common.model.SendNotificationModel;import org.springframework.stereotype.Service;import java.time.LocalDateTime;import java.util.List;import java.util.Set;@Servicepublic interface NotificationService {void sendNotification(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;void dispatchScheduled(int scheduleId) throws ProfitMandiBusinessException;int dispatchDueScheduled(int batchSize) throws ProfitMandiBusinessException;boolean cancelSchedule(int scheduleId);int addScheduleForCampaign(int campaignId, LocalDateTime scheduledAt) throws ProfitMandiBusinessException;int resolveAudienceSize(NotificationTargetCriteria criteria) throws ProfitMandiBusinessException;Set<Integer> resolveTargetUserIds(NotificationTargetCriteria criteria) 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;/*** Offers & Schemes Radar digest — one WhatsApp per HO user summarising a* finance operator's selection of offers and schemes.** @param mobile recipient's mobile (E.164 or bare 10-digit — the gateway normalises)* @param regionSummary human-readable region field for {{1}} — either "All India" or "N region(s)"* @param offersAdded count of newly-published offers in the selection ({{2}})* @param schemesAdded count of newly-published schemes in the selection ({{3}})* @param revisions count of items that revise an already-running offer or scheme ({{4}})* @param endingSoon count of selected items whose endDate is within 7 days of today ({{5}})*/boolean sendOfferRadar(String mobile, String regionSummary, int offersAdded, int schemesAdded,int revisions, int endingSoon) throws Exception;}