| 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)
|
| 14039 |
kshitij.so |
31 |
group_id = Field(Integer(unsigned=True), default=1, server_default='1')
|
|
|
32 |
status = Field(Boolean, default=True, server_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))
|
| 15099 |
amit.gupta |
199 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 15081 |
amit.gupta |
200 |
using_options(shortnames=True)
|
|
|
201 |
using_table_options(mysql_engine="InnoDB")
|
| 15331 |
amit.gupta |
202 |
|
| 15680 |
amit.gupta |
203 |
class RetailerAddresses(Entity):
|
| 15676 |
amit.gupta |
204 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
205 |
retailer_id = Field(Integer(unsigned=True))
|
| 15681 |
amit.gupta |
206 |
title = Field(String(128))
|
| 15676 |
amit.gupta |
207 |
agent_id=Field(Integer(unsigned=True))
|
|
|
208 |
address = Field(String(512))
|
|
|
209 |
city = Field(String(64))
|
|
|
210 |
state = Field(String(48))
|
|
|
211 |
pin = Field(String(6))
|
| 15683 |
amit.gupta |
212 |
created = Field(DateTime,default=func.now())
|
| 15676 |
amit.gupta |
213 |
using_options(shortnames=True)
|
|
|
214 |
using_table_options(mysql_engine="InnoDB")
|
| 15675 |
amit.gupta |
215 |
class DailySourcewiseOrderInfo(Entity):
|
|
|
216 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
217 |
source = Field(Integer(2))
|
|
|
218 |
order_count = Field(Integer(4))
|
|
|
219 |
quantity_count = Field(Integer(4))
|
|
|
220 |
sale_amount = Field(Integer(10))
|
|
|
221 |
created = Field(DateTime)
|
|
|
222 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
223 |
using_options(shortnames=True)
|
|
|
224 |
using_table_options(mysql_engine="InnoDB")
|
|
|
225 |
|
| 15331 |
amit.gupta |
226 |
class AlreadyCalledNumbers(Entity):
|
|
|
227 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
228 |
mobile_number = Field(String(10), unique=True)
|
| 15352 |
amit.gupta |
229 |
using_options(shortnames=True)
|
|
|
230 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
231 |
|
| 15710 |
amit.gupta |
232 |
class Pincodeavailability(Entity):
|
|
|
233 |
code = Field(String(6), unique=True)
|
|
|
234 |
amount = Field(Integer(11))
|
|
|
235 |
using_options(shortnames=True)
|
|
|
236 |
using_table_options(mysql_engine="InnoDB")
|
|
|
237 |
|
| 15254 |
amit.gupta |
238 |
class RetailerContacts(Entity):
|
|
|
239 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
240 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
241 |
agent_id = Field(Integer(unsigned=True))
|
|
|
242 |
mobile_number = Field(String(10))
|
| 15260 |
amit.gupta |
243 |
contact_type = Field(Enum('sms', 'called', 'ringing'))
|
| 15254 |
amit.gupta |
244 |
call_type = Field(String(10))
|
|
|
245 |
created = Field(DateTime,default=func.now())
|
|
|
246 |
using_options(shortnames=True)
|
|
|
247 |
using_table_options(mysql_engine="InnoDB")
|
|
|
248 |
|
|
|
249 |
|
| 15096 |
amit.gupta |
250 |
class CallHistory(Entity):
|
|
|
251 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
252 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
253 |
agent_id = Field(Integer(unsigned=True))
|
|
|
254 |
mobile_number = Field(String(10))
|
| 15113 |
amit.gupta |
255 |
call_type = Field(String(10))
|
| 15096 |
amit.gupta |
256 |
sms_verified = Field(Boolean)
|
|
|
257 |
call_time = Field(DateTime)
|
|
|
258 |
duration_sec = Field(Integer)
|
| 15234 |
amit.gupta |
259 |
last_fetch_time = Field(DateTime)
|
| 15377 |
amit.gupta |
260 |
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 |
261 |
disposition_description = Field(String(192))
|
| 15201 |
manas |
262 |
disposition_comments = Field(String(192))
|
| 15096 |
amit.gupta |
263 |
created = Field(DateTime,default=func.now())
|
| 15110 |
amit.gupta |
264 |
using_options(shortnames=True)
|
|
|
265 |
using_table_options(mysql_engine="InnoDB")
|
| 15096 |
amit.gupta |
266 |
|
| 15081 |
amit.gupta |
267 |
class RetryConfig(Entity):
|
| 15359 |
amit.gupta |
268 |
call_type = Field(Enum('fresh', 'followup', 'onboarding'))
|
| 15096 |
amit.gupta |
269 |
disposition_type = Field(Enum('ringing_no_answer', 'not_reachable'))
|
| 15081 |
amit.gupta |
270 |
retry_count = Field(Integer(unsigned=True))
|
| 15110 |
amit.gupta |
271 |
minutes_ahead = Field(Integer(unsigned=True))
|
| 15081 |
amit.gupta |
272 |
using_options(shortnames=True)
|
|
|
273 |
using_table_options(mysql_engine="InnoDB")
|
| 15133 |
amit.gupta |
274 |
|
|
|
275 |
class RetailerLinks(Entity):
|
| 15234 |
amit.gupta |
276 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15254 |
amit.gupta |
277 |
retailer_id = Field(Integer(unsigned=True), unique=True)
|
| 15138 |
amit.gupta |
278 |
agent_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
279 |
code = Field(String(10), unique=True)
|
| 16480 |
kshitij.so |
280 |
mapped_with = Field(String(256))
|
| 15133 |
amit.gupta |
281 |
activated = Field(DateTime,onupdate=func.now())
|
| 15255 |
amit.gupta |
282 |
user_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
283 |
created = Field(DateTime,default=func.now())
|
|
|
284 |
using_options(shortnames=True)
|
|
|
285 |
using_table_options(mysql_engine="InnoDB")
|
| 15135 |
amit.gupta |
286 |
|
|
|
287 |
class Activation_Codes(Entity):
|
|
|
288 |
code = Field(String(10))
|
| 15138 |
amit.gupta |
289 |
created = Field(DateTime, default=func.now())
|
| 15144 |
amit.gupta |
290 |
using_options(shortnames=True)
|
|
|
291 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
292 |
|
| 15189 |
manas |
293 |
class Agents(Entity):
|
|
|
294 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
295 |
name = Field(String(64))
|
|
|
296 |
email = Field(String(100))
|
|
|
297 |
password = Field(String(64))
|
|
|
298 |
type = Field(Enum('crm','fos'))
|
|
|
299 |
last_login = Field(DateTime)
|
| 15533 |
amit.gupta |
300 |
login_type = Field(String(10))
|
| 15189 |
manas |
301 |
created = Field(DateTime, default=func.now())
|
|
|
302 |
using_options(shortnames=True)
|
|
|
303 |
using_table_options(mysql_engine="InnoDB")
|
|
|
304 |
|
|
|
305 |
class Agent_Roles(Entity):
|
|
|
306 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
307 |
agent_id = Field(Integer(unsigned=True))
|
|
|
308 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
309 |
created = Field(DateTime, default=func.now())
|
|
|
310 |
using_options(shortnames=True)
|
|
|
311 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
312 |
|
| 15189 |
manas |
313 |
class AgentLoginTimings(Entity):
|
|
|
314 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
315 |
agent_id = Field(Integer(unsigned=True))
|
|
|
316 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
317 |
loginTime = Field(DateTime)
|
|
|
318 |
logoutTime = Field(DateTime)
|
|
|
319 |
created = Field(DateTime, default=func.now())
|
|
|
320 |
using_options(shortnames=True)
|
|
|
321 |
using_table_options(mysql_engine="InnoDB")
|
| 15424 |
amit.gupta |
322 |
|
|
|
323 |
class Clicks(Entity):
|
|
|
324 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
325 |
user_id = Field(Integer(unsigned=True))
|
|
|
326 |
tag = Field(String(20))
|
|
|
327 |
created = Field(DateTime, default=func.now())
|
|
|
328 |
using_options(shortnames=True)
|
|
|
329 |
using_table_options(mysql_engine="InnoDB")
|
| 15189 |
manas |
330 |
|
| 15234 |
amit.gupta |
331 |
class FetchDataHistory(Entity):
|
|
|
332 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
333 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
334 |
agent_id = Field(Integer(unsigned=True))
|
|
|
335 |
call_type = Field(String(10))
|
|
|
336 |
last_action = Field(Enum('login','disposition'))
|
|
|
337 |
last_action_time = Field(DateTime)
|
|
|
338 |
created = Field(DateTime,default=func.now())
|
|
|
339 |
using_options(shortnames=True)
|
|
|
340 |
using_table_options(mysql_engine="InnoDB")
|
|
|
341 |
|
| 15690 |
manish.sha |
342 |
class Pushnotifications(Entity):
|
|
|
343 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
344 |
user_id = Field(Integer(unsigned=True))
|
|
|
345 |
notification_campaign_id = Field(Integer(unsigned=True))
|
|
|
346 |
type = Field(String(16))
|
|
|
347 |
status = Field(Boolean)
|
|
|
348 |
message = Field(String(64))
|
|
|
349 |
response_time = Field(DateTime)
|
|
|
350 |
created = Field(DateTime)
|
|
|
351 |
using_options(shortnames=True)
|
|
|
352 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
353 |
|
| 15791 |
manish.sha |
354 |
|
|
|
355 |
class MerchantSubOrders(Entity):
|
|
|
356 |
orderId = Field(Integer, primary_key= True, autoincrement=False)
|
|
|
357 |
merchantOrderId = Field(String(30), primary_key=True)
|
|
|
358 |
merchantSubOrderId = Field(String(50), primary_key=True)
|
|
|
359 |
storeId = Field(Integer)
|
|
|
360 |
userId = Field(Integer)
|
|
|
361 |
productCode = Field(String(50))
|
|
|
362 |
brand = Field(String(30))
|
|
|
363 |
productName = Field(String(50))
|
| 16305 |
manas |
364 |
categoryId = Field(Integer)
|
| 15791 |
manish.sha |
365 |
amountPaid = Field(Float)
|
|
|
366 |
quantity = Field(Integer)
|
|
|
367 |
unitPrice = Field(Float)
|
|
|
368 |
status = Field(String(30))
|
|
|
369 |
createdTime = Field(DateTime)
|
|
|
370 |
using_options(shortnames=True)
|
|
|
371 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
372 |
|
| 16374 |
amit.gupta |
373 |
class paytm_coupons(Entity):
|
|
|
374 |
id = Field(Integer, primary_key= True)
|
|
|
375 |
coupon = Field(String(64))
|
| 16412 |
amit.gupta |
376 |
offer_text = Field(String(256))
|
| 16374 |
amit.gupta |
377 |
min_cart_amount = Field(Integer)
|
|
|
378 |
cart_item_limit = Field(Integer)
|
|
|
379 |
max_cashback_amount = Field(Integer)
|
|
|
380 |
usage_limit = Field(Integer)
|
|
|
381 |
cod_available = Field(Integer)
|
|
|
382 |
valid_upto = Field(DateTime)
|
|
|
383 |
cashback_type = Enum(CASHBACK_AMOUNT, CASHBACK_PERCENTAGE)
|
| 16412 |
amit.gupta |
384 |
created = Field(DateTime,default=func.now())
|
| 16374 |
amit.gupta |
385 |
using_options(shortnames=True)
|
|
|
386 |
using_table_options(mysql_engine="InnoDB")
|
|
|
387 |
|
|
|
388 |
class paytm_coupon_usages(Entity):
|
|
|
389 |
id = Field(Integer, primary_key= True)
|
|
|
390 |
user_id = Field(Integer)
|
|
|
391 |
order_id = Field(Integer)
|
|
|
392 |
coupon = Field(String(64))
|
|
|
393 |
cashback = Field(Integer)
|
|
|
394 |
created = Field(DateTime,default=func.now())
|
|
|
395 |
using_options(shortnames=True)
|
|
|
396 |
using_table_options(mysql_engine="InnoDB")
|
| 16928 |
amit.gupta |
397 |
|
|
|
398 |
|
|
|
399 |
class paytm_coupon_non_usages(Entity):
|
|
|
400 |
id = Field(Integer, primary_key= True)
|
|
|
401 |
user_id = Field(Integer)
|
|
|
402 |
order_id = Field(Integer)
|
|
|
403 |
created = Field(DateTime,default=func.now())
|
|
|
404 |
using_options(shortnames=True)
|
|
|
405 |
using_table_options(mysql_engine="InnoDB")
|
|
|
406 |
|
| 16374 |
amit.gupta |
407 |
|
|
|
408 |
|
| 15816 |
amit.gupta |
409 |
class NotificationViews(Entity):
|
|
|
410 |
id = Field(Integer, primary_key= True)
|
|
|
411 |
user_id = Field(Integer(unsigned=True))
|
|
|
412 |
notification_rule_id = Field(Integer(unsigned=True))
|
|
|
413 |
created = Field(DateTime)
|
|
|
414 |
using_options(shortnames=True)
|
|
|
415 |
using_table_options(mysql_engine="InnoDB")
|
|
|
416 |
|
|
|
417 |
class MissingAmazonOrderUsers(Entity):
|
|
|
418 |
user_id = Field(Integer, primary_key= True)
|
|
|
419 |
using_options(shortnames=True)
|
|
|
420 |
using_table_options(mysql_engine="InnoDB")
|
|
|
421 |
class PendingToTrackAmazonOrderUsers(Entity):
|
|
|
422 |
user_id = Field(Integer, primary_key= True)
|
|
|
423 |
using_options(shortnames=True)
|
|
|
424 |
using_table_options(mysql_engine="InnoDB")
|
|
|
425 |
|
|
|
426 |
|
| 15917 |
amit.gupta |
427 |
class User_addresses(Entity):
|
|
|
428 |
id = Field(Integer, primary_key= True)
|
|
|
429 |
user_id = Field(Integer(unsigned=True))
|
|
|
430 |
store_name = Field(String(128))
|
|
|
431 |
address = Field(String(256))
|
|
|
432 |
city = Field(String(64))
|
|
|
433 |
pincode = Field(String(6))
|
|
|
434 |
state = Field(String(48))
|
|
|
435 |
using_options(shortnames=True)
|
|
|
436 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
437 |
|
| 15917 |
amit.gupta |
438 |
class All_user_addresses(Entity):
|
|
|
439 |
id = Field(Integer, primary_key= True)
|
|
|
440 |
user_id = Field(Integer(unsigned=True))
|
|
|
441 |
address = Field(String(256))
|
|
|
442 |
store_name = Field(String(128))
|
|
|
443 |
city = Field(String(64))
|
|
|
444 |
pincode = Field(String(6))
|
|
|
445 |
state = Field(String(48))
|
|
|
446 |
source = Field(Enum('retailer_crm_edited', 'retailer_master', 'fos_crm', 'user_profile'))
|
|
|
447 |
created = Field(DateTime,default=func.now())
|
|
|
448 |
using_options(shortnames=True)
|
|
|
449 |
using_table_options(mysql_engine="InnoDB")
|
| 16372 |
manas |
450 |
|
|
|
451 |
class user_filters(Entity):
|
|
|
452 |
id = Field(Integer, primary_key= True)
|
|
|
453 |
user_id = Field(Integer(unsigned=True))
|
|
|
454 |
type=Field(Enum('clear','brand'))
|
|
|
455 |
filters = Field(String(256))
|
| 16482 |
manas |
456 |
created = Field(DateTime,default=func.now())
|
| 16372 |
manas |
457 |
using_options(shortnames=True)
|
|
|
458 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
459 |
|
|
|
460 |
class app_offers(Entity):
|
|
|
461 |
id = Field(Integer, primary_key=True)
|
|
|
462 |
affiliate_id = Field(Integer)
|
|
|
463 |
affiliate_offer_id = Field(String(256))
|
|
|
464 |
offer_price = Field(Float)
|
| 16536 |
kshitij.so |
465 |
user_payout = Field(Float)
|
|
|
466 |
override_payout = Field(Boolean)
|
|
|
467 |
overriden_payout = Field(Float)
|
| 16479 |
kshitij.so |
468 |
app_name = Field(String(256))
|
| 16536 |
kshitij.so |
469 |
package_name = Field(String(256))
|
| 16479 |
kshitij.so |
470 |
image_url = Field(String(256))
|
| 16573 |
manish.sha |
471 |
description = Field(Text)
|
|
|
472 |
shortDescription = Field(Text)
|
| 16585 |
manish.sha |
473 |
finalShortDescription = Field(Text)
|
| 16573 |
manish.sha |
474 |
longDescription = Field(Text)
|
| 16585 |
manish.sha |
475 |
finalLongDescription = Field(Text)
|
| 16479 |
kshitij.so |
476 |
link = Field(String(256))
|
|
|
477 |
offer_active = Field(Boolean)
|
| 16480 |
kshitij.so |
478 |
priority = Field(String(256))
|
| 16479 |
kshitij.so |
479 |
show = Field(Boolean)
|
| 16536 |
kshitij.so |
480 |
offerCategory = Field(String(256))
|
|
|
481 |
promoImage = Field(String(256))
|
| 16812 |
manish.sha |
482 |
ratings = Field(Float)
|
| 16573 |
manish.sha |
483 |
downloads = Field(String(100))
|
| 16595 |
manish.sha |
484 |
appmaster_id = Field(Integer)
|
| 16692 |
manish.sha |
485 |
offerCondition = Field(Text)
|
| 16733 |
manish.sha |
486 |
location = Field(String(1024))
|
| 16479 |
kshitij.so |
487 |
using_options(shortnames=True)
|
|
|
488 |
using_table_options(mysql_engine="InnoDB")
|
|
|
489 |
|
|
|
490 |
class app_affiliates(Entity):
|
|
|
491 |
id = Field(Integer, primary_key=True)
|
|
|
492 |
name = Field(String(256))
|
|
|
493 |
isActive = Field(Boolean)
|
|
|
494 |
using_options(shortnames=True)
|
|
|
495 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
496 |
|
| 16595 |
manish.sha |
497 |
class appmasters(Entity):
|
|
|
498 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
499 |
app_name = Field(String(256))
|
|
|
500 |
package_name = Field(String(256))
|
| 16597 |
manish.sha |
501 |
os_name = Field(Enum('ANDROID', 'IOS', 'WINDOWS'))
|
| 16595 |
manish.sha |
502 |
shortDescription = Field(Text)
|
|
|
503 |
longDescription = Field(Text)
|
|
|
504 |
customerOneLiner = Field(String(512))
|
|
|
505 |
retailerOneLiner = Field(String(512))
|
| 16727 |
manish.sha |
506 |
showApp = Field(Boolean)
|
| 16941 |
manish.sha |
507 |
rank = Field(Integer)
|
| 16595 |
manish.sha |
508 |
using_options(shortnames=True)
|
|
|
509 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
510 |
|
| 16631 |
manish.sha |
511 |
class approved_app_transactions(Entity):
|
|
|
512 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
513 |
app_id = Field(Integer)
|
|
|
514 |
retailer_id = Field(Integer)
|
|
|
515 |
transaction_id = Field(String(100))
|
|
|
516 |
transaction_time = Field(DateTime)
|
|
|
517 |
redirect_url = Field(String(256))
|
|
|
518 |
payout_status = Field(Integer)
|
|
|
519 |
payout_description = Field(String(100))
|
|
|
520 |
cashback_status = Field(Integer)
|
|
|
521 |
cash_back_description = Field(String(100))
|
|
|
522 |
payout_amount = Field(Integer)
|
|
|
523 |
payout_time = Field(DateTime)
|
|
|
524 |
offer_price = Field(Integer)
|
|
|
525 |
overridenCashBack = Field(Integer)
|
|
|
526 |
isCashBackOverriden = Field(Boolean)
|
|
|
527 |
user_payout = Field(Integer)
|
|
|
528 |
cashBackConsidered = Field(Boolean)
|
| 16913 |
manish.sha |
529 |
final_user_payout = Field(Integer)
|
| 16631 |
manish.sha |
530 |
using_options(shortnames=True)
|
|
|
531 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
532 |
|
| 16631 |
manish.sha |
533 |
class user_app_cashbacks(Entity):
|
|
|
534 |
user_id = Field(Integer)
|
|
|
535 |
status = Field(String(30))
|
|
|
536 |
amount = Field(Integer)
|
|
|
537 |
fortnightOfYear = Field(Integer)
|
|
|
538 |
yearVal = Field(Integer)
|
| 16696 |
manish.sha |
539 |
batchCreditId = Field(Integer)
|
| 16861 |
manish.sha |
540 |
creditedDate = Field(Date)
|
| 16631 |
manish.sha |
541 |
using_options(shortnames=True)
|
|
|
542 |
using_table_options(mysql_engine="InnoDB")
|
|
|
543 |
|
|
|
544 |
class user_app_installs(Entity):
|
|
|
545 |
user_id = Field(Integer)
|
|
|
546 |
fortnightOfYear = Field(Integer)
|
|
|
547 |
transaction_date = Field(Date)
|
|
|
548 |
app_id = Field(Integer)
|
|
|
549 |
app_name = Field(String(256))
|
|
|
550 |
installCount = Field(Integer)
|
|
|
551 |
payoutAmount = Field(Integer)
|
|
|
552 |
using_options(shortnames=True)
|
|
|
553 |
using_table_options(mysql_engine="InnoDB")
|
|
|
554 |
|
|
|
555 |
class total_app_installs(Entity):
|
|
|
556 |
app_id = Field(Integer)
|
|
|
557 |
app_name = Field(String(256))
|
|
|
558 |
date = Field(Date)
|
|
|
559 |
totalPayoutAmount = Field(Integer)
|
|
|
560 |
totalOfferAmount = Field(Integer)
|
|
|
561 |
using_options(shortnames=True)
|
|
|
562 |
using_table_options(mysql_engine="InnoDB")
|
| 16769 |
manas |
563 |
|
|
|
564 |
class app_transactions(Entity):
|
| 16793 |
manas |
565 |
transaction_id=Field(String(256))
|
| 16769 |
manas |
566 |
retailer_id = Field(Integer)
|
|
|
567 |
app_id = Field(Integer)
|
|
|
568 |
app_name = Field(String(256))
|
|
|
569 |
cashback_status= Field(Integer)
|
|
|
570 |
redirect_url = Field(String(256))
|
|
|
571 |
cash_back_description = Field(String(256))
|
|
|
572 |
payout_status = Field(Integer)
|
|
|
573 |
overridenCashBack = Field(Integer)
|
|
|
574 |
isCashBackOverriden=Field(Boolean)
|
|
|
575 |
transaction_time = Field(DateTime)
|
|
|
576 |
payout_time = Field(DateTime)
|
|
|
577 |
offer_price=Field(Float, default=0.0, server_default="0.0")
|
|
|
578 |
payout_amount=Field(Float, default=0.0, server_default="0.0")
|
|
|
579 |
user_payout = Field(Float, default=0.0, server_default="0.0")
|
|
|
580 |
payout_description = Field(String(256))
|
| 16913 |
manish.sha |
581 |
final_user_payout = Field(Integer)
|
| 16769 |
manas |
582 |
using_options(shortnames=True)
|
|
|
583 |
using_table_options(mysql_engine="InnoDB")
|
| 17280 |
manish.sha |
584 |
|
|
|
585 |
class notification_campaigns(Entity):
|
|
|
586 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
587 |
name = Field(String(32))
|
|
|
588 |
title = Field(String(32))
|
|
|
589 |
message = Field(String(512))
|
|
|
590 |
type = Field(Enum('url','native','update'))
|
|
|
591 |
url = Field(String(512))
|
|
|
592 |
sql = Field(String(512))
|
|
|
593 |
expiresat = Field(DateTime)
|
|
|
594 |
status = Field(Enum('active','inactive'))
|
|
|
595 |
created = Field(DateTime)
|
| 17349 |
manish.sha |
596 |
sendsms = Field(Boolean)
|
|
|
597 |
messagetext = Field(String(512))
|
|
|
598 |
smsprocessed = Field(Boolean)
|
| 17280 |
manish.sha |
599 |
using_options(shortnames=True)
|
|
|
600 |
using_table_options(mysql_engine="InnoDB")
|
| 18258 |
manas |
601 |
|
|
|
602 |
class mobileappsettings(Entity):
|
|
|
603 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
604 |
setting = Field(String(64))
|
|
|
605 |
value = Field(String(512))
|
|
|
606 |
created = Field(DateTime)
|
|
|
607 |
modified= Field(DateTime)
|
|
|
608 |
using_options(shortnames=True)
|
|
|
609 |
using_table_options(mysql_engine="InnoDB")
|
|
|
610 |
|
|
|
611 |
class UserMasterData(Entity):
|
|
|
612 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
613 |
user_id = Field(Integer(unsigned=True))
|
|
|
614 |
agent_id=Field(Integer(unsigned=True))
|
|
|
615 |
project_id=Field(Integer(unsigned=True))
|
|
|
616 |
contact1 = Field(String(10))
|
|
|
617 |
pincode_servicable = Field(Boolean)
|
|
|
618 |
status = Field(String(20))
|
|
|
619 |
retry_count = Field(Integer(3))
|
|
|
620 |
invalid_retry_count = Field(Integer(3))
|
|
|
621 |
next_call_time = Field(DateTime)
|
|
|
622 |
counter = Field(Integer(unsigned=True))
|
|
|
623 |
disposition = Field(String(32))
|
|
|
624 |
created = Field(DateTime, default=func.now())
|
|
|
625 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
626 |
using_options(shortnames=True)
|
|
|
627 |
using_table_options(mysql_engine="InnoDB")
|
|
|
628 |
|
| 14826 |
kshitij.so |
629 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 14039 |
kshitij.so |
630 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
|
|
631 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
|
|
632 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
633 |
metadata.bind = cengine
|
| 14826 |
kshitij.so |
634 |
metadata.bind.echo = echo
|
| 14039 |
kshitij.so |
635 |
setup_all(True)
|
|
|
636 |
|
|
|
637 |
if __name__=="__main__":
|
| 18258 |
manas |
638 |
initialize()
|