Subversion Repositories SmartDukaan

Rev

Rev 1627 | Rev 1886 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1627 Rev 1731
Line 331... Line 331...
331
    """
331
    """
332
    Returns the number of distinct customers who have done successful transactions
332
    Returns the number of distinct customers who have done successful transactions
333
    """
333
    """
334
    pass
334
    pass
335
 
335
 
336
  def getMaxValidOrderAmount(self, ):
336
  def getValidOrdersAmountRange(self, ):
337
    """
337
    """
338
    Returns the maximum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
338
    Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
339
    """
-
 
340
    pass
-
 
341
 
-
 
342
  def getMinValidOrderAmount(self, ):
-
 
343
    """
-
 
344
    Returns the minimum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
339
    List contains two values, first minimum amount and second maximum amount.
345
    """
340
    """
346
    pass
341
    pass
347
 
342
 
348
 
343
 
349
class Client(Iface):
344
class Client(Iface):
Line 1551... Line 1546...
1551
    self._iprot.readMessageEnd()
1546
    self._iprot.readMessageEnd()
1552
    if result.success != None:
1547
    if result.success != None:
1553
      return result.success
1548
      return result.success
1554
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getNoOfCustomersWithSuccessfulTransaction failed: unknown result");
1549
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getNoOfCustomersWithSuccessfulTransaction failed: unknown result");
1555
 
1550
 
1556
  def getMaxValidOrderAmount(self, ):
1551
  def getValidOrdersAmountRange(self, ):
1557
    """
-
 
1558
    Returns the maximum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
1559
    """
-
 
1560
    self.send_getMaxValidOrderAmount()
-
 
1561
    return self.recv_getMaxValidOrderAmount()
-
 
1562
 
-
 
1563
  def send_getMaxValidOrderAmount(self, ):
-
 
1564
    self._oprot.writeMessageBegin('getMaxValidOrderAmount', TMessageType.CALL, self._seqid)
-
 
1565
    args = getMaxValidOrderAmount_args()
-
 
1566
    args.write(self._oprot)
-
 
1567
    self._oprot.writeMessageEnd()
-
 
1568
    self._oprot.trans.flush()
-
 
1569
 
-
 
1570
  def recv_getMaxValidOrderAmount(self, ):
-
 
1571
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1572
    if mtype == TMessageType.EXCEPTION:
-
 
1573
      x = TApplicationException()
-
 
1574
      x.read(self._iprot)
-
 
1575
      self._iprot.readMessageEnd()
-
 
1576
      raise x
-
 
1577
    result = getMaxValidOrderAmount_result()
-
 
1578
    result.read(self._iprot)
-
 
1579
    self._iprot.readMessageEnd()
-
 
1580
    if result.success != None:
-
 
1581
      return result.success
-
 
1582
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMaxValidOrderAmount failed: unknown result");
-
 
1583
 
-
 
1584
  def getMinValidOrderAmount(self, ):
-
 
1585
    """
1552
    """
1586
    Returns the minimum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
1553
    Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
1554
    List contains two values, first minimum amount and second maximum amount.
1587
    """
1555
    """
1588
    self.send_getMinValidOrderAmount()
1556
    self.send_getValidOrdersAmountRange()
1589
    return self.recv_getMinValidOrderAmount()
1557
    return self.recv_getValidOrdersAmountRange()
1590
 
1558
 
1591
  def send_getMinValidOrderAmount(self, ):
1559
  def send_getValidOrdersAmountRange(self, ):
1592
    self._oprot.writeMessageBegin('getMinValidOrderAmount', TMessageType.CALL, self._seqid)
1560
    self._oprot.writeMessageBegin('getValidOrdersAmountRange', TMessageType.CALL, self._seqid)
1593
    args = getMinValidOrderAmount_args()
1561
    args = getValidOrdersAmountRange_args()
1594
    args.write(self._oprot)
1562
    args.write(self._oprot)
1595
    self._oprot.writeMessageEnd()
1563
    self._oprot.writeMessageEnd()
1596
    self._oprot.trans.flush()
1564
    self._oprot.trans.flush()
1597
 
1565
 
1598
  def recv_getMinValidOrderAmount(self, ):
1566
  def recv_getValidOrdersAmountRange(self, ):
1599
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
1567
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
1600
    if mtype == TMessageType.EXCEPTION:
1568
    if mtype == TMessageType.EXCEPTION:
