Subversion Repositories SmartDukaan

Rev

Rev 3339 | Rev 3390 | 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,
25
    PRODUCT_QUESTION = 7,
26
    OTHER = 8
27
}
28
 
3106 mandeep.dh 29
enum ActivityType {
3269 mandeep.dh 30
    SEND_EMAIL_TO_CUSTOMER = 1,
3271 mandeep.dh 31
    RECEIVED_EMAIL_FROM_CUSTOMER = 2,
3269 mandeep.dh 32
    CALLED_CUSTOMER = 3,
3271 mandeep.dh 33
    RECEIVED_CALL_FROM_CUSTOMER = 4,
3269 mandeep.dh 34
    OTHER = 5
3106 mandeep.dh 35
}
36
 
3026 mandeep.dh 37
struct Ticket {
38
    1:i64 id,
3269 mandeep.dh 39
    2:optional i64 customerId, // used for registered users
40
    3:optional string customerEmailId, // used for un-registered users
41
    4:i64 openDate,
42
    5:optional i64 closeDate,
43
    6:optional string description,
44
    7:TicketPriority priority,
45
    8:TicketCategory category,
46
    9:TicketStatus status,
47
   10:optional i64 assigneeId,
48
   11:i64 creatorId,
49
   12:optional i64 orderId,
50
   13:optional string airwayBillNo,
51
   14:optional string productName
3026 mandeep.dh 52
}
53
 
54
struct Activity {
55
    1:i64 id,
3168 mandeep.dh 56
    2:optional string description,
3106 mandeep.dh 57
    3:i64 creationTimestamp, // represents time at which this activity occurred
58
    4:ActivityType type,
3269 mandeep.dh 59
    5:optional i64 customerId, // used for registered users
60
    6:optional string customerMobileNumber, // used for unregistered users
61
    7:i64 creatorId,
3026 mandeep.dh 62
 
3269 mandeep.dh 63
    // represents the numeric identifier for the emails sent to customers
64
    // These are archived in helper..useremailarchive or helper..useremail
65
    8:optional i64 emailId,
66
 
3106 mandeep.dh 67
    // ticket related fields to track changes on ticket fields
3269 mandeep.dh 68
    9:optional i64 ticketId,
69
   10:optional TicketPriority ticketPriority,
70
   11:optional i64 ticketAssigneeId,
71
   12:optional TicketStatus ticketStatus,
72
   13:optional TicketCategory ticketCategory,
73
   14:optional string ticketDescription
3026 mandeep.dh 74
}
75
 
76
struct Agent {
77
    1:i64 id,
78
    2:string name,
79
    3:string emailId,
3168 mandeep.dh 80
    4:optional i64 managerId,
3026 mandeep.dh 81
    5:string password
82
}
83
 
3374 rajveer 84
service CRMService extends GenericService.GenericService{
3026 mandeep.dh 85
    // Methods to read/write tickets from/in database
86
    list<Ticket> getTickets(1:i64 customerId);
3087 mandeep.dh 87
    list<Ticket> getAssignedTickets(1:i64 agentId);
3137 mandeep.dh 88
    list<Ticket> getUnassignedTickets();
89
    // Retrieves all tickets assigned to an agent or its reportee.
90
    list<Ticket> getAllTickets(1:i64 agentId);
3026 mandeep.dh 91
    Ticket getTicket(1:i64 ticketId);
3206 mandeep.dh 92
    void updateTicket(1:Ticket ticket, 2:Activity activity);
93
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
3026 mandeep.dh 94
 
95
    // Methods to read/write activities from/in database
96
    list<Activity> getActivities(1:i64 customerId);
3339 mandeep.dh 97
    list<Activity> getActivitiesByCreator(1:i64 creatorId);
3026 mandeep.dh 98
    list<Activity> getActivitiesForTicket(1:i64 ticketId);
99
    Activity getActivity(1:i64 activityId);
100
    Activity getLastActivity(1:i64 ticketId);
101
    void insertActivity(1:Activity activity);
102
 
103
    // Methods to read agent information
3087 mandeep.dh 104
    list<Agent> getAllAgents();
3026 mandeep.dh 105
    Agent getAgent(1:i64 agentId);
106
    Agent getAgentByEmailId(1:string agentEmailId);
3087 mandeep.dh 107
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
108
 
109
    // Methods to read roles and permissions information
110
    list<string> getRoleNamesForAgent(1:string agentEmailId);
3106 mandeep.dh 111
    list<string> getPermissionsForRoleName(1:string roleName);
3339 mandeep.dh 112
 
113
    // Misc methods
114
    i64 getLastEmailProcessedTimestamp();
115
    void updateLastEmailProcessedTimestamp(1:i64 timestamp);
3026 mandeep.dh 116
}