Subversion Repositories SmartDukaan

Rev

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

Rev 4488 Rev 4495
Line 532... Line 532...
532
     - orderId
532
     - orderId
533
     - isValid
533
     - isValid
534
    """
534
    """
535
    pass
535
    pass
536
 
536
 
-
 
537
  def validateReturnProduct(self, orderId, isUsable):
-
 
538
    """
-
 
539
    Parameters:
-
 
540
     - orderId
-
 
541
     - isUsable
-
 
542
    """
-
 
543
    pass
-
 
544
 
537
  def reshipOrder(self, orderId):
545
  def reshipOrder(self, orderId):
538
    """
546
    """
539
    If the order is in RTO_RECEIVED_PRESTINE or DOA_CERT_INVALID state, it does the following:
547
    If the order is in RTO_RECEIVED_PRESTINE or DOA_CERT_INVALID state, it does the following:
540
    	1. Creates a new order for processing in the BILLED state. All billing information is saved.
548
    	1. Creates a new order for processing in the BILLED state. All billing information is saved.
541
    	2. Marks the current order as one of the final states RTO_RESHIPPED and DOA_INVALID_RESHIPPED depending on what state the order started in.
549
    	2. Marks the current order as one of the final states RTO_RESHIPPED and DOA_INVALID_RESHIPPED depending on what state the order started in.
Line 2648... Line 2656...
2648
      return result.success
2656
      return result.success
2649
    if result.ex is not None:
2657
    if result.ex is not None:
2650
      raise result.ex
2658
      raise result.ex
2651
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validateDoa failed: unknown result");
2659
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validateDoa failed: unknown result");
2652
 
2660
 
-
 
2661
  def validateReturnProduct(self, orderId, isUsable):
-
 
2662
    """
-
 
2663
    Parameters:
-
 
2664
     - orderId
-
 
2665
     - isUsable
-
 
2666
    """
-
 
2667
    self.send_validateReturnProduct(orderId, isUsable)
-
 
2668
    return self.recv_validateReturnProduct()
-
 
2669
 
-
 
2670
  def send_validateReturnProduct(self, orderId, isUsable):
-
 
2671
    self._oprot.writeMessageBegin('validateReturnProduct', TMessageType.CALL, self._seqid)
-
 
2672
    args = validateReturnProduct_args()
-
 
2673
    args.orderId = orderId
-
 
2674
    args.isUsable = isUsable
-
 
2675
    args.write(self._oprot)
-
 
2676
    self._oprot.writeMessageEnd()
-
 
2677
    self._oprot.trans.flush()
-
 
2678
 
-
 
2679
  def recv_validateReturnProduct(self, ):
-
 
2680
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2681
    if mtype == TMessageType.EXCEPTION:
-
 
2682
      x = TApplicationException()
-
 
2683
      x.read(self._iprot)
-
 
2684
      self._iprot.readMessageEnd()
-
 
2685
      raise x
-
 
2686
    result = validateReturnProduct_result()
-
 
2687
    result.read(self._iprot)
-
 
2688
    self._iprot.readMessageEnd()
-
 
2689
    if result.success is not None:
-
 
2690
      return result.success
-
 
2691
    if result.ex is not None:
-
 
2692
      raise result.ex
-
 
2693
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validateReturnProduct failed: unknown result");
-
 
2694
 
2653
  def reshipOrder(self, orderId):
2695
  def reshipOrder(self, orderId):
2654
    """
2696
    """
2655
    If the order is in RTO_RECEIVED_PRESTINE or DOA_CERT_INVALID state, it does the following:
2697
    If the order is in RTO_RECEIVED_PRESTINE or DOA_CERT_INVALID state, it does the following:
2656
    	1. Creates a new order for processing in the BILLED state. All billing information is saved.
2698
    	1. Creates a new order for processing in the BILLED state. All billing information is saved.
2657
    	2. Marks the current order as one of the final states RTO_RESHIPPED and DOA_INVALID_RESHIPPED depending on what state the order started in.
2699
    	2. Marks the current order as one of the final states RTO_RESHIPPED and DOA_INVALID_RESHIPPED depending on what state the order started in.
Line 3693... Line 3735...
3693
    self._processMap["requestPickupNumber"] = Processor.process_requestPickupNumber
3735
    self._processMap["requestPickupNumber"] = Processor.process_requestPickupNumber
3694
    self._processMap["authorizePickup"] = Processor.process_authorizePickup
3736
    self._processMap["authorizePickup"] = Processor.process_authorizePickup
3695
    self._processMap["markDoasAsPickedUp"] = Processor.process_markDoasAsPickedUp
3737
    self._processMap["markDoasAsPickedUp"] = Processor.process_markDoasAsPickedUp
