Subversion Repositories SmartDukaan

Rev

Rev 8921 | Rev 8923 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
104 ashish 1
'''
2
Created on 29-Mar-2010
3
 
4
@author: ashish
5
'''
6594 anupam.sin 6
from MySQLdb.constants.FLAG import AUTO_INCREMENT
4501 mandeep.dh 7
from elixir import metadata, setup_all
104 ashish 8
from elixir.entity import Entity
9
from elixir.fields import Field
4501 mandeep.dh 10
from elixir.options import using_options, using_table_options
11
from elixir.relationships import ManyToOne, OneToMany
12
from sqlalchemy.engine import create_engine
6594 anupam.sin 13
from sqlalchemy.types import Integer, String, Float, DateTime, Boolean, Enum, \
8282 kshitij.so 14
    Numeric, BigInteger, LargeBinary,Date
104 ashish 15
 
16
#===============================================================================
17
# Different entities in the model
18
#===============================================================================
19
 
3187 rajveer 20
def initialize(dbname='transaction', db_hostname="localhost", echoOn=True):
746 rajveer 21
    #metadata.bind = "sqlite:///Transactionsnew.sqlite"
1122 chandransh 22
    #metadata.bind = 'mysql://root:shop2020@localhost/transaction'
3187 rajveer 23
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
1122 chandransh 24
    metadata.bind = engine
1911 chandransh 25
    metadata.bind.echo = echoOn
483 rajveer 26
    setup_all(True)
27
 
28
 
29
if __name__=="__main__":
30
    initialize()
2783 chandransh 31
 
32
class InvoiceIDGenerator(Entity):
5527 anupam.sin 33
    id = Field(Integer)
5528 anupam.sin 34
    orderType = Field(Integer, primary_key = True)
2783 chandransh 35
    using_options(shortnames=True)
36
    using_table_options(mysql_engine="InnoDB")   
483 rajveer 37
 
5508 rajveer 38
class RechargeVoucherTracker(Entity):
39
    order = ManyToOne("Order")
40
    voucherType = Field(Integer)
41
    amount = Field(Integer)
42
    voucherIssued = Field(Boolean)
43
    voucherCode = Field(String(30))
44
    issuedOn = Field(DateTime)
45
    using_options(shortnames=True)
46
    using_table_options(mysql_engine="InnoDB")
47
 
483 rajveer 48
class LineItem(Entity):
49
    id = Field(Integer, primary_key=True, autoincrement=True)
699 chandransh 50
    item_id = Field(Integer)
963 chandransh 51
    productGroup = Field(String(100))
52
    brand = Field(String(100))
53
    model_number = Field(String(50))
54
    model_name = Field(String(50))
669 chandransh 55
    color = Field(String(20))
483 rajveer 56
    extra_info = Field(String(100))
57
    quantity = Field(Float)
58
    unit_price = Field(Float)
59
    unit_weight = Field(Float)
60
    total_price = Field(Float)
996 varun.gupt 61
    transfer_price = Field(Float)
6751 amar.kumar 62
    nlc = Field(Float)
483 rajveer 63
    total_weight = Field(Float)
2783 chandransh 64
    item_number = Field(String(50))
7322 vikram.rag 65
    serial_number = Field(String(50)) 
4172 rajveer 66
    dealText = Field(String(100))
4295 varun.gupt 67
    warranty_expiry_timestamp = Field(DateTime)
483 rajveer 68
    order = ManyToOne("Order")
6039 amit.gupta 69
    vatRate = Field(Float)
746 rajveer 70
    using_options(shortnames=True)
71
    using_table_options(mysql_engine="InnoDB")
72
 
1276 chandransh 73
    def __repr__(self):
74
        return "{0} {1} {2} {3}".format(self.brand or "", self.model_name or "", self.model_number or "", self.color or "")
75
 
483 rajveer 76
class Order(Entity):
77
    id = Field(Integer, primary_key=True, autoincrement=True)
78
    warehouse_id = Field(Integer)
79
    logistics_provider_id = Field(Integer)
80
    airwaybill_no = Field(String(50))
81
    tracking_id = Field(String(50))
