| 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 |
/**
|
| 37276 |
amit |
31 |
* Re-index the models whose deal window opens today or closed yesterday, so Solr's
|
|
|
32 |
* derived hot_deal_b follows the window without anyone editing the deal. Run daily.
|
| 37254 |
amit |
33 |
*/
|
|
|
34 |
void syncHotDealFlags();
|
| 37211 |
amit |
35 |
}
|