Subversion Repositories SmartDukaan

Rev

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

Rev 4285 Rev 4295
Line 654... Line 654...
654
    Returns a map containing the number of risky orders keyed by item id. A risky order
654
    Returns a map containing the number of risky orders keyed by item id. A risky order
655
    is defined as one whose shipping date is about to expire.
655
    is defined as one whose shipping date is about to expire.
656
    """
656
    """
657
    pass
657
    pass
658
 
658
 
-
 
659
  def getOrdersForItemIds(self, itemIds):
-
 
660
    """
-
 
661
    Returns a list of all orders which have items with given id
-
 
662
 
-
 
663
    Parameters:
-
 
664
     - itemIds
-
 
665
    """
-
 
666
    pass
-
 
667
 
659
  def markOrderCancellationRequestReceived(self, orderId):
668
  def markOrderCancellationRequestReceived(self, orderId):
660
    """
669
    """
661
    Mark order as cancellation request received. If customer sends request of cancellation of
670
    Mark order as cancellation request received. If customer sends request of cancellation of
662
    a particular order, this method will be called. It will just change status of the order
671
    a particular order, this method will be called. It will just change status of the order
663
    depending on its current status. It also records the previous status, so that we can move
672
    depending on its current status. It also records the previous status, so that we can move
Line 2834... Line 2843...
2834
    self._iprot.readMessageEnd()
2843
    self._iprot.readMessageEnd()
2835
    if result.success is not None:
2844
    if result.success is not None:
2836
      return result.success
2845
      return result.success
2837
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemWiseRiskyOrdersCount failed: unknown result");
2846
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemWiseRiskyOrdersCount failed: unknown result");
2838
 
2847
 
-
 
2848
  def getOrdersForItemIds(self, itemIds):
-
 
2849
    """
-
 
2850
    Returns a list of all orders which have items with given id
-
 
2851
 
-
 
2852
    Parameters:
-
 
2853
     - itemIds
-
 
2854
    """
-
 
2855
    self.send_getOrdersForItemIds(itemIds)
-
 
2856
    return self.recv_getOrdersForItemIds()
-
 
2857
 
-
 
2858
  def send_getOrdersForItemIds(self, itemIds):
-
 
2859
    self._oprot.writeMessageBegin('getOrdersForItemIds', TMessageType.CALL, self._seqid)
-
 
2860
    args = getOrdersForItemIds_args()
-
 
2861
    args.itemIds = itemIds
-
 
2862
    args.write(self._oprot)
-
 
2863
    self._oprot.writeMessageEnd()
-
 
2864
    self._oprot.trans.flush()
-
 
2865
 
-
 
2866
  def recv_getOrdersForItemIds(self, ):
-
 
2867
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2868
    if mtype == TMessageType.EXCEPTION:
-
 
2869
      x = TApplicationException()
-
 
2870
      x.read(self._iprot)
-
 
2871
      self._iprot.readMessageEnd()
-
 
2872
      raise x
-
 
2873
    result = getOrdersForItemIds_result()
-
 
2874
    result.read(self._iprot)
-
 
2875
    self._iprot.readMessageEnd()
-
 
2876
    if result.success is not None:
-
 
2877
      return result.success
-
 
2878
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOrdersForItemIds failed: unknown result");
-
 
2879
 
2839
  def markOrderCancellationRequestReceived(self, orderId):
2880
  def markOrderCancellationRequestReceived(self, orderId):
2840
    """
2881
    """
2841
    Mark order as cancellation request received. If customer sends request of cancellation of
2882
    Mark order as cancellation request received. If customer sends request of cancellation of
2842
    a particular order, this method will be called. It will just change status of the order
2883
    a particular order, this method will be called. It will just change status of the order
2843
    depending on its current status. It also records the previous status, so that we can move
2884
    depending on its current status. It also records the previous status, so that we can move
Line 3103... Line 3144...
3103
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
3144
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
3104
    self._processMap["reconcileCodCollection"] = Processor.process_reconcileCodCollection
3145
    self._processMap["reconcileCodCollection"] = Processor.process_reconcileCodCollection
3105
    self._processMap["getTransactionsRequiringExtraProcessing"] = Processor.process_getTransactionsRequiringExtraProcessing