82
    expected_delivery_time = Field(DateTime)
3986 chandransh 83
    promised_delivery_time = Field(DateTime)
4004 chandransh 84
    expected_shipping_time = Field(DateTime)
4102 chandransh 85
    promised_shipping_time = Field(DateTime)
6726 rajveer 86
    courier_delivery_time = Field(DateTime)
483 rajveer 87
    customer_id = Field(Integer)
88
    customer_name = Field(String(50))
89
    customer_mobilenumber = Field(String(20))
90
    customer_pincode = Field(String(10))
738 chandransh 91
    customer_address1 = Field(String(100))
92
    customer_address2 = Field(String(100))
669 chandransh 93
    customer_city = Field(String(100))
94
    customer_state = Field(String(100))
483 rajveer 95
    customer_email = Field(String(50))
96
    status = Field(Integer)
97
    statusDescription = Field(String(50))
98
    total_amount = Field(Float)
6318 rajveer 99
    gvAmount = Field(Float)
483 rajveer 100
    total_weight = Field(Float)
101
    invoice_number = Field(String(30))
102
    billed_by = Field(String(30))
103
    created_timestamp = Field(DateTime)
104
    accepted_timestamp = Field(DateTime)
105
    billing_timestamp = Field(DateTime)
106
    shipping_timestamp = Field(DateTime)
1113 chandransh 107
    pickup_timestamp = Field(DateTime)
483 rajveer 108
    delivery_timestamp = Field(DateTime)
1208 chandransh 109
    outofstock_timestamp = Field(DateTime)
483 rajveer 110
    lineitems = OneToMany("LineItem")
111
    transaction = ManyToOne("Transaction")
6903 anupam.sin 112
    insuranceDetails = OneToMany("InsuranceDetailForOrder")
642 chandransh 113
    jacket_number = Field(Integer)
1132 chandransh 114
    receiver = Field(String(50))
1220 chandransh 115
    batchNo = Field(Integer)
116
    serialNo = Field(Integer)
2536 chandransh 117
    doaFlag = Field(Boolean)
118
    pickupRequestNo = Field(String(20))
2764 chandransh 119
    doa_auth_timestamp = Field(DateTime)
120
    doa_pickup_timestamp = Field(DateTime)
121
    received_return_timestamp = Field(DateTime)
122
    reship_timestamp = Field(DateTime)
123
    refund_timestamp = Field(DateTime)
2628 chandransh 124
    new_order_id = Field(Integer)
2819 chandransh 125
    purchase_order_id = Field(Integer)
3064 chandransh 126
    cod = Field(Boolean)
3226 chandransh 127
    refunded_by = Field(String(30))
5141 anupam.sin 128
    refund_reason = Field(String(256))
3064 chandransh 129
    verification_timestamp = Field(DateTime)
3581 chandransh 130
    delay_reason = Field(Enum('INVENTORY_LOW_PHASED_OUT', 'INVENTORY_LOW_COLOR_NOT_AVAILABLE',\
131
                              'INVENTORY_LOW_REVERSAL_NOT_ON_TIME', 'INVENTORY_LOW_PRODUCT_NOT_SEALED',\
132
                              'COURIER_DELAY_NOT_DELIVERED_TO_COURIER_ON_TIME', 'COURIER_DELAY_DID_NOT_CONNECT',\
133
                              'COURIER_DELAY_CUSTOMER_NOT_AVAILABLE', 'COURIER_DELAY_INCORRECT_ADDRESS',\
134
                              'COURIER_DELAY_OCTROI_DELAY', 'COURIER_DELAY_FORCES_OF_NATURE',\
135
                              'COD_VERIFICATION_DELAY', 'PAYMENT_FLAGGED', 'OTHERS'))
3956 chandransh 136
    cod_reconciliation_timestamp = Field(DateTime)
4247 rajveer 137
    previousStatus = Field(Integer)
4269 anupam.sin 138
    vendorId = Field(Integer)
5302 rajveer 139
    delayReasonText= Field(String(250))
4815 phani.kuma 140
    doa_logistics_provider_id = Field(Integer)
4910 phani.kuma 141
    local_connected_timestamp = Field(DateTime)
