| 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;
|
| 36521 |
amit |
17 |
import java.util.Set;
|
| 36305 |
amit |
18 |
import java.util.LinkedHashMap;
|
| 27877 |
amit.gupta |
19 |
|
|
|
20 |
@Service
|
|
|
21 |
public interface OfferService {
|
| 36049 |
amit |
22 |
void evictOfferCaches(int offerId);
|
|
|
23 |
|
| 36521 |
amit |
24 |
void evictOfferDefinitionCache(int offerId);
|
|
|
25 |
|
|
|
26 |
Set<Integer> getMonthOfferIds(YearMonth yearMonth) throws ProfitMandiBusinessException;
|
|
|
27 |
|
| 27877 |
amit.gupta |
28 |
void addOfferService(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
|
|
|
29 |
|
| 33247 |
ranu |
30 |
List<CreateOfferRequest> getPublishedOffers(int fofoId, YearMonth yearMonth) throws ProfitMandiBusinessException;
|
| 27877 |
amit.gupta |
31 |
|
| 36049 |
amit |
32 |
List<CreateOfferRequest> getPublishedOffersCached(int fofoId, YearMonth yearMonth) throws ProfitMandiBusinessException;
|
|
|
33 |
|
| 33247 |
ranu |
34 |
Map<Integer, CreateOfferRequest> getAllOffers(YearMonth yearMonth) throws ProfitMandiBusinessException;
|
| 27877 |
amit.gupta |
35 |
|
| 36049 |
amit |
36 |
CreateOfferRequest getOfferDefinition(int offerId) throws ProfitMandiBusinessException;
|
|
|
37 |
|
| 33247 |
ranu |
38 |
CreateOfferRequest getOffer(int fofoId, int offerId) throws ProfitMandiBusinessException;
|
| 27877 |
amit.gupta |
39 |
|
| 33247 |
ranu |
40 |
List<CreateOfferRequest> getPublishedOffers(LocalDate date, int fofoId, int catalogId) throws ProfitMandiBusinessException;
|
| 29684 |
amit.gupta |
41 |
|
| 31903 |
amit.gupta |
42 |
Map<Integer, CreateOfferRequest> getPublishedOffers(LocalDate date, int fofoId, String brand);
|
| 29785 |
amit.gupta |
43 |
|
| 36374 |
ranu |
44 |
List<CreateOfferRequest> getActiveOffers(int fofoId) throws ProfitMandiBusinessException;
|
|
|
45 |
|
| 31903 |
amit.gupta |
46 |
void createOffers(InputStream inputStream) throws Exception;
|
| 29785 |
amit.gupta |
47 |
|
| 33247 |
ranu |
48 |
Map<Integer, Map<Integer, Long>> getSlabPayoutMap(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
|
| 29902 |
amit.gupta |
49 |
|
| 31205 |
amit.gupta |
50 |
|
| 31903 |
amit.gupta |
51 |
Map<Integer, Map<Integer, AmountModel>> getSlabPayoutMapNew(CreateOfferRequest createOfferRequest);
|
|
|
52 |
|
| 33247 |
ranu |
53 |
CreateOfferRequest getCreateOfferRequest(Offer fromOffer) throws ProfitMandiBusinessException;
|
| 31903 |
amit.gupta |
54 |
|
| 33613 |
amit.gupta |
55 |
void reverseAdditionalSelloutSchemes(List<InventoryItem> inventoryItems, String reversalReason) throws ProfitMandiBusinessException;
|
| 31920 |
amit.gupta |
56 |
|
| 36103 |
amit |
57 |
void restoreAdditionalSelloutSchemes(List<InventoryItem> inventoryItems, String restoreReason) throws ProfitMandiBusinessException;
|
|
|
58 |
|
| 31920 |
amit.gupta |
59 |
void processSellin(CreateOfferRequest createOfferRequest) throws Exception;
|
| 35394 |
amit |
60 |
|
|
|
61 |
Map<Integer, QtyAmountModel> getCriteriaQtyAmounModelMap(CreateOfferRequest createOfferRequest, int fofoId) throws ProfitMandiBusinessException;
|
|
|
62 |
|
| 31920 |
amit.gupta |
63 |
void processActivationtOffer(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
|
| 33030 |
amit.gupta |
64 |
|
| 36305 |
amit |
65 |
/**
|
|
|
66 |
* Read-only calculation of offer payouts per partner. Returns a list of payout data
|
|
|
67 |
* without persisting anything. Used by batch processing to separate read from write.
|
|
|
68 |
*/
|
|
|
69 |
List<OfferPartnerPayoutData> calculateOfferPayouts(CreateOfferRequest createOfferRequest) throws ProfitMandiBusinessException;
|
|
|
70 |
|
|
|
71 |
List<SellinPartnerPayoutData> calculateSellinPayouts(CreateOfferRequest createOfferRequest) throws Exception;
|
|
|
72 |
|
| 33247 |
ranu |
73 |
String getPartnerCriteriaString(PartnerCriteria partnerCriteria) throws ProfitMandiBusinessException;
|
| 33999 |
tejus.loha |
74 |
|
|
|
75 |
ByteArrayOutputStream createCSVOfferReport(CreateOfferRequest createOfferRequest) throws Exception;
|
| 35205 |
amit |
76 |
|
|
|
77 |
void sendWhatsapp(Offer offer, List<Integer> fofoIds, String imageUrl) throws Exception;
|
| 35856 |
amit |
78 |
|
|
|
79 |
void deleteOffer(int offerId) throws ProfitMandiBusinessException;
|
|
|
80 |
|
|
|
81 |
List<Offer> publishAllUnpublished(YearMonth yearMonth) throws ProfitMandiBusinessException;
|
| 35885 |
amit |
82 |
|
|
|
83 |
void removePartnersFromOffer(int offerId, List<Integer> fofoIds) throws ProfitMandiBusinessException;
|
|
|
84 |
|
|
|
85 |
void addPartnersToOffer(int offerId, List<Integer> fofoIds) throws ProfitMandiBusinessException;
|
|
|
86 |
|
|
|
87 |
int cloneOfferForPartners(int sourceOfferId, List<Integer> fofoIds, List<Integer> targets) throws ProfitMandiBusinessException;
|
|
|
88 |
|
|
|
89 |
void updateOfferTargets(int offerId, List<Integer> newTargets) throws ProfitMandiBusinessException;
|
| 35924 |
amit |
90 |
|
|
|
91 |
void updateOfferSlabs(com.spice.profitmandi.dao.model.UpdateOfferSlabsRequest request) throws ProfitMandiBusinessException;
|
| 36633 |
amit |
92 |
|
|
|
93 |
List<Offer> activateOffers(List<Integer> offerIds, boolean active) throws ProfitMandiBusinessException;
|
| 27877 |
amit.gupta |
94 |
}
|