| 37211 |
amit |
1 |
package com.spice.profitmandi.service.catalog;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
|
|
4 |
import com.spice.profitmandi.dao.entity.catalog.ModelHotDeal;
|
|
|
5 |
|
|
|
6 |
import java.time.LocalDate;
|
|
|
7 |
import java.util.List;
|
|
|
8 |
|
|
|
9 |
public interface ModelHotDealService {
|
|
|
10 |
|
|
|
11 |
int MAX_ACTIVE_DEALS_PER_BRAND = 15;
|
|
|
12 |
|
|
|
13 |
List<ModelHotDeal> getDealsForBrand(int brandId);
|
|
|
14 |
|
| 37254 |
amit |
15 |
/** All deals across brands, newest window first, server-side searched + paginated. */
|
|
|
16 |
List<ModelHotDeal> searchDeals(String query, int page, int pageSize);
|
|
|
17 |
|
|
|
18 |
long countDeals(String query);
|
|
|
19 |
|
| 37211 |
amit |
20 |
long countActive(int brandId);
|
|
|
21 |
|
| 37244 |
amit |
22 |
void addDeal(int brandId, int catalogItemId, LocalDate startDate, LocalDate endDate,
|
|
|
23 |
HotDealAttributes attributes, String user) throws ProfitMandiBusinessException;
|
| 37211 |
amit |
24 |
|
| 37244 |
amit |
25 |
void updateDeal(int id, LocalDate startDate, LocalDate endDate,
|
|
|
26 |
HotDealAttributes attributes, String user) throws ProfitMandiBusinessException;
|
| 37211 |
amit |
27 |
|
|
|
28 |
void removeDeal(int id) throws ProfitMandiBusinessException;
|
| 37254 |
amit |
29 |
|
|
|
30 |
/**
|
|
|
31 |
* Reconcile catalog.tag_listing.hot_deals with the date-windowed model_hot_deal
|
|
|
32 |
* source of truth (Solr's hot_deal_b reads that flag): models with an active deal
|
|
|
33 |
* get flagged, everything else unflagged. Run daily so windows start/expire on time.
|
|
|
34 |
*/
|
|
|
35 |
void syncHotDealFlags();
|
| 37211 |
amit |
36 |
}
|