Subversion Repositories SmartDukaan

Rev

Rev 36802 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24383 amit.gupta 1
package com.spice.profitmandi.dao.repository.cs;
2
 
24439 govind 3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
24417 govind 4
import com.spice.profitmandi.common.model.CustomRetailer;
5
import com.spice.profitmandi.dao.entity.auth.AuthUser;
29927 amit.gupta 6
import com.spice.profitmandi.dao.entity.cs.*;
27393 amit.gupta 7
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
32923 ranu 8
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
26978 tejbeer 9
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
36212 ranu 10
import com.spice.profitmandi.dao.model.*;
35920 ranu 11
import org.springframework.cache.annotation.Cacheable;
29927 amit.gupta 12
import org.springframework.stereotype.Service;
24383 amit.gupta 13
 
29927 amit.gupta 14
import java.util.List;
15
import java.util.Map;
16
import java.util.Set;
17
 
24383 amit.gupta 18
@Service
19
public interface CsService {
34921 ranu 20
    int getAuthUserIdWithoutTicketAssignee(int categoryId, EscalationType escalationType, int fofoId) throws ProfitMandiBusinessException;
21
 
31762 tejbeer 22
    // Sends happy code to customer
23
    void addActivity(Ticket ticket, Activity activity);
24500 govind 24
 
31762 tejbeer 25
    void createTicket(int fofoId, int categoryId, int subcategoryId, String message) throws ProfitMandiBusinessException;
24500 govind 26
 
32923 ranu 27
    void createTicket(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId) throws ProfitMandiBusinessException;
28
 
36210 ranu 29
    void createTicket(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, EscalationType targetEscalation) throws ProfitMandiBusinessException;
30
 
32923 ranu 31
    void createTicketWithMedia(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, ActivityMediaModel selectedRecording) throws ProfitMandiBusinessException;
32
 
36210 ranu 33
    void createTicketWithMedia(int fofoId, int categoryId, int subcategoryId, String message, int createdByAuthId, ActivityMediaModel selectedRecording, EscalationType targetEscalation) throws ProfitMandiBusinessException;
34
 
33204 ranu 35
    TicketActivityMedia createMediaActivity(ActivityMediaModel selectedRecording);
36
 
37
    void addMediaActivity(Ticket ticket, TicketActivityMedia activity);
38
 
32923 ranu 39
    void createTicketRemarkEscalation(int fofoId, int authId, int categoryId, int subcategoryId, String message, CollectionRemark remark) throws ProfitMandiBusinessException;
40
 
31762 tejbeer 41
    void addPartnerToRegion(int regionId, List<Integer> fofoIds);
24500 govind 42
 
31762 tejbeer 43
    Map<Integer, TicketSubCategory> getSubCategoryIdAndSubCategoryMap(List<Integer> subCategoryIds);
24500 govind 44
 
31762 tejbeer 45
    Map<Integer, TicketCategory> getSubCategoryIdAndCategoryMap(List<Integer> subCategoryIds);
24500 govind 46
 
47
 
31762 tejbeer 48
    Map<Integer, AuthUser> getAuthUserIdAndAuthUserMap(List<TicketAssigned> ticketAssigneds);
24500 govind 49
 
33244 ranu 50
    Map<Integer, CustomRetailer> getPartnerByFofoIds(List<Ticket> tickets) throws ProfitMandiBusinessException;
24500 govind 51
 
31762 tejbeer 52
    List<TicketCategory> getAllTicketCategotyFromSubCategory();
24500 govind 53
 
31762 tejbeer 54
    Map<Integer, AuthUser> getAuthUserIdAndAuthUserMapUsingPositions(List<Position> positions);
25721 tejbeer 55
 
31762 tejbeer 56
    Map<Integer, TicketCategory> getCategoryIdAndCategoryUsingPositions(List<Position> positions);
25721 tejbeer 57
 
31762 tejbeer 58
    Map<Integer, Region> getRegionIdAndRegionMap(List<Position> positions);
24500 govind 59
 
33244 ranu 60
    Map<Integer, List<CustomRetailer>> getRegionPartners(List<Position> position) throws ProfitMandiBusinessException;
25721 tejbeer 61
 
33244 ranu 62
    Map<Integer, List<CustomRetailer>> getPositionCustomRetailerMap(List<Position> position) throws ProfitMandiBusinessException;
25721 tejbeer 63
 
31762 tejbeer 64
    Map<Integer, AuthUser> getTicketIdAndAuthUserMapUsingTickets(List<Ticket> tickets);
25721 tejbeer 65
 
35683 ranu 66
    void updateTicket(int categoryId, int subCategoryId, Ticket ticket, int authUserId, EscalationType escalationType, ActivityMediaModel recording,int currentUserId) throws ProfitMandiBusinessException;
31762 tejbeer 67
    void updateTicket(int categoryId, int subCategoryId, Ticket ticket, int authUserId, EscalationType escalationType) throws ProfitMandiBusinessException;
25721 tejbeer 68
 
33244 ranu 69
    Map<String, Set<String>> getAuthUserPartnerEmailMapping() throws ProfitMandiBusinessException;
26298 tejbeer 70
 
33244 ranu 71
    Map<String, Set<Integer>> getAuthUserPartnerIdMapping() throws ProfitMandiBusinessException;
25721 tejbeer 72
 
33244 ranu 73
    Map<Integer, List<Integer>> getAuthUserIdPartnerIdMapping() throws ProfitMandiBusinessException;
28377 tejbeer 74
 
36802 ranu 75
    Map<Integer, List<Integer>> getAuthUserIdAllPartnerIdMapping() throws ProfitMandiBusinessException;
76
 
33244 ranu 77
    List<String> getAuthUserByPartnerId(int fofoId) throws ProfitMandiBusinessException;
26978 tejbeer 78
 
34082 ranu 79
    Map<Integer, List<Integer>> authUserpartnerIdMap(int authId, int categoryId);
80
 
33244 ranu 81
    List<AuthUser> getAuthUserIdByPartnerId(int fofoId) throws ProfitMandiBusinessException;
26298 tejbeer 82
 
33244 ranu 83
    List<AuthUser> getAuthUserIdByPartnerId(int fofoId, EscalationType... escalationTypes) throws ProfitMandiBusinessException;
33041 ranu 84
 
33244 ranu 85
    Map<EscalationType, String> getAuthUserAndEsclationTypeByPartnerId(int fofoId) throws ProfitMandiBusinessException;
27078 amit.gupta 86
 
33244 ranu 87
    Map<Integer, List<Integer>> getL2L1Mapping() throws ProfitMandiBusinessException;
28908 tejbeer 88
 
33244 ranu 89
    int getAuthUserId(int categoryId, EscalationType escalationType, int fofoId) throws ProfitMandiBusinessException;
28908 tejbeer 90
 
36212 ranu 91
    /**
92
     * Gets auth user ID with fallback to next escalation level if not found.
93
     * Returns both the user ID and the actual escalation level that was used.
94
     */
95
    EscalationAssignmentResult getAuthUserWithFallback(int categoryId, EscalationType targetEscalation, int fofoId) throws ProfitMandiBusinessException;
96
 
31762 tejbeer 97
    List<AuthUser> getAuthUserIds(int categoryId, List<EscalationType> escalationType);
27124 amit.gupta 98
 
31762 tejbeer 99
    List<AuthUser> getAuthUserByCategoryId(int categoryId);
27205 amit.gupta 100
 
35683 ranu 101
    void assignTicket(Ticket ticket,int currentUserId) throws ProfitMandiBusinessException;
102
 
31762 tejbeer 103
    void assignTicket(Ticket ticket) throws ProfitMandiBusinessException;
27545 tejbeer 104
 
31762 tejbeer 105
    Map<Integer, List<AuthUser>> getAssignedAuthList(List<Ticket> tickets);
27205 amit.gupta 106
 
33244 ranu 107
    Map<EscalationType, AuthUser> getAuthUserAndEsclationByPartnerId(int fofoId) throws ProfitMandiBusinessException;
29296 manish 108
 
35394 amit 109
    // Batch method to fetch auth user escalations for all fofoIds at once
110
    Map<Integer, Map<EscalationType, AuthUser>> getAuthUserAndEsclationByPartnerIds(Set<Integer> fofoIds) throws ProfitMandiBusinessException;
111
 
31762 tejbeer 112
    Activity createActivity(ActivityType activityType, String message, int createdBy);
30003 tejbeer 113
 
31762 tejbeer 114
    List<AuthUser> getAuthUserByCategoryId(int categoryId, EscalationType escalationType);
31152 tejbeer 115
 
33244 ranu 116
    Map<Integer, FofoReportingModel> getPartnerIdSalesHeaders() throws ProfitMandiBusinessException;
31152 tejbeer 117
 
34905 ranu 118
    Map<Integer, FofoAbmReportingModel> getPartnerIdABMHeaders() throws ProfitMandiBusinessException;
119
 
33244 ranu 120
    Map<Integer, FofoRBMReportingModel> getPartnerIdRBMHeaders() throws ProfitMandiBusinessException;
33161 ranu 121
 
35920 ranu 122
    @Cacheable(value = "authUserEmailInactivePartnerIdMapping", cacheManager = "thirtyMinsTimeOutCacheManager")
123
    Map<String, Set<Integer>> getAuthUserInactivePartnerIdMapping() throws ProfitMandiBusinessException;
124
 
33244 ranu 125
    Map<String, Set<Integer>> getAuthUserPartnerIdMappingByCategoryIds(List<Integer> categoryIds, boolean activeOnly) throws ProfitMandiBusinessException;
31762 tejbeer 126
 
35394 amit 127
    /**
128
     * Batch method to get BM/ASM/RBM auth user IDs for all fofoIds at once.
129
     * Returns Map<fofoId, Map<role, authUserId>> where role is "BM", "ASM", or "RBM".
130
     */
131
    Map<Integer, Map<String, Integer>> getBmAsmRbmAuthUserIdsByFofoIds(Set<Integer> fofoIds) throws ProfitMandiBusinessException;
31762 tejbeer 132
 
36972 ranu 133
    /**
134
     * Batch equivalent of {@link #getAuthUserIdWithoutTicketAssignee}. Returns Map&lt;fofoId, authUserId&gt; for a
135
     * single (categoryId, escalationType). Missing fofoIds map to 0.
136
     */
137
    Map<Integer, Integer> getAuthUserIdsWithoutTicketAssigneeByFofoIds(int categoryId, EscalationType escalationType, Set<Integer> fofoIds) throws ProfitMandiBusinessException;
138
 
35635 ranu 139
    Map<Integer, Boolean> getUnreadStatusForTickets(List<Ticket> tickets, int userId, TicketReadStatus.UserType userType);
35626 amit 140
 
35635 ranu 141
    void markTicketAsRead(int ticketId, int userId, TicketReadStatus.UserType userType);
35626 amit 142
 
143
    Map<Integer, Activity> getLastActivitiesForTickets(List<Integer> ticketIds);
144
 
35639 amit 145
    Map<Integer, Activity> getLastMessageActivitiesForTickets(List<Integer> ticketIds);
146
 
35626 amit 147
    void notifyPartnerOfExternalCommunication(Ticket ticket, Activity activity);
148
 
24500 govind 149
}