3146
    self._processMap["getTransactionsRequiringExtraProcessing"] = Processor.process_getTransactionsRequiringExtraProcessing
3106
    self._processMap["markTransactionAsProcessed"] = Processor.process_markTransactionAsProcessed
3147
    self._processMap["markTransactionAsProcessed"] = Processor.process_markTransactionAsProcessed
3107
    self._processMap["getItemWiseRiskyOrdersCount"] = Processor.process_getItemWiseRiskyOrdersCount
3148
    self._processMap["getItemWiseRiskyOrdersCount"] = Processor.process_getItemWiseRiskyOrdersCount
-
 
3149
    self._processMap["getOrdersForItemIds"] = Processor.process_getOrdersForItemIds
3108
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3150
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3109
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3151
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3110
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3152
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3111
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3153
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3112
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
3154
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
Line 3901... Line 3943...
3901
    oprot.writeMessageBegin("getItemWiseRiskyOrdersCount", TMessageType.REPLY, seqid)
3943
    oprot.writeMessageBegin("getItemWiseRiskyOrdersCount", TMessageType.REPLY, seqid)
3902
    result.write(oprot)
3944
    result.write(oprot)
3903
    oprot.writeMessageEnd()
3945
    oprot.writeMessageEnd()
3904
    oprot.trans.flush()
3946
    oprot.trans.flush()
3905
 
3947
 
-
 
3948
  def process_getOrdersForItemIds(self, seqid, iprot, oprot):
-
 
3949
    args = getOrdersForItemIds_args()
-
 
3950
    args.read(iprot)
-
 
3951
    iprot.readMessageEnd()
-
 
3952
    result = getOrdersForItemIds_result()
-
 
3953
    result.success = self._handler.getOrdersForItemIds(args.itemIds)
-
 
3954
    oprot.writeMessageBegin("getOrdersForItemIds", TMessageType.REPLY, seqid)
-
 
3955
    result.write(oprot)
-
 
3956
    oprot.writeMessageEnd()
-
 
3957
    oprot.trans.flush()
-
 
3958
 
3906
  def process_markOrderCancellationRequestReceived(self, seqid, iprot, oprot):
3959
  def process_markOrderCancellationRequestReceived(self, seqid, iprot, oprot):
3907
    args = markOrderCancellationRequestReceived_args()
3960
    args = markOrderCancellationRequestReceived_args()
3908
    args.read(iprot)
3961
    args.read(iprot)
3909
    iprot.readMessageEnd()
3962
    iprot.readMessageEnd()
3910
    result = markOrderCancellationRequestReceived_result()
3963
    result = markOrderCancellationRequestReceived_result()
Line 12357... Line 12410...
12357
      oprot.writeFieldEnd()
12410
      oprot.writeFieldEnd()
12358
    oprot.writeFieldStop()
12411
    oprot.writeFieldStop()
12359
    oprot.writeStructEnd()
12412
    oprot.writeStructEnd()
12360
 
12413
 
12361
  def validate(self):
12414
  def validate(self):
-
 
12415
    return
-
 
12416
 
-
 
12417
 
-
 
12418
  def __repr__(self):
-
 
12419
    L = ['%s=%r' % (key, value)
-
 
12420
      for key, value in self.__dict__.iteritems()]
-
 
12421
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12422
 
-
 
12423
  def __eq__(self, other):
-
 
12424
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12425
 
-
 
12426
  def __ne__(self, other):
-
 
12427
    return not (self == other)
-
 
12428
 
-
 
12429
class getOrdersForItemIds_args:
-
 
12430
  """
-
 
12431
  Attributes:
-
 
12432
   - itemIds
-
 
12433
  """
-
 
12434
 
-
 
12435
  thrift_spec = (
-
 
12436
    None, # 0
-
 
12437
    (1, TType.LIST, 'itemIds', (TType.I64,None), None, ), # 1
-
 
12438
  )
-
 
12439
 
-
 
12440
  def __init__(self, itemIds=None,):
-
 
12441
    self.itemIds = itemIds
-
 
12442
 
-
 
12443
  def read(self, iprot):
-
 
12444
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12445
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12446
      return
-
 
12447
    iprot.readStructBegin()
-
 
12448
    while True:
-
 
12449
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12450
      if ftype == TType.STOP:
-
 
12451
        break
-
 