142
    reached_destination_timestamp = Field(DateTime)
143
    first_dlvyatmp_timestamp = Field(DateTime)
4303 rajveer 144
    orderInventory = OneToMany("OrderInventory")
5386 phani.kuma 145
    vendor_paid = Field(Boolean, default=0, server_default="0")
5062 varun.gupt 146
    originalOrderId = Field(Integer)
5110 mandeep.dh 147
    fulfilmentWarehouseId = Field(Integer)
5527 anupam.sin 148
    orderType = Field(Integer)
5720 rajveer 149
    pickupStoreId = Field(Integer, default=0, server_default="0")
6525 rajveer 150
    otg = Field(Boolean, default=0, server_default="0")
7033 anupam.sin 151
    insurer = Field(Integer, default=0, server_default="0")
152
    insuranceAmount = Field(Float, default=0, server_default="0")
7190 amar.kumar 153
    freebieItemId = Field(Integer, default=0, server_default="0")
7564 rajveer 154
    source = Field(Integer, default=1, server_default="1")
7293 anupam.sin 155
    storeId = Field(Integer, default=0, server_default="0")
7549 rajveer 156
    advanceAmount = Field(Float, default=0, server_default="0")
8717 amar.kumar 157
    productCondition = Field(Integer, default=0, server_default="0")
2628 chandransh 158
    using_options(shortnames=True)
159
    using_table_options(mysql_engine="InnoDB")
5348 anupam.sin 160
 
161
class CodVerificationAgent(Entity):
162
    orderId = Field(Integer, primary_key=True, autoincrement=True)
163
    verificationAgent = Field(String(200))
164
    using_options(shortnames=True)
165
    using_table_options(mysql_engine="InnoDB")
166
 
104 ashish 167
class Transaction(Entity):
483 rajveer 168
    id = Field(Integer, primary_key=True, autoincrement=True)
169
    createdOn = Field(DateTime)
170
    status = Field(Integer)
171
    status_message = Field(String(100))
172
    customer_id = Field(Integer)
173
    shopping_cart_id = Field(Integer)
2815 vikas 174
    session_source = Field(String(100))
175
    session_start_time = Field(DateTime)
3858 vikas 176
    first_source = Field(String(100))
177
    first_source_start_time = Field(DateTime)
483 rajveer 178
    orders = OneToMany("Order")
2219 varun.gupt 179
    coupon_code = Field(String(20))
746 rajveer 180
    using_options(shortnames=True)
181
    using_table_options(mysql_engine="InnoDB")
132 ashish 182
 
4394 rajveer 183
class Alert(Entity):
132 ashish 184
    id = Field(Integer, primary_key=True, autoincrement=True)
483 rajveer 185
    type = Field(Integer)
4394 rajveer 186
    status = Field(Integer)
187
    timestamp = Field(DateTime)
188
    description = Field(String(100))
4444 rajveer 189
    warehouseId = Field(Integer)
746 rajveer 190
    using_options(shortnames=True)
1225 chandransh 191
    using_table_options(mysql_engine="InnoDB")
192
 
193
class BatchNoGenerator(Entity):
194
    id=Field(Integer, primary_key=True)
195
    using_options(shortnames=True)
196
    using_table_options(mysql_engine="InnoDB")
4008 mandeep.dh 197
 
198
class TransactionRequiringExtraProcessing(Entity):
4015 mandeep.dh 199
    transaction_id = Field(Integer, primary_key=True, autoincrement=False)
6733 anupam.sin 200
    category = Field(Enum('COD_VERIFICATION', 'DELAYED_DELIVERY', 'PAYMENT_FLAGGED', 'RECHARGE_UNKNOWN'), primary_key=True, autoincrement=False)
4008 mandeep.dh 201
    using_options(shortnames=True)
202
    using_table_options(mysql_engine="InnoDB")
4303 rajveer 203
 
204
class OrderInventory(Entity):
205
    order = ManyToOne("Order", primary_key=True)
206
    itemId = Field(Integer)
207
    timestamp = Field(DateTime)
208
    hotspotAction = Field(Integer)
209
    estimate = Field(Integer)
