Subversion Repositories SmartDukaan

Rev

Rev 37409 | Rev 37794 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
25822 amit.gupta 1
package com.spice.profitmandi.service;
2
 
30066 amit.gupta 3
import com.spice.profitmandi.common.enumuration.MessageType;
29198 manish 4
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
37508 ranu 5
import com.spice.profitmandi.common.model.NotificationTargetCriteria;
25822 amit.gupta 6
import com.spice.profitmandi.common.model.SendNotificationModel;
37508 ranu 7
import org.springframework.stereotype.Service;
37409 vikas 8
 
37508 ranu 9
import java.time.LocalDateTime;
37409 vikas 10
import java.util.List;
37508 ranu 11
import java.util.Set;
25822 amit.gupta 12
 
13
@Service
14
public interface NotificationService {
29198 manish 15
	void sendNotification(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;
29927 amit.gupta 16
 
37508 ranu 17
    void dispatchScheduled(int scheduleId) throws ProfitMandiBusinessException;
18
 
19
    int dispatchDueScheduled(int batchSize) throws ProfitMandiBusinessException;
20
 
21
    boolean cancelSchedule(int scheduleId);
22
 
23
    int addScheduleForCampaign(int campaignId, LocalDateTime scheduledAt) throws ProfitMandiBusinessException;
24
 
25
    int resolveAudienceSize(NotificationTargetCriteria criteria) throws ProfitMandiBusinessException;
26
 
27
    Set<Integer> resolveTargetUserIds(NotificationTargetCriteria criteria) throws ProfitMandiBusinessException;
28
 
29927 amit.gupta 29
	void sendNotificationToAll(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;
30025 amit.gupta 30
 
34550 vikas.jang 31
	void sendNotificationToSystemUsers(SendNotificationModel sendNotificationModel) throws ProfitMandiBusinessException;
32
 
34468 vikas.jang 33
	void sendNotification(int fofoId, String campaignName, MessageType messageType, String title, String message) throws ProfitMandiBusinessException;
30859 tejbeer 34
 
34468 vikas.jang 35
	void sendNotification(int fofoId, String campaignName, MessageType messageType, String title, String message, String Url) throws ProfitMandiBusinessException;
30989 tejbeer 36
 
37409 vikas 37
	// ── WhatsApp ──────────────────────────────────────────────────────────────
38
	// One method per business event, each taking the template's variables rather than a rendered
39
	// message. The gateway is template-first: Meta needs the variables separately, and rejects any
40
	// parameter containing a newline — so a formatted string cannot be passed through here at all.
41
	// The message wording itself lives in the approved Meta template, not in the caller.
32253 amit.gupta 42
 
37409 vikas 43
	boolean shouldSendWhatsappMessage(String mobile);
32253 amit.gupta 44
 
37409 vikas 45
	boolean sendWhatsappInvoice(int customerId, int fofoId, String invoiceNumber, String whatsAppNo) throws Exception;
32405 jai.hind 46
 
37409 vikas 47
	boolean sendPaymentLink(String mobile, String paymentLink) throws Exception;
34468 vikas.jang 48
 
37409 vikas 49
	boolean sendOfferAnnouncement(String mobile, String offerName, String schemeType, String startDate,
50
								  String endDate, String imageUrl) throws Exception;
33715 ranu 51
 
37409 vikas 52
	/**
53
	 * One line per lot. The approved template has three variables, so at most three lots go out per
54
	 * send; anything beyond that is dropped and logged rather than silently trimmed.
55
	 */
56
	boolean sendBiddingLive(String mobile, List<String> lots, String mediaUrl) throws Exception;
35504 vikas 57
 
37409 vikas 58
	/** Days in default and the penalty rate are fixed copy in the template, so only these two vary. */
59
	boolean sendLoanDefaultAlert(String mobile, String name, String outstandingAmount) throws Exception;
36064 aman 60
 
37409 vikas 61
	boolean sendOrderDelivered(String mobile, String airwayBillNumber) throws Exception;
62
 
63
	/** Post-purchase protection upsell. The approved template attaches the invoice PDF and names it. */
64
	boolean sendADLDWhatsappMessage(String mobile, String invoiceNumber, String mediaUrl, String fileName)
65
			throws Exception;
66
 
25822 amit.gupta 67
}