Subversion Repositories SmartDukaan

Rev

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

Rev 1274 Rev 1466
Line 282... Line 282...
282
 
282
 
283
  def validateCart(self, cartId):
283
  def validateCart(self, cartId):
284
    """
284
    """
285
    Validates that:
285
    Validates that:
286
    1. The checkout timestamp is greater than the updatedOn timestamp.
286
    1. The checkout timestamp is greater than the updatedOn timestamp.
287
    2. None of the lines in the cart for an inactive item.
287
    2. All of the lines in the cart are active items.
288
    3. The estimate for any of the lines in cart doesn't change.
288
    3. The estimate for any of the lines in cart doesn't change.
289
    Returns true only if all three hold.
289
    If all three are true, returns empty string; else returns appropriate message.
290
    
290
    
291
    Parameters:
291
    Parameters:
292
     - cartId
292
     - cartId
293
    """
293
    """
294
    pass
294
    pass
Line 1482... Line 1482...
1482
 
1482
 
1483
  def validateCart(self, cartId):
1483
  def validateCart(self, cartId):
1484
    """
1484
    """
1485
    Validates that:
1485
    Validates that:
1486
    1. The checkout timestamp is greater than the updatedOn timestamp.
1486
    1. The checkout timestamp is greater than the updatedOn timestamp.
1487
    2. None of the lines in the cart for an inactive item.
1487
    2. All of the lines in the cart are active items.
1488
    3. The estimate for any of the lines in cart doesn't change.
1488
    3. The estimate for any of the lines in cart doesn't change.
1489
    Returns true only if all three hold.
1489
    If all three are true, returns empty string; else returns appropriate message.
1490
    
1490
    
1491
    Parameters:
1491
    Parameters:
1492
     - cartId
1492
     - cartId
1493
    """
1493
    """
1494
    self.send_validateCart(cartId)
1494
    self.send_validateCart(cartId)
Line 6905... Line 6905...
6905
   - success
6905
   - success
6906
   - scex
6906
   - scex
6907
  """
6907
  """
6908
 
6908
 
6909
  thrift_spec = (
6909
  thrift_spec = (
6910
    (0, TType.BOOL, 'success', None, None, ), # 0
6910
    (0, TType.STRING, 'success', None, None, ), # 0
6911
    (1, TType.STRUCT, 'scex', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
6911
    (1, TType.STRUCT, 'scex', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
6912
  )
6912
  )
6913
 
6913
 
6914
  def __init__(self, success=None, scex=None,):
6914
  def __init__(self, success=None, scex=None,):
6915
    self.success = success
6915
    self.success = success
Line 6923... Line 6923...
6923
    while True:
6923
    while True:
6924
      (fname, ftype, fid) = iprot.readFieldBegin()
6924
      (fname, ftype, fid) = iprot.readFieldBegin()
6925
      if ftype == TType.STOP:
6925
      if ftype == TType.STOP:
6926
        break
6926
        break
6927
      if fid == 0:
6927
      if fid == 0:
6928
        if ftype == TType.BOOL:
6928
        if ftype == TType.STRING:
6929
          self.success = iprot.readBool();
6929
          self.success = iprot.readString();
6930
        else:
6930
        else:
6931
          iprot.skip(ftype)
6931
          iprot.skip(ftype)
6932
      elif fid == 1:
6932
      elif fid == 1:
6933
        if ftype == TType.STRUCT:
6933
        if ftype == TType.STRUCT:
6934
          self.scex = ShoppingCartException()
6934
          self.scex = ShoppingCartException()
Line 6944... Line 6944...
6944
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
6944
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
6945
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
6945
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
6946
      return
6946
      return
6947
    oprot.writeStructBegin('validateCart_result')
6947
    oprot.writeStructBegin('validateCart_result')
6948
    if self.success != None:
6948
    if self.success != None:
6949
      oprot.writeFieldBegin('success', TType.BOOL, 0)
6949
      oprot.writeFieldBegin('success', TType.STRING, 0)
6950
      oprot.writeBool(self.success)
6950
      oprot.writeString(self.success)
6951
      oprot.writeFieldEnd()
6951
      oprot.writeFieldEnd()
6952
    if self.scex != None:
6952
    if self.scex != None:
6953
      oprot.writeFieldBegin('scex', TType.STRUCT, 1)
6953
      oprot.writeFieldBegin('scex', TType.STRUCT, 1)
6954
      self.scex.write(oprot)
6954
      self.scex.write(oprot)
6955
      oprot.writeFieldEnd()
6955
      oprot.writeFieldEnd()