210
    using_options(shortnames=True)
211
    using_table_options(mysql_engine="InnoDB")
4600 varun.gupt 212
 
213
class EBSSettlementSummary(Entity):
214
    settlementId = Field(Integer, primary_key = True)
215
    settlementDate = Field(DateTime)
216
    transactionDateFrom = Field(DateTime)
217
    transactionDateTo = Field(DateTime)
5389 phani.kuma 218
    amount = Field(Numeric(precision=11, scale=3, asdecimal=False))
4600 varun.gupt 219
    detailsUploaded = Field(Boolean)
220
    using_options(shortnames=True)
221
    using_table_options(mysql_engine="InnoDB")
4905 varun.gupt 222
 
4600 varun.gupt 223
class PaymentSettlement(Entity):
4905 varun.gupt 224
    referenceId = Field(Integer)    #PaymentID in case of prepaid & Order Id in case of COD
5386 phani.kuma 225
    originalOrderId = Field(Integer)    #originalOrderId in case of prepaid is NULL & Order Id of original Order or Order Id in case of COD
4600 varun.gupt 226
    paymentGatewayId = Field(Integer)
227
    settlementDate = Field(DateTime)
5389 phani.kuma 228
    serviceTax = Field(Numeric(precision=11, scale=3, asdecimal=False))
229
    otherCharges = Field(Numeric(precision=11, scale=3, asdecimal=False))
230
    netCollection = Field(Numeric(precision=11, scale=3, asdecimal=False))
4600 varun.gupt 231
    using_options(shortnames=True)
5527 anupam.sin 232
    using_table_options(mysql_engine="InnoDB")
233
 
234
class Attribute(Entity):
235
    orderId = Field(Integer)
236
    name = Field(String(100))
237
    value = Field(String(100))
238
    using_options(shortnames=True)
6389 rajveer 239
    using_table_options(mysql_engine="InnoDB")
240
 
241
 
242
class EmiScheme(Entity):
243
    id  = Field(Integer, primary_key=True)
244
    gatewayId  = Field(Integer)
245
    bankId = Field(Integer)
246
    tenure = Field(Integer)
6396 amit.gupta 247
    bankName = Field(String(256))
248
    tenureDescription = Field(String(256))
6389 rajveer 249
    minAmount = Field(Integer)
250
    chargeType = Field(Integer)
6409 rajveer 251
    chargeValue = Field(Float)
6389 rajveer 252
    using_options(shortnames=True)
253
    using_table_options(mysql_engine="InnoDB")
254
 
255
class MiscCharges(Entity):
256
    transaction = ManyToOne("Transaction", primary_key=True)
6396 amit.gupta 257
    chargeType = Field(Integer, primary_key=True, autoincrement=False)
6389 rajveer 258
    chargeAmount = Field(Float)
259
    using_options(shortnames=True)
6580 anupam.sin 260
    using_table_options(mysql_engine="InnoDB")
261
 
6591 anupam.sin 262
class BlockedIpRange(Entity):
6580 anupam.sin 263
    id = Field(Integer, primary_key=True, autoincrement=True)
6594 anupam.sin 264
    start = Field(BigInteger)
265
    end = Field(BigInteger)
6591 anupam.sin 266
    expiredOn = Field(DateTime)
6580 anupam.sin 267
    using_options(shortnames=True)
6591 anupam.sin 268
    using_table_options(mysql_engine="InnoDB")
269
 
270
class DeniedIpAddress(Entity):
271
    id = Field(Integer, primary_key=True, autoincrement=True)
272
    ip = Field(String(256))
273
    deniedOn = Field(DateTime)
274
    rechargeType = Field(Integer)
275
    deviceNumber = Field(String(128))
276
    using_options(shortnames=True)
6903 anupam.sin 277
    using_table_options(mysql_engine="InnoDB")
278
 
279
class InsuranceDetailForOrder(Entity):
280
    id = Field(Integer, primary_key=True, autoincrement=True)
281
    dob = Field(String(64))
282
    guardianName = Field(String(255))
283
    startDate = Field(DateTime)
284
    expiryDate = Field(DateTime)
6915 anupam.sin 285
    isDeclared = Field(Boolean, default=0)
