Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
22608 ashik.ali 1
package com.spice.profitmandi.service.scheme;
2
 
22653 ashik.ali 3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
23019 ashik.ali 4
import com.spice.profitmandi.common.model.SchemeModel;
22653 ashik.ali 5
import com.spice.profitmandi.dao.entity.catalog.Scheme;
23968 amit.gupta 6
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
26332 amit.gupta 7
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
24264 amit.gupta 8
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
25503 amit.gupta 9
import com.spice.profitmandi.dao.model.CreateSchemeRequest;
30121 amit.gupta 10
import org.springframework.stereotype.Service;
22653 ashik.ali 11
 
30121 amit.gupta 12
import java.time.LocalDate;
13
import java.time.LocalDateTime;
14
import java.util.Arrays;
15
import java.util.List;
16
import java.util.Map;
17
import java.util.Set;
18
 
22608 ashik.ali 19
@Service
20
public interface SchemeService {
22859 ashik.ali 21
	public void saveScheme(int creatorId, CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException;
26802 tejbeer 22
 
22859 ashik.ali 23
	public Scheme getSchemeById(int schemeId) throws ProfitMandiBusinessException;
26802 tejbeer 24
 
23019 ashik.ali 25
	public List<SchemeModel> getAllSchemeModels(LocalDateTime startDateTime, LocalDateTime endDateTime);
26802 tejbeer 26
 
22653 ashik.ali 27
	public void activeSchemeById(int schemeId) throws ProfitMandiBusinessException;
26802 tejbeer 28
 
25071 amit.gupta 29
	public void expireSchemeById(int schemeId, LocalDateTime expiryDate) throws ProfitMandiBusinessException;
26802 tejbeer 30
 
23365 ashik.ali 31
	public void processSchemeIn(int purchaseId, int retailerId) throws ProfitMandiBusinessException;
26802 tejbeer 32
 
30454 amit.gupta 33
	public float processSchemeOut(int fofoOrderId, int retailerId) throws ProfitMandiBusinessException;
26802 tejbeer 34
 
35
	// public void rollbackSchemeForInventoryItemId(int inventoryItemId);
36
	public void rollbackSchemes(List<Integer> inventoryItemIds, int rollbackReference, String rollbackReason)
37
			throws Exception;
38
 
39
	public Map<String, Object> getSchemes(Set<Integer> roleIds, int offset, int limit)
40
			throws ProfitMandiBusinessException;
41
 
42
	public List<Scheme> getPaginatedSchemes(Set<Integer> roleIds, int offset, int limit)
43
			throws ProfitMandiBusinessException;
44
 
45
	void reverseSchemes(List<InventoryItem> inventoryItems, int reversalReference, String reversalReason)
46
			throws ProfitMandiBusinessException;
47
 
24264 amit.gupta 48
	void reverseSchemes(List<InventoryItem> inventoryItems, int reversalReference, String reversalReason,
30454 amit.gupta 49
						List<SchemeType> schemeTypes) throws ProfitMandiBusinessException;
26802 tejbeer 50
 
26332 amit.gupta 51
	public double getTotalMargin(int itemId, PartnerType partnerType, LocalDateTime localDateTime);
26802 tejbeer 52
 
30121 amit.gupta 53
	Map<Integer, Float> getCatalogSchemeCashBack();
26802 tejbeer 54
 
27877 amit.gupta 55
	public List<Scheme> selectSchemeByPartnerType(PartnerType partnerType, LocalDate onDate, int itemId, boolean isAdmin, int offset,
30454 amit.gupta 56
												  int limit) throws ProfitMandiBusinessException;
26802 tejbeer 57
 
30454 amit.gupta 58
	List<Scheme> selectPercentageScheme(PartnerType partnerType, LocalDate onDate, int catalogId,
59
										boolean isAdmin, int offset, int limit) throws ProfitMandiBusinessException;
60
 
27395 amit.gupta 61
	void processActivation() throws ProfitMandiBusinessException;
30454 amit.gupta 62
 
29234 amit.gupta 63
	public static final List<SchemeType> OUT_SCHEME_TYPES = Arrays.asList(SchemeType.CATEGORY, SchemeType.HYGEINE, SchemeType.OUT, SchemeType.TERTIARY);
22608 ashik.ali 64
}