Subversion Repositories SmartDukaan

Rev

Rev 36210 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.repository.cs;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.common.model.CustomRetailer;
import com.spice.profitmandi.dao.entity.auth.AuthUser;
import com.spice.profitmandi.dao.entity.cs.*;
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
import com.spice.profitmandi.dao.model.*;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public interface CsService {
    int getAuthUserIdWithoutTicketAssignee(int categoryId, EscalationType escalationType, int fofoId) throws ProfitMandiBusinessException;

    // Sends happy code to customer
    void addActivity(Ticket ticket, Activity activity);

    void createTicket(int fofoId, int categoryId, int subcategoryId, String message) throws ProfitMandiBusinessException;

    void createTicket(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId) throws ProfitMandiBusinessException;

    void createTicket(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, EscalationType targetEscalation) throws ProfitMandiBusinessException;

    void createTicketWithMedia(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, ActivityMediaModel selectedRecording) throws ProfitMandiBusinessException;

    void createTicketWithMedia(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, ActivityMediaModel selectedRecording, EscalationType targetEscalation) throws ProfitMandiBusinessException;

    TicketActivityMedia createMediaActivity(ActivityMediaModel selectedRecording);

    void addMediaActivity(Ticket ticket, TicketActivityMedia activity);

    void createTicketRemarkEscalation(int fofoId, int authId, int categoryId, int subcategoryId, String message, CollectionRemark remark) throws ProfitMandiBusinessException;

    void addPartnerToRegion(int regionId, List<Integer> fofoIds);

    Map<Integer, TicketSubCategory> getSubCategoryIdAndSubCategoryMap(List<Integer> subCategoryIds);

    Map<Integer, TicketCategory> getSubCategoryIdAndCategoryMap(List<Integer> subCategoryIds);


    Map<Integer, AuthUser> getAuthUserIdAndAuthUserMap(List<TicketAssigned> ticketAssigneds);

    Map<Integer, CustomRetailer> getPartnerByFofoIds(List<Ticket> tickets) throws ProfitMandiBusinessException;

    List<TicketCategory> getAllTicketCategotyFromSubCategory();

    Map<Integer, AuthUser> getAuthUserIdAndAuthUserMapUsingPositions(List<Position> positions);

    Map<Integer, TicketCategory> getCategoryIdAndCategoryUsingPositions(List<Position> positions);

    Map<Integer, Region> getRegionIdAndRegionMap(List<Position> positions);

    Map<Integer, List<CustomRetailer>> getRegionPartners(List<Position> position) throws ProfitMandiBusinessException;

    Map<Integer, List<CustomRetailer>> getPositionCustomRetailerMap(List<Position> position) throws ProfitMandiBusinessException;

    Map<Integer, AuthUser> getTicketIdAndAuthUserMapUsingTickets(List<Ticket> tickets);

    void updateTicket(int categoryId, int subCategoryId, Ticket ticket, int authUserId, EscalationType escalationType, ActivityMediaModel recording,int currentUserId) throws ProfitMandiBusinessException;
    void updateTicket(int categoryId, int subCategoryId, Ticket ticket, int authUserId, EscalationType escalationType) throws ProfitMandiBusinessException;

    Map<String, Set<String>> getAuthUserPartnerEmailMapping() throws ProfitMandiBusinessException;

    Map<String, Set<Integer>> getAuthUserPartnerIdMapping() throws ProfitMandiBusinessException;

    Map<Integer, List<Integer>> getAuthUserIdPartnerIdMapping() throws ProfitMandiBusinessException;

    List<String> getAuthUserByPartnerId(int fofoId) throws ProfitMandiBusinessException;

    Map<Integer, List<Integer>> authUserpartnerIdMap(int authId, int categoryId);

    List<AuthUser> getAuthUserIdByPartnerId(int fofoId) throws ProfitMandiBusinessException;

    List<AuthUser> getAuthUserIdByPartnerId(int fofoId, EscalationType... escalationTypes) throws ProfitMandiBusinessException;

    Map<EscalationType, String> getAuthUserAndEsclationTypeByPartnerId(int fofoId) throws ProfitMandiBusinessException;

    Map<Integer, List<Integer>> getL2L1Mapping() throws ProfitMandiBusinessException;

    int getAuthUserId(int categoryId, EscalationType escalationType, int fofoId) throws ProfitMandiBusinessException;

    /**
     * Gets auth user ID with fallback to next escalation level if not found.
     * Returns both the user ID and the actual escalation level that was used.
     */
    EscalationAssignmentResult getAuthUserWithFallback(int categoryId, EscalationType targetEscalation, int fofoId) throws ProfitMandiBusinessException;

    List<AuthUser> getAuthUserIds(int categoryId, List<EscalationType> escalationType);

    List<AuthUser> getAuthUserByCategoryId(int categoryId);

    void assignTicket(Ticket ticket,int currentUserId) throws ProfitMandiBusinessException;

    void assignTicket(Ticket ticket) throws ProfitMandiBusinessException;

    Map<Integer, List<AuthUser>> getAssignedAuthList(List<Ticket> tickets);

    Map<EscalationType, AuthUser> getAuthUserAndEsclationByPartnerId(int fofoId) throws ProfitMandiBusinessException;

    // Batch method to fetch auth user escalations for all fofoIds at once
    Map<Integer, Map<EscalationType, AuthUser>> getAuthUserAndEsclationByPartnerIds(Set<Integer> fofoIds) throws ProfitMandiBusinessException;

    Activity createActivity(ActivityType activityType, String message, int createdBy);

    List<AuthUser> getAuthUserByCategoryId(int categoryId, EscalationType escalationType);

    Map<Integer, FofoReportingModel> getPartnerIdSalesHeaders() throws ProfitMandiBusinessException;

    Map<Integer, FofoAbmReportingModel> getPartnerIdABMHeaders() throws ProfitMandiBusinessException;

    Map<Integer, FofoRBMReportingModel> getPartnerIdRBMHeaders() throws ProfitMandiBusinessException;

    @Cacheable(value = "authUserEmailInactivePartnerIdMapping", cacheManager = "thirtyMinsTimeOutCacheManager")
    Map<String, Set<Integer>> getAuthUserInactivePartnerIdMapping() throws ProfitMandiBusinessException;

    Map<String, Set<Integer>> getAuthUserPartnerIdMappingByCategoryIds(List<Integer> categoryIds, boolean activeOnly) throws ProfitMandiBusinessException;

    /**
     * Batch method to get BM/ASM/RBM auth user IDs for all fofoIds at once.
     * Returns Map<fofoId, Map<role, authUserId>> where role is "BM", "ASM", or "RBM".
     */
    Map<Integer, Map<String, Integer>> getBmAsmRbmAuthUserIdsByFofoIds(Set<Integer> fofoIds) throws ProfitMandiBusinessException;

    Map<Integer, Boolean> getUnreadStatusForTickets(List<Ticket> tickets, int userId, TicketReadStatus.UserType userType);

    void markTicketAsRead(int ticketId, int userId, TicketReadStatus.UserType userType);

    Map<Integer, Activity> getLastActivitiesForTickets(List<Integer> ticketIds);

    Map<Integer, Activity> getLastMessageActivitiesForTickets(List<Integer> ticketIds);

    void notifyPartnerOfExternalCommunication(Ticket ticket, Activity activity);

}