| 15086 |
amit.gupta |
1 |
from sqlalchemy import create_engine
|
| 15011 |
amit.gupta |
2 |
from elixir import *
|
| 14039 |
kshitij.so |
3 |
from elixir.entity import Entity
|
|
|
4 |
from elixir.fields import Field
|
|
|
5 |
from elixir.options import using_options, using_table_options
|
| 15081 |
amit.gupta |
6 |
from sqlalchemy.sql.expression import func
|
| 15011 |
amit.gupta |
7 |
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Enum, \
|
| 16631 |
manish.sha |
8 |
Text, Date
|
| 15234 |
amit.gupta |
9 |
from sqlalchemy.dialects.mysql.base import LONGTEXT
|
| 14039 |
kshitij.so |
10 |
|
| 16374 |
amit.gupta |
11 |
CASHBACK_AMOUNT = 'CASHBACK_AMOUNT'
|
|
|
12 |
CASHBACK_PERCENTAGE = 'CASHBACK_PERCENTAGE'
|
| 14039 |
kshitij.so |
13 |
class Users(Entity):
|
|
|
14 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
15 |
username = Field(String(128))
|
|
|
16 |
email = Field(String(128))
|
|
|
17 |
password = Field(String(64))
|
|
|
18 |
first_name = Field(String(64))
|
|
|
19 |
last_name = Field(String(64))
|
|
|
20 |
mobile_number = Field(String(15))
|
|
|
21 |
referral_url = Field(String(256))
|
|
|
22 |
referrer = Field(String(32))
|
|
|
23 |
password_reset = Field(String(64))
|
|
|
24 |
activation_code = Field(String(40))
|
| 15917 |
amit.gupta |
25 |
address_line_1 = Field(String(128))
|
|
|
26 |
address_line_2 = Field(String(128))
|
|
|
27 |
city = Field(String(128))
|
|
|
28 |
state = Field(String(64))
|
|
|
29 |
pincode = Field(String(6))
|
| 15393 |
amit.gupta |
30 |
activated = Field(Boolean)
|
| 18669 |
manas |
31 |
group_id = Field(Integer(unsigned=True), default=1)
|
|
|
32 |
status = Field(Integer, default=1)
|
| 15245 |
manas |
33 |
utm_campaign = Field(String(128))
|
| 15365 |
amit.gupta |
34 |
activation_time = Field(DateTime)
|
| 14039 |
kshitij.so |
35 |
created = Field(DateTime)
|
|
|
36 |
modified = Field(DateTime)
|
| 15191 |
manish.sha |
37 |
usergroup_id = Field(Text)
|
| 14039 |
kshitij.so |
38 |
using_options(shortnames=True)
|
|
|
39 |
using_table_options(mysql_engine="InnoDB")
|
|
|
40 |
|
|
|
41 |
class user_actions(Entity):
|
|
|
42 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
43 |
user_id = Field(Integer(unsigned=True))
|
|
|
44 |
store_product_id = Field(Integer(unsigned=True))
|
|
|
45 |
action = Field(Enum('like','dislike'))
|
| 15392 |
amit.gupta |
46 |
created = Field(DateTime, default=func.now())
|
| 14039 |
kshitij.so |
47 |
using_options(shortnames=True)
|
|
|
48 |
using_table_options(mysql_engine="InnoDB")
|
| 15369 |
amit.gupta |
49 |
|
|
|
50 |
class OnboardedRetailerChecklists(Entity):
|
|
|
51 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
52 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
53 |
number_verification = Field(Boolean)
|
|
|
54 |
preferences = Field(Boolean)
|
|
|
55 |
doa_return_policy = Field(Boolean)
|
|
|
56 |
payment_option = Field(Boolean)
|
|
|
57 |
contact_us = Field(Boolean)
|
| 15371 |
amit.gupta |
58 |
product_info = Field(Boolean)
|
|
|
59 |
redeem = Field(Boolean)
|
| 15392 |
amit.gupta |
60 |
created = Field(DateTime,default=func.now())
|
| 15369 |
amit.gupta |
61 |
using_options(shortnames=True)
|
|
|
62 |
using_table_options(mysql_engine="InnoDB")
|
| 14039 |
kshitij.so |
63 |
|
|
|
64 |
class brand_preferences(Entity):
|
|
|
65 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
66 |
user_id = Field(Integer(unsigned=True))
|
|
|
67 |
category_id = Field(Integer(unsigned=True))
|
|
|
68 |
brand = Field(String(128))
|
|
|
69 |
status = Field(Enum('show','hide'),default='hide', server_default='hide')
|
|
|
70 |
created = Field(DateTime)
|
|
|
71 |
modified = Field(DateTime)
|
|
|
72 |
using_options(shortnames=True)
|
|
|
73 |
using_table_options(mysql_engine="InnoDB")
|
|
|
74 |
|
|
|
75 |
class price_preferences(Entity):
|
|
|
76 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
77 |
user_id = Field(Integer(unsigned=True))
|
|
|
78 |
category_id = Field(Integer(unsigned=True))
|
|
|
79 |
min_price = Field(Float, default=0.0, server_default="0.0")
|
|
|
80 |
max_price = Field(Float, default=0.0, server_default="0.0")
|
|
|
81 |
created = Field(DateTime)
|
|
|
82 |
modified = Field(DateTime)
|
|
|
83 |
using_options(shortnames=True)
|
|
|
84 |
using_table_options(mysql_engine="InnoDB")
|
|
|
85 |
|
| 14769 |
kshitij.so |
86 |
class Brands(Entity):
|
|
|
87 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
88 |
name = Field(String(128))
|
|
|
89 |
category_id = Field(Integer)
|
|
|
90 |
using_options(shortnames=True)
|
|
|
91 |
using_table_options(mysql_engine="InnoDB")
|
| 14859 |
manish.sha |
92 |
|
| 14921 |
manish.sha |
93 |
class Feedbacks(Entity):
|
| 14859 |
manish.sha |
94 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
95 |
user_id = Field(Integer(unsigned=True))
|
|
|
96 |
email = Field(String(128))
|
|
|
97 |
subject = Field(String(256))
|
|
|
98 |
message = Field(Text)
|
|
|
99 |
created = Field(DateTime)
|
|
|
100 |
isTicketCreated = Field(Boolean, default=False, server_default='0')
|
| 14921 |
manish.sha |
101 |
using_options(shortnames=True)
|
|
|
102 |
using_table_options(mysql_engine="InnoDB")
|
| 14039 |
kshitij.so |
103 |
|
| 16976 |
amit.gupta |
104 |
class Order_Parse_Info(Entity):
|
|
|
105 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
106 |
user_id = Field(Integer(unsigned=True))
|
|
|
107 |
order_id = Field(Integer(unsigned=True))
|
|
|
108 |
address = Field(String(256))
|
|
|
109 |
email = Field(String(128))
|
|
|
110 |
name = Field(String(128))
|
|
|
111 |
mobile = Field(String(12))
|
| 16977 |
amit.gupta |
112 |
city = Field(String(128))
|
|
|
113 |
state = Field(String(128))
|
|
|
114 |
pin = Field(String(8))
|
| 16976 |
amit.gupta |
115 |
using_options(shortnames=True)
|
|
|
116 |
using_table_options(mysql_engine="InnoDB")
|
|
|
117 |
|
| 15011 |
amit.gupta |
118 |
class Postoffices(Entity):
|
|
|
119 |
id = Field(Integer(10, unsigned=True), primary_key=True)
|
|
|
120 |
name = Field(String(128))
|
|
|
121 |
pincode = Field(Integer(6, unsigned=True))
|
|
|
122 |
deliverystatus = Field(Boolean)
|
|
|
123 |
divisionname = Field(String(128))
|
|
|
124 |
regionname = Field(String(128))
|
|
|
125 |
taluk = Field(String(128))
|
|
|
126 |
district = Field(String(128))
|
|
|
127 |
state = Field(String(128))
|
|
|
128 |
using_options(shortnames=True)
|
|
|
129 |
using_table_options(mysql_engine="InnoDB")
|
|
|
130 |
|
| 15048 |
kshitij.so |
131 |
class Orders(Entity):
|
|
|
132 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
133 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
134 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
135 |
order_url = Field(String(256))
|
|
|
136 |
status = Field(String(32))
|
|
|
137 |
created = Field(DateTime)
|
|
|
138 |
modified = Field(DateTime)
|
|
|
139 |
using_options(shortnames=True)
|
|
|
140 |
using_table_options(mysql_engine="InnoDB")
|
|
|
141 |
|
| 15532 |
amit.gupta |
142 |
class FlipkartOrders(Entity):
|
|
|
143 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
144 |
user_id = Field(Integer(unsigned=True))
|
|
|
145 |
email = Field(String(128))
|
|
|
146 |
subtagId= Field(String(32))
|
|
|
147 |
identifier = Field(String(32))
|
|
|
148 |
catalogId = Field(Integer)
|
| 17239 |
amit.gupta |
149 |
title = Field(String(512))
|
| 15532 |
amit.gupta |
150 |
brand = Field(String(64))
|
|
|
151 |
model = Field(String(64))
|
|
|
152 |
status = Field(String(16))
|
|
|
153 |
price = Field(Float)
|
|
|
154 |
category = Field(String(16))
|
|
|
155 |
quantity = Field(SmallInteger)
|
|
|
156 |
created = Field(DateTime)
|
| 17239 |
amit.gupta |
157 |
payOut = Field(Integer)
|
|
|
158 |
payOutPercentage = Field(SmallInteger)
|
|
|
159 |
affiliateOrderItemId = Field(String(20))
|
| 15532 |
amit.gupta |
160 |
using_options(shortnames=True)
|
|
|
161 |
using_table_options(mysql_engine="InnoDB")
|
|
|
162 |
|
| 15234 |
amit.gupta |
163 |
class OrdersRaw(Entity):
|
|
|
164 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
165 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
166 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
167 |
order_url = Field(String(256))
|
| 15566 |
amit.gupta |
168 |
sub_tag = Field(String(32))
|
| 15554 |
amit.gupta |
169 |
rawhtml = Field(LONGTEXT)
|
| 15234 |
amit.gupta |
170 |
status = Field(String(32))
|
|
|
171 |
created = Field(DateTime)
|
|
|
172 |
modified = Field(DateTime)
|
| 15236 |
amit.gupta |
173 |
using_options(tablename="orders")
|
|
|
174 |
using_table_options(useexisting=True,mysql_engine="InnoDB")
|
| 15234 |
amit.gupta |
175 |
|
| 15081 |
amit.gupta |
176 |
class Retailers(Entity):
|
|
|
177 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15083 |
amit.gupta |
178 |
identifier = Field(String(128))
|
| 15081 |
amit.gupta |
179 |
title = Field(String(256))
|
|
|
180 |
address = Field(String(512))
|
| 15254 |
amit.gupta |
181 |
address_new = Field(String(512))
|
| 15081 |
amit.gupta |
182 |
agent_id=Field(Integer(unsigned=True))
|
|
|
183 |
contact1 = Field(String(10))
|
|
|
184 |
contact2 = Field(String(10))
|
|
|
185 |
pin = Field(String(6))
|
| 15254 |
amit.gupta |
186 |
cod_limit = Field(Integer(10))
|
| 15675 |
amit.gupta |
187 |
city = Field(String(64))
|
| 15081 |
amit.gupta |
188 |
state = Field(String(48))
|
|
|
189 |
status = Field(String(20))
|
| 15083 |
amit.gupta |
190 |
is_elavated = Field(Boolean)
|
| 15086 |
amit.gupta |
191 |
retry_count = Field(Integer(3))
|
|
|
192 |
invalid_retry_count = Field(Integer(3))
|
| 15081 |
amit.gupta |
193 |
call_priority = Field(Enum('user_initiated', 'system_initiated'))
|
|
|
194 |
next_call_time = Field(DateTime)
|
| 15086 |
amit.gupta |
195 |
is_std = Field(Boolean)
|
|
|
196 |
is_or = Field(Boolean)
|
| 16169 |
amit.gupta |
197 |
created = Field(DateTime, default=func.now())
|
| 15110 |
amit.gupta |
198 |
disposition = Field(String(32))
|
| 19732 |
manas |
199 |
isvalidated = Field(Boolean)
|
|
|
200 |
tinnumber = Field(String(11))
|
| 19767 |
manas |
201 |
source = Field(Enum('justdial', 'inbound','outbound'))
|
|
|
202 |
comments = Field(String(256))
|
| 15099 |
amit.gupta |
203 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 15081 |
amit.gupta |
204 |
using_options(shortnames=True)
|
|
|
205 |
using_table_options(mysql_engine="InnoDB")
|
| 15331 |
amit.gupta |
206 |
|
| 15680 |
amit.gupta |
207 |
class RetailerAddresses(Entity):
|
| 15676 |
amit.gupta |
208 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
209 |
retailer_id = Field(Integer(unsigned=True))
|
| 15681 |
amit.gupta |
210 |
title = Field(String(128))
|
| 15676 |
amit.gupta |
211 |
agent_id=Field(Integer(unsigned=True))
|
|
|
212 |
address = Field(String(512))
|
|
|
213 |
city = Field(String(64))
|
|
|
214 |
state = Field(String(48))
|
|
|
215 |
pin = Field(String(6))
|
| 15683 |
amit.gupta |
216 |
created = Field(DateTime,default=func.now())
|
| 15676 |
amit.gupta |
217 |
using_options(shortnames=True)
|
|
|
218 |
using_table_options(mysql_engine="InnoDB")
|
| 15675 |
amit.gupta |
219 |
class DailySourcewiseOrderInfo(Entity):
|
|
|
220 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
221 |
source = Field(Integer(2))
|
|
|
222 |
order_count = Field(Integer(4))
|
|
|
223 |
quantity_count = Field(Integer(4))
|
|
|
224 |
sale_amount = Field(Integer(10))
|
|
|
225 |
created = Field(DateTime)
|
|
|
226 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
227 |
using_options(shortnames=True)
|
|
|
228 |
using_table_options(mysql_engine="InnoDB")
|
|
|
229 |
|
| 15331 |
amit.gupta |
230 |
class AlreadyCalledNumbers(Entity):
|
|
|
231 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
232 |
mobile_number = Field(String(10), unique=True)
|
| 15352 |
amit.gupta |
233 |
using_options(shortnames=True)
|
|
|
234 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
235 |
|
| 15710 |
amit.gupta |
236 |
class Pincodeavailability(Entity):
|
|
|
237 |
code = Field(String(6), unique=True)
|
|
|
238 |
amount = Field(Integer(11))
|
|
|
239 |
using_options(shortnames=True)
|
|
|
240 |
using_table_options(mysql_engine="InnoDB")
|
|
|
241 |
|
| 15254 |
amit.gupta |
242 |
class RetailerContacts(Entity):
|
|
|
243 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
244 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
245 |
agent_id = Field(Integer(unsigned=True))
|
|
|
246 |
mobile_number = Field(String(10))
|
| 15260 |
amit.gupta |
247 |
contact_type = Field(Enum('sms', 'called', 'ringing'))
|
| 15254 |
amit.gupta |
248 |
call_type = Field(String(10))
|
|
|
249 |
created = Field(DateTime,default=func.now())
|
|
|
250 |
using_options(shortnames=True)
|
|
|
251 |
using_table_options(mysql_engine="InnoDB")
|
|
|
252 |
|
|
|
253 |
|
| 15096 |
amit.gupta |
254 |
class CallHistory(Entity):
|
|
|
255 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
256 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
257 |
agent_id = Field(Integer(unsigned=True))
|
|
|
258 |
mobile_number = Field(String(10))
|
| 15113 |
amit.gupta |
259 |
call_type = Field(String(10))
|
| 15096 |
amit.gupta |
260 |
sms_verified = Field(Boolean)
|
|
|
261 |
call_time = Field(DateTime)
|
|
|
262 |
duration_sec = Field(Integer)
|
| 15234 |
amit.gupta |
263 |
last_fetch_time = Field(DateTime)
|
| 15377 |
amit.gupta |
264 |
call_disposition = Field(Enum('call_later','ringing_no_answer', 'not_reachable', 'switch_off', 'invalid_no', 'wrong_no', 'hang_up','retailer_not_interested', 'alreadyuser', 'verified_link_sent', 'onboarded'))
|
| 15096 |
amit.gupta |
265 |
disposition_description = Field(String(192))
|
| 15201 |
manas |
266 |
disposition_comments = Field(String(192))
|
| 15096 |
amit.gupta |
267 |
created = Field(DateTime,default=func.now())
|
| 15110 |
amit.gupta |
268 |
using_options(shortnames=True)
|
|
|
269 |
using_table_options(mysql_engine="InnoDB")
|
| 15096 |
amit.gupta |
270 |
|
| 15081 |
amit.gupta |
271 |
class RetryConfig(Entity):
|
| 18307 |
manas |
272 |
call_type = Field(Enum('fresh', 'followup', 'onboarding','default'))
|
| 15096 |
amit.gupta |
273 |
disposition_type = Field(Enum('ringing_no_answer', 'not_reachable'))
|
| 15081 |
amit.gupta |
274 |
retry_count = Field(Integer(unsigned=True))
|
| 15110 |
amit.gupta |
275 |
minutes_ahead = Field(Integer(unsigned=True))
|
| 15081 |
amit.gupta |
276 |
using_options(shortnames=True)
|
|
|
277 |
using_table_options(mysql_engine="InnoDB")
|
| 15133 |
amit.gupta |
278 |
|
|
|
279 |
class RetailerLinks(Entity):
|
| 15234 |
amit.gupta |
280 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15254 |
amit.gupta |
281 |
retailer_id = Field(Integer(unsigned=True), unique=True)
|
| 15138 |
amit.gupta |
282 |
agent_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
283 |
code = Field(String(10), unique=True)
|
| 16480 |
kshitij.so |
284 |
mapped_with = Field(String(256))
|
| 15133 |
amit.gupta |
285 |
activated = Field(DateTime,onupdate=func.now())
|
| 15255 |
amit.gupta |
286 |
user_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
287 |
created = Field(DateTime,default=func.now())
|
|
|
288 |
using_options(shortnames=True)
|
|
|
289 |
using_table_options(mysql_engine="InnoDB")
|
| 15135 |
amit.gupta |
290 |
|
|
|
291 |
class Activation_Codes(Entity):
|
| 19777 |
manas |
292 |
status = Field(Boolean,default=True, server_default='1')
|
| 15135 |
amit.gupta |
293 |
code = Field(String(10))
|
| 15138 |
amit.gupta |
294 |
created = Field(DateTime, default=func.now())
|
| 15144 |
amit.gupta |
295 |
using_options(shortnames=True)
|
|
|
296 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
297 |
|
| 15189 |
manas |
298 |
class Agents(Entity):
|
|
|
299 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
300 |
name = Field(String(64))
|
|
|
301 |
email = Field(String(100))
|
|
|
302 |
password = Field(String(64))
|
|
|
303 |
type = Field(Enum('crm','fos'))
|
|
|
304 |
last_login = Field(DateTime)
|
| 15533 |
amit.gupta |
305 |
login_type = Field(String(10))
|
| 15189 |
manas |
306 |
created = Field(DateTime, default=func.now())
|
|
|
307 |
using_options(shortnames=True)
|
|
|
308 |
using_table_options(mysql_engine="InnoDB")
|
|
|
309 |
|
|
|
310 |
class Agent_Roles(Entity):
|
|
|
311 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
312 |
agent_id = Field(Integer(unsigned=True))
|
|
|
313 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
314 |
created = Field(DateTime, default=func.now())
|
|
|
315 |
using_options(shortnames=True)
|
|
|
316 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
317 |
|
| 15189 |
manas |
318 |
class AgentLoginTimings(Entity):
|
|
|
319 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
320 |
agent_id = Field(Integer(unsigned=True))
|
|
|
321 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
322 |
loginTime = Field(DateTime)
|
|
|
323 |
logoutTime = Field(DateTime)
|
|
|
324 |
created = Field(DateTime, default=func.now())
|
|
|
325 |
using_options(shortnames=True)
|
|
|
326 |
using_table_options(mysql_engine="InnoDB")
|
| 15424 |
amit.gupta |
327 |
|
|
|
328 |
class Clicks(Entity):
|
|
|
329 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
330 |
user_id = Field(Integer(unsigned=True))
|
|
|
331 |
tag = Field(String(20))
|
|
|
332 |
created = Field(DateTime, default=func.now())
|
|
|
333 |
using_options(shortnames=True)
|
|
|
334 |
using_table_options(mysql_engine="InnoDB")
|
| 15189 |
manas |
335 |
|
| 15234 |
amit.gupta |
336 |
class FetchDataHistory(Entity):
|
|
|
337 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
338 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
339 |
agent_id = Field(Integer(unsigned=True))
|
|
|
340 |
call_type = Field(String(10))
|
|
|
341 |
last_action = Field(Enum('login','disposition'))
|
|
|
342 |
last_action_time = Field(DateTime)
|
|
|
343 |
created = Field(DateTime,default=func.now())
|
|
|
344 |
using_options(shortnames=True)
|
|
|
345 |
using_table_options(mysql_engine="InnoDB")
|
|
|
346 |
|
| 15690 |
manish.sha |
347 |
class Pushnotifications(Entity):
|
|
|
348 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
349 |
user_id = Field(Integer(unsigned=True))
|
|
|
350 |
notification_campaign_id = Field(Integer(unsigned=True))
|
|
|
351 |
type = Field(String(16))
|
|
|
352 |
status = Field(Boolean)
|
|
|
353 |
message = Field(String(64))
|
|
|
354 |
response_time = Field(DateTime)
|
|
|
355 |
created = Field(DateTime)
|
|
|
356 |
using_options(shortnames=True)
|
|
|
357 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
358 |
|
| 15791 |
manish.sha |
359 |
|
|
|
360 |
class MerchantSubOrders(Entity):
|
|
|
361 |
orderId = Field(Integer, primary_key= True, autoincrement=False)
|
|
|
362 |
merchantOrderId = Field(String(30), primary_key=True)
|
|
|
363 |
merchantSubOrderId = Field(String(50), primary_key=True)
|
|
|
364 |
storeId = Field(Integer)
|
|
|
365 |
userId = Field(Integer)
|
|
|
366 |
productCode = Field(String(50))
|
|
|
367 |
brand = Field(String(30))
|
|
|
368 |
productName = Field(String(50))
|
| 16305 |
manas |
369 |
categoryId = Field(Integer)
|
| 15791 |
manish.sha |
370 |
amountPaid = Field(Float)
|
|
|
371 |
quantity = Field(Integer)
|
|
|
372 |
unitPrice = Field(Float)
|
|
|
373 |
status = Field(String(30))
|
|
|
374 |
createdTime = Field(DateTime)
|
|
|
375 |
using_options(shortnames=True)
|
|
|
376 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
377 |
|
| 16374 |
amit.gupta |
378 |
class paytm_coupons(Entity):
|
|
|
379 |
id = Field(Integer, primary_key= True)
|
|
|
380 |
coupon = Field(String(64))
|
| 16412 |
amit.gupta |
381 |
offer_text = Field(String(256))
|
| 16374 |
amit.gupta |
382 |
min_cart_amount = Field(Integer)
|
|
|
383 |
cart_item_limit = Field(Integer)
|
|
|
384 |
max_cashback_amount = Field(Integer)
|
|
|
385 |
usage_limit = Field(Integer)
|
|
|
386 |
cod_available = Field(Integer)
|
|
|
387 |
valid_upto = Field(DateTime)
|
|
|
388 |
cashback_type = Enum(CASHBACK_AMOUNT, CASHBACK_PERCENTAGE)
|
| 16412 |
amit.gupta |
389 |
created = Field(DateTime,default=func.now())
|
| 16374 |
amit.gupta |
390 |
using_options(shortnames=True)
|
|
|
391 |
using_table_options(mysql_engine="InnoDB")
|
|
|
392 |
|
|
|
393 |
class paytm_coupon_usages(Entity):
|
|
|
394 |
id = Field(Integer, primary_key= True)
|
|
|
395 |
user_id = Field(Integer)
|
|
|
396 |
order_id = Field(Integer)
|
|
|
397 |
coupon = Field(String(64))
|
|
|
398 |
cashback = Field(Integer)
|
|
|
399 |
created = Field(DateTime,default=func.now())
|
|
|
400 |
using_options(shortnames=True)
|
|
|
401 |
using_table_options(mysql_engine="InnoDB")
|
| 16928 |
amit.gupta |
402 |
|
|
|
403 |
|
|
|
404 |
class paytm_coupon_non_usages(Entity):
|
|
|
405 |
id = Field(Integer, primary_key= True)
|
|
|
406 |
user_id = Field(Integer)
|
|
|
407 |
order_id = Field(Integer)
|
|
|
408 |
created = Field(DateTime,default=func.now())
|
|
|
409 |
using_options(shortnames=True)
|
|
|
410 |
using_table_options(mysql_engine="InnoDB")
|
|
|
411 |
|
| 16374 |
amit.gupta |
412 |
|
|
|
413 |
|
| 15816 |
amit.gupta |
414 |
class NotificationViews(Entity):
|
|
|
415 |
id = Field(Integer, primary_key= True)
|
|
|
416 |
user_id = Field(Integer(unsigned=True))
|
|
|
417 |
notification_rule_id = Field(Integer(unsigned=True))
|
|
|
418 |
created = Field(DateTime)
|
|
|
419 |
using_options(shortnames=True)
|
|
|
420 |
using_table_options(mysql_engine="InnoDB")
|
|
|
421 |
|
|
|
422 |
class MissingAmazonOrderUsers(Entity):
|
|
|
423 |
user_id = Field(Integer, primary_key= True)
|
|
|
424 |
using_options(shortnames=True)
|
|
|
425 |
using_table_options(mysql_engine="InnoDB")
|
|
|
426 |
class PendingToTrackAmazonOrderUsers(Entity):
|
|
|
427 |
user_id = Field(Integer, primary_key= True)
|
|
|
428 |
using_options(shortnames=True)
|
|
|
429 |
using_table_options(mysql_engine="InnoDB")
|
|
|
430 |
|
|
|
431 |
|
| 15917 |
amit.gupta |
432 |
class User_addresses(Entity):
|
|
|
433 |
id = Field(Integer, primary_key= True)
|
|
|
434 |
user_id = Field(Integer(unsigned=True))
|
|
|
435 |
store_name = Field(String(128))
|
|
|
436 |
address = Field(String(256))
|
|
|
437 |
city = Field(String(64))
|
|
|
438 |
pincode = Field(String(6))
|
|
|
439 |
state = Field(String(48))
|
|
|
440 |
using_options(shortnames=True)
|
|
|
441 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
442 |
|
| 15917 |
amit.gupta |
443 |
class All_user_addresses(Entity):
|
|
|
444 |
id = Field(Integer, primary_key= True)
|
|
|
445 |
user_id = Field(Integer(unsigned=True))
|
|
|
446 |
address = Field(String(256))
|
|
|
447 |
store_name = Field(String(128))
|
|
|
448 |
city = Field(String(64))
|
|
|
449 |
pincode = Field(String(6))
|
|
|
450 |
state = Field(String(48))
|
|
|
451 |
source = Field(Enum('retailer_crm_edited', 'retailer_master', 'fos_crm', 'user_profile'))
|
|
|
452 |
created = Field(DateTime,default=func.now())
|
|
|
453 |
using_options(shortnames=True)
|
|
|
454 |
using_table_options(mysql_engine="InnoDB")
|
| 16372 |
manas |
455 |
|
|
|
456 |
class user_filters(Entity):
|
|
|
457 |
id = Field(Integer, primary_key= True)
|
|
|
458 |
user_id = Field(Integer(unsigned=True))
|
|
|
459 |
type=Field(Enum('clear','brand'))
|
|
|
460 |
filters = Field(String(256))
|
| 16482 |
manas |
461 |
created = Field(DateTime,default=func.now())
|
| 16372 |
manas |
462 |
using_options(shortnames=True)
|
|
|
463 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
464 |
|
|
|
465 |
class app_offers(Entity):
|
|
|
466 |
id = Field(Integer, primary_key=True)
|
|
|
467 |
affiliate_id = Field(Integer)
|
|
|
468 |
affiliate_offer_id = Field(String(256))
|
|
|
469 |
offer_price = Field(Float)
|
| 16536 |
kshitij.so |
470 |
user_payout = Field(Float)
|
|
|
471 |
override_payout = Field(Boolean)
|
|
|
472 |
overriden_payout = Field(Float)
|
| 16479 |
kshitij.so |
473 |
app_name = Field(String(256))
|
| 16536 |
kshitij.so |
474 |
package_name = Field(String(256))
|
| 16479 |
kshitij.so |
475 |
image_url = Field(String(256))
|
| 16573 |
manish.sha |
476 |
description = Field(Text)
|
|
|
477 |
shortDescription = Field(Text)
|
| 16585 |
manish.sha |
478 |
finalShortDescription = Field(Text)
|
| 16573 |
manish.sha |
479 |
longDescription = Field(Text)
|
| 16585 |
manish.sha |
480 |
finalLongDescription = Field(Text)
|
| 16479 |
kshitij.so |
481 |
link = Field(String(256))
|
|
|
482 |
offer_active = Field(Boolean)
|
| 16480 |
kshitij.so |
483 |
priority = Field(String(256))
|
| 16479 |
kshitij.so |
484 |
show = Field(Boolean)
|
| 16536 |
kshitij.so |
485 |
offerCategory = Field(String(256))
|
|
|
486 |
promoImage = Field(String(256))
|
| 16812 |
manish.sha |
487 |
ratings = Field(Float)
|
| 16573 |
manish.sha |
488 |
downloads = Field(String(100))
|
| 16595 |
manish.sha |
489 |
appmaster_id = Field(Integer)
|
| 16692 |
manish.sha |
490 |
offerCondition = Field(Text)
|
| 16733 |
manish.sha |
491 |
location = Field(String(1024))
|
| 16479 |
kshitij.so |
492 |
using_options(shortnames=True)
|
|
|
493 |
using_table_options(mysql_engine="InnoDB")
|
|
|
494 |
|
|
|
495 |
class app_affiliates(Entity):
|
|
|
496 |
id = Field(Integer, primary_key=True)
|
|
|
497 |
name = Field(String(256))
|
|
|
498 |
isActive = Field(Boolean)
|
|
|
499 |
using_options(shortnames=True)
|
|
|
500 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
501 |
|
| 16595 |
manish.sha |
502 |
class appmasters(Entity):
|
|
|
503 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
504 |
app_name = Field(String(256))
|
|
|
505 |
package_name = Field(String(256))
|
| 16597 |
manish.sha |
506 |
os_name = Field(Enum('ANDROID', 'IOS', 'WINDOWS'))
|
| 16595 |
manish.sha |
507 |
shortDescription = Field(Text)
|
|
|
508 |
longDescription = Field(Text)
|
|
|
509 |
customerOneLiner = Field(String(512))
|
|
|
510 |
retailerOneLiner = Field(String(512))
|
| 16727 |
manish.sha |
511 |
showApp = Field(Boolean)
|
| 16941 |
manish.sha |
512 |
rank = Field(Integer)
|
| 16595 |
manish.sha |
513 |
using_options(shortnames=True)
|
|
|
514 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
515 |
|
| 16631 |
manish.sha |
516 |
class approved_app_transactions(Entity):
|
|
|
517 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
518 |
app_id = Field(Integer)
|
|
|
519 |
retailer_id = Field(Integer)
|
|
|
520 |
transaction_id = Field(String(100))
|
|
|
521 |
transaction_time = Field(DateTime)
|
|
|
522 |
redirect_url = Field(String(256))
|
|
|
523 |
payout_status = Field(Integer)
|
|
|
524 |
payout_description = Field(String(100))
|
|
|
525 |
cashback_status = Field(Integer)
|
|
|
526 |
cash_back_description = Field(String(100))
|
|
|
527 |
payout_amount = Field(Integer)
|
|
|
528 |
payout_time = Field(DateTime)
|
|
|
529 |
offer_price = Field(Integer)
|
|
|
530 |
overridenCashBack = Field(Integer)
|
|
|
531 |
isCashBackOverriden = Field(Boolean)
|
|
|
532 |
user_payout = Field(Integer)
|
|
|
533 |
cashBackConsidered = Field(Boolean)
|
| 16913 |
manish.sha |
534 |
final_user_payout = Field(Integer)
|
| 16631 |
manish.sha |
535 |
using_options(shortnames=True)
|
|
|
536 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
537 |
|
| 16631 |
manish.sha |
538 |
class user_app_cashbacks(Entity):
|
|
|
539 |
user_id = Field(Integer)
|
|
|
540 |
status = Field(String(30))
|
|
|
541 |
amount = Field(Integer)
|
|
|
542 |
fortnightOfYear = Field(Integer)
|
|
|
543 |
yearVal = Field(Integer)
|
| 16696 |
manish.sha |
544 |
batchCreditId = Field(Integer)
|
| 16861 |
manish.sha |
545 |
creditedDate = Field(Date)
|
| 16631 |
manish.sha |
546 |
using_options(shortnames=True)
|
|
|
547 |
using_table_options(mysql_engine="InnoDB")
|
|
|
548 |
|
|
|
549 |
class user_app_installs(Entity):
|
|
|
550 |
user_id = Field(Integer)
|
|
|
551 |
fortnightOfYear = Field(Integer)
|
|
|
552 |
transaction_date = Field(Date)
|
|
|
553 |
app_id = Field(Integer)
|
|
|
554 |
app_name = Field(String(256))
|
|
|
555 |
installCount = Field(Integer)
|
|
|
556 |
payoutAmount = Field(Integer)
|
|
|
557 |
using_options(shortnames=True)
|
|
|
558 |
using_table_options(mysql_engine="InnoDB")
|
|
|
559 |
|
|
|
560 |
class total_app_installs(Entity):
|
|
|
561 |
app_id = Field(Integer)
|
|
|
562 |
app_name = Field(String(256))
|
|
|
563 |
date = Field(Date)
|
|
|
564 |
totalPayoutAmount = Field(Integer)
|
|
|
565 |
totalOfferAmount = Field(Integer)
|
|
|
566 |
using_options(shortnames=True)
|
|
|
567 |
using_table_options(mysql_engine="InnoDB")
|
| 16769 |
manas |
568 |
|
|
|
569 |
class app_transactions(Entity):
|
| 16793 |
manas |
570 |
transaction_id=Field(String(256))
|
| 16769 |
manas |
571 |
retailer_id = Field(Integer)
|
|
|
572 |
app_id = Field(Integer)
|
|
|
573 |
app_name = Field(String(256))
|
|
|
574 |
cashback_status= Field(Integer)
|
|
|
575 |
redirect_url = Field(String(256))
|
|
|
576 |
cash_back_description = Field(String(256))
|
|
|
577 |
payout_status = Field(Integer)
|
|
|
578 |
overridenCashBack = Field(Integer)
|
|
|
579 |
isCashBackOverriden=Field(Boolean)
|
|
|
580 |
transaction_time = Field(DateTime)
|
|
|
581 |
payout_time = Field(DateTime)
|
|
|
582 |
offer_price=Field(Float, default=0.0, server_default="0.0")
|
|
|
583 |
payout_amount=Field(Float, default=0.0, server_default="0.0")
|
|
|
584 |
user_payout = Field(Float, default=0.0, server_default="0.0")
|
|
|
585 |
payout_description = Field(String(256))
|
| 16913 |
manish.sha |
586 |
final_user_payout = Field(Integer)
|
| 16769 |
manas |
587 |
using_options(shortnames=True)
|
|
|
588 |
using_table_options(mysql_engine="InnoDB")
|
| 17280 |
manish.sha |
589 |
|
|
|
590 |
class notification_campaigns(Entity):
|
|
|
591 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
592 |
name = Field(String(32))
|
|
|
593 |
title = Field(String(32))
|
|
|
594 |
message = Field(String(512))
|
|
|
595 |
type = Field(Enum('url','native','update'))
|
|
|
596 |
url = Field(String(512))
|
|
|
597 |
sql = Field(String(512))
|
|
|
598 |
expiresat = Field(DateTime)
|
|
|
599 |
status = Field(Enum('active','inactive'))
|
|
|
600 |
created = Field(DateTime)
|
| 17349 |
manish.sha |
601 |
sendsms = Field(Boolean)
|
|
|
602 |
messagetext = Field(String(512))
|
|
|
603 |
smsprocessed = Field(Boolean)
|
| 17280 |
manish.sha |
604 |
using_options(shortnames=True)
|
|
|
605 |
using_table_options(mysql_engine="InnoDB")
|
| 18258 |
manas |
606 |
|
|
|
607 |
class mobileappsettings(Entity):
|
|
|
608 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
609 |
setting = Field(String(64))
|
|
|
610 |
value = Field(String(512))
|
|
|
611 |
created = Field(DateTime)
|
|
|
612 |
modified= Field(DateTime)
|
|
|
613 |
using_options(shortnames=True)
|
|
|
614 |
using_table_options(mysql_engine="InnoDB")
|
|
|
615 |
|
| 18265 |
manas |
616 |
class UserCrmCallingData(Entity):
|
| 18258 |
manas |
617 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
618 |
user_id = Field(Integer(unsigned=True))
|
| 18265 |
manas |
619 |
name = Field(String(128))
|
| 18258 |
manas |
620 |
agent_id=Field(Integer(unsigned=True))
|
|
|
621 |
project_id=Field(Integer(unsigned=True))
|
| 18265 |
manas |
622 |
user_available = Field(Integer(unsigned=True))
|
| 18258 |
manas |
623 |
contact1 = Field(String(10))
|
|
|
624 |
pincode_servicable = Field(Boolean)
|
|
|
625 |
status = Field(String(20))
|
|
|
626 |
retry_count = Field(Integer(3))
|
|
|
627 |
invalid_retry_count = Field(Integer(3))
|
|
|
628 |
next_call_time = Field(DateTime)
|
|
|
629 |
counter = Field(Integer(unsigned=True))
|
|
|
630 |
disposition = Field(String(32))
|
|
|
631 |
created = Field(DateTime, default=func.now())
|
|
|
632 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
633 |
using_options(shortnames=True)
|
|
|
634 |
using_table_options(mysql_engine="InnoDB")
|
|
|
635 |
|
| 18293 |
manas |
636 |
class CallHistoryCrm(Entity):
|
|
|
637 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
638 |
user_id = Field(Integer(unsigned=True))
|
|
|
639 |
agent_id = Field(Integer(unsigned=True))
|
|
|
640 |
project_id = Field(Integer(unsigned=True))
|
|
|
641 |
mobile_number = Field(String(10))
|
|
|
642 |
call_time = Field(DateTime)
|
|
|
643 |
duration_sec = Field(Integer)
|
| 18672 |
manas |
644 |
call_disposition = Field(Enum('call_later','ringing_no_answer', 'not_reachable', 'switch_off', 'technical_issue', 'pricing_issue', 'shipping_issue','internet_issue','checking_price', 'order_process', 'placed_order','place_order','product_availability','return_replacement','already_purchased','product_quality_issue','delayed_delivery','other_complaint','not_dealing_accessories'))
|
| 18293 |
manas |
645 |
disposition_description = Field(String(192))
|
|
|
646 |
disposition_comments = Field(String(192))
|
|
|
647 |
created = Field(DateTime,default=func.now())
|
|
|
648 |
using_options(shortnames=True)
|
|
|
649 |
using_table_options(mysql_engine="InnoDB")
|
|
|
650 |
|
| 18352 |
manas |
651 |
class ProductPricingInputs(Entity):
|
|
|
652 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
653 |
user_id = Field(Integer(unsigned=True))
|
|
|
654 |
disposition_id = Field(Integer(unsigned=True))
|
|
|
655 |
call_disposition = Field(Enum('call_later','technical_issue', 'pricing_issue', 'shipping_issue','internet_issue','checking_price', 'order_process', 'placed_order','place_order'))
|
|
|
656 |
agent_id = Field(Integer(unsigned=True))
|
|
|
657 |
project_id = Field(Integer(unsigned=True))
|
|
|
658 |
product_input = Field (String(256))
|
|
|
659 |
pricing_input = Field(Float)
|
|
|
660 |
created = Field(DateTime,default=func.now())
|
|
|
661 |
using_options(shortnames=True)
|
|
|
662 |
using_table_options(mysql_engine="InnoDB")
|
| 19329 |
kshitij.so |
663 |
|
|
|
664 |
class user_accounts(Entity):
|
|
|
665 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
666 |
user_id = Field(Integer(unsigned=True))
|
|
|
667 |
account_type = Field(Enum('saholic','gcm_regid','cartId'))
|
|
|
668 |
account_key = Field(String(128))
|
|
|
669 |
using_options(shortnames=True)
|
|
|
670 |
using_table_options(mysql_engine="InnoDB")
|
| 19666 |
amit.gupta |
671 |
|
|
|
672 |
class tinxys_stats(Entity):
|
|
|
673 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
674 |
req_date = Field(Date, unique=True, default=func.curdate())
|
|
|
675 |
total = Field(Integer, default=0)
|
| 19716 |
amit.gupta |
676 |
request_failed = Field(Integer, default=0)
|
| 19666 |
amit.gupta |
677 |
invalid_tin = Field(Integer, default=0)
|
| 19717 |
amit.gupta |
678 |
using_options(shortnames=True)
|
| 19666 |
amit.gupta |
679 |
using_table_options(mysql_engine="InnoDB")
|
| 19744 |
manas |
680 |
|
|
|
681 |
class profitmandi_sms(Entity):
|
|
|
682 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
683 |
mobile_number = Field(String(10))
|
|
|
684 |
identifier = Field(Integer(unsigned=True))
|
|
|
685 |
sms_type = Field(Enum('code'))
|
|
|
686 |
sms_id = Field(String(128))
|
|
|
687 |
status = Field(String(512))
|
|
|
688 |
created = Field(DateTime, default=func.now())
|
|
|
689 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
690 |
using_options(shortnames=True)
|
|
|
691 |
using_table_options(mysql_engine="InnoDB")
|
| 22264 |
amit.gupta |
692 |
#it runs through the proxy
|
|
|
693 |
def initialize(dbname='dtr', db_hostname="127.0.0.1", echo=True, setup=True):
|
| 14039 |
kshitij.so |
694 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
|
|
695 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
|
|
696 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
697 |
metadata.bind = cengine
|
| 14826 |
kshitij.so |
698 |
metadata.bind.echo = echo
|
| 19329 |
kshitij.so |
699 |
setup_all(setup)
|
| 14039 |
kshitij.so |
700 |
|
|
|
701 |
if __name__=="__main__":
|
| 18258 |
manas |
702 |
initialize()
|