Subversion Repositories SmartDukaan

Rev

Rev 27424 | Rev 30121 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.service.scheme;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.stereotype.Service;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.common.model.SchemeModel;
import com.spice.profitmandi.dao.entity.catalog.Scheme;
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
import com.spice.profitmandi.dao.model.CreateSchemeRequest;

@Service
public interface SchemeService {
        public void saveScheme(int creatorId, CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException;

        public Scheme getSchemeById(int schemeId) throws ProfitMandiBusinessException;

        public List<SchemeModel> getAllSchemeModels(LocalDateTime startDateTime, LocalDateTime endDateTime);

        public void activeSchemeById(int schemeId) throws ProfitMandiBusinessException;

        public void expireSchemeById(int schemeId, LocalDateTime expiryDate) throws ProfitMandiBusinessException;

        public void processSchemeIn(int purchaseId, int retailerId) throws ProfitMandiBusinessException;

        public void processSchemeOut(int fofoOrderId, int retailerId) throws ProfitMandiBusinessException;

        // public void rollbackSchemeForInventoryItemId(int inventoryItemId);
        public void rollbackSchemes(List<Integer> inventoryItemIds, int rollbackReference, String rollbackReason)
                        throws Exception;

        public Map<String, Object> getSchemes(Set<Integer> roleIds, int offset, int limit)
                        throws ProfitMandiBusinessException;

        public List<Scheme> getPaginatedSchemes(Set<Integer> roleIds, int offset, int limit)
                        throws ProfitMandiBusinessException;

        void reverseSchemes(List<InventoryItem> inventoryItems, int reversalReference, String reversalReason)
                        throws ProfitMandiBusinessException;

        void reverseSchemes(List<InventoryItem> inventoryItems, int reversalReference, String reversalReason,
                        SchemeType schemeType) throws ProfitMandiBusinessException;

        public double getTotalMargin(int itemId, PartnerType partnerType, LocalDateTime localDateTime);

        Map<Integer, Float> getItemSchemeCashBack();

        public List<Scheme> selectSchemeByPartnerType(PartnerType partnerType, LocalDate onDate, int itemId, boolean isAdmin, int offset,
                        int limit) throws ProfitMandiBusinessException;

        // void updateSchmesForModel(int catalogId) throws ProfitMandiBusinessException;

        public long selectSchemeCount(PartnerType partnerType, LocalDate onDate, int itemId, boolean isAdmin);

        void processActivation() throws ProfitMandiBusinessException;
}