| 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))
|
|
|
112 |
using_options(shortnames=True)
|
|
|
113 |
using_table_options(mysql_engine="InnoDB")
|
|
|
114 |
|
| 15011 |
amit.gupta |
115 |
class Postoffices(Entity):
|
|
|
116 |
id = Field(Integer(10, unsigned=True), primary_key=True)
|
|
|
117 |
name = Field(String(128))
|
|
|
118 |
pincode = Field(Integer(6, unsigned=True))
|
|
|
119 |
deliverystatus = Field(Boolean)
|
|
|
120 |
divisionname = Field(String(128))
|
|
|
121 |
regionname = Field(String(128))
|
|
|
122 |
taluk = Field(String(128))
|
|
|
123 |
district = Field(String(128))
|
|
|
124 |
state = Field(String(128))
|
|
|
125 |
using_options(shortnames=True)
|
|
|
126 |
using_table_options(mysql_engine="InnoDB")
|
|
|
127 |
|
| 15048 |
kshitij.so |
128 |
class Orders(Entity):
|
|
|
129 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
130 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
131 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
132 |
order_url = Field(String(256))
|
|
|
133 |
status = Field(String(32))
|
|
|
134 |
created = Field(DateTime)
|
|
|
135 |
modified = Field(DateTime)
|
|
|
136 |
using_options(shortnames=True)
|
|
|
137 |
using_table_options(mysql_engine="InnoDB")
|
|
|
138 |
|
| 15532 |
amit.gupta |
139 |
class FlipkartOrders(Entity):
|
|
|
140 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
141 |
user_id = Field(Integer(unsigned=True))
|
|
|
142 |
email = Field(String(128))
|
|
|
143 |
subtagId= Field(String(32))
|
|
|
144 |
identifier = Field(String(32))
|
|
|
145 |
catalogId = Field(Integer)
|
|
|
146 |
title = Field(String(128))
|
|
|
147 |
brand = Field(String(64))
|
|
|
148 |
model = Field(String(64))
|
|
|
149 |
status = Field(String(16))
|
|
|
150 |
price = Field(Float)
|
|
|
151 |
category = Field(String(16))
|
|
|
152 |
quantity = Field(SmallInteger)
|
|
|
153 |
created = Field(DateTime)
|
|
|
154 |
modified = Field(DateTime)
|
|
|
155 |
using_options(shortnames=True)
|
|
|
156 |
using_table_options(mysql_engine="InnoDB")
|
|
|
157 |
|
| 15234 |
amit.gupta |
158 |
class OrdersRaw(Entity):
|
|
|
159 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
160 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
161 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
162 |
order_url = Field(String(256))
|
| 15566 |
amit.gupta |
163 |
sub_tag = Field(String(32))
|
| 15554 |
amit.gupta |
164 |
rawhtml = Field(LONGTEXT)
|
| 15234 |
amit.gupta |
165 |
status = Field(String(32))
|
|
|
166 |
created = Field(DateTime)
|
|
|
167 |
modified = Field(DateTime)
|
| 15236 |
amit.gupta |
168 |
using_options(tablename="orders")
|
|
|
169 |
using_table_options(useexisting=True,mysql_engine="InnoDB")
|
| 15234 |
amit.gupta |
170 |
|
| 15081 |
amit.gupta |
171 |
class Retailers(Entity):
|
|
|
172 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15083 |
amit.gupta |
173 |
identifier = Field(String(128))
|
| 15081 |
amit.gupta |
174 |
title = Field(String(256))
|
|
|
175 |
address = Field(String(512))
|
| 15254 |
amit.gupta |
176 |
address_new = Field(String(512))
|
| 15081 |
amit.gupta |
177 |
agent_id=Field(Integer(unsigned=True))
|
|
|
178 |
contact1 = Field(String(10))
|
|
|
179 |
contact2 = Field(String(10))
|
|
|
180 |
pin = Field(String(6))
|
| 15254 |
amit.gupta |
181 |
cod_limit = Field(Integer(10))
|
| 15675 |
amit.gupta |
182 |
city = Field(String(64))
|
| 15081 |
amit.gupta |
183 |
state = Field(String(48))
|
|
|
184 |
status = Field(String(20))
|
| 15083 |
amit.gupta |
185 |
is_elavated = Field(Boolean)
|
| 15086 |
amit.gupta |
186 |
retry_count = Field(Integer(3))
|
|
|
187 |
invalid_retry_count = Field(Integer(3))
|
| 15081 |
amit.gupta |
188 |
call_priority = Field(Enum('user_initiated', 'system_initiated'))
|
|
|
189 |
next_call_time = Field(DateTime)
|
| 15086 |
amit.gupta |
190 |
is_std = Field(Boolean)
|
|
|
191 |
is_or = Field(Boolean)
|
| 16169 |
amit.gupta |
192 |
created = Field(DateTime, default=func.now())
|
| 15110 |
amit.gupta |
193 |
disposition = Field(String(32))
|
| 15099 |
amit.gupta |
194 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 15081 |
amit.gupta |
195 |
using_options(shortnames=True)
|
|
|
196 |
using_table_options(mysql_engine="InnoDB")
|
| 15331 |
amit.gupta |
197 |
|
| 15680 |
amit.gupta |
198 |
class RetailerAddresses(Entity):
|
| 15676 |
amit.gupta |
199 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
200 |
retailer_id = Field(Integer(unsigned=True))
|
| 15681 |
amit.gupta |
201 |
title = Field(String(128))
|
| 15676 |
amit.gupta |
202 |
agent_id=Field(Integer(unsigned=True))
|
|
|
203 |
address = Field(String(512))
|
|
|
204 |
city = Field(String(64))
|
|
|
205 |
state = Field(String(48))
|
|
|
206 |
pin = Field(String(6))
|
| 15683 |
amit.gupta |
207 |
created = Field(DateTime,default=func.now())
|
| 15676 |
amit.gupta |
208 |
using_options(shortnames=True)
|
|
|
209 |
using_table_options(mysql_engine="InnoDB")
|
| 15675 |
amit.gupta |
210 |
class DailySourcewiseOrderInfo(Entity):
|
|
|
211 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
212 |
source = Field(Integer(2))
|
|
|
213 |
order_count = Field(Integer(4))
|
|
|
214 |
quantity_count = Field(Integer(4))
|
|
|
215 |
sale_amount = Field(Integer(10))
|
|
|
216 |
created = Field(DateTime)
|
|
|
217 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
218 |
using_options(shortnames=True)
|
|
|
219 |
using_table_options(mysql_engine="InnoDB")
|
|
|
220 |
|
| 15331 |
amit.gupta |
221 |
class AlreadyCalledNumbers(Entity):
|
|
|
222 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
223 |
mobile_number = Field(String(10), unique=True)
|
| 15352 |
amit.gupta |
224 |
using_options(shortnames=True)
|
|
|
225 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
226 |
|
| 15710 |
amit.gupta |
227 |
class Pincodeavailability(Entity):
|
|
|
228 |
code = Field(String(6), unique=True)
|
|
|
229 |
amount = Field(Integer(11))
|
|
|
230 |
using_options(shortnames=True)
|
|
|
231 |
using_table_options(mysql_engine="InnoDB")
|
|
|
232 |
|
| 15254 |
amit.gupta |
233 |
class RetailerContacts(Entity):
|
|
|
234 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
235 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
236 |
agent_id = Field(Integer(unsigned=True))
|
|
|
237 |
mobile_number = Field(String(10))
|
| 15260 |
amit.gupta |
238 |
contact_type = Field(Enum('sms', 'called', 'ringing'))
|
| 15254 |
amit.gupta |
239 |
call_type = Field(String(10))
|
|
|
240 |
created = Field(DateTime,default=func.now())
|
|
|
241 |
using_options(shortnames=True)
|
|
|
242 |
using_table_options(mysql_engine="InnoDB")
|
|
|
243 |
|
|
|
244 |
|
| 15096 |
amit.gupta |
245 |
class CallHistory(Entity):
|
|
|
246 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
247 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
248 |
agent_id = Field(Integer(unsigned=True))
|
|
|
249 |
mobile_number = Field(String(10))
|
| 15113 |
amit.gupta |
250 |
call_type = Field(String(10))
|
| 15096 |
amit.gupta |
251 |
sms_verified = Field(Boolean)
|
|
|
252 |
call_time = Field(DateTime)
|
|
|
253 |
duration_sec = Field(Integer)
|
| 15234 |
amit.gupta |
254 |
last_fetch_time = Field(DateTime)
|
| 15377 |
amit.gupta |
255 |
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 |
256 |
disposition_description = Field(String(192))
|
| 15201 |
manas |
257 |
disposition_comments = Field(String(192))
|
| 15096 |
amit.gupta |
258 |
created = Field(DateTime,default=func.now())
|
| 15110 |
amit.gupta |
259 |
using_options(shortnames=True)
|
|
|
260 |
using_table_options(mysql_engine="InnoDB")
|
| 15096 |
amit.gupta |
261 |
|
| 15081 |
amit.gupta |
262 |
class RetryConfig(Entity):
|
| 15359 |
amit.gupta |
263 |
call_type = Field(Enum('fresh', 'followup', 'onboarding'))
|
| 15096 |
amit.gupta |
264 |
disposition_type = Field(Enum('ringing_no_answer', 'not_reachable'))
|
| 15081 |
amit.gupta |
265 |
retry_count = Field(Integer(unsigned=True))
|
| 15110 |
amit.gupta |
266 |
minutes_ahead = Field(Integer(unsigned=True))
|
| 15081 |
amit.gupta |
267 |
using_options(shortnames=True)
|
|
|
268 |
using_table_options(mysql_engine="InnoDB")
|
| 15133 |
amit.gupta |
269 |
|
|
|
270 |
class RetailerLinks(Entity):
|
| 15234 |
amit.gupta |
271 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15254 |
amit.gupta |
272 |
retailer_id = Field(Integer(unsigned=True), unique=True)
|
| 15138 |
amit.gupta |
273 |
agent_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
274 |
code = Field(String(10), unique=True)
|
| 16480 |
kshitij.so |
275 |
mapped_with = Field(String(256))
|
| 15133 |
amit.gupta |
276 |
activated = Field(DateTime,onupdate=func.now())
|
| 15255 |
amit.gupta |
277 |
user_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
278 |
created = Field(DateTime,default=func.now())
|
|
|
279 |
using_options(shortnames=True)
|
|
|
280 |
using_table_options(mysql_engine="InnoDB")
|
| 15135 |
amit.gupta |
281 |
|
|
|
282 |
class Activation_Codes(Entity):
|
|
|
283 |
code = Field(String(10))
|
| 15138 |
amit.gupta |
284 |
created = Field(DateTime, default=func.now())
|
| 15144 |
amit.gupta |
285 |
using_options(shortnames=True)
|
|
|
286 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
287 |
|
| 15189 |
manas |
288 |
class Agents(Entity):
|
|
|
289 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
290 |
name = Field(String(64))
|
|
|
291 |
email = Field(String(100))
|
|
|
292 |
password = Field(String(64))
|
|
|
293 |
type = Field(Enum('crm','fos'))
|
|
|
294 |
last_login = Field(DateTime)
|
| 15533 |
amit.gupta |
295 |
login_type = Field(String(10))
|
| 15189 |
manas |
296 |
created = Field(DateTime, default=func.now())
|
|
|
297 |
using_options(shortnames=True)
|
|
|
298 |
using_table_options(mysql_engine="InnoDB")
|
|
|
299 |
|
|
|
300 |
class Agent_Roles(Entity):
|
|
|
301 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
302 |
agent_id = Field(Integer(unsigned=True))
|
|
|
303 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
304 |
created = Field(DateTime, default=func.now())
|
|
|
305 |
using_options(shortnames=True)
|
|
|
306 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
307 |
|
| 15189 |
manas |
308 |
class AgentLoginTimings(Entity):
|
|
|
309 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
310 |
agent_id = Field(Integer(unsigned=True))
|
|
|
311 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
312 |
loginTime = Field(DateTime)
|
|
|
313 |
logoutTime = Field(DateTime)
|
|
|
314 |
created = Field(DateTime, default=func.now())
|
|
|
315 |
using_options(shortnames=True)
|
|
|
316 |
using_table_options(mysql_engine="InnoDB")
|
| 15424 |
amit.gupta |
317 |
|
|
|
318 |
class Clicks(Entity):
|
|
|
319 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
320 |
user_id = Field(Integer(unsigned=True))
|
|
|
321 |
tag = Field(String(20))
|
|
|
322 |
created = Field(DateTime, default=func.now())
|
|
|
323 |
using_options(shortnames=True)
|
|
|
324 |
using_table_options(mysql_engine="InnoDB")
|
| 15189 |
manas |
325 |
|
| 15234 |
amit.gupta |
326 |
class FetchDataHistory(Entity):
|
|
|
327 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
328 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
329 |
agent_id = Field(Integer(unsigned=True))
|
|
|
330 |
call_type = Field(String(10))
|
|
|
331 |
last_action = Field(Enum('login','disposition'))
|
|
|
332 |
last_action_time = Field(DateTime)
|
|
|
333 |
created = Field(DateTime,default=func.now())
|
|
|
334 |
using_options(shortnames=True)
|
|
|
335 |
using_table_options(mysql_engine="InnoDB")
|
|
|
336 |
|
| 15690 |
manish.sha |
337 |
class Pushnotifications(Entity):
|
|
|
338 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
339 |
user_id = Field(Integer(unsigned=True))
|
|
|
340 |
notification_campaign_id = Field(Integer(unsigned=True))
|
|
|
341 |
type = Field(String(16))
|
|
|
342 |
status = Field(Boolean)
|
|
|
343 |
message = Field(String(64))
|
|
|
344 |
response_time = Field(DateTime)
|
|
|
345 |
created = Field(DateTime)
|
|
|
346 |
using_options(shortnames=True)
|
|
|
347 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
348 |
|
| 15791 |
manish.sha |
349 |
|
|
|
350 |
class MerchantSubOrders(Entity):
|
|
|
351 |
orderId = Field(Integer, primary_key= True, autoincrement=False)
|
|
|
352 |
merchantOrderId = Field(String(30), primary_key=True)
|
|
|
353 |
merchantSubOrderId = Field(String(50), primary_key=True)
|
|
|
354 |
storeId = Field(Integer)
|
|
|
355 |
userId = Field(Integer)
|
|
|
356 |
productCode = Field(String(50))
|
|
|
357 |
brand = Field(String(30))
|
|
|
358 |
productName = Field(String(50))
|
| 16305 |
manas |
359 |
categoryId = Field(Integer)
|
| 15791 |
manish.sha |
360 |
amountPaid = Field(Float)
|
|
|
361 |
quantity = Field(Integer)
|
|
|
362 |
unitPrice = Field(Float)
|
|
|
363 |
status = Field(String(30))
|
|
|
364 |
createdTime = Field(DateTime)
|
|
|
365 |
using_options(shortnames=True)
|
|
|
366 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
367 |
|
| 16374 |
amit.gupta |
368 |
class paytm_coupons(Entity):
|
|
|
369 |
id = Field(Integer, primary_key= True)
|
|
|
370 |
coupon = Field(String(64))
|
| 16412 |
amit.gupta |
371 |
offer_text = Field(String(256))
|
| 16374 |
amit.gupta |
372 |
min_cart_amount = Field(Integer)
|
|
|
373 |
cart_item_limit = Field(Integer)
|
|
|
374 |
max_cashback_amount = Field(Integer)
|
|
|
375 |
usage_limit = Field(Integer)
|
|
|
376 |
cod_available = Field(Integer)
|
|
|
377 |
valid_upto = Field(DateTime)
|
|
|
378 |
cashback_type = Enum(CASHBACK_AMOUNT, CASHBACK_PERCENTAGE)
|
| 16412 |
amit.gupta |
379 |
created = Field(DateTime,default=func.now())
|
| 16374 |
amit.gupta |
380 |
using_options(shortnames=True)
|
|
|
381 |
using_table_options(mysql_engine="InnoDB")
|
|
|
382 |
|
|
|
383 |
class paytm_coupon_usages(Entity):
|
|
|
384 |
id = Field(Integer, primary_key= True)
|
|
|
385 |
user_id = Field(Integer)
|
|
|
386 |
order_id = Field(Integer)
|
|
|
387 |
coupon = Field(String(64))
|
|
|
388 |
cashback = Field(Integer)
|
|
|
389 |
created = Field(DateTime,default=func.now())
|
|
|
390 |
using_options(shortnames=True)
|
|
|
391 |
using_table_options(mysql_engine="InnoDB")
|
| 16928 |
amit.gupta |
392 |
|
|
|
393 |
|
|
|
394 |
class paytm_coupon_non_usages(Entity):
|
|
|
395 |
id = Field(Integer, primary_key= True)
|
|
|
396 |
user_id = Field(Integer)
|
|
|
397 |
order_id = Field(Integer)
|
|
|
398 |
created = Field(DateTime,default=func.now())
|
|
|
399 |
using_options(shortnames=True)
|
|
|
400 |
using_table_options(mysql_engine="InnoDB")
|
|
|
401 |
|
| 16374 |
amit.gupta |
402 |
|
|
|
403 |
|
| 15816 |
amit.gupta |
404 |
class NotificationViews(Entity):
|
|
|
405 |
id = Field(Integer, primary_key= True)
|
|
|
406 |
user_id = Field(Integer(unsigned=True))
|
|
|
407 |
notification_rule_id = Field(Integer(unsigned=True))
|
|
|
408 |
created = Field(DateTime)
|
|
|
409 |
using_options(shortnames=True)
|
|
|
410 |
using_table_options(mysql_engine="InnoDB")
|
|
|
411 |
|
|
|
412 |
class MissingAmazonOrderUsers(Entity):
|
|
|
413 |
user_id = Field(Integer, primary_key= True)
|
|
|
414 |
using_options(shortnames=True)
|
|
|
415 |
using_table_options(mysql_engine="InnoDB")
|
|
|
416 |
class PendingToTrackAmazonOrderUsers(Entity):
|
|
|
417 |
user_id = Field(Integer, primary_key= True)
|
|
|
418 |
using_options(shortnames=True)
|
|
|
419 |
using_table_options(mysql_engine="InnoDB")
|
|
|
420 |
|
|
|
421 |
|
| 15917 |
amit.gupta |
422 |
class User_addresses(Entity):
|
|
|
423 |
id = Field(Integer, primary_key= True)
|
|
|
424 |
user_id = Field(Integer(unsigned=True))
|
|
|
425 |
store_name = Field(String(128))
|
|
|
426 |
address = Field(String(256))
|
|
|
427 |
city = Field(String(64))
|
|
|
428 |
pincode = Field(String(6))
|
|
|
429 |
state = Field(String(48))
|
|
|
430 |
using_options(shortnames=True)
|
|
|
431 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
432 |
|
| 15917 |
amit.gupta |
433 |
class All_user_addresses(Entity):
|
|
|
434 |
id = Field(Integer, primary_key= True)
|
|
|
435 |
user_id = Field(Integer(unsigned=True))
|
|
|
436 |
address = Field(String(256))
|
|
|
437 |
store_name = Field(String(128))
|
|
|
438 |
city = Field(String(64))
|
|
|
439 |
pincode = Field(String(6))
|
|
|
440 |
state = Field(String(48))
|
|
|
441 |
source = Field(Enum('retailer_crm_edited', 'retailer_master', 'fos_crm', 'user_profile'))
|
|
|
442 |
created = Field(DateTime,default=func.now())
|
|
|
443 |
using_options(shortnames=True)
|
|
|
444 |
using_table_options(mysql_engine="InnoDB")
|
| 16372 |
manas |
445 |
|
|
|
446 |
class user_filters(Entity):
|
|
|
447 |
id = Field(Integer, primary_key= True)
|
|
|
448 |
user_id = Field(Integer(unsigned=True))
|
|
|
449 |
type=Field(Enum('clear','brand'))
|
|
|
450 |
filters = Field(String(256))
|
| 16482 |
manas |
451 |
created = Field(DateTime,default=func.now())
|
| 16372 |
manas |
452 |
using_options(shortnames=True)
|
|
|
453 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
454 |
|
|
|
455 |
class app_offers(Entity):
|
|
|
456 |
id = Field(Integer, primary_key=True)
|
|
|
457 |
affiliate_id = Field(Integer)
|
|
|
458 |
affiliate_offer_id = Field(String(256))
|
|
|
459 |
offer_price = Field(Float)
|
| 16536 |
kshitij.so |
460 |
user_payout = Field(Float)
|
|
|
461 |
override_payout = Field(Boolean)
|
|
|
462 |
overriden_payout = Field(Float)
|
| 16479 |
kshitij.so |
463 |
app_name = Field(String(256))
|
| 16536 |
kshitij.so |
464 |
package_name = Field(String(256))
|
| 16479 |
kshitij.so |
465 |
image_url = Field(String(256))
|
| 16573 |
manish.sha |
466 |
description = Field(Text)
|
|
|
467 |
shortDescription = Field(Text)
|
| 16585 |
manish.sha |
468 |
finalShortDescription = Field(Text)
|
| 16573 |
manish.sha |
469 |
longDescription = Field(Text)
|
| 16585 |
manish.sha |
470 |
finalLongDescription = Field(Text)
|
| 16479 |
kshitij.so |
471 |
link = Field(String(256))
|
|
|
472 |
offer_active = Field(Boolean)
|
| 16480 |
kshitij.so |
473 |
priority = Field(String(256))
|
| 16479 |
kshitij.so |
474 |
show = Field(Boolean)
|
| 16536 |
kshitij.so |
475 |
offerCategory = Field(String(256))
|
|
|
476 |
promoImage = Field(String(256))
|
| 16812 |
manish.sha |
477 |
ratings = Field(Float)
|
| 16573 |
manish.sha |
478 |
downloads = Field(String(100))
|
| 16595 |
manish.sha |
479 |
appmaster_id = Field(Integer)
|
| 16692 |
manish.sha |
480 |
offerCondition = Field(Text)
|
| 16733 |
manish.sha |
481 |
location = Field(String(1024))
|
| 16479 |
kshitij.so |
482 |
using_options(shortnames=True)
|
|
|
483 |
using_table_options(mysql_engine="InnoDB")
|
|
|
484 |
|
|
|
485 |
class app_affiliates(Entity):
|
|
|
486 |
id = Field(Integer, primary_key=True)
|
|
|
487 |
name = Field(String(256))
|
|
|
488 |
isActive = Field(Boolean)
|
|
|
489 |
using_options(shortnames=True)
|
|
|
490 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
491 |
|
| 16595 |
manish.sha |
492 |
class appmasters(Entity):
|
|
|
493 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
494 |
app_name = Field(String(256))
|
|
|
495 |
package_name = Field(String(256))
|
| 16597 |
manish.sha |
496 |
os_name = Field(Enum('ANDROID', 'IOS', 'WINDOWS'))
|
| 16595 |
manish.sha |
497 |
shortDescription = Field(Text)
|
|
|
498 |
longDescription = Field(Text)
|
|
|
499 |
customerOneLiner = Field(String(512))
|
|
|
500 |
retailerOneLiner = Field(String(512))
|
| 16727 |
manish.sha |
501 |
showApp = Field(Boolean)
|
| 16941 |
manish.sha |
502 |
rank = Field(Integer)
|
| 16595 |
manish.sha |
503 |
using_options(shortnames=True)
|
|
|
504 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
505 |
|
| 16631 |
manish.sha |
506 |
class approved_app_transactions(Entity):
|
|
|
507 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
508 |
app_id = Field(Integer)
|
|
|
509 |
retailer_id = Field(Integer)
|
|
|
510 |
transaction_id = Field(String(100))
|
|
|
511 |
transaction_time = Field(DateTime)
|
|
|
512 |
redirect_url = Field(String(256))
|
|
|
513 |
payout_status = Field(Integer)
|
|
|
514 |
payout_description = Field(String(100))
|
|
|
515 |
cashback_status = Field(Integer)
|
|
|
516 |
cash_back_description = Field(String(100))
|
|
|
517 |
payout_amount = Field(Integer)
|
|
|
518 |
payout_time = Field(DateTime)
|
|
|
519 |
offer_price = Field(Integer)
|
|
|
520 |
overridenCashBack = Field(Integer)
|
|
|
521 |
isCashBackOverriden = Field(Boolean)
|
|
|
522 |
user_payout = Field(Integer)
|
|
|
523 |
cashBackConsidered = Field(Boolean)
|
| 16913 |
manish.sha |
524 |
final_user_payout = Field(Integer)
|
| 16631 |
manish.sha |
525 |
using_options(shortnames=True)
|
|
|
526 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
527 |
|
| 16631 |
manish.sha |
528 |
class user_app_cashbacks(Entity):
|
|
|
529 |
user_id = Field(Integer)
|
|
|
530 |
status = Field(String(30))
|
|
|
531 |
amount = Field(Integer)
|
|
|
532 |
fortnightOfYear = Field(Integer)
|
|
|
533 |
yearVal = Field(Integer)
|
| 16696 |
manish.sha |
534 |
batchCreditId = Field(Integer)
|
| 16861 |
manish.sha |
535 |
creditedDate = Field(Date)
|
| 16631 |
manish.sha |
536 |
using_options(shortnames=True)
|
|
|
537 |
using_table_options(mysql_engine="InnoDB")
|
|
|
538 |
|
|
|
539 |
class user_app_installs(Entity):
|
|
|
540 |
user_id = Field(Integer)
|
|
|
541 |
fortnightOfYear = Field(Integer)
|
|
|
542 |
transaction_date = Field(Date)
|
|
|
543 |
app_id = Field(Integer)
|
|
|
544 |
app_name = Field(String(256))
|
|
|
545 |
installCount = Field(Integer)
|
|
|
546 |
payoutAmount = Field(Integer)
|
|
|
547 |
using_options(shortnames=True)
|
|
|
548 |
using_table_options(mysql_engine="InnoDB")
|
|
|
549 |
|
|
|
550 |
class total_app_installs(Entity):
|
|
|
551 |
app_id = Field(Integer)
|
|
|
552 |
app_name = Field(String(256))
|
|
|
553 |
date = Field(Date)
|
|
|
554 |
totalPayoutAmount = Field(Integer)
|
|
|
555 |
totalOfferAmount = Field(Integer)
|
|
|
556 |
using_options(shortnames=True)
|
|
|
557 |
using_table_options(mysql_engine="InnoDB")
|
| 16769 |
manas |
558 |
|
|
|
559 |
class app_transactions(Entity):
|
| 16793 |
manas |
560 |
transaction_id=Field(String(256))
|
| 16769 |
manas |
561 |
retailer_id = Field(Integer)
|
|
|
562 |
app_id = Field(Integer)
|
|
|
563 |
app_name = Field(String(256))
|
|
|
564 |
cashback_status= Field(Integer)
|
|
|
565 |
redirect_url = Field(String(256))
|
|
|
566 |
cash_back_description = Field(String(256))
|
|
|
567 |
payout_status = Field(Integer)
|
|
|
568 |
overridenCashBack = Field(Integer)
|
|
|
569 |
isCashBackOverriden=Field(Boolean)
|
|
|
570 |
transaction_time = Field(DateTime)
|
|
|
571 |
payout_time = Field(DateTime)
|
|
|
572 |
offer_price=Field(Float, default=0.0, server_default="0.0")
|
|
|
573 |
payout_amount=Field(Float, default=0.0, server_default="0.0")
|
|
|
574 |
user_payout = Field(Float, default=0.0, server_default="0.0")
|
|
|
575 |
payout_description = Field(String(256))
|
| 16913 |
manish.sha |
576 |
final_user_payout = Field(Integer)
|
| 16769 |
manas |
577 |
using_options(shortnames=True)
|
|
|
578 |
using_table_options(mysql_engine="InnoDB")
|
|
|
579 |
|
| 14826 |
kshitij.so |
580 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 14039 |
kshitij.so |
581 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
|
|
582 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
|
|
583 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
584 |
metadata.bind = cengine
|
| 14826 |
kshitij.so |
585 |
metadata.bind.echo = echo
|
| 14039 |
kshitij.so |
586 |
setup_all(True)
|
|
|
587 |
|
|
|
588 |
if __name__=="__main__":
|
|
|
589 |
initialize()
|
| 15011 |
amit.gupta |
590 |
|
|
|
591 |
|
|
|
592 |
|