Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
27877 amit.gupta 1
package com.spice.profitmandi.service.offers;
2
 
30274 amit.gupta 3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
4
import com.spice.profitmandi.dao.entity.catalog.Offer;
31205 amit.gupta 5
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
31903 amit.gupta 6
import com.spice.profitmandi.dao.model.AmountModel;
30274 amit.gupta 7
import com.spice.profitmandi.dao.model.CreateOfferRequest;
35394 amit 8
import com.spice.profitmandi.dao.model.QtyAmountModel;
33999 tejus.loha 9
import org.apache.commons.io.output.ByteArrayOutputStream;
30274 amit.gupta 10
import org.springframework.stereotype.Service;
11
 
29684 amit.gupta 12
import java.io.InputStream;
27877 amit.gupta 13
import java.time.LocalDate;
14
import java.time.YearMonth;
15
import java.util.List;
29785 amit.gupta 16
import java.util.Map;
36305 amit 17
import java.util.LinkedHashMap;
27877 amit.gupta 18
 
19
@Service
20
public interface OfferService {
36049 amit 21
	void evictOfferCaches(int offerId);
22
 
27877 amit.gupta 23
	void addOfferService(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
24
 
33247 ranu 25
    List<CreateOfferRequest> getPublishedOffers(int fofoId, YearMonth yearMonth) throws ProfitMandiBusinessException;
27877 amit.gupta 26
 
36049 amit 27
    List<CreateOfferRequest> getPublishedOffersCached(int fofoId, YearMonth yearMonth) throws ProfitMandiBusinessException;
28
 
33247 ranu 29
    Map<Integer, CreateOfferRequest> getAllOffers(YearMonth yearMonth) throws ProfitMandiBusinessException;
27877 amit.gupta 30
 
36049 amit 31
    CreateOfferRequest getOfferDefinition(int offerId) throws ProfitMandiBusinessException;
32
 
33247 ranu 33
    CreateOfferRequest getOffer(int fofoId, int offerId) throws ProfitMandiBusinessException;
27877 amit.gupta 34
 
33247 ranu 35
    List<CreateOfferRequest> getPublishedOffers(LocalDate date, int fofoId, int catalogId) throws ProfitMandiBusinessException;
29684 amit.gupta 36
 
31903 amit.gupta 37
    Map<Integer, CreateOfferRequest> getPublishedOffers(LocalDate date, int fofoId, String brand);
29785 amit.gupta 38
 
36374 ranu 39
    List<CreateOfferRequest> getActiveOffers(int fofoId) throws ProfitMandiBusinessException;
40
 
31903 amit.gupta 41
    void createOffers(InputStream inputStream) throws Exception;
29785 amit.gupta 42
 
33247 ranu 43
    Map<Integer, Map<Integer, Long>> getSlabPayoutMap(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
29902 amit.gupta 44
 
31205 amit.gupta 45
 
31903 amit.gupta 46
    Map<Integer, Map<Integer, AmountModel>> getSlabPayoutMapNew(CreateOfferRequest createOfferRequest);
47
 
33247 ranu 48
    CreateOfferRequest getCreateOfferRequest(Offer fromOffer) throws ProfitMandiBusinessException;
31903 amit.gupta 49
 
33613 amit.gupta 50
    void reverseAdditionalSelloutSchemes(List<InventoryItem> inventoryItems, String reversalReason) throws ProfitMandiBusinessException;
31920 amit.gupta 51
 
36103 amit 52
    void restoreAdditionalSelloutSchemes(List<InventoryItem> inventoryItems, String restoreReason) throws ProfitMandiBusinessException;
53
 
31920 amit.gupta 54
    void processSellin(CreateOfferRequest createOfferRequest) throws Exception;
35394 amit 55
 
56
    Map<Integer, QtyAmountModel> getCriteriaQtyAmounModelMap(CreateOfferRequest createOfferRequest, int fofoId) throws ProfitMandiBusinessException;
57
 
31920 amit.gupta 58
    void processActivationtOffer(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
33030 amit.gupta 59
 
36305 amit 60
    /**
61
     * Read-only calculation of offer payouts per partner. Returns a list of payout data
62
     * without persisting anything. Used by batch processing to separate read from write.
63
     */
64
    List<OfferPartnerPayoutData> calculateOfferPayouts(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
65
 
66
    List<SellinPartnerPayoutData> calculateSellinPayouts(CreateOfferRequest createOfferRequest) throws Exception;
67
 
33247 ranu 68
    String getPartnerCriteriaString(PartnerCriteria partnerCriteria) throws ProfitMandiBusinessException;
33999 tejus.loha 69
 
70
    ByteArrayOutputStream createCSVOfferReport(CreateOfferRequest createOfferRequest) throws Exception;
35205 amit 71
 
72
    void sendWhatsapp(Offer offer, List<Integer> fofoIds, String imageUrl) throws Exception;
35856 amit 73
 
74
    void deleteOffer(int offerId) throws ProfitMandiBusinessException;
75
 
76
    List<Offer> publishAllUnpublished(YearMonth yearMonth) throws ProfitMandiBusinessException;
35885 amit 77
 
78
    void removePartnersFromOffer(int offerId, List<Integer> fofoIds) throws ProfitMandiBusinessException;
79
 
80
    void addPartnersToOffer(int offerId, List<Integer> fofoIds) throws ProfitMandiBusinessException;
81
 
82
    int cloneOfferForPartners(int sourceOfferId, List<Integer> fofoIds, List<Integer> targets) throws ProfitMandiBusinessException;
83
 
84
    void updateOfferTargets(int offerId, List<Integer> newTargets) throws ProfitMandiBusinessException;
35924 amit 85
 
86
    void updateOfferSlabs(com.spice.profitmandi.dao.model.UpdateOfferSlabsRequest request) throws ProfitMandiBusinessException;
27877 amit.gupta 87
}