1601
      x = TApplicationException()
1569
      x = TApplicationException()
1602
      x.read(self._iprot)
1570
      x.read(self._iprot)
1603
      self._iprot.readMessageEnd()
1571
      self._iprot.readMessageEnd()
1604
      raise x
1572
      raise x
1605
    result = getMinValidOrderAmount_result()
1573
    result = getValidOrdersAmountRange_result()
1606
    result.read(self._iprot)
1574
    result.read(self._iprot)
1607
    self._iprot.readMessageEnd()
1575
    self._iprot.readMessageEnd()
1608
    if result.success != None:
1576
    if result.success != None:
1609
      return result.success
1577
      return result.success
1610
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMinValidOrderAmount failed: unknown result");
1578
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrdersAmountRange failed: unknown result");
1611
 
1579
 
1612
 
1580
 
1613
class Processor(Iface, TProcessor):
1581
class Processor(Iface, TProcessor):
1614
  def __init__(self, handler):
1582
  def __init__(self, handler):
1615
    self._handler = handler
1583
    self._handler = handler
Line 1647... Line 1615...
1647
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
1615
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
1648
    self._processMap["getAlerts"] = Processor.process_getAlerts
1616
    self._processMap["getAlerts"] = Processor.process_getAlerts
1649
    self._processMap["setAlert"] = Processor.process_setAlert
1617
    self._processMap["setAlert"] = Processor.process_setAlert
1650
    self._processMap["getValidOrderCount"] = Processor.process_getValidOrderCount
1618
    self._processMap["getValidOrderCount"] = Processor.process_getValidOrderCount
1651
    self._processMap["getNoOfCustomersWithSuccessfulTransaction"] = Processor.process_getNoOfCustomersWithSuccessfulTransaction
1619
    self._processMap["getNoOfCustomersWithSuccessfulTransaction"] = Processor.process_getNoOfCustomersWithSuccessfulTransaction
1652
    self._processMap["getMaxValidOrderAmount"] = Processor.process_getMaxValidOrderAmount
-
 
1653
    self._processMap["getMinValidOrderAmount"] = Processor.process_getMinValidOrderAmount
1620
    self._processMap["getValidOrdersAmountRange"] = Processor.process_getValidOrdersAmountRange
1654
 
1621
 
1655
  def process(self, iprot, oprot):
1622
  def process(self, iprot, oprot):
1656
    (name, type, seqid) = iprot.readMessageBegin()
1623
    (name, type, seqid) = iprot.readMessageBegin()
1657
    if name not in self._processMap:
1624
    if name not in self._processMap:
1658
      iprot.skip(TType.STRUCT)
1625
      iprot.skip(TType.STRUCT)
Line 2137... Line 2104...
2137
    oprot.writeMessageBegin("getNoOfCustomersWithSuccessfulTransaction", TMessageType.REPLY, seqid)
2104
    oprot.writeMessageBegin("getNoOfCustomersWithSuccessfulTransaction", TMessageType.REPLY, seqid)
2138
    result.write(oprot)
2105
    result.write(oprot)
2139
    oprot.writeMessageEnd()
2106
    oprot.writeMessageEnd()
2140
    oprot.trans.flush()
2107
    oprot.trans.flush()
2141
 
2108
 
2142
  def process_getMaxValidOrderAmount(self, seqid, iprot, oprot):
2109
  def process_getValidOrdersAmountRange(self, seqid, iprot, oprot):
2143
    args = getMaxValidOrderAmount_args()
2110
    args = getValidOrdersAmountRange_args()
2144
    args.read(iprot)
2111
    args.read(iprot)
2145
    iprot.readMessageEnd()
2112
    iprot.readMessageEnd()
2146
    result = getMaxValidOrderAmount_result()
2113
    result = getValidOrdersAmountRange_result()
2147
    result.success = self._handler.getMaxValidOrderAmount()
2114
    result.success = self._handler.getValidOrdersAmountRange()
2148
    oprot.writeMessageBegin("getMaxValidOrderAmount", TMessageType.REPLY, seqid)
-
 
2149
    result.write(oprot)
-
 
2150
    oprot.writeMessageEnd()
-
 
2151
    oprot.trans.flush()
-
 
2152
 
-
 
2153
  def process_getMinValidOrderAmount(self, seqid, iprot, oprot):
-
 
2154
    args = getMinValidOrderAmount_args()
