Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
116 ashish 1
namespace java in.shop2020.utils
2
namespace py shop2020.thriftpy.utils
3
 
3374 rajveer 4
include "GenericService.thrift"
5
 
116 ashish 6
/**
7
Helper service
8
created by @ashish
9
**/
10
 
4693 mandeep.dh 11
struct Agent {
12
    1:i64 id,
13
    2:string name,
14
    3:string emailId,
15
    4:optional i64 managerId,
16
    5:string password,
17
    6:bool isActive
18
}
19
 
121 ashish 20
struct Mail{
21
	1:list<string> to,
22
	2:string subject,
23
	3:string data,
351 ashish 24
	4:string sender,
25
	5:list<string> attachments,
26
	6:string password
121 ashish 27
}
28
 
29
struct TextMessage{
30
	1:string number,
31
	2:string message,
32
	3:i64 dispatchTime,
33
	4:i64 deliveryTime
34
}
35
 
116 ashish 36
exception HelperServiceException{
37
	1:i64 id,
38
	2:string message
39
}
40
 
121 ashish 41
struct Message{
42
	1:i64 id,
43
	2:string message
44
}
45
 
2780 chandransh 46
enum Role{
47
	WAREHOUSE_EXECUTIVE = 0,
48
	ADMIN = 1,
4358 rajveer 49
	WAREHOUSE_MONITOR = 2
2780 chandransh 50
}
51
 
495 rajveer 52
struct DashboardUser{
53
	1:string username,
54
	2:string password,
2442 chandransh 55
	3:i64 warehouseId,
8303 amar.kumar 56
	4:Role role,
57
	5:i64 source
495 rajveer 58
}
59
 
751 chandransh 60
struct LogisticsUser{
61
	1:string username,
62
	2:i64 providerId
63
}
64
 
1611 ankur.sing 65
struct StatisticsUser{
1891 ankur.sing 66
	1:string username
1611 ankur.sing 67
}
68
 
2023 ankur.sing 69
struct CatalogDashboardUser{
70
	1:string username,
2356 ankur.sing 71
	2:string password,
72
	3:i64 role
2023 ankur.sing 73
}
74
 
1397 varun.gupt 75
struct UserEmail{
1422 varun.gupt 76
	1:i64 id,
5864 rajveer 77
	2:list<string> emailTo,
1422 varun.gupt 78
	3:string emailFrom,
79
	4:string subject,
80
	5:string body,
81
	6:string source,
82
	7:string emailType,
83
	8:bool status,
5864 rajveer 84
	9:i64 timestamp,
85
	10:list<string> cc,
86
	11:list<string> bcc
1397 varun.gupt 87
}
88
 
1891 ankur.sing 89
struct ReportUser{
90
	1:string username,
91
	2:i64 role
92
}
93
 
94
struct Report{
95
	1:i64 id,
96
	2:string description,
97
	3:string controller
98
}
99
 
4806 varun.gupt 100
struct QuickLink	{
4996 varun.gupt 101
	1:i64 id,
102
	2:string url,
103
	3:string text
4806 varun.gupt 104
}
105
 
7410 amar.kumar 106
struct AgentWarehouseMapping{
107
	1:i64 agentId,
108
	2:i64 warehouseId
109
}
110
 