3696
    self._processMap["receiveReturn"] = Processor.process_receiveReturn
3738
    self._processMap["receiveReturn"] = Processor.process_receiveReturn
3697
    self._processMap["validateDoa"] = Processor.process_validateDoa
3739
    self._processMap["validateDoa"] = Processor.process_validateDoa
-
 
3740
    self._processMap["validateReturnProduct"] = Processor.process_validateReturnProduct
3698
    self._processMap["reshipOrder"] = Processor.process_reshipOrder
3741
    self._processMap["reshipOrder"] = Processor.process_reshipOrder
3699
    self._processMap["refundOrder"] = Processor.process_refundOrder
3742
    self._processMap["refundOrder"] = Processor.process_refundOrder
3700
    self._processMap["getReturnOrders"] = Processor.process_getReturnOrders
3743
    self._processMap["getReturnOrders"] = Processor.process_getReturnOrders
3701
    self._processMap["getReturnOrder"] = Processor.process_getReturnOrder
3744
    self._processMap["getReturnOrder"] = Processor.process_getReturnOrder
3702
    self._processMap["processReturn"] = Processor.process_processReturn
3745
    self._processMap["processReturn"] = Processor.process_processReturn
Line 4409... Line 4452...
4409
    oprot.writeMessageBegin("validateDoa", TMessageType.REPLY, seqid)
4452
    oprot.writeMessageBegin("validateDoa", TMessageType.REPLY, seqid)
4410
    result.write(oprot)
4453
    result.write(oprot)
4411
    oprot.writeMessageEnd()
4454
    oprot.writeMessageEnd()
4412
    oprot.trans.flush()
4455
    oprot.trans.flush()
4413
 
4456
 
-
 
4457
  def process_validateReturnProduct(self, seqid, iprot, oprot):
-
 
4458
    args = validateReturnProduct_args()
-
 
4459
    args.read(iprot)
-
 
4460
    iprot.readMessageEnd()
-
 
4461
    result = validateReturnProduct_result()
-
 
4462
    try:
-
 
4463
      result.success = self._handler.validateReturnProduct(args.orderId, args.isUsable)
-
 
4464
    except TransactionServiceException, ex:
-
 
4465
      result.ex = ex
-
 
4466
    oprot.writeMessageBegin("validateReturnProduct", TMessageType.REPLY, seqid)
-
 
4467
    result.write(oprot)
-
 
4468
    oprot.writeMessageEnd()
-
 
4469
    oprot.trans.flush()
-
 
4470
 
4414
  def process_reshipOrder(self, seqid, iprot, oprot):
4471
  def process_reshipOrder(self, seqid, iprot, oprot):
4415
    args = reshipOrder_args()
4472
    args = reshipOrder_args()
4416
    args.read(iprot)
4473
    args.read(iprot)
4417
    iprot.readMessageEnd()
4474
    iprot.readMessageEnd()
4418
    result = reshipOrder_result()
4475
    result = reshipOrder_result()
Line 12014... Line 12071...
12014
    if self.success is not None:
12071
    if self.success is not None:
12015
      oprot.writeFieldBegin('success', TType.BOOL, 0)
12072
      oprot.writeFieldBegin('success', TType.BOOL, 0)
12016
      oprot.writeBool(self.success)
12073
      oprot.writeBool(self.success)
12017
      oprot.writeFieldEnd()
12074
      oprot.writeFieldEnd()
12018
    if self.ex is not None:
12075
    if self.ex is not None:
-
 
12076
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
12077
      self.ex.write(oprot)
-
 
12078
      oprot.writeFieldEnd()
-
 
12079
    oprot.writeFieldStop()
-
 
12080
    oprot.writeStructEnd()
-
 
12081
 
-
 
12082
  def validate(self):
-
 
12083
    return
-
 
12084
 
-
 
12085
 
-
 
12086
  def __repr__(self):
-
 
12087
    L = ['%s=%r' % (key, value)
-
 
12088
      for key, value in self.__dict__.iteritems()]
-
 
12089
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12090
 
-
 
12091
  def __eq__(self, other):
-
 
12092
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12093
 
-
 
12094
  def __ne__(self, other):
-
 
12095
    return not (self == other)
-
 
12096
 
-
 
12097
class validateReturnProduct_args:
-
 
12098
  """
-
 
12099
  Attributes:
-
 
12100
   - orderId
-
 
12101
   - isUsable
-
 
12102
  """
-
 
12103
 
-
 
12104
  thrift_spec = (
-
 
12105
    None, # 0
-
 
12106
    (1, TType.I64, 'orderId', None, None, ), # 1
-
 
12107
    (2, TType.BOOL, 'isUsable', None, None, ), # 2
-
 
12108
  )
