Subversion Repositories SmartDukaan

Rev

Rev 3168 | Rev 3269 | 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
 
4
enum TicketPriority {
5
    LOW = 0,
6
    HIGH = 1,
7
    MEDIUM = 2
8
}
9
 
10
enum TicketStatus {
11
    OPEN = 0,
12
    CLOSED = 1,
13
    REOPEN = 2
14
}
15
 
16
enum TicketCategory {
17
    RETURN_FORM = 1,
18
    ORDER_CANCELLATION = 2,
19
    DELIVERY_PROBLEM = 3,
20
    PAYMENT_STATUS = 4,
21
    ORDER_STATUS = 5,
22
    PRODUCT_REQUEST = 6,
23
    PRODUCT_QUESTION = 7,
24
    OTHER = 8
25
}
26
 
3106 mandeep.dh 27
enum ActivityType {
28
    EMAIL_CUSTOMER = 1,
29
    CALL_CUSTOMER = 2,
30
    OTHER = 3
31
}
32
 
3026 mandeep.dh 33
struct Ticket {
34
    1:i64 id,
35
    2:i64 customerId,
36
    3:i64 openDate,
3168 mandeep.dh 37
    4:optional i64 closeDate,
3106 mandeep.dh 38
    5:string description,
39
    6:TicketPriority priority,
40
    7:TicketCategory category,
41
    8:TicketStatus status,
3168 mandeep.dh 42
    9:optional i64 assigneeId
3106 mandeep.dh 43
    10:i64 creatorId,
3168 mandeep.dh 44
    11:optional i64 orderId,
45
    12:optional string airwayBillNo,
46
    13:optional string productName
3026 mandeep.dh 47
}
48
 
49
struct Activity {
50
    1:i64 id,
3168 mandeep.dh 51
    2:optional string description,
3106 mandeep.dh 52
    3:i64 creationTimestamp, // represents time at which this activity occurred
53
    4:ActivityType type,
3026 mandeep.dh 54
    5:i64 customerId,
55
    6:i64 creatorId,
3206 mandeep.dh 56
    7:optional i64 emailId,
3026 mandeep.dh 57
 
3106 mandeep.dh 58
    // ticket related fields to track changes on ticket fields
3206 mandeep.dh 59
    8:optional i64 ticketId,
60
    9:optional TicketPriority ticketPriority,
61
   10:optional i64 ticketAssigneeId,
62
   11:optional TicketStatus ticketStatus,
63
   12:optional TicketCategory ticketCategory,
64
   13:optional string ticketDescription
3026 mandeep.dh 65
}
66
 
67
struct Agent {
68
    1:i64 id,
69
    2:string name,
70
    3:string emailId,
3168 mandeep.dh 71
    4:optional i64 managerId,
3026 mandeep.dh 72
    5:string password
73
}
74
 
75
service CRMService {
76
    // Methods to read/write tickets from/in database
77
    list<Ticket> getTickets(1:i64 customerId);
3087 mandeep.dh 78
    list<Ticket> getAssignedTickets(1:i64 agentId);
3137 mandeep.dh 79
    list<Ticket> getUnassignedTickets();
80
    // Retrieves all tickets assigned to an agent or its reportee.
81
    list<Ticket> getAllTickets(1:i64 agentId);
3026 mandeep.dh 82
    Ticket getTicket(1:i64 ticketId);
3206 mandeep.dh 83
    void updateTicket(1:Ticket ticket, 2:Activity activity);
84
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
3026 mandeep.dh 85
 
86
    // Methods to read/write activities from/in database
87
    list<Activity> getActivities(1:i64 customerId);
88
    list<Activity> getActivitiesForTicket(1:i64 ticketId);
89
    Activity getActivity(1:i64 activityId);
90
    Activity getLastActivity(1:i64 ticketId);
91
    void insertActivity(1:Activity activity);
92
 
93
    // Methods to read agent information
3087 mandeep.dh 94
    list<Agent> getAllAgents();
3026 mandeep.dh 95
    Agent getAgent(1:i64 agentId);
96
    Agent getAgentByEmailId(1:string agentEmailId);
3087 mandeep.dh 97
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
98
 
99
    // Methods to read roles and permissions information
100
    list<string> getRoleNamesForAgent(1:string agentEmailId);
3106 mandeep.dh 101
    list<string> getPermissionsForRoleName(1:string roleName);
3026 mandeep.dh 102
}