6903 anupam.sin 286
    order = ManyToOne("Order")
287
    using_options(shortnames=True)
6906 rajveer 288
    using_table_options(mysql_engine="InnoDB")
289
 
6915 anupam.sin 290
    def __init__(self):
291
        self.isDeclared = 0
292
 
6906 rajveer 293
class DocumentStore(Entity):
294
    docType = Field(Integer, primary_key=True, autoincrement=False)
295
    docSource = Field(Integer, primary_key=True, autoincrement=False)
296
    document  = Field(LargeBinary)
297
    using_options(shortnames=True)
7073 anupam.sin 298
    using_table_options(mysql_engine="InnoDB")
299
 
300
class Company(Entity):
301
    id = Field(Integer, primary_key=True, autoincrement=True)
302
    name = Field(String(255))
303
    Address = Field(String(255))
304
    using_options(shortnames=True)
305
    using_table_options(mysql_engine="InnoDB")
306
 
307
class WalletForCompany(Entity):
308
    id = Field(Integer, primary_key=True, autoincrement=True)
309
    companyId = Field(Integer)
7102 rajveer 310
    amount = Field(Integer)
7073 anupam.sin 311
    using_options(shortnames=True)
312
    using_table_options(mysql_engine="InnoDB")
313
 
314
class WalletHistoryForCompany(Entity):
315
    id = Field(Integer, primary_key=True, autoincrement=True)
316
    walletId = Field(Integer)
7102 rajveer 317
    amount = Field(Integer)
7073 anupam.sin 318
    transactionTime = Field(DateTime)
7102 rajveer 319
    openingBal = Field(Integer)
320
    closingBal = Field(Integer)
7073 anupam.sin 321
    referenceNumber = Field(Integer)
322
    description = Field(String(255))
323
    using_options(shortnames=True)
324
    using_table_options(mysql_engine="InnoDB")
325
 
326
class RechargeTransaction(Entity):
327
    id = Field(Integer, primary_key=True, autoincrement=True)
328
    storeId = Field(Integer)
7102 rajveer 329
    amount = Field(Integer)
7073 anupam.sin 330
    transactionTime = Field(DateTime)
7075 rajveer 331
    responseTime = Field(DateTime)
332
    description = Field(String(255))
333
    spiceTID = Field(String(255))
7369 rajveer 334
    aggTID = Field(String(255))
335
    providerTID = Field(String(255))
7075 rajveer 336
    plan = Field(String(255))
7073 anupam.sin 337
    deviceNum = Field(String(64))
338
    deviceType = Field(Integer)
339
    isFrc = Field(Boolean)
340
    email = Field(String(255))
7102 rajveer 341
    discount = Field(Integer)
342
    paymentAmount = Field(Integer)
7145 rajveer 343
    payMethod = Field(Integer, default=0, server_default="0")
7073 anupam.sin 344
    status = Field(Integer)
345
    invoiceNumber = Field(Integer)
346
    circleId = Field(Integer)
7075 rajveer 347
    operatorId = Field(Integer)
7073 anupam.sin 348
    name = Field(String(255))
349
    simNum = Field(String(255))
350
    cafNum = Field(String(255))
7080 anupam.sin 351
    ipAddress = Field(String(255))
352
    alternateNumber = Field(String(255))
7073 anupam.sin 353
    using_options(shortnames=True)
7075 rajveer 354
    using_table_options(mysql_engine="InnoDB")
7076 rajveer 355
 
7120 rajveer 356
class OperatorSeries(Entity):
357
    series = Field(Integer, primary_key=True, autoincrement=False)
358
    operatorId = Field(Integer)
359
    circleId = Field(Integer)
360
    using_options(shortnames=True)
361
    using_table_options(mysql_engine="InnoDB")
362
 
7076 rajveer 363
class FRC(Entity):
364
    id = Field(Integer, primary_key=True)
365
    operatorId = Field(Integer)
366
    circleId = Field(Integer)
367
    denomination = Field(Integer)
368
    maxDiscount = Field(Integer)
369
    using_options(shortnames=True)
370
    using_table_options(mysql_engine="InnoDB")