-
 
12109
 
-
 
12110
  def __init__(self, orderId=None, isUsable=None,):
-
 
12111
    self.orderId = orderId
-
 
12112
    self.isUsable = isUsable
-
 
12113
 
-
 
12114
  def read(self, iprot):
-
 
12115
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12116
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12117
      return
-
 
12118
    iprot.readStructBegin()
-
 
12119
    while True:
-
 
12120
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12121
      if ftype == TType.STOP:
-
 
12122
        break
-
 
12123
      if fid == 1:
-
 
12124
        if ftype == TType.I64:
-
 
12125
          self.orderId = iprot.readI64();
-
 
12126
        else:
-
 
12127
          iprot.skip(ftype)
-
 
12128
      elif fid == 2:
-
 
12129
        if ftype == TType.BOOL:
-
 
12130
          self.isUsable = iprot.readBool();
-
 
12131
        else:
-
 
12132
          iprot.skip(ftype)
-
 
12133
      else:
-
 
12134
        iprot.skip(ftype)
-
 
12135
      iprot.readFieldEnd()
-
 
12136
    iprot.readStructEnd()
-
 
12137
 
-
 
12138
  def write(self, oprot):
-
 
12139
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12140
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12141
      return
-
 
12142
    oprot.writeStructBegin('validateReturnProduct_args')
-
 
12143
    if self.orderId is not None:
-
 
12144
      oprot.writeFieldBegin('orderId', TType.I64, 1)
-
 
12145
      oprot.writeI64(self.orderId)
-
 
12146
      oprot.writeFieldEnd()
-
 
12147
    if self.isUsable is not None:
-
 
12148
      oprot.writeFieldBegin('isUsable', TType.BOOL, 2)
-
 
12149
      oprot.writeBool(self.isUsable)
-
 
12150
      oprot.writeFieldEnd()
-
 
12151
    oprot.writeFieldStop()
-
 
12152
    oprot.writeStructEnd()
-
 
12153
 
-
 
12154
  def validate(self):
-
 
12155
    return
-
 
12156
 
-
 
12157
 
-
 
12158
  def __repr__(self):
-
 
12159
    L = ['%s=%r' % (key, value)
-
 
12160
      for key, value in self.__dict__.iteritems()]
-
 
12161
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12162
 
-
 
12163
  def __eq__(self, other):
-
 
12164
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12165
 
-
 
12166
  def __ne__(self, other):
-
 
12167
    return not (self == other)
-
 
12168
 
-
 
12169
class validateReturnProduct_result:
-
 
12170
  """
-
 
12171
  Attributes:
-
 
12172
   - success
-
 
12173
   - ex
-
 
12174
  """
-
 
12175
 
-
 
12176
  thrift_spec = (
-
 
12177
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
12178
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
12179
  )
-
 
12180
 
-
 
12181
  def __init__(self, success=None, ex=None,):
-
 
12182
    self.success = success
-
 
12183
    self.ex = ex
-
 
12184
 
-
 
12185
  def read(self, iprot):
-
 
12186
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12187
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12188
      return
-
 
12189
    iprot.readStructBegin()
-
 
12190
    while True:
-
 
12191
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12192
      if ftype == TType.STOP:
-
 
12193
        break
-
 
12194
      if fid == 0:
-
 
12195
        if ftype == TType.BOOL:
-
 
12196
          self.success = iprot.readBool();
-
 
12197
        else:
-
 
12198
          iprot.skip(ftype)
-
 
12199
      elif fid == 1:
-
 
12200
        if ftype == TType.STRUCT:
-
 
12201
          self.ex = TransactionServiceException()
-
 
12202
          self.ex.read(iprot)
-
 
12203
        else:
-
 
12204
          iprot.skip(ftype)
-
 
12205
      else:
-
 
12206
        iprot.skip(ftype)
-
 
12207
      iprot.readFieldEnd()
-
 
12208
    iprot.readStructEnd()
-
 
12209
 
-
 
12210
  def write(self, oprot):
-
 
12211
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12212
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12213
      return
-
 
12214
    oprot.writeStructBegin('validateReturnProduct_result')
-
 
12215
    if self.success is not None:
-
 
12216
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
12217
      oprot.writeBool(self.success)
-
 
12218
      oprot.writeFieldEnd()
-
 
12219
    if self.ex is not None:
12019
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
12220
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
12020
      self.ex.write(oprot)
12221
      self.ex.write(oprot)
12021
      oprot.writeFieldEnd()
12222
      oprot.writeFieldEnd()
12022
    oprot.writeFieldStop()
12223
    oprot.writeFieldStop()
12023
    oprot.writeStructEnd()
12224
    oprot.writeStructEnd()