3374 rajveer 111
service HelperService extends GenericService.GenericService{
763 rajveer 112
	/**
3206 mandeep.dh 113
	* Save email details, to be sent later; Also returns its identifier.
2455 varun.gupt 114
	*/
8020 rajveer 115
	i64 saveUserEmailForSending(1:list<string> emailTo, 2:string emailFrom, 3:string subject, 4:string body, 5:string source, 6:string emailType, 7:list<string> cc, 8:list<string> bcc, 9:i64 sourceId) throws (1:HelperServiceException se),
2455 varun.gupt 116
 
117
	/**
118
	* Retreives all the emails pending for dispatch
119
	*/
3086 rajveer 120
	list<UserEmail> getEmailsToBeSent() throws (1:HelperServiceException se),
2455 varun.gupt 121
 
122
	/**
123
	* Marks email as sent after successful dispatch
124
	*/
1422 varun.gupt 125
	void markEmailAsSent(1:i64 emailId) throws (1:HelperServiceException se),
1397 varun.gupt 126
 
121 ashish 127
	void sendMail(1:Mail mail) throws (1:HelperServiceException se),
128
	void sendText(1:TextMessage message) throws (1:HelperServiceException se),
129
 
351 ashish 130
	void addMessage(1:Message message) throws (1:HelperServiceException se),
121 ashish 131
	void updateMessage(1:i64 id, 2:string message) throws (1:HelperServiceException se),
351 ashish 132
	Message getMessage(1:i64 id) throws (1:HelperServiceException se),
495 rajveer 133
	Message getSubstitutedMessage(1:i64 id, 2:map<string,string> params) throws (1:HelperServiceException se),
134
 
135
	//authenticate dashboard users
136
	bool addUser(1:string username, 2:string password, 3:i64 warehouseId) throws (1:HelperServiceException se),
137
	bool deleteUser(1:string username) throws (1:HelperServiceException se),
2442 chandransh 138
 
751 chandransh 139
	/**
2442 chandransh 140
	 Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
141
	 The loggedOn timestamp for the dashboard user is updated .
751 chandransh 142
	*/
2442 chandransh 143
	DashboardUser authenticateDashboardUser(1:string username, 2:string password) throws (1:HelperServiceException se),
144
 
145
	/**
146
	Update the password of the dashboard user. Currently, there is no place where this method is called.
147
	*/
751 chandransh 148
	bool updatePassword(1:string username, 2:string oldPassword, 3:string newPassword) throws (1:HelperServiceException se),
149
 
150
	/**
151
	 Returns the LogisticsUser struct associated with the given username and password if they match.
152
	 Throws an exception otherwise.
153
	*/
154
	LogisticsUser authenticateLogisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse)
1611 ankur.sing 155
 
156
	/**
157
	 Returns the StatisticsUser struct associated with the given username and password if they match.
158
	 Throws an exception otherwise.
159
	*/
1891 ankur.sing 160
	StatisticsUser authenticateStatisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
161
 
162
	/**
163
	 Returns the ReportUser struct associated with the given username and password if they match.
164
	 Throws an exception otherwise.
165
	*/
166
	ReportUser authenticateReportUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
167
 
168
	/**
169
	Returns list of reports which are configured for the given role. 
170
	*/
2023 ankur.sing 171
	list<Report> getReports(1:i64 role),
172
 
173
	/**
2356 ankur.sing 174
	 Returns the CatalogDashboardUser struct associated with the given username, password and role if they match.
2023 ankur.sing 175
	 Throws an exception otherwise.
176
	*/
6788 rajveer 177
	CatalogDashboardUser authenticateCatalogUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
4544 varun.gupt 178
 
179
	/**
180
	Saves the list of entity Ids to be shared with an email address 
181
	*/
4693 mandeep.dh 182
	void shareEntities(1:list<i64> entityIds, 2:string email) throws(1:HelperServiceException hse),
183
 
184
    // Methods to read agent information
4806 varun.gupt 185
    list<Agent> getAgents(),
186
    bool validateLogIn(1:string emailId, 2:string password),
187
    void updatePasswordForAgent(1:string agentEmailId, 2:string password),
4693 mandeep.dh 188
 
189
    // Methods to read roles and permissions information
4806 varun.gupt 190
    list<string> getRoleNamesForAgent(1:string agentEmailId),
4996 varun.gupt 191
    list<string> getPermissionsForRoleName(1:string roleName),
4806 varun.gupt 192
 
193
    //Methods to save and read QuickLinks
194
    void saveQuickLink(1:string url, 2:string text) throws(1:HelperServiceException hse),
4996 varun.gupt 195
    list<QuickLink> getQuickLinks() throws(1:HelperServiceException hse),
5055 varun.gupt 196
    void updateQuickLink(1:i64 id, 2:string url, 3:string text) throws(1:HelperServiceException hse),
197
 
198
	/**
199
	Returns a list of emails to which product notifications have been sent in a given date range
200
	*/
6322 amar.kumar 201
	list<string> getEmailsForNotificationsSent(1:i64 startDatetime, 2:i64 endDatetime) throws(1:HelperServiceException hse),
202
 
203
	//Returns body of mail sent for order confirmation
7410 amar.kumar 204
	string getOrderConfirmationMail(1:i64 orderId),
7221 kshitij.so 205
 
206
	//Returns body of mail sent for delivery success
7410 amar.kumar 207
	string getOrderDeliveryMail(1:i64 orderId),
208
 
209
	list<i64> getWarehouseIdsForAgent(1:string agentEmailId),
210
 
116 ashish 211
}