| 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, \
|
|
|
8 |
Text
|
| 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 |
|
| 15011 |
amit.gupta |
104 |
class Postoffices(Entity):
|
|
|
105 |
id = Field(Integer(10, unsigned=True), primary_key=True)
|
|
|
106 |
name = Field(String(128))
|
|
|
107 |
pincode = Field(Integer(6, unsigned=True))
|
|
|
108 |
deliverystatus = Field(Boolean)
|
|
|
109 |
divisionname = Field(String(128))
|
|
|
110 |
regionname = Field(String(128))
|
|
|
111 |
taluk = Field(String(128))
|
|
|
112 |
district = Field(String(128))
|
|
|
113 |
state = Field(String(128))
|
|
|
114 |
using_options(shortnames=True)
|
|
|
115 |
using_table_options(mysql_engine="InnoDB")
|
|
|
116 |
|
| 15048 |
kshitij.so |
117 |
class Orders(Entity):
|
|
|
118 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
119 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
120 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
121 |
order_url = Field(String(256))
|
|
|
122 |
status = Field(String(32))
|
|
|
123 |
created = Field(DateTime)
|
|
|
124 |
modified = Field(DateTime)
|
|
|
125 |
using_options(shortnames=True)
|
|
|
126 |
using_table_options(mysql_engine="InnoDB")
|
|
|
127 |
|
| 15532 |
amit.gupta |
128 |
class FlipkartOrders(Entity):
|
|
|
129 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
130 |
user_id = Field(Integer(unsigned=True))
|
|
|
131 |
email = Field(String(128))
|
|
|
132 |
subtagId= Field(String(32))
|
|
|
133 |
identifier = Field(String(32))
|
|
|
134 |
catalogId = Field(Integer)
|
|
|
135 |
title = Field(String(128))
|
|
|
136 |
brand = Field(String(64))
|
|
|
137 |
model = Field(String(64))
|
|
|
138 |
status = Field(String(16))
|
|
|
139 |
price = Field(Float)
|
|
|
140 |
category = Field(String(16))
|
|
|
141 |
quantity = Field(SmallInteger)
|
|
|
142 |
created = Field(DateTime)
|
|
|
143 |
modified = Field(DateTime)
|
|
|
144 |
using_options(shortnames=True)
|
|
|
145 |
using_table_options(mysql_engine="InnoDB")
|
|
|
146 |
|
| 15234 |
amit.gupta |
147 |
class OrdersRaw(Entity):
|
|
|
148 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
149 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
150 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
151 |
order_url = Field(String(256))
|
| 15566 |
amit.gupta |
152 |
sub_tag = Field(String(32))
|
| 15554 |
amit.gupta |
153 |
rawhtml = Field(LONGTEXT)
|
| 15234 |
amit.gupta |
154 |
status = Field(String(32))
|
|
|
155 |
created = Field(DateTime)
|
|
|
156 |
modified = Field(DateTime)
|
| 15236 |
amit.gupta |
157 |
using_options(tablename="orders")
|
|
|
158 |
using_table_options(useexisting=True,mysql_engine="InnoDB")
|
| 15234 |
amit.gupta |
159 |
|
| 15081 |
amit.gupta |
160 |
class Retailers(Entity):
|
|
|
161 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15083 |
amit.gupta |
162 |
identifier = Field(String(128))
|
| 15081 |
amit.gupta |
163 |
title = Field(String(256))
|
|
|
164 |
address = Field(String(512))
|
| 15254 |
amit.gupta |
165 |
address_new = Field(String(512))
|
| 15081 |
amit.gupta |
166 |
agent_id=Field(Integer(unsigned=True))
|
|
|
167 |
contact1 = Field(String(10))
|
|
|
168 |
contact2 = Field(String(10))
|
|
|
169 |
pin = Field(String(6))
|
| 15254 |
amit.gupta |
170 |
cod_limit = Field(Integer(10))
|
| 15675 |
amit.gupta |
171 |
city = Field(String(64))
|
| 15081 |
amit.gupta |
172 |
state = Field(String(48))
|
|
|
173 |
status = Field(String(20))
|
| 15083 |
amit.gupta |
174 |
is_elavated = Field(Boolean)
|
| 15086 |
amit.gupta |
175 |
retry_count = Field(Integer(3))
|
|
|
176 |
invalid_retry_count = Field(Integer(3))
|
| 15081 |
amit.gupta |
177 |
call_priority = Field(Enum('user_initiated', 'system_initiated'))
|
|
|
178 |
next_call_time = Field(DateTime)
|
| 15086 |
amit.gupta |
179 |
is_std = Field(Boolean)
|
|
|
180 |
is_or = Field(Boolean)
|
| 16169 |
amit.gupta |
181 |
created = Field(DateTime, default=func.now())
|
| 15110 |
amit.gupta |
182 |
disposition = Field(String(32))
|
| 15099 |
amit.gupta |
183 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 15081 |
amit.gupta |
184 |
using_options(shortnames=True)
|
|
|
185 |
using_table_options(mysql_engine="InnoDB")
|
| 15331 |
amit.gupta |
186 |
|
| 15680 |
amit.gupta |
187 |
class RetailerAddresses(Entity):
|
| 15676 |
amit.gupta |
188 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
189 |
retailer_id = Field(Integer(unsigned=True))
|
| 15681 |
amit.gupta |
190 |
title = Field(String(128))
|
| 15676 |
amit.gupta |
191 |
agent_id=Field(Integer(unsigned=True))
|
|
|
192 |
address = Field(String(512))
|
|
|
193 |
city = Field(String(64))
|
|
|
194 |
state = Field(String(48))
|
|
|
195 |
pin = Field(String(6))
|
| 15683 |
amit.gupta |
196 |
created = Field(DateTime,default=func.now())
|
| 15676 |
amit.gupta |
197 |
using_options(shortnames=True)
|
|
|
198 |
using_table_options(mysql_engine="InnoDB")
|
| 15675 |
amit.gupta |
199 |
class DailySourcewiseOrderInfo(Entity):
|
|
|
200 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
201 |
source = Field(Integer(2))
|
|
|
202 |
order_count = Field(Integer(4))
|
|
|
203 |
quantity_count = Field(Integer(4))
|
|
|
204 |
sale_amount = Field(Integer(10))
|
|
|
205 |
created = Field(DateTime)
|
|
|
206 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
207 |
using_options(shortnames=True)
|
|
|
208 |
using_table_options(mysql_engine="InnoDB")
|
|
|
209 |
|
| 15331 |
amit.gupta |
210 |
class AlreadyCalledNumbers(Entity):
|
|
|
211 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
212 |
mobile_number = Field(String(10), unique=True)
|
| 15352 |
amit.gupta |
213 |
using_options(shortnames=True)
|
|
|
214 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
215 |
|
| 15710 |
amit.gupta |
216 |
class Pincodeavailability(Entity):
|
|
|
217 |
code = Field(String(6), unique=True)
|
|
|
218 |
amount = Field(Integer(11))
|
|
|
219 |
using_options(shortnames=True)
|
|
|
220 |
using_table_options(mysql_engine="InnoDB")
|
|
|
221 |
|
| 15254 |
amit.gupta |
222 |
class RetailerContacts(Entity):
|
|
|
223 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
224 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
225 |
agent_id = Field(Integer(unsigned=True))
|
|
|
226 |
mobile_number = Field(String(10))
|
| 15260 |
amit.gupta |
227 |
contact_type = Field(Enum('sms', 'called', 'ringing'))
|
| 15254 |
amit.gupta |
228 |
call_type = Field(String(10))
|
|
|
229 |
created = Field(DateTime,default=func.now())
|
|
|
230 |
using_options(shortnames=True)
|
|
|
231 |
using_table_options(mysql_engine="InnoDB")
|
|
|
232 |
|
|
|
233 |
|
| 15096 |
amit.gupta |
234 |
class CallHistory(Entity):
|
|
|
235 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
236 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
237 |
agent_id = Field(Integer(unsigned=True))
|
|
|
238 |
mobile_number = Field(String(10))
|
| 15113 |
amit.gupta |
239 |
call_type = Field(String(10))
|
| 15096 |
amit.gupta |
240 |
sms_verified = Field(Boolean)
|
|
|
241 |
call_time = Field(DateTime)
|
|
|
242 |
duration_sec = Field(Integer)
|
| 15234 |
amit.gupta |
243 |
last_fetch_time = Field(DateTime)
|
| 15377 |
amit.gupta |
244 |
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 |
245 |
disposition_description = Field(String(192))
|
| 15201 |
manas |
246 |
disposition_comments = Field(String(192))
|
| 15096 |
amit.gupta |
247 |
created = Field(DateTime,default=func.now())
|
| 15110 |
amit.gupta |
248 |
using_options(shortnames=True)
|
|
|
249 |
using_table_options(mysql_engine="InnoDB")
|
| 15096 |
amit.gupta |
250 |
|
| 15081 |
amit.gupta |
251 |
class RetryConfig(Entity):
|
| 15359 |
amit.gupta |
252 |
call_type = Field(Enum('fresh', 'followup', 'onboarding'))
|
| 15096 |
amit.gupta |
253 |
disposition_type = Field(Enum('ringing_no_answer', 'not_reachable'))
|
| 15081 |
amit.gupta |
254 |
retry_count = Field(Integer(unsigned=True))
|
| 15110 |
amit.gupta |
255 |
minutes_ahead = Field(Integer(unsigned=True))
|
| 15081 |
amit.gupta |
256 |
using_options(shortnames=True)
|
|
|
257 |
using_table_options(mysql_engine="InnoDB")
|
| 15133 |
amit.gupta |
258 |
|
|
|
259 |
class RetailerLinks(Entity):
|
| 15234 |
amit.gupta |
260 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15254 |
amit.gupta |
261 |
retailer_id = Field(Integer(unsigned=True), unique=True)
|
| 15138 |
amit.gupta |
262 |
agent_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
263 |
code = Field(String(10), unique=True)
|
| 16480 |
kshitij.so |
264 |
mapped_with = Field(String(256))
|
| 15133 |
amit.gupta |
265 |
activated = Field(DateTime,onupdate=func.now())
|
| 15255 |
amit.gupta |
266 |
user_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
267 |
created = Field(DateTime,default=func.now())
|
|
|
268 |
using_options(shortnames=True)
|
|
|
269 |
using_table_options(mysql_engine="InnoDB")
|
| 15135 |
amit.gupta |
270 |
|
|
|
271 |
class Activation_Codes(Entity):
|
|
|
272 |
code = Field(String(10))
|
| 15138 |
amit.gupta |
273 |
created = Field(DateTime, default=func.now())
|
| 15144 |
amit.gupta |
274 |
using_options(shortnames=True)
|
|
|
275 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
276 |
|
| 15189 |
manas |
277 |
class Agents(Entity):
|
|
|
278 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
279 |
name = Field(String(64))
|
|
|
280 |
email = Field(String(100))
|
|
|
281 |
password = Field(String(64))
|
|
|
282 |
type = Field(Enum('crm','fos'))
|
|
|
283 |
last_login = Field(DateTime)
|
| 15533 |
amit.gupta |
284 |
login_type = Field(String(10))
|
| 15189 |
manas |
285 |
created = Field(DateTime, default=func.now())
|
|
|
286 |
using_options(shortnames=True)
|
|
|
287 |
using_table_options(mysql_engine="InnoDB")
|
|
|
288 |
|
|
|
289 |
class Agent_Roles(Entity):
|
|
|
290 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
291 |
agent_id = Field(Integer(unsigned=True))
|
|
|
292 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
293 |
created = Field(DateTime, default=func.now())
|
|
|
294 |
using_options(shortnames=True)
|
|
|
295 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
296 |
|
| 15189 |
manas |
297 |
class AgentLoginTimings(Entity):
|
|
|
298 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
299 |
agent_id = Field(Integer(unsigned=True))
|
|
|
300 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
301 |
loginTime = Field(DateTime)
|
|
|
302 |
logoutTime = Field(DateTime)
|
|
|
303 |
created = Field(DateTime, default=func.now())
|
|
|
304 |
using_options(shortnames=True)
|
|
|
305 |
using_table_options(mysql_engine="InnoDB")
|
| 15424 |
amit.gupta |
306 |
|
|
|
307 |
class Clicks(Entity):
|
|
|
308 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
309 |
user_id = Field(Integer(unsigned=True))
|
|
|
310 |
tag = Field(String(20))
|
|
|
311 |
created = Field(DateTime, default=func.now())
|
|
|
312 |
using_options(shortnames=True)
|
|
|
313 |
using_table_options(mysql_engine="InnoDB")
|
| 15189 |
manas |
314 |
|
| 15234 |
amit.gupta |
315 |
class FetchDataHistory(Entity):
|
|
|
316 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
317 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
318 |
agent_id = Field(Integer(unsigned=True))
|
|
|
319 |
call_type = Field(String(10))
|
|
|
320 |
last_action = Field(Enum('login','disposition'))
|
|
|
321 |
last_action_time = Field(DateTime)
|
|
|
322 |
created = Field(DateTime,default=func.now())
|
|
|
323 |
using_options(shortnames=True)
|
|
|
324 |
using_table_options(mysql_engine="InnoDB")
|
|
|
325 |
|
| 15690 |
manish.sha |
326 |
class Pushnotifications(Entity):
|
|
|
327 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
328 |
user_id = Field(Integer(unsigned=True))
|
|
|
329 |
notification_campaign_id = Field(Integer(unsigned=True))
|
|
|
330 |
type = Field(String(16))
|
|
|
331 |
status = Field(Boolean)
|
|
|
332 |
message = Field(String(64))
|
|
|
333 |
response_time = Field(DateTime)
|
|
|
334 |
created = Field(DateTime)
|
|
|
335 |
using_options(shortnames=True)
|
|
|
336 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
337 |
|
| 15791 |
manish.sha |
338 |
|
|
|
339 |
class MerchantSubOrders(Entity):
|
|
|
340 |
orderId = Field(Integer, primary_key= True, autoincrement=False)
|
|
|
341 |
merchantOrderId = Field(String(30), primary_key=True)
|
|
|
342 |
merchantSubOrderId = Field(String(50), primary_key=True)
|
|
|
343 |
storeId = Field(Integer)
|
|
|
344 |
userId = Field(Integer)
|
|
|
345 |
productCode = Field(String(50))
|
|
|
346 |
brand = Field(String(30))
|
|
|
347 |
productName = Field(String(50))
|
| 16305 |
manas |
348 |
categoryId = Field(Integer)
|
| 15791 |
manish.sha |
349 |
amountPaid = Field(Float)
|
|
|
350 |
quantity = Field(Integer)
|
|
|
351 |
unitPrice = Field(Float)
|
|
|
352 |
status = Field(String(30))
|
|
|
353 |
createdTime = Field(DateTime)
|
|
|
354 |
using_options(shortnames=True)
|
|
|
355 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
356 |
|
| 16374 |
amit.gupta |
357 |
class paytm_coupons(Entity):
|
|
|
358 |
id = Field(Integer, primary_key= True)
|
|
|
359 |
coupon = Field(String(64))
|
| 16412 |
amit.gupta |
360 |
offer_text = Field(String(256))
|
| 16374 |
amit.gupta |
361 |
min_cart_amount = Field(Integer)
|
|
|
362 |
cart_item_limit = Field(Integer)
|
|
|
363 |
max_cashback_amount = Field(Integer)
|
|
|
364 |
usage_limit = Field(Integer)
|
|
|
365 |
cod_available = Field(Integer)
|
|
|
366 |
valid_upto = Field(DateTime)
|
|
|
367 |
cashback_type = Enum(CASHBACK_AMOUNT, CASHBACK_PERCENTAGE)
|
| 16412 |
amit.gupta |
368 |
created = Field(DateTime,default=func.now())
|
| 16374 |
amit.gupta |
369 |
using_options(shortnames=True)
|
|
|
370 |
using_table_options(mysql_engine="InnoDB")
|
|
|
371 |
|
|
|
372 |
class paytm_coupon_usages(Entity):
|
|
|
373 |
id = Field(Integer, primary_key= True)
|
|
|
374 |
user_id = Field(Integer)
|
|
|
375 |
order_id = Field(Integer)
|
|
|
376 |
coupon = Field(String(64))
|
|
|
377 |
cashback = Field(Integer)
|
|
|
378 |
created = Field(DateTime,default=func.now())
|
|
|
379 |
using_options(shortnames=True)
|
|
|
380 |
using_table_options(mysql_engine="InnoDB")
|
|
|
381 |
|
|
|
382 |
|
| 15816 |
amit.gupta |
383 |
class NotificationViews(Entity):
|
|
|
384 |
id = Field(Integer, primary_key= True)
|
|
|
385 |
user_id = Field(Integer(unsigned=True))
|
|
|
386 |
notification_rule_id = Field(Integer(unsigned=True))
|
|
|
387 |
created = Field(DateTime)
|
|
|
388 |
using_options(shortnames=True)
|
|
|
389 |
using_table_options(mysql_engine="InnoDB")
|
|
|
390 |
|
|
|
391 |
class MissingAmazonOrderUsers(Entity):
|
|
|
392 |
user_id = Field(Integer, primary_key= True)
|
|
|
393 |
using_options(shortnames=True)
|
|
|
394 |
using_table_options(mysql_engine="InnoDB")
|
|
|
395 |
class PendingToTrackAmazonOrderUsers(Entity):
|
|
|
396 |
user_id = Field(Integer, primary_key= True)
|
|
|
397 |
using_options(shortnames=True)
|
|
|
398 |
using_table_options(mysql_engine="InnoDB")
|
|
|
399 |
|
|
|
400 |
|
| 15917 |
amit.gupta |
401 |
class User_addresses(Entity):
|
|
|
402 |
id = Field(Integer, primary_key= True)
|
|
|
403 |
user_id = Field(Integer(unsigned=True))
|
|
|
404 |
store_name = Field(String(128))
|
|
|
405 |
address = Field(String(256))
|
|
|
406 |
city = Field(String(64))
|
|
|
407 |
pincode = Field(String(6))
|
|
|
408 |
state = Field(String(48))
|
|
|
409 |
using_options(shortnames=True)
|
|
|
410 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
411 |
|
| 15917 |
amit.gupta |
412 |
class All_user_addresses(Entity):
|
|
|
413 |
id = Field(Integer, primary_key= True)
|
|
|
414 |
user_id = Field(Integer(unsigned=True))
|
|
|
415 |
address = Field(String(256))
|
|
|
416 |
store_name = Field(String(128))
|
|
|
417 |
city = Field(String(64))
|
|
|
418 |
pincode = Field(String(6))
|
|
|
419 |
state = Field(String(48))
|
|
|
420 |
source = Field(Enum('retailer_crm_edited', 'retailer_master', 'fos_crm', 'user_profile'))
|
|
|
421 |
created = Field(DateTime,default=func.now())
|
|
|
422 |
using_options(shortnames=True)
|
|
|
423 |
using_table_options(mysql_engine="InnoDB")
|
| 16372 |
manas |
424 |
|
|
|
425 |
class user_filters(Entity):
|
|
|
426 |
id = Field(Integer, primary_key= True)
|
|
|
427 |
user_id = Field(Integer(unsigned=True))
|
|
|
428 |
type=Field(Enum('clear','brand'))
|
|
|
429 |
filters = Field(String(256))
|
| 16482 |
manas |
430 |
created = Field(DateTime,default=func.now())
|
| 16372 |
manas |
431 |
using_options(shortnames=True)
|
|
|
432 |
using_table_options(mysql_engine="InnoDB")
|
| 16479 |
kshitij.so |
433 |
|
|
|
434 |
class app_offers(Entity):
|
|
|
435 |
id = Field(Integer, primary_key=True)
|
|
|
436 |
affiliate_id = Field(Integer)
|
|
|
437 |
affiliate_app_id = Field(String(256))
|
|
|
438 |
startDate = Field(DateTime)
|
|
|
439 |
endDate = Field(DateTime)
|
|
|
440 |
affiliate_offer_id = Field(String(256))
|
|
|
441 |
offer_price = Field(Float)
|
|
|
442 |
app_name = Field(String(256))
|
|
|
443 |
image_url = Field(String(256))
|
|
|
444 |
description = Field(String(256))
|
|
|
445 |
link = Field(String(256))
|
|
|
446 |
offer_active = Field(Boolean)
|
| 16480 |
kshitij.so |
447 |
action = Field(String(256))
|
|
|
448 |
priority = Field(String(256))
|
| 16479 |
kshitij.so |
449 |
show = Field(Boolean)
|
|
|
450 |
using_options(shortnames=True)
|
|
|
451 |
using_table_options(mysql_engine="InnoDB")
|
|
|
452 |
|
|
|
453 |
class app_affiliates(Entity):
|
|
|
454 |
id = Field(Integer, primary_key=True)
|
|
|
455 |
name = Field(String(256))
|
|
|
456 |
isActive = Field(Boolean)
|
|
|
457 |
using_options(shortnames=True)
|
|
|
458 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
459 |
|
| 16479 |
kshitij.so |
460 |
|
|
|
461 |
|
| 14826 |
kshitij.so |
462 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 14039 |
kshitij.so |
463 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
|
|
464 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
|
|
465 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
466 |
metadata.bind = cengine
|
| 14826 |
kshitij.so |
467 |
metadata.bind.echo = echo
|
| 14039 |
kshitij.so |
468 |
setup_all(True)
|
|
|
469 |
|
|
|
470 |
if __name__=="__main__":
|
|
|
471 |
initialize()
|
| 15011 |
amit.gupta |
472 |
|
|
|
473 |
|
|
|
474 |
|