| Line 7... |
Line 7... |
| 7 |
from elixir.entity import Entity
|
7 |
from elixir.entity import Entity
|
| 8 |
from elixir.fields import Field
|
8 |
from elixir.fields import Field
|
| 9 |
from elixir.options import using_options, using_table_options
|
9 |
from elixir.options import using_options, using_table_options
|
| 10 |
from elixir.relationships import OneToMany, ManyToOne
|
10 |
from elixir.relationships import OneToMany, ManyToOne
|
| 11 |
from sqlalchemy import create_engine
|
11 |
from sqlalchemy import create_engine
|
| 12 |
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text, Enum, BigInteger
|
12 |
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text, Enum, BigInteger, Date
|
| 13 |
import datetime
|
13 |
import datetime
|
| 14 |
import elixir
|
14 |
import elixir
|
| 15 |
|
15 |
|
| 16 |
class EntityIDGenerator(Entity):
|
16 |
class EntityIDGenerator(Entity):
|
| 17 |
id=Field(Integer, primary_key=True)
|
17 |
id=Field(Integer, primary_key=True)
|
| Line 271... |
Line 271... |
| 271 |
suppressMfnPriceUpdate = Field(Boolean)
|
271 |
suppressMfnPriceUpdate = Field(Boolean)
|
| 272 |
suppressFbaPriceUpdate = Field(Boolean)
|
272 |
suppressFbaPriceUpdate = Field(Boolean)
|
| 273 |
suppressFbbPriceUpdate = Field(Boolean)
|
273 |
suppressFbbPriceUpdate = Field(Boolean)
|
| 274 |
taxCode = Field(String(255))
|
274 |
taxCode = Field(String(255))
|
| 275 |
fbbtaxCode = Field(String(255))
|
275 |
fbbtaxCode = Field(String(255))
|
| - |
|
276 |
overrrideWanlc = Field(Boolean)
|
| - |
|
277 |
exceptionalWanlc = Field(Float)
|
| - |
|
278 |
fcAutoPricing = Field(Boolean)
|
| 276 |
using_options(shortnames=True)
|
279 |
using_options(shortnames=True)
|
| 277 |
using_table_options(mysql_engine="InnoDB")
|
280 |
using_table_options(mysql_engine="InnoDB")
|
| 278 |
|
281 |
|
| 279 |
class PageViewEvents(Entity):
|
282 |
class PageViewEvents(Entity):
|
| 280 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
283 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| Line 597... |
Line 600... |
| 597 |
lowestAmazonPrice = Field(Float)
|
600 |
lowestAmazonPrice = Field(Float)
|
| 598 |
lowestAmazonSeller = Field(String(255))
|
601 |
lowestAmazonSeller = Field(String(255))
|
| 599 |
competitorPricing = ManyToOne("CompetitorPricingRequest")
|
602 |
competitorPricing = ManyToOne("CompetitorPricingRequest")
|
| 600 |
using_options(shortnames=True)
|
603 |
using_options(shortnames=True)
|
| 601 |
using_table_options(mysql_engine="InnoDB")
|
604 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
605 |
|
| - |
|
606 |
class AmazonPromotion(Entity):
|
| - |
|
607 |
sku = Field(String(20))
|
| - |
|
608 |
standardPrice = Field(Float)
|
| - |
|
609 |
salePrice = Field(Float)
|
| - |
|
610 |
startDate = Field(DateTime)
|
| - |
|
611 |
endDate = Field(DateTime)
|
| - |
|
612 |
addedOn = Field(DateTime)
|
| - |
|
613 |
updatedOnMarketplace = Field(DateTime,default = datetime.datetime.strptime('01-01-1970 00:00:00', '%d-%m-%Y %H:%M:%S'),server_default = '1970-01-01')
|
| - |
|
614 |
promotionActive = Field(Boolean)
|
| - |
|
615 |
stateId = Field(Integer)
|
| - |
|
616 |
promotionType = Field(Integer)
|
| - |
|
617 |
using_options(shortnames=True)
|
| - |
|
618 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
619 |
|
| - |
|
620 |
class AmazonScrapingHistory(Entity):
|
| - |
|
621 |
item_id = Field(Integer, primary_key=True, autoincrement=False)
|
| - |
|
622 |
warehouseLocation = Field(Integer, primary_key=True, autoincrement=False)
|
| - |
|
623 |
ourSellingPrice = Field(Float)
|
| - |
|
624 |
ourTp = Field(Float)
|
| - |
|
625 |
lowestPossibleTp = Field(Float)
|
| - |
|
626 |
lowestPossibleSp = Field(Float)
|
| - |
|
627 |
ourRank = Field(Integer)
|
| - |
|
628 |
ourInventory = Field(Integer)
|
| - |
|
629 |
lowestSellerName = Field(String(255))
|
| - |
|
630 |
lowestSellerSp = Field(Float)
|
| - |
|
631 |
secondLowestSellerName = Field(String(255))
|
| - |
|
632 |
secondLowestSellerSp = Field(Float)
|
| - |
|
633 |
thirdLowestSellerName = Field(String(255))
|
| - |
|
634 |
thirdLowestSellerSp = Field(Float)
|
| - |
|
635 |
competitiveCategory = Field(Integer)
|
| - |
|
636 |
wanlc = Field(Float)
|
| - |
|
637 |
commission = Field(Float)
|
| - |
|
638 |
competitorCommission = Field(Float)
|
| - |
|
639 |
returnProvision = Field(Float)
|
| - |
|
640 |
courierCost = Field(Float)
|
| - |
|
641 |
risky = Field(Boolean)
|
| - |
|
642 |
runType = Field(Integer)
|
| - |
|
643 |
totalSeller = Field(Integer)
|
| - |
|
644 |
ourEnoughStock = Field(Boolean)
|
| - |
|
645 |
marginIncreasedPotential = Field(Float)
|
| - |
|
646 |
avgSale = Field(Float)
|
| - |
|
647 |
multipleListings = Field(Boolean)
|
| - |
|
648 |
proposedSp = Field(Float)
|
| - |
|
649 |
proposedTp = Field(Float)
|
| - |
|
650 |
targetNlc = Field(Float)
|
| - |
|
651 |
decision = Field(Integer)
|
| - |
|
652 |
reason = Field(String(255))
|
| - |
|
653 |
timestamp =Field(DateTime, primary_key=True, autoincrement=False)
|
| - |
|
654 |
using_options(shortnames=True)
|
| - |
|
655 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
656 |
|
| - |
|
657 |
|
| - |
|
658 |
|
| - |
|
659 |
|
| 602 |
|
660 |
|
| 603 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
661 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
| 604 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
662 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 605 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
663 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 606 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
664 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|