-
 
2155
    args.read(iprot)
-
 
2156
    iprot.readMessageEnd()
-
 
2157
    result = getMinValidOrderAmount_result()
-
 
2158
    result.success = self._handler.getMinValidOrderAmount()
-
 
2159
    oprot.writeMessageBegin("getMinValidOrderAmount", TMessageType.REPLY, seqid)
2115
    oprot.writeMessageBegin("getValidOrdersAmountRange", TMessageType.REPLY, seqid)
2160
    result.write(oprot)
2116
    result.write(oprot)
2161
    oprot.writeMessageEnd()
2117
    oprot.writeMessageEnd()
2162
    oprot.trans.flush()
2118
    oprot.trans.flush()
2163
 
2119
 
2164
 
2120
 
Line 6859... Line 6815...
6859
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
6815
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
6860
 
6816
 
6861
  def __ne__(self, other):
6817
  def __ne__(self, other):
6862
    return not (self == other)
6818
    return not (self == other)
6863
 
6819
 
6864
class getMaxValidOrderAmount_args:
6820
class getValidOrdersAmountRange_args:
6865
 
6821
 
6866
  thrift_spec = (
6822
  thrift_spec = (
6867
  )
6823
  )
6868
 
6824
 
6869
  def read(self, iprot):
6825
  def read(self, iprot):
Line 6882... Line 6838...
6882
 
6838
 
6883
  def write(self, oprot):
6839
  def write(self, oprot):
6884
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
6840
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
6885
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
6841
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
6886
      return
6842
      return
6887
    oprot.writeStructBegin('getMaxValidOrderAmount_args')
6843
    oprot.writeStructBegin('getValidOrdersAmountRange_args')
6888
    oprot.writeFieldStop()
6844
    oprot.writeFieldStop()
6889
    oprot.writeStructEnd()
6845
    oprot.writeStructEnd()
6890
 
6846
 
6891
  def __repr__(self):
6847
  def __repr__(self):
