| 94 |
ashish |
1 |
'''
|
|
|
2 |
Created on 22-Mar-2010
|
|
|
3 |
|
|
|
4 |
@author: ashish
|
|
|
5 |
'''
|
| 4873 |
mandeep.dh |
6 |
from elixir import metadata, setup_all
|
| 94 |
ashish |
7 |
from elixir.entity import Entity
|
|
|
8 |
from elixir.fields import Field
|
| 4873 |
mandeep.dh |
9 |
from elixir.options import using_options, using_table_options
|
| 5318 |
rajveer |
10 |
from elixir.relationships import OneToMany, ManyToOne
|
| 4873 |
mandeep.dh |
11 |
from sqlalchemy import create_engine
|
| 6903 |
anupam.sin |
12 |
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text, Enum, BigInteger
|
| 4873 |
mandeep.dh |
13 |
import datetime
|
|
|
14 |
import elixir
|
| 94 |
ashish |
15 |
|
| 626 |
chandransh |
16 |
class EntityIDGenerator(Entity):
|
|
|
17 |
id=Field(Integer, primary_key=True)
|
|
|
18 |
using_options(shortnames=True)
|
| 746 |
rajveer |
19 |
using_table_options(mysql_engine="InnoDB")
|
| 122 |
ashish |
20 |
|
| 94 |
ashish |
21 |
class Item(Entity):
|
| 122 |
ashish |
22 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 963 |
chandransh |
23 |
product_group = Field(String(100))
|
| 4917 |
phani.kuma |
24 |
brand = Field(String(100), default='', server_default='')
|
|
|
25 |
model_number = Field(String(50), default='', server_default='')
|
|
|
26 |
model_name = Field(String(100), default='', server_default='')
|
|
|
27 |
color = Field(String(20), default='', server_default='')
|
|
|
28 |
category = Field(Integer, default=0, server_default="0")
|
| 483 |
rajveer |
29 |
comments = Field(String(200))
|
| 122 |
ashish |
30 |
catalog_item_id = Field(Integer)
|
|
|
31 |
feature_id = Field(Integer)
|
|
|
32 |
feature_description = Field(String(200))
|
| 483 |
rajveer |
33 |
mrp = Field(Float)
|
|
|
34 |
sellingPrice = Field(Float)
|
|
|
35 |
weight = Field(Float)
|
| 122 |
ashish |
36 |
addedOn = Field(DateTime)
|
| 609 |
chandransh |
37 |
updatedOn = Field(DateTime)
|
| 122 |
ashish |
38 |
startDate = Field(DateTime)
|
|
|
39 |
retireDate = Field(DateTime)
|
| 5217 |
amit.gupta |
40 |
comingSoonStartDate = Field(DateTime)
|
|
|
41 |
expectedArrivalDate = Field(DateTime)
|
| 483 |
rajveer |
42 |
status = Field(Integer)
|
| 2035 |
rajveer |
43 |
status_description = Field(String(100))
|
| 609 |
chandransh |
44 |
bestDealText = Field(String(100))
|
| 6777 |
vikram.rag |
45 |
bestDealsDetailsText = Field(String(1000))
|
|
|
46 |
bestDealsDetailsLink = Field(String(200))
|
| 630 |
chandransh |
47 |
bestDealValue = Field(Float)
|
| 621 |
chandransh |
48 |
bestSellingRank = Field(Integer)
|
| 103 |
ashish |
49 |
statusChangeLog = OneToMany("ItemChangeLog")
|
| 1910 |
varun.gupt |
50 |
defaultForEntity = Field(Boolean)
|
| 2251 |
ankur.sing |
51 |
risky = Field(Boolean)
|
| 3355 |
chandransh |
52 |
expectedDelay = Field(Integer)
|
| 4295 |
varun.gupt |
53 |
warranty_period = Field(Integer)
|
| 4406 |
anupam.sin |
54 |
isWarehousePreferenceSticky = Field(Boolean)
|
| 4506 |
phani.kuma |
55 |
preferredVendor = Field(Integer)
|
| 5135 |
mandeep.dh |
56 |
type = Field(Enum('SERIALIZED', 'NON_SERIALIZED'), default = 'NON_SERIALIZED', server_default='NON_SERIALIZED')
|
| 5385 |
phani.kuma |
57 |
hasItemNo = Field(Boolean)
|
| 7256 |
rajveer |
58 |
activeOnStore = Field(Boolean)
|
| 6241 |
amit.gupta |
59 |
showSellingPrice = Field(Boolean)
|
| 6805 |
anupam.sin |
60 |
preferredInsurer = Field(Integer)
|
| 7291 |
vikram.rag |
61 |
asin = Field(String(20))
|
|
|
62 |
holdInventory = Field(Integer, default=0, server_default="0")
|
|
|
63 |
defaultInventory = Field(Integer, default=0, server_default="0")
|
| 9841 |
rajveer |
64 |
holdOverride = Field(Boolean)
|
| 746 |
rajveer |
65 |
using_options(shortnames=True)
|
|
|
66 |
using_table_options(mysql_engine="InnoDB")
|
| 103 |
ashish |
67 |
|
| 94 |
ashish |
68 |
def __repr__(self):
|
| 122 |
ashish |
69 |
return "<Item>%d</item>" % (self.id)
|
| 1308 |
chandransh |
70 |
|
| 7330 |
amit.gupta |
71 |
class ItemVatMaster(Entity):
|
|
|
72 |
itemId = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
73 |
stateId = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
74 |
vatPercentage = Field(Float)
|
|
|
75 |
using_options(shortnames=True)
|
|
|
76 |
using_table_options(mysql_engine="InnoDB")
|
|
|
77 |
|
|
|
78 |
|
| 103 |
ashish |
79 |
class ItemChangeLog(Entity):
|
| 122 |
ashish |
80 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 103 |
ashish |
81 |
old_status = Field(Integer)
|
|
|
82 |
new_status = Field(Integer)
|
| 1308 |
chandransh |
83 |
timestamp = Field(DateTime)
|
| 103 |
ashish |
84 |
item = ManyToOne("Item")
|
| 746 |
rajveer |
85 |
using_options(shortnames=True)
|
|
|
86 |
using_table_options(mysql_engine="InnoDB")
|
| 94 |
ashish |
87 |
|
| 103 |
ashish |
88 |
def __repr__(self):
|
|
|
89 |
return "<Log><id>%d</id><item>%d</item><old_status>%d</old_status><new_status>%d</new_status></Log>" %(self.id,self.item.id, self.old_status, self.new_status)
|
| 94 |
ashish |
90 |
|
| 635 |
rajveer |
91 |
class Category(Entity):
|
| 1970 |
rajveer |
92 |
id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
93 |
label = Field(String(50))
|
|
|
94 |
description = Field(String(200))
|
|
|
95 |
parent_category_id = Field(Integer)
|
| 4762 |
phani.kuma |
96 |
display_name = Field(String(50))
|
| 746 |
rajveer |
97 |
using_options(shortnames=True)
|
|
|
98 |
using_table_options(mysql_engine="InnoDB")
|
| 1970 |
rajveer |
99 |
|
| 3008 |
rajveer |
100 |
class SimilarItems(Entity):
|
|
|
101 |
item = ManyToOne('Item', primary_key=True)
|
|
|
102 |
catalog_item_id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
103 |
using_options(shortnames=True)
|
|
|
104 |
using_table_options(mysql_engine="InnoDB")
|
|
|
105 |
|
| 3079 |
rajveer |
106 |
class ProductNotification(Entity):
|
|
|
107 |
item = ManyToOne('Item', primary_key=True)
|
|
|
108 |
email = Field(String(100), primary_key=True, autoincrement=False)
|
|
|
109 |
addedOn = Field(DateTime, primary_key=True, autoincrement=False)
|
|
|
110 |
using_options(shortnames=True)
|
|
|
111 |
using_table_options(mysql_engine="InnoDB")
|
| 3557 |
rajveer |
112 |
|
|
|
113 |
class Source(Entity):
|
|
|
114 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
115 |
name = Field(String(50))
|
|
|
116 |
identifier = Field(String(100))
|
|
|
117 |
using_options(shortnames=True)
|
|
|
118 |
using_table_options(mysql_engine="InnoDB")
|
| 6511 |
kshitij.so |
119 |
|
| 3557 |
rajveer |
120 |
class SourceItemPricing(Entity):
|
|
|
121 |
source = ManyToOne('Source', primary_key=True)
|
|
|
122 |
item = ManyToOne('Item', primary_key=True)
|
|
|
123 |
mrp = Field(Float)
|
|
|
124 |
sellingPrice = Field(Float)
|
|
|
125 |
using_options(shortnames=True)
|
|
|
126 |
using_table_options(mysql_engine="InnoDB")
|
| 746 |
rajveer |
127 |
|
| 4649 |
phani.kuma |
128 |
class AuthorizationLog(Entity):
|
|
|
129 |
id = Field(Integer, primary_key=True, autoincrement = True)
|
|
|
130 |
timestamp = Field(DateTime, default=datetime.datetime.now())
|
|
|
131 |
item = ManyToOne('Item')
|
|
|
132 |
username = Field(String(30))
|
|
|
133 |
reason = Field(Text)
|
|
|
134 |
using_options(shortnames=True)
|
|
|
135 |
using_table_options(mysql_engine="InnoDB")
|
|
|
136 |
|
| 5504 |
phani.kuma |
137 |
class VoucherItemMapping(Entity):
|
| 5512 |
rajveer |
138 |
voucherType = Field(Integer, primary_key=True)
|
| 5504 |
phani.kuma |
139 |
item = ManyToOne('Item', primary_key=True)
|
|
|
140 |
amount = Field(Integer, default=0, server_default="0")
|
|
|
141 |
using_options(shortnames=True)
|
|
|
142 |
using_table_options(mysql_engine="InnoDB")
|
|
|
143 |
|
| 6039 |
amit.gupta |
144 |
class CategoryVatMaster(Entity):
|
| 7330 |
amit.gupta |
145 |
categoryId = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
146 |
stateId = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
147 |
minVal = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
148 |
maxVal = Field(Integer, primary_key=True, autoincrement=False)
|
| 6039 |
amit.gupta |
149 |
vatPercent = Field(Float)
|
|
|
150 |
using_options(shortnames=True)
|
|
|
151 |
using_table_options(mysql_engine="InnoDB")
|
|
|
152 |
|
| 6255 |
rajveer |
153 |
class OOSTracker(Entity):
|
|
|
154 |
itemId = Field(Integer, primary_key=True)
|
|
|
155 |
using_options(shortnames=True)
|
|
|
156 |
using_table_options(mysql_engine="InnoDB")
|
| 6532 |
amit.gupta |
157 |
|
|
|
158 |
class EntityTag(Entity):
|
|
|
159 |
tag = Field(String(100),primary_key=True)
|
|
|
160 |
entityId = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
161 |
using_options(shortnames=True)
|
|
|
162 |
using_table_options(mysql_engine="InnoDB")
|
| 6848 |
kshitij.so |
163 |
|
|
|
164 |
class Banner(Entity):
|
|
|
165 |
bannerName = Field(String(100),primary_key=True)
|
|
|
166 |
imageName = Field(String(100))
|
|
|
167 |
link = Field(String(400))
|
|
|
168 |
priority = Field(Integer)
|
|
|
169 |
hasMap = Field(Boolean)
|
| 9156 |
amit.gupta |
170 |
bannerType = Field(Integer,primary_key=True, autoincrement=False)
|
| 6848 |
kshitij.so |
171 |
using_options(shortnames=True)
|
|
|
172 |
using_table_options(mysql_engine="InnoDB")
|
|
|
173 |
|
|
|
174 |
class BannerMap(Entity):
|
|
|
175 |
bannerName = Field(String(100))
|
|
|
176 |
mapLink = Field(String(400))
|
|
|
177 |
coordinates = Field(String(20))
|
| 9155 |
kshitij.so |
178 |
bannerType = Field(Integer)
|
| 6848 |
kshitij.so |
179 |
using_options(shortnames=True)
|
|
|
180 |
using_table_options(mysql_engine="InnoDB")
|
| 8579 |
kshitij.so |
181 |
|
|
|
182 |
class BannerUriMapping(Entity):
|
|
|
183 |
bannerName = Field(String(100))
|
|
|
184 |
uri = Field(String(100))
|
|
|
185 |
isActive = Field(Boolean)
|
| 9155 |
kshitij.so |
186 |
bannerType = Field(Integer)
|
| 10097 |
kshitij.so |
187 |
target = Field(Boolean)
|
| 8579 |
kshitij.so |
188 |
using_options(shortnames=True)
|
|
|
189 |
using_table_options(mysql_engine="InnoDB")
|
|
|
190 |
|
|
|
191 |
class Campaign(Entity):
|
|
|
192 |
id = Field(Integer,primary_key=True)
|
|
|
193 |
campaignName = Field(String(255))
|
|
|
194 |
imageName = Field(String(255))
|
|
|
195 |
using_options(shortnames=True)
|
|
|
196 |
using_table_options(mysql_engine="InnoDB")
|
| 6255 |
rajveer |
197 |
|
| 6805 |
anupam.sin |
198 |
class ItemInsurerMapping(Entity):
|
|
|
199 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
200 |
itemId = Field(Integer)
|
|
|
201 |
insurerId = Field(Integer)
|
|
|
202 |
premiumType = Field(Integer)
|
|
|
203 |
premiumAmount = Field(Float)
|
| 9299 |
kshitij.so |
204 |
insurerType = Field(Integer)
|
| 6805 |
anupam.sin |
205 |
using_options(shortnames=True)
|
|
|
206 |
using_table_options(mysql_engine="InnoDB")
|
|
|
207 |
|
|
|
208 |
class Insurer(Entity):
|
|
|
209 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
210 |
name = Field(String(255))
|
|
|
211 |
address = Field(String(255))
|
| 6903 |
anupam.sin |
212 |
declaredAmount = Field(BigInteger)
|
|
|
213 |
creditedAmount = Field(BigInteger)
|
| 9299 |
kshitij.so |
214 |
insurerType = Field(Integer)
|
| 6805 |
anupam.sin |
215 |
using_options(shortnames=True)
|
|
|
216 |
using_table_options(mysql_engine="InnoDB")
|
| 7190 |
amar.kumar |
217 |
|
|
|
218 |
class FreebieItem(Entity):
|
|
|
219 |
itemId = Field(Integer, primary_key=True)
|
|
|
220 |
freebieItemId = Field(Integer)
|
|
|
221 |
using_options(shortnames=True)
|
|
|
222 |
using_table_options(mysql_engine="InnoDB")
|
| 7256 |
rajveer |
223 |
|
| 7272 |
amit.gupta |
224 |
class BrandInfo(Entity):
|
|
|
225 |
name = Field(String(255), primary_key=True)
|
|
|
226 |
serviceCenterLocatorUrl = Field(String(255))
|
|
|
227 |
using_options(shortnames=True)
|
|
|
228 |
using_table_options(mysql_engine="InnoDB")
|
|
|
229 |
|
| 7256 |
rajveer |
230 |
class StorePricing(Entity):
|
|
|
231 |
item = ManyToOne('Item', primary_key=True)
|
|
|
232 |
recommendedPrice = Field(Float)
|
|
|
233 |
minPrice = Field(Float)
|
|
|
234 |
maxPrice = Field(Float)
|
|
|
235 |
minAdvancePrice = Field(Float)
|
| 7308 |
rajveer |
236 |
freebieItemId = Field(Integer)
|
| 7351 |
rajveer |
237 |
absoluteMinPrice = Field(Float)
|
| 7308 |
rajveer |
238 |
bestDealText = Field(String(100))
|
| 7256 |
rajveer |
239 |
using_options(shortnames=True)
|
| 7291 |
vikram.rag |
240 |
using_table_options(mysql_engine="InnoDB")
|
|
|
241 |
|
| 7281 |
kshitij.so |
242 |
class Amazonlisted(Entity):
|
| 7396 |
kshitij.so |
243 |
itemId = Field(Integer, primary_key=True, autoincrement=False)
|
| 7281 |
kshitij.so |
244 |
asin = Field(String(255))
|
|
|
245 |
name = Field(String(255))
|
|
|
246 |
brand = Field(String(255))
|
|
|
247 |
model = Field(String(255))
|
|
|
248 |
manufacturer_name = Field(String(255))
|
|
|
249 |
part_number = Field(String(255))
|
|
|
250 |
ean = Field(String(255))
|
|
|
251 |
upc = Field(String(255))
|
|
|
252 |
fbaPrice = Field(Float)
|
| 10909 |
vikram.rag |
253 |
fbbPrice = Field(Float)
|
| 7281 |
kshitij.so |
254 |
sellingPrice = Field(Float)
|
|
|
255 |
isFba = Field(Boolean)
|
|
|
256 |
isNonFba = Field(Boolean)
|
| 10909 |
vikram.rag |
257 |
isFbb = Field(Boolean)
|
| 7281 |
kshitij.so |
258 |
isInventoryOverride = Field(Boolean)
|
|
|
259 |
color = Field(String(255))
|
|
|
260 |
category = Field(String(255))
|
| 7367 |
kshitij.so |
261 |
handlingTime = Field(Integer)
|
|
|
262 |
isCustomTime = Field(Boolean)
|
| 7516 |
vikram.rag |
263 |
category_code = Field(Integer, default=0, server_default="0")
|
| 7770 |
kshitij.so |
264 |
mfnPriceLastUpdatedOn = Field(DateTime)
|
|
|
265 |
fbaPriceLastUpdatedOn = Field(DateTime)
|
| 10909 |
vikram.rag |
266 |
fbbPriceLastUpdatedOn = Field(DateTime)
|
| 7770 |
kshitij.so |
267 |
mfnPriceLastUpdatedOnSc = Field(DateTime)
|
|
|
268 |
fbaPriceLastUpdatedOnSc = Field(DateTime)
|
| 10909 |
vikram.rag |
269 |
fbbPriceLastUpdatedOnSc = Field(DateTime)
|
| 8139 |
kshitij.so |
270 |
suppressMfnPriceUpdate = Field(Boolean)
|
| 8140 |
kshitij.so |
271 |
suppressFbaPriceUpdate = Field(Boolean)
|
| 10909 |
vikram.rag |
272 |
suppressFbbPriceUpdate = Field(Boolean)
|
| 8619 |
kshitij.so |
273 |
taxCode = Field(String(255))
|
| 10909 |
vikram.rag |
274 |
fbbtaxCode = Field(String(255))
|
| 7281 |
kshitij.so |
275 |
using_options(shortnames=True)
|
|
|
276 |
using_table_options(mysql_engine="InnoDB")
|
|
|
277 |
|
| 7977 |
kshitij.so |
278 |
class PageViewEvents(Entity):
|
|
|
279 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 8139 |
kshitij.so |
280 |
catalogId = Field(Integer,index=True)
|
|
|
281 |
url = Field(String(255),index=True)
|
| 7977 |
kshitij.so |
282 |
sellingPrice = Field(Float)
|
|
|
283 |
comingSoon = Field(Boolean)
|
|
|
284 |
ip = Field(String(255))
|
|
|
285 |
sessionId = Field(String(255))
|
| 8139 |
kshitij.so |
286 |
eventTimestamp = Field(DateTime,index=True)
|
| 7977 |
kshitij.so |
287 |
using_options(shortnames=True)
|
|
|
288 |
using_table_options(mysql_engine="InnoDB")
|
|
|
289 |
|
|
|
290 |
class CartEvents(Entity):
|
|
|
291 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 8139 |
kshitij.so |
292 |
catalogId = Field(Integer,index=True)
|
|
|
293 |
itemId = Field(Integer,index=True)
|
| 7977 |
kshitij.so |
294 |
sellingPrice = Field(Float)
|
|
|
295 |
inStock = Field(Boolean)
|
|
|
296 |
comingSoon = Field(Boolean)
|
|
|
297 |
ip = Field(String(255))
|
|
|
298 |
sessionId = Field(String(255))
|
| 8139 |
kshitij.so |
299 |
eventTimestamp = Field(DateTime,index=True)
|
| 7977 |
kshitij.so |
300 |
using_options(shortnames=True)
|
|
|
301 |
using_table_options(mysql_engine="InnoDB")
|
|
|
302 |
|
| 8182 |
amar.kumar |
303 |
class EbayItem(Entity):
|
|
|
304 |
ebayListingId = Field(String(32), primary_key=True)
|
|
|
305 |
itemId = Field(Integer, primary_key=True, autoincrement = False)
|
|
|
306 |
listingName = Field(String(255))
|
|
|
307 |
listingPrice = Field(Float)
|
|
|
308 |
listingExpiryDate = Field(DateTime)
|
|
|
309 |
subsidy = Field(Float)
|
|
|
310 |
defaultWarehouseId = Field(Integer)
|
|
|
311 |
using_options(shortnames=True)
|
|
|
312 |
using_table_options(mysql_engine="InnoDB")
|
| 8739 |
vikram.rag |
313 |
|
|
|
314 |
class SnapdealItem(Entity):
|
|
|
315 |
item_id = Field(Integer, primary_key=True, autoincrement = False)
|
|
|
316 |
exceptionPrice = Field(Float)
|
|
|
317 |
warehouseId = Field(Integer)
|
| 9242 |
kshitij.so |
318 |
transferPrice = Field(Float)
|
|
|
319 |
sellingPrice = Field(Float)
|
|
|
320 |
courierCost = Field(Float)
|
|
|
321 |
commission = Field(Float)
|
|
|
322 |
serviceTax = Field(Float)
|
|
|
323 |
updatedOn = Field(DateTime)
|
| 9404 |
vikram.rag |
324 |
maxNlc = Field(Float)
|
| 9478 |
kshitij.so |
325 |
skuAtSnapdeal = Field(String(255))
|
| 9242 |
kshitij.so |
326 |
isListedOnSnapdeal = Field(Boolean)
|
|
|
327 |
suppressPriceFeed = Field(Boolean)
|
|
|
328 |
suppressInventoryFeed = Field(Boolean)
|
| 9568 |
kshitij.so |
329 |
supc = Field(String(255))
|
| 9724 |
kshitij.so |
330 |
shippingTime = Field(Integer)
|
| 9779 |
kshitij.so |
331 |
priceUpdatedBy = Field(String(255))
|
| 8739 |
vikram.rag |
332 |
using_options(shortnames=True)
|
|
|
333 |
using_table_options(mysql_engine="InnoDB")
|
| 9242 |
kshitij.so |
334 |
|
| 10097 |
kshitij.so |
335 |
class MarketPlaceUpdateHistory(Entity):
|
| 9242 |
kshitij.so |
336 |
id = Field(Integer, primary_key=True, autoincrement = True)
|
|
|
337 |
item_id = Field(Integer)
|
| 10097 |
kshitij.so |
338 |
source = Field(Integer)
|
|
|
339 |
isListedOnSource = Field(Boolean)
|
| 9242 |
kshitij.so |
340 |
exceptionPrice = Field(Float)
|
|
|
341 |
warehouseId = Field(Integer)
|
|
|
342 |
transferPrice = Field(Float)
|
|
|
343 |
sellingPrice = Field(Float)
|
|
|
344 |
courierCost = Field(Float)
|
|
|
345 |
commission = Field(Float)
|
|
|
346 |
serviceTax = Field(Float)
|
|
|
347 |
suppressPriceFeed = Field(Boolean)
|
|
|
348 |
suppressInventoryFeed = Field(Boolean)
|
| 9478 |
kshitij.so |
349 |
maxNlc = Field(Float)
|
| 10097 |
kshitij.so |
350 |
skuAtSource = Field(String(255))
|
| 9242 |
kshitij.so |
351 |
updatedOn = Field(DateTime)
|
| 10097 |
kshitij.so |
352 |
marketPlaceSerialNumber = Field(String(255))
|
| 9779 |
kshitij.so |
353 |
priceUpdatedBy = Field(String(255))
|
| 9242 |
kshitij.so |
354 |
using_options(shortnames=True)
|
|
|
355 |
using_table_options(mysql_engine="InnoDB")
|
| 9724 |
kshitij.so |
356 |
|
|
|
357 |
class MarketplaceItems(Entity):
|
|
|
358 |
itemId = Field(Integer,primary_key=True, autoincrement = False)
|
|
|
359 |
source = Field(Integer,primary_key=True, autoincrement = False)
|
|
|
360 |
emiFee = Field(Float)
|
|
|
361 |
courierCost = Field(Float)
|
|
|
362 |
closingFee = Field(Float)
|
|
|
363 |
returnProvision = Field(Float)
|
|
|
364 |
commission = Field(Float)
|
| 10287 |
kshitij.so |
365 |
pgFee = Field(Float)
|
| 9724 |
kshitij.so |
366 |
vat = Field(Float)
|
|
|
367 |
packagingCost = Field(Float)
|
|
|
368 |
otherCost = Field(Float)
|
|
|
369 |
serviceTax = Field(Float)
|
|
|
370 |
autoIncrement = Field(Boolean)
|
|
|
371 |
autoDecrement = Field(Boolean)
|
|
|
372 |
manualFavourite = Field(Boolean)
|
|
|
373 |
autoFavourite = Field(Boolean)
|
|
|
374 |
currentSp = Field(Float)
|
|
|
375 |
currentTp = Field(Float)
|
|
|
376 |
minimumPossibleSp = Field(Float)
|
|
|
377 |
minimumPossibleTp = Field(Float)
|
| 9909 |
kshitij.so |
378 |
maximumSellingPrice = Field(Float)
|
| 9724 |
kshitij.so |
379 |
lastCheckedTimestamp = Field(DateTime)
|
|
|
380 |
using_options(shortnames=True)
|
|
|
381 |
using_table_options(mysql_engine="InnoDB")
|
| 7977 |
kshitij.so |
382 |
|
| 9621 |
manish.sha |
383 |
class ProductFeedSubmit(Entity):
|
|
|
384 |
catalogItemId = Field(Integer, primary_key=True)
|
|
|
385 |
stockLinkedFeed = Field(Boolean)
|
|
|
386 |
using_options(shortnames=True)
|
|
|
387 |
using_table_options(mysql_engine="InnoDB")
|
| 9776 |
vikram.rag |
388 |
|
|
|
389 |
class MarketPlaceItemPrice(Entity):
|
|
|
390 |
item_id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
391 |
source = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
392 |
sellingPrice = Field(Float)
|
|
|
393 |
lastUpdatedOn = Field(DateTime)
|
|
|
394 |
lastUpdatedOnMarketplace = Field(DateTime,default = datetime.datetime.strptime('01-01-1970 15:00:00', '%d-%m-%Y %H:%M:%S'),server_default = '1970-01-01')
|
|
|
395 |
suppressPriceFeed = Field(Boolean)
|
|
|
396 |
isListedOnSource = Field(Boolean)
|
|
|
397 |
using_options(shortnames=True)
|
|
|
398 |
using_table_options(mysql_engine="InnoDB")
|
| 9242 |
kshitij.so |
399 |
|
| 9779 |
kshitij.so |
400 |
class SourcePercentageMaster(Entity):
|
|
|
401 |
source = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
402 |
emiFee = Field(Float)
|
|
|
403 |
closingFee = Field(Float)
|
|
|
404 |
returnProvision = Field(Float)
|
|
|
405 |
commission = Field(Float)
|
| 10287 |
kshitij.so |
406 |
pgFee = Field(Float)
|
| 9884 |
kshitij.so |
407 |
competitorCommissionAccessory = Field(Float)
|
|
|
408 |
competitorCommissionOther = Field(Float)
|
| 9779 |
kshitij.so |
409 |
serviceTax = Field(Float)
|
|
|
410 |
using_options(shortnames=True)
|
|
|
411 |
using_table_options(mysql_engine="InnoDB")
|
|
|
412 |
|
|
|
413 |
class SourceItemPercentage(Entity):
|
|
|
414 |
item_id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
415 |
source = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
416 |
emiFee = Field(Float)
|
|
|
417 |
closingFee = Field(Float)
|
|
|
418 |
returnProvision = Field(Float)
|
|
|
419 |
commission = Field(Float)
|
| 10287 |
kshitij.so |
420 |
pgFee = Field(Float)
|
| 9884 |
kshitij.so |
421 |
competitorCommissionAccessory = Field(Float)
|
|
|
422 |
competitorCommissionOther = Field(Float)
|
| 9779 |
kshitij.so |
423 |
serviceTax = Field(Float)
|
| 10097 |
kshitij.so |
424 |
startDate = Field(DateTime, primary_key=True, autoincrement=False)
|
|
|
425 |
expiryDate = Field(DateTime)
|
| 9779 |
kshitij.so |
426 |
using_options(shortnames=True)
|
|
|
427 |
using_table_options(mysql_engine="InnoDB")
|
|
|
428 |
|
| 10097 |
kshitij.so |
429 |
class SourceCategoryPercentage(Entity):
|
|
|
430 |
category_id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
431 |
source = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
432 |
emiFee = Field(Float)
|
|
|
433 |
closingFee = Field(Float)
|
|
|
434 |
returnProvision = Field(Float)
|
|
|
435 |
commission = Field(Float)
|
| 10287 |
kshitij.so |
436 |
pgFee = Field(Float)
|
| 10097 |
kshitij.so |
437 |
competitorCommissionAccessory = Field(Float)
|
|
|
438 |
competitorCommissionOther = Field(Float)
|
|
|
439 |
serviceTax = Field(Float)
|
|
|
440 |
startDate = Field(DateTime, primary_key=True, autoincrement=False)
|
|
|
441 |
expiryDate = Field(DateTime)
|
|
|
442 |
using_options(shortnames=True)
|
|
|
443 |
using_table_options(mysql_engine="InnoDB")
|
|
|
444 |
|
| 9884 |
kshitij.so |
445 |
class MarketPlaceHistory(Entity):
|
|
|
446 |
item_id = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
447 |
source = Field(Integer, primary_key=True, autoincrement=False)
|
|
|
448 |
lowestTp = Field(Float)
|
|
|
449 |
lowestPossibleTp = Field(Float)
|
|
|
450 |
lowestPossibleSp = Field(Float)
|
|
|
451 |
ourInventory = Field(Integer)
|
|
|
452 |
otherInventory = Field(Integer)
|
|
|
453 |
secondLowestInventory = Field(Integer)
|
|
|
454 |
ourRank = Field(Integer)
|
|
|
455 |
competitionBasis = Field(Integer)
|
|
|
456 |
competitiveCategory = Field(Integer)
|
|
|
457 |
risky = Field(Boolean)
|
|
|
458 |
lowestOfferPrice = Field(Float)
|
|
|
459 |
lowestSellingPrice = Field(Float)
|
|
|
460 |
lowestSellerName = Field(String(255))
|
|
|
461 |
lowestSellerCode = Field(String(255))
|
|
|
462 |
ourOfferPrice = Field(Float)
|
|
|
463 |
ourSellingPrice = Field(Float)
|
|
|
464 |
ourTp = Field(Float)
|
|
|
465 |
ourNlc = Field(Float)
|
|
|
466 |
proposedSellingPrice = Field(Float)
|
|
|
467 |
proposedTp = Field(Float)
|
|
|
468 |
targetNlc = Field(Float)
|
|
|
469 |
salesPotential = Field(Integer)
|
|
|
470 |
secondLowestSellerName = Field(String(255))
|
|
|
471 |
secondLowestSellerCode = Field(String(255))
|
|
|
472 |
secondLowestSellingPrice = Field(Float)
|
|
|
473 |
secondLowestOfferPrice = Field(Float)
|
|
|
474 |
secondLowestTp = Field(Float)
|
|
|
475 |
marginIncreasedPotential = Field(Float)
|
|
|
476 |
margin = Field(Float)
|
|
|
477 |
competitorEnoughStock = Field(Boolean)
|
|
|
478 |
ourEnoughStock = Field(Boolean)
|
|
|
479 |
totalSeller = Field(Integer)
|
|
|
480 |
salesPotential = Field(Integer)
|
|
|
481 |
avgSales = Field(Float)
|
|
|
482 |
decision = Field(Integer)
|
| 9909 |
kshitij.so |
483 |
reason = Field(String(255))
|
| 9949 |
kshitij.so |
484 |
run = Field(Integer)
|
| 9884 |
kshitij.so |
485 |
timestamp =Field(DateTime, primary_key=True, autoincrement=False)
|
|
|
486 |
using_options(shortnames=True)
|
|
|
487 |
using_table_options(mysql_engine="InnoDB")
|
|
|
488 |
|
| 9945 |
vikram.rag |
489 |
class FlipkartItem(Entity):
|
|
|
490 |
item_id = Field(Integer, primary_key=True, autoincrement = False)
|
|
|
491 |
exceptionPrice = Field(Float)
|
|
|
492 |
warehouseId = Field(Integer)
|
|
|
493 |
commissionValue = Field(Float)
|
|
|
494 |
serviceTaxValue = Field(Float)
|
|
|
495 |
maxNlc = Field(Float)
|
|
|
496 |
skuAtFlipkart = Field(String(255))
|
|
|
497 |
isListedOnFlipkart = Field(Boolean)
|
|
|
498 |
suppressPriceFeed = Field(Boolean)
|
|
|
499 |
suppressInventoryFeed = Field(Boolean)
|
| 10097 |
kshitij.so |
500 |
flipkartSerialNumber = Field(String(255))
|
| 9945 |
vikram.rag |
501 |
updatedOn = Field(DateTime)
|
|
|
502 |
updatedBy = Field(String(255))
|
|
|
503 |
using_options(shortnames=True)
|
|
|
504 |
using_table_options(mysql_engine="InnoDB")
|
|
|
505 |
|
| 3187 |
rajveer |
506 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
| 746 |
rajveer |
507 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 1122 |
chandransh |
508 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 6532 |
amit.gupta |
509 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
510 |
metadata.bind = cengine
|
| 94 |
ashish |
511 |
metadata.bind.echo = True
|
|
|
512 |
setup_all(True)
|
| 115 |
ashish |
513 |
|
|
|
514 |
if __name__=="__main__":
|
| 9242 |
kshitij.so |
515 |
initialize()
|