7120 rajveer 371
 
7075 rajveer 372
class HotspotStore(Entity):
373
    id = Field(Integer, primary_key=True)
374
    hotspotId = Field(String(3))
375
    companyId = Field(Integer)
376
    name = Field(String(100))
377
    city = Field(String(100))
7076 rajveer 378
    collectedAmount = Field(Integer)
7075 rajveer 379
    availableLimit = Field(Integer)
380
    creditLimit = Field(Integer)
381
    salt = Field(String(100))
382
    password = Field(String(100))
383
    isActive = Field(Boolean)
7096 anupam.sin 384
    circleId = Field(Integer)
7169 anupam.sin 385
    email = Field(String(100))
7308 rajveer 386
    line1 = Field(String(100))
387
    line2 = Field(String(100))
388
    state = Field(String(100))
389
    pin = Field(String(10))
390
    phone = Field(String(20))
7423 anupam.sin 391
    tin = Field(String(100))
7308 rajveer 392
    approvalEmail = Field(String(255))
7967 anupam.sin 393
    clusterEmail = Field(String(100))
7075 rajveer 394
    using_options(shortnames=True)
7251 rajveer 395
    using_table_options(mysql_engine="InnoDB")
396
 
397
class RechargeCollection(Entity):
398
    hotspotId = Field(String(3), primary_key=True, autoincrement=False)
399
    reconDate = Field(Integer, primary_key=True, autoincrement=False)
400
    cash = Field(Integer)
401
    hdfc = Field(Integer)
402
    grossAmount = Field(Integer)
403
    discount = Field(Integer)
404
    netCollection = Field(Integer)
405
    addedAt = Field(DateTime)
406
    pushedAt = Field(DateTime)
407
    pushedToOcr = Field(Boolean)
408
    using_options(shortnames=True)
409
    using_table_options(mysql_engine="InnoDB")
7406 rajveer 410
 
411
class StoreOrderCollection(Entity):
412
    hotspotId = Field(String(3), primary_key=True, autoincrement=False)
413
    orderId = Field(Integer, primary_key=True, autoincrement=False)
414
    collectionType = Field(String(255), primary_key=True, autoincrement=False)
415
    productName = Field(String(255))
416
    advanceAmount = Field(Integer)
417
    cash = Field(Integer)
418
    card = Field(Integer)
419
    addedAt = Field(DateTime)
420
    pushedAt = Field(DateTime)
421
    pushedToOcr = Field(Boolean)
422
    using_options(shortnames=True)
423
    using_table_options(mysql_engine="InnoDB")
7263 anupam.sin 424
 
425
class SourceDetail(Entity):
426
    id = Field(Integer, primary_key=True, autoincrement=False)
427
    name = Field(String(255))
428
    email = Field(String(255))
7410 amar.kumar 429
    tinNumber = Field(String(255))
7530 kshitij.so 430
    lastUpdatedOn = Field(DateTime)
7263 anupam.sin 431
    using_options(shortnames=True)
7311 kshitij.so 432
    using_table_options(mysql_engine="InnoDB")
433
 
434
class AmazonOrder(Entity):
435
    orderId = Field(Integer, primary_key=True, autoincrement=False)
7322 vikram.rag 436
    amazonOrderCode = Field(String(255))
437
    amazonOrderItemCode = Field(String(255))
7311 kshitij.so 438
    transactionId = Field(Integer)
439
    item_id = Field(Integer)
7322 vikram.rag 440
    status = Field(String(50))
7715 vikram.rag 441
    purchaseDateOnAmazon = Field(DateTime)
7311 kshitij.so 442
    using_options(shortnames=True)
7386 anupam.sin 443
    using_table_options(mysql_engine="InnoDB")
444
 
445
class StoreOrderDetail(Entity):
446
    orderId = Field(Integer, primary_key=True, autoincrement=False)
447
    storeId = Field(Integer, primary_key=True, autoincrement=False)
448
    advanceAmount = Field(Float)
449
    cashAmount = Field(Float)
450
    cardAmount = Field(Float)
451
    payStatus = Field(Integer)
7393 anupam.sin 452
    edcBank = Field(String(100))
