Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
3026 mandeep.dh 1
namespace java in.shop2020.crm
2
namespace py shop2020.thriftpy.crm
3
 
3374 rajveer 4
include "GenericService.thrift"
5
 
3026 mandeep.dh 6
enum TicketPriority {
7
    LOW = 0,
8
    HIGH = 1,
9
    MEDIUM = 2
10
}
11
 
12
enum TicketStatus {
13
    OPEN = 0,
14
    CLOSED = 1,
15
    REOPEN = 2
16
}
17
 
18
enum TicketCategory {
19
    RETURN_FORM = 1,
20
    ORDER_CANCELLATION = 2,
21
    DELIVERY_PROBLEM = 3,
22
    PAYMENT_STATUS = 4,
23
    ORDER_STATUS = 5,
24
    PRODUCT_REQUEST = 6,
6176 amit.gupta 25
    RECHARGE_RELATED = 7,
3499 mandeep.dh 26
    OTHER = 8,
3578 mandeep.dh 27
    COD_VERIFICATION = 9,
4008 mandeep.dh 28
    FAILED_PAYMENTS = 10,
4267 anupam.sin 29
    DELAYED_DELIVERY = 11,
4490 anupam.sin 30
    PAYMENT_FLAGGED = 12,
4681 amar.kumar 31
    DOA_RECEIVED = 13,
4948 phani.kuma 32
    PRODUCT_PROCUREMENT = 14,
5407 amar.kumar 33
    UNDELIVERED = 15,
5791 anupam.sin 34
    CATEGORY = 16,
6104 rajveer 35
    STORE_PICKUP = 17,
7372 kshitij.so 36
    ON_TIME_GUARANTEE = 18,
7598 kshitij.so 37
    LOW_INVENTORY_CANCELLED_ORDERS = 19,
38
    //Start:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
11890 kshitij.so 39
    RTO_REFUND = 20,
7598 kshitij.so 40
    //End:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
17274 manish.sha 41
    Bulk_Order_ENQUIRY = 21,
14882 manish.sha 42
    PROFITMANDI_FEEDBACK = 22,
43
    PROFITMANDI_ORDER_NOT_SEEN = 23,
44
    PROFITMANDI_CASHBACK = 24,
45
    PROFITMANDI_RECHARGE_ISSUE = 25,
17274 manish.sha 46
    PROFITMANDI_OTHER = 26,
18709 manas 47
    PROFITMANDI_ORDER_TRACKING_ISSUE = 27,
48
    PROFITMANDI_REFUND_PROBLEM=28,
49
    PROFITMANDI_TECHNICAL_PROBLEM=29,
50
    PROFITMANDI_PRODUCT_ISSUE=30,
51
    PROFITMANDI_DELAYED_DELIVERY=31    
3026 mandeep.dh 52
}
53
 
3106 mandeep.dh 54
enum ActivityType {
3269 mandeep.dh 55
    SEND_EMAIL_TO_CUSTOMER = 1,
3271 mandeep.dh 56
    RECEIVED_EMAIL_FROM_CUSTOMER = 2,
3269 mandeep.dh 57
    CALLED_CUSTOMER = 3,
3271 mandeep.dh 58
    RECEIVED_CALL_FROM_CUSTOMER = 4,
4020 mandeep.dh 59
    OTHER = 5,
18709 manas 60
    ESCALATE_TICKET = 6,
61
    PROFITMANDI_CRM_APP_TICKET=7
3106 mandeep.dh 62
}
63
 
3390 mandeep.dh 64
struct Agent {
65
    1:i64 id,
66
    2:string name,
67
    3:string emailId,
68
    4:optional i64 managerId,
4793 amar.kumar 69
    5:string password,
16244 manish.sha 70
    6:bool is_active,
71
    7:bool is_pmCrmUser,
72
    8:bool is_allAssignable;
3390 mandeep.dh 73
}
74
 
3026 mandeep.dh 75
struct Ticket {
76
    1:i64 id,
3390 mandeep.dh 77
    2:optional i64 customerId,
78
    3:i64 openDate,
79
    4:optional i64 closeDate,
80
    5:optional string description,
81
    6:TicketPriority priority,
82
    7:TicketCategory category,
83
    8:TicketStatus status,
84
    9:optional i64 assigneeId,
85
   10:i64 creatorId,
86
   11:optional i64 orderId,
87
   12:optional string airwayBillNo,
88
   13:optional string productName,
89
 
90
   // used for un-registered users
91
   14:optional string customerMobileNumber,
92
   15:optional string customerEmailId,
3546 mandeep.dh 93
   16:optional string customerName
3026 mandeep.dh 94
}
95
 