6892
    L = ['%s=%r' % (key, value)
6848
    L = ['%s=%r' % (key, value)
Line 6897... Line 6853...
6897
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
6853
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
6898
 
6854
 
6899
  def __ne__(self, other):
6855
  def __ne__(self, other):
6900
    return not (self == other)
6856
    return not (self == other)
6901
 
6857
 
6902
class getMaxValidOrderAmount_result:
6858
class getValidOrdersAmountRange_result:
6903
  """
6859
  """
6904
  Attributes:
6860
  Attributes:
6905
   - success
6861
   - success
6906
  """
6862
  """
6907
 
6863
 
6908
  thrift_spec = (
6864
  thrift_spec = (
6909
    (0, TType.DOUBLE, 'success', None, None, ), # 0
6865
    (0, TType.LIST, 'success', (TType.DOUBLE,None), None, ), # 0
6910
  )
6866
  )
6911
 
6867
 
6912
  def __init__(self, success=None,):
6868
  def __init__(self, success=None,):
6913
    self.success = success
6869
    self.success = success
6914
 
6870
 
Line 6920... Line 6876...
6920
    while True:
6876
    while True:
6921
      (fname, ftype, fid) = iprot.readFieldBegin()
6877
      (fname, ftype, fid) = iprot.readFieldBegin()
6922
      if ftype == TType.STOP:
6878
      if ftype == TType.STOP:
6923
        break
6879
        break
6924
      if fid == 0:
6880
      if fid == 0:
6925
        if ftype == TType.DOUBLE:
6881
        if ftype == TType.LIST:
6926
          self.success = iprot.readDouble();
-
 
6927
        else:
-
 
6928
          iprot.skip(ftype)
-
 
6929
      else:
-
 
6930
        iprot.skip(ftype)
-
 
6931
      iprot.readFieldEnd()
-
 
6932
    iprot.readStructEnd()
-
 
6933
 
-
 
6934
  def write(self, oprot):
-
 
6935
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6936
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6937
      return
-
 
6938
    oprot.writeStructBegin('getMaxValidOrderAmount_result')
-
 
6939
    if self.success != None:
6882
          self.success = []
6940
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
-
 
6941
      oprot.writeDouble(self.success)
-
 
6942
      oprot.writeFieldEnd()
-
 
6943
    oprot.writeFieldStop()
-
 
6944
    oprot.writeStructEnd()
-
 
6945
 
-
 
6946
  def __repr__(self):
-
 
6947
    L = ['%s=%r' % (key, value)
-
 
6948
      for key, value in self.__dict__.iteritems()]
-
 
6949
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6950
 
-
 
6951
  def __eq__(self, other):
-
 
6952
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6953
 
-
 
6954
  def __ne__(self, other):
-
 
6955
    return not (self == other)
-
 
6956
 
-
 
6957
class getMinValidOrderAmount_args:
-
 
6958
 
-
 
6959
  thrift_spec = (
-
 
6960
  )
-
 
6961
 
-
 
6962
  def read(self, iprot):
-
 
6963
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6964
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6965
      return
-
 
6966
    iprot.readStructBegin()
-
 
6967
    while True:
-
 
6968
      (fname, ftype, fid) = iprot.readFieldBegin()
6883
          (_etype144, _size141) = iprot.readListBegin()
6969
      if ftype == TType.STOP:
-
 
6970
        break
-
 
6971
      else:
-
 
6972
        iprot.skip(ftype)
-
 
6973
      iprot.readFieldEnd()
-
 
6974
    iprot.readStructEnd()
-
 
6975
 
-
 
6976
  def write(self, oprot):
-
 
6977
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6978
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6979
      return
-
 
6980
    oprot.writeStructBegin('getMinValidOrderAmount_args')
-
 
6981
    oprot.writeFieldStop()
-
 
6982
    oprot.writeStructEnd()
-
 
6983
 
-
 
6984
  def __repr__(self):
-
 
6985
    L = ['%s=%r' % (key, value)
-
 
6986
      for key, value in self.__dict__.iteritems()]
6884
          for _i145 in xrange(_size141):
6987
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6988
 
-
 
6989
  def __eq__(self, other):
-
 
6990
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6991
 
-
 
6992
  def __ne__(self, other):
-
 
6993
    return not (self == other)
-
 
6994
 
-
 
6995
class getMinValidOrderAmount_result:
-
 
6996
  """
-
 
6997
  Attributes:
-
 
6998
   - success
-
 
6999
  """
-
 
7000
 
-
 
7001
  thrift_spec = (
-
 
7002
    (0, TType.DOUBLE, 'success', None, None, ), # 0
-
 
7003
  )
-
 
7004
 
-
 
7005
  def __init__(self, success=None,):
-
 
7006
    self.success = success
-
 
7007
 
-
 
7008
  def read(self, iprot):
-
 
7009
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7010
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7011
      return
-
 
7012
    iprot.readStructBegin()
-
 
7013
    while True:
-
 
7014
      (fname, ftype, fid) = iprot.readFieldBegin()
6885
            _elem146 = iprot.readDouble();
7015
      if ftype == TType.STOP:
-
 
7016
        break
-
 
7017
      if fid == 0:
-
 
7018
        if ftype == TType.DOUBLE:
6886
            self.success.append(_elem146)
7019
          self.success = iprot.readDouble();
6887
          iprot.readListEnd()
7020
        else:
6888
        else:
7021
          iprot.skip(ftype)
6889
          iprot.skip(ftype)
7022
      else:
6890
      else:
7023
        iprot.skip(ftype)
6891
        iprot.skip(ftype)
7024
      iprot.readFieldEnd()
6892
      iprot.readFieldEnd()
Line 7026... Line 6894...
7026
 
6894
 
7027
  def write(self, oprot):
6895
  def write(self, oprot):
7028
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
6896
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
7029
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
6897
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
7030
      return
6898
      return
7031
    oprot.writeStructBegin('getMinValidOrderAmount_result')
6899
    oprot.writeStructBegin('getValidOrdersAmountRange_result')
7032
    if self.success != None:
6900
    if self.success != None:
7033
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
6901
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
6902
      oprot.writeListBegin(TType.DOUBLE, len(self.success))
-
 
6903
      for iter147 in self.success:
7034
      oprot.writeDouble(self.success)
6904
        oprot.writeDouble(iter147)
-
 
6905
      oprot.writeListEnd()
7035
      oprot.writeFieldEnd()
6906
      oprot.writeFieldEnd()
7036
    oprot.writeFieldStop()
6907
    oprot.writeFieldStop()
7037
    oprot.writeStructEnd()
6908
    oprot.writeStructEnd()
7038
 
6909
 
7039
  def __repr__(self):
6910
  def __repr__(self):