453
    cashRefundAmount = Field(Float)
454
    cardRefundAmount = Field(Float)
7423 anupam.sin 455
    approvalCode = Field(String(100))
7611 anupam.sin 456
    cardType = Field(String(100))
7386 anupam.sin 457
    using_options(shortnames=True)
458
    using_table_options(mysql_engine="InnoDB")
459
 
460
class EdcBank(Entity):
461
    id = Field(Integer, primary_key=True, autoincrement=True)
462
    name = Field(String(255))
463
    using_options(shortnames=True)
7967 anupam.sin 464
    using_table_options(mysql_engine="InnoDB")
465
 
466
class HotspotServiceMatrix(Entity): 
467
    storeId = Field(Integer, primary_key=True)
468
    hotspotId = Field(String(3))
469
    rechargeService = Field(Boolean, default=0, server_default="0")
470
    storeWebsiteService = Field(Boolean, default=0, server_default="0")
471
    pickupFromStoreService = Field(Boolean, default=0, server_default="0")
472
    using_options(shortnames=True)
8182 amar.kumar 473
    using_table_options(mysql_engine="InnoDB")
474
 
475
class  EbayOrder(Entity):
476
    orderId = Field(Integer, primary_key=True, autoincrement=False)
477
    salesRecordNumber = Field(Integer)
478
    paisaPayId = Field(String(32))
479
    ebayListingId = Field(String(32))
480
    subsidyAmount = Field(Float)
481
    ebayTxnDate = Field(DateTime)
482
    transactionId = Field(String(16))
483
    listingName = Field(String(128))
484
    listingPrice = Field(Float)
8247 amar.kumar 485
    bluedartPaisaPayRef = Field(String(16))
8182 amar.kumar 486
    using_options(shortnames=True)
487
    using_table_options(mysql_engine="InnoDB")
8488 amar.kumar 488
 
489
class  SnapdealOrder(Entity):
490
    orderId = Field(Integer, primary_key=True, autoincrement=False)
491
    subOrderId = Field(Integer)
492
    referenceCode = Field(String(32))
493
    snapdealTxnDate = Field(DateTime)
494
    productName = Field(String(128))
495
    listingPrice = Field(Float)
496
    using_options(shortnames=True)
497
    using_table_options(mysql_engine="InnoDB")
8282 kshitij.so 498
 
499
class AmazonFbaSalesSnapshot(Entity):
500
    dateOfSale = Field(Date, primary_key=True)
8363 vikram.rag 501
    item_id = Field(Integer, primary_key=True,autoincrement=False)
502
    totalOrderCount = Field(Integer)
8282 kshitij.so 503
    amazonFbaInventory = Field(Integer)
504
    isOutOfStock = Field(Boolean)
505
    salePrice = Field(Float)
8445 vikram.rag 506
    ourPrice = Field(Float)
8282 kshitij.so 507
    minFbaPrice = Field(Float)
8363 vikram.rag 508
    minMfnPrice = Field(Float)
8542 vikram.rag 509
    totalSale = Field(Numeric(precision=11, scale=3, asdecimal=False))
510
    promotionSale =  Field(Numeric(precision=11, scale=3, asdecimal=False))
8363 vikram.rag 511
    promotionOrderCount = Field(Integer)
8532 vikram.rag 512
    ourPriceSnapshotDate  =  Field(DateTime)
513
    salePriceSnapshotDate  = Field(DateTime)
514
    minMfnPriceSnapshotDate = Field(DateTime)
515
    minFbaPriceSnapshotDate = Field(DateTime)
8282 kshitij.so 516
    using_options(shortnames=True)
8921 anupam.sin 517
    using_table_options(mysql_engine="InnoDB")
518
 
519
class SpiceTransactionHistory(Entity):
520
    orderId = Field(Integer, primary_key=True, autoincrement=False)
521
    spiceTID = Field(String(32))
522
    reponseCode = Field(String(32))
523
    rechargeTime = Field(DateTime)
8922 anupam.sin 524
    reconcilationTime = Field(DateTime)
525
    using_options(shortnames=True)
526
    using_table_options(mysql_engine="InnoDB")