96
struct Activity {
97
    1:i64 id,
3168 mandeep.dh 98
    2:optional string description,
3106 mandeep.dh 99
    3:i64 creationTimestamp, // represents time at which this activity occurred
100
    4:ActivityType type,
3269 mandeep.dh 101
    5:optional i64 customerId, // used for registered users
3390 mandeep.dh 102
    6:i64 creatorId,
3026 mandeep.dh 103
 
3269 mandeep.dh 104
    // represents the numeric identifier for the emails sent to customers
105
    // These are archived in helper..useremailarchive or helper..useremail
3390 mandeep.dh 106
    7:optional i64 userEmailId,
3269 mandeep.dh 107
 
3106 mandeep.dh 108
    // ticket related fields to track changes on ticket fields
3390 mandeep.dh 109
    8:optional i64 ticketId,
110
    9:optional TicketPriority ticketPriority,
111
   10:optional i64 ticketAssigneeId,
112
   11:optional TicketStatus ticketStatus,
113
   12:optional TicketCategory ticketCategory,
114
   13:optional string ticketDescription,
115
 
116
   // Activities created as part of mails received from customers
117
   // have to be explicitly marked as read by agents in CRM.
118
   // This flag is set over such activities when any agent marks it as read!
3546 mandeep.dh 119
   14:optional bool isRead,
3390 mandeep.dh 120
 
121
   // used for un-registered users
122
   15:optional string customerMobileNumber,
123
   16:optional string customerEmailId,
124
   17:optional string customerName,
4241 anupam.sin 125
 
126
   // used for attachments name separated by semicolon
127
   18:optional string attachments
3026 mandeep.dh 128
}
129
 
3390 mandeep.dh 130
struct SearchFilter {
131
    1:optional i64 ticketId,
132
    2:optional i64 activityId,
133
    3:optional list<i64> ticketAssigneeIds,
134
    4:optional list<i64> activityCreatorIds,
135
    5:optional i64 agentId,
136
    6:optional i64 customerId,
137
    7:optional i64 startTimestamp,
138
    8:optional i64 endTimestamp,
139
    9:optional bool isActivityRead,
140
   10:optional string agentEmailId,
141
   11:optional string customerEmailId,
3499 mandeep.dh 142
   12:optional string customerMobileNumber,
3546 mandeep.dh 143
   13:optional list<TicketStatus> ticketStatuses,
3499 mandeep.dh 144
   14:optional TicketCategory ticketCategory,
3546 mandeep.dh 145
   15:optional TicketPriority ticketPriority,
14882 manish.sha 146
   16:optional ActivityType activityType,
14898 manish.sha 147
   17:optional list<TicketCategory> ticketCategoryList,
148
   18:optional bool notShowPmTickets
3026 mandeep.dh 149
}
150
 
7410 amar.kumar 151
exception CRMServiceException {
152
    1:GenericService.ExceptionType exceptionType,
153
    2:string message
154
}
155
 
3374 rajveer 156
service CRMService extends GenericService.GenericService{
3026 mandeep.dh 157
    // Methods to read/write tickets from/in database
3390 mandeep.dh 158
    list<Ticket> getTickets(1:SearchFilter searchFilter);
3137 mandeep.dh 159
    list<Ticket> getUnassignedTickets();
3206 mandeep.dh 160
    void updateTicket(1:Ticket ticket, 2:Activity activity);
161
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
4793 amar.kumar 162
    void unassignAgentTickets(1:i32 assigneeId);
3026 mandeep.dh 163
 
164
    // Methods to read/write activities from/in database
3390 mandeep.dh 165
    list<Activity> getActivities(1:SearchFilter searchFilter);
3405 mandeep.dh 166
    i64 insertActivity(1:Activity activity);
3390 mandeep.dh 167
    void markAsRead(1:i64 activityId, 2:i64 agentId);
3026 mandeep.dh 168
 
169
    // Methods to read agent information
3390 mandeep.dh 170
    list<Agent> getAgents(1:SearchFilter searchFilter);
5287 amar.kumar 171
    list<Agent> getInactiveAgents(1:SearchFilter searchFilter);
3087 mandeep.dh 172
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
173
 
174
    // Methods to read roles and permissions information
175
    list<string> getRoleNamesForAgent(1:string agentEmailId);
3106 mandeep.dh 176
    list<string> getPermissionsForRoleName(1:string roleName);
3339 mandeep.dh 177
 
178
    // Misc methods
179
    i64 getLastEmailProcessedTimestamp();
180
    void updateLastEmailProcessedTimestamp(1:i64 timestamp);
4793 amar.kumar 181
 
182
    // Method to change active/inactive status of Agent
183
    void changeAgentStatus(1:bool status, 2:string emailId);
184
 
185
    //Method to add a new CRM Agent 
186
    void insertAgent(1:Agent agent, 2:list<string> role);
5169 amar.kumar 187
 
188
    //Method to change CRM agent role
189
    void changeAgentRole(1:i64 id, 2:list<string> role);
190
 
191
    //Method to get openTicketCount for any agent
192
    i32 getOpenTicketCountForAgent(1:i64 agentId);
5909 amar.kumar 193
 
194
    //Method to get all open tickets grouped by categories
195
    map<string,i64> getOpenTicketsMap();
8366 manish.sha 196
 
197
    //Method to get Required Data Map for Fedex Reconciliation
198
    map<string,string> getFedexReconciliationDataMap(1:list<i64> order_ids, string method_key);
3026 mandeep.dh 199
}