Subversion Repositories SmartDukaan

Rev

Rev 2442 | Rev 2780 | 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
 
4
/**
5
Helper service
6
created by @ashish
7
**/
8
 
121 ashish 9
struct Mail{
10
	1:list<string> to,
11
	2:string subject,
12
	3:string data,
351 ashish 13
	4:string sender,
14
	5:list<string> attachments,
15
	6:string password
121 ashish 16
}
17
 
18
struct TextMessage{
19
	1:string number,
20
	2:string message,
21
	3:i64 dispatchTime,
22
	4:i64 deliveryTime
23
}
24
 
116 ashish 25
exception HelperServiceException{
26
	1:i64 id,
27
	2:string message
28
}
29
 
121 ashish 30
struct Message{
31
	1:i64 id,
32
	2:string message
33
}
34
 
495 rajveer 35
struct DashboardUser{
36
	1:string username,
37
	2:string password,
2442 chandransh 38
	3:i64 warehouseId,
39
	4:bool admin
495 rajveer 40
}
41
 
751 chandransh 42
struct LogisticsUser{
43
	1:string username,
44
	2:i64 providerId
45
}
46
 
1611 ankur.sing 47
struct StatisticsUser{
1891 ankur.sing 48
	1:string username
1611 ankur.sing 49
}
50
 
2023 ankur.sing 51
struct CatalogDashboardUser{
52
	1:string username,
2356 ankur.sing 53
	2:string password,
54
	3:i64 role
2023 ankur.sing 55
}
56
 
1397 varun.gupt 57
struct UserEmail{
1422 varun.gupt 58
	1:i64 id,
59
	2:string emailTo,
60
	3:string emailFrom,
61
	4:string subject,
62
	5:string body,
63
	6:string source,
64
	7:string emailType,
65
	8:bool status,
66
	9:i64 timestamp
1397 varun.gupt 67
}
68
 
1891 ankur.sing 69
struct ReportUser{
70
	1:string username,
71
	2:i64 role
72
}
73
 
74
struct Report{
75
	1:i64 id,
76
	2:string description,
77
	3:string controller
78
}
79
 
302 ashish 80
service HelperService{
763 rajveer 81
	/**
82
	* For closing the open session in sqlalchemy
83
	*/
84
	void closeSession(),
85
 
2455 varun.gupt 86
	/**
87
	* Save email details, to be sent later
88
	*/
1397 varun.gupt 89
	void saveUserEmailForSending(1:string emailTo, 2:string emailFrom, 3:string subject, 4:string body, 5:string source, 6:string emailType) throws (1:HelperServiceException se),
2455 varun.gupt 90
 
91
	/**
92
	* Retreives all the emails pending for dispatch
93
	*/
1422 varun.gupt 94
	list<UserEmail> getEmailsToBeSent(1:string emailType) throws (1:HelperServiceException se),
2455 varun.gupt 95
 
96
	/**
97
	* Marks email as sent after successful dispatch
98
	*/
1422 varun.gupt 99
	void markEmailAsSent(1:i64 emailId) throws (1:HelperServiceException se),
1397 varun.gupt 100
 
121 ashish 101
	void sendMail(1:Mail mail) throws (1:HelperServiceException se),
102
	void sendText(1:TextMessage message) throws (1:HelperServiceException se),
103
 
351 ashish 104
	void addMessage(1:Message message) throws (1:HelperServiceException se),
121 ashish 105
	void updateMessage(1:i64 id, 2:string message) throws (1:HelperServiceException se),
351 ashish 106
	Message getMessage(1:i64 id) throws (1:HelperServiceException se),
495 rajveer 107
	Message getSubstitutedMessage(1:i64 id, 2:map<string,string> params) throws (1:HelperServiceException se),
108
 
109
	//authenticate dashboard users
110
	bool addUser(1:string username, 2:string password, 3:i64 warehouseId) throws (1:HelperServiceException se),
111
	bool deleteUser(1:string username) throws (1:HelperServiceException se),
2442 chandransh 112
 
751 chandransh 113
	/**
2442 chandransh 114
	 Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
115
	 The loggedOn timestamp for the dashboard user is updated .
751 chandransh 116
	*/
2442 chandransh 117
	DashboardUser authenticateDashboardUser(1:string username, 2:string password) throws (1:HelperServiceException se),
118
 
119
	/**
120
	Update the password of the dashboard user. Currently, there is no place where this method is called.
121
	*/
751 chandransh 122
	bool updatePassword(1:string username, 2:string oldPassword, 3:string newPassword) throws (1:HelperServiceException se),
123
 
124
	/**
125
	 Returns the LogisticsUser struct associated with the given username and password if they match.
126
	 Throws an exception otherwise.
127
	*/
128
	LogisticsUser authenticateLogisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse)
1611 ankur.sing 129
 
130
	/**
131
	 Returns the StatisticsUser struct associated with the given username and password if they match.
132
	 Throws an exception otherwise.
133
	*/
1891 ankur.sing 134
	StatisticsUser authenticateStatisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
135
 
136
	/**
137
	 Returns the ReportUser struct associated with the given username and password if they match.
138
	 Throws an exception otherwise.
139
	*/
140
	ReportUser authenticateReportUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
141
 
142
	/**
143
	Returns list of reports which are configured for the given role. 
144
	*/
2023 ankur.sing 145
	list<Report> getReports(1:i64 role),
146
 
147
	/**
2356 ankur.sing 148
	 Returns the CatalogDashboardUser struct associated with the given username, password and role if they match.
2023 ankur.sing 149
	 Throws an exception otherwise.
150
	*/
2356 ankur.sing 151
	CatalogDashboardUser authenticateCatalogUser(1:string username, 2:string password, 3:i64 role) throws(1:HelperServiceException hse),
116 ashish 152
}