12452
      if fid == 1:
-
 
12453
        if ftype == TType.LIST:
-
 
12454
          self.itemIds = []
-
 
12455
          (_etype250, _size247) = iprot.readListBegin()
-
 
12456
          for _i251 in xrange(_size247):
-
 
12457
            _elem252 = iprot.readI64();
-
 
12458
            self.itemIds.append(_elem252)
-
 
12459
          iprot.readListEnd()
-
 
12460
        else:
-
 
12461
          iprot.skip(ftype)
-
 
12462
      else:
-
 
12463
        iprot.skip(ftype)
-
 
12464
      iprot.readFieldEnd()
-
 
12465
    iprot.readStructEnd()
-
 
12466
 
-
 
12467
  def write(self, oprot):
-
 
12468
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12469
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12470
      return
-
 
12471
    oprot.writeStructBegin('getOrdersForItemIds_args')
-
 
12472
    if self.itemIds is not None:
-
 
12473
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
-
 
12474
      oprot.writeListBegin(TType.I64, len(self.itemIds))
-
 
12475
      for iter253 in self.itemIds:
-
 
12476
        oprot.writeI64(iter253)
-
 
12477
      oprot.writeListEnd()
-
 
12478
      oprot.writeFieldEnd()
-
 
12479
    oprot.writeFieldStop()
-
 
12480
    oprot.writeStructEnd()
-
 
12481
 
-
 
12482
  def validate(self):
-
 
12483
    return
-
 
12484
 
-
 
12485
 
-
 
12486
  def __repr__(self):
-
 
12487
    L = ['%s=%r' % (key, value)
-
 
12488
      for key, value in self.__dict__.iteritems()]
-
 
12489
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12490
 
-
 
12491
  def __eq__(self, other):
-
 
12492
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12493
 
-
 
12494
  def __ne__(self, other):
-
 
12495
    return not (self == other)
-
 
12496
 
-
 
12497
class getOrdersForItemIds_result:
-
 
12498
  """
-
 
12499
  Attributes:
-
 
12500
   - success
-
 
12501
  """
-
 
12502
 
-
 
12503
  thrift_spec = (
-
 
12504
    (0, TType.LIST, 'success', (TType.STRUCT,(Order, Order.thrift_spec)), None, ), # 0
-
 
12505
  )
-
 
12506
 
-
 
12507
  def __init__(self, success=None,):
-
 
12508
    self.success = success
-
 
12509
 
-
 
12510
  def read(self, iprot):
-
 
12511
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12512
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12513
      return
-
 
12514
    iprot.readStructBegin()
-
 
12515
    while True:
-
 
12516
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12517
      if ftype == TType.STOP:
-
 
12518
        break
-
 
12519
      if fid == 0:
-
 
12520
        if ftype == TType.LIST:
-
 
12521
          self.success = []
-
 
12522
          (_etype257, _size254) = iprot.readListBegin()
-
 
12523
          for _i258 in xrange(_size254):
-
 
12524
            _elem259 = Order()
-
 
12525
            _elem259.read(iprot)
-
 
12526
            self.success.append(_elem259)
-
 
12527
          iprot.readListEnd()
-
 
12528
        else:
-
 
12529
          iprot.skip(ftype)
-
 
12530
      else:
-
 
12531
        iprot.skip(ftype)
-
 
12532
      iprot.readFieldEnd()
-
 
12533
    iprot.readStructEnd()
-
 
12534
 
-
 
12535
  def write(self, oprot):
-
 
12536
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12537
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12538
      return
-
 
12539
    oprot.writeStructBegin('getOrdersForItemIds_result')
-
 
12540
    if self.success is not None:
-
 
12541
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
12542
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
12543
      for iter260 in self.success:
-
 
12544
        iter260.write(oprot)
-
 
12545
      oprot.writeListEnd()
-
 
12546
      oprot.writeFieldEnd()
-
 
12547
    oprot.writeFieldStop()
-
 
12548
    oprot.writeStructEnd()
-
 
12549
 
-
 
12550
  def validate(self):
12362
    return
12551
    return
12363
 
12552
 
12364
 
12553
 
12365
  def __repr__(self):
12554
  def __repr__(self):
12366
    L = ['%s=%r' % (key, value)
12555
    L = ['%s=%r' % (key, value)