Subversion Repositories SmartDukaan

Rev

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

Rev 1113 Rev 1132
Line 79... Line 79...
79
    """
79
    """
80
    pass
80
    pass
81
 
81
 
82
  def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
82
  def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
83
    """
83
    """
-
 
84
    Returns orders within a range of their billing dates
-
 
85
    
84
    Parameters:
86
    Parameters:
85
     - status
87
     - status
86
     - start_billing_date
88
     - start_billing_date
87
     - end_billing_date
89
     - end_billing_date
88
     - warehouse_id
90
     - warehouse_id
Line 180... Line 182...
180
     - providerId
182
     - providerId
181
     - pickupDetails
183
     - pickupDetails
182
    """
184
    """
183
    pass
185
    pass
184
 
186
 
-
 
187
  def markOrdersAsDelivered(self, providerId, deliveredOrders):
-
 
188
    """
-
 
189
    Marks all orders with AWBs in the given map as delivered. Also sets the delivery timestamp and
-
 
190
    the name of the receiver.
-
 
191
    Raises an exception if we encounter report for an AWB number that we did not ship.
-
 
192
    
-
 
193
    Parameters:
-
 
194
     - providerId
-
 
195
     - deliveredOrders
-
 
196
    """
-
 
197
    pass
-
 
198
 
185
  def getAlerts(self, orderId, valid):
199
  def getAlerts(self, orderId, valid):
186
    """
200
    """
187
    Parameters:
201
    Parameters:
188
     - orderId
202
     - orderId
189
     - valid
203
     - valid
Line 474... Line 488...
474
      raise result.ex
488
      raise result.ex
475
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllOrders failed: unknown result");
489
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllOrders failed: unknown result");
476
 
490
 
477
  def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
491
  def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
478
    """
492
    """
-
 
493
    Returns orders within a range of their billing dates
-
 
494
    
479
    Parameters:
495
    Parameters:
480
     - status
496
     - status
481
     - start_billing_date
497
     - start_billing_date
482
     - end_billing_date
498
     - end_billing_date
483
     - warehouse_id
499
     - warehouse_id
Line 888... Line 904...
888
      return result.success
904
      return result.success
889
    if result.ex != None:
905
    if result.ex != None:
890
      raise result.ex
906
      raise result.ex
891
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsPickedUp failed: unknown result");
907
    raise TApplicationException(TApplicationException.MISSING_RESULT, "markOrdersAsPickedUp failed: unknown result");
892
 
908
 
-
 
909
  def markOrdersAsDelivered(self, providerId, deliveredOrders):
-
 
910
    """
-
 
911
    Marks all orders with AWBs in the given map as delivered. Also sets the delivery timestamp and
-
 
912
    the name of the receiver.
-
 
913
    Raises an exception if we encounter report for an AWB number that we did not ship.
-
 
914
    
-
 
915
    Parameters:
-
 
916
     - providerId
-
 
917
     - deliveredOrders
-
 
918
    """
-
 
919
    self.send_markOrdersAsDelivered(providerId, deliveredOrders)
-
 
920
    self.recv_markOrdersAsDelivered()
-
 
921
 
-
 
922
  def send_markOrdersAsDelivered(self, providerId, deliveredOrders):
-
 
923
    self._oprot.writeMessageBegin('markOrdersAsDelivered', TMessageType.CALL, self._seqid)
-
 
924
    args = markOrdersAsDelivered_args()
-
 
925
    args.providerId = providerId
-
 
926
    args.deliveredOrders = deliveredOrders
-
 
927
    args.write(self._oprot)
-
 
928
    self._oprot.writeMessageEnd()
-
 
929
    self._oprot.trans.flush()
-
 
930
 
-
 
931
  def recv_markOrdersAsDelivered(self, ):
-
 
932
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
933
    if mtype == TMessageType.EXCEPTION:
-
 
934
      x = TApplicationException()
-
 
935
      x.read(self._iprot)
-
 
936
      self._iprot.readMessageEnd()
-
 
937
      raise x
-
 
938
    result = markOrdersAsDelivered_result()
-
 
939
    result.read(self._iprot)
-
 
940
    self._iprot.readMessageEnd()
-
 
941
    if result.ex != None:
-
 
942
      raise result.ex
-
 
943
    return
-
 
944
 
893
  def getAlerts(self, orderId, valid):
945
  def getAlerts(self, orderId, valid):
894
    """
946
    """
895
    Parameters:
947
    Parameters:
896
     - orderId
948
     - orderId
897
     - valid
949
     - valid
Line 979... Line 1031...
979
    self._processMap["createOrder"] = Processor.process_createOrder
1031
    self._processMap["createOrder"] = Processor.process_createOrder
980
    self._processMap["getOrder"] = Processor.process_getOrder
1032
    self._processMap["getOrder"] = Processor.process_getOrder
981
    self._processMap["getLineItemsForOrder"] = Processor.process_getLineItemsForOrder
1033
    self._processMap["getLineItemsForOrder"] = Processor.process_getLineItemsForOrder
982
    self._processMap["markOrdersAsManifested"] = Processor.process_markOrdersAsManifested
1034
    self._processMap["markOrdersAsManifested"] = Processor.process_markOrdersAsManifested
983
    self._processMap["markOrdersAsPickedUp"] = Processor.process_markOrdersAsPickedUp
1035
    self._processMap["markOrdersAsPickedUp"] = Processor.process_markOrdersAsPickedUp
-
 
1036
    self._processMap["markOrdersAsDelivered"] = Processor.process_markOrdersAsDelivered
984
    self._processMap["getAlerts"] = Processor.process_getAlerts
1037
    self._processMap["getAlerts"] = Processor.process_getAlerts
985
    self._processMap["setAlert"] = Processor.process_setAlert
1038
    self._processMap["setAlert"] = Processor.process_setAlert
986
 
1039
 
987
  def process(self, iprot, oprot):
1040
  def process(self, iprot, oprot):
988
    (name, type, seqid) = iprot.readMessageBegin()
1041
    (name, type, seqid) = iprot.readMessageBegin()
Line 1274... Line 1327...
1274
    oprot.writeMessageBegin("markOrdersAsPickedUp", TMessageType.REPLY, seqid)
1327
    oprot.writeMessageBegin("markOrdersAsPickedUp", TMessageType.REPLY, seqid)
1275
    result.write(oprot)
1328
    result.write(oprot)
1276
    oprot.writeMessageEnd()
1329
    oprot.writeMessageEnd()
1277
    oprot.trans.flush()
1330
    oprot.trans.flush()
1278
 
1331
 
-
 
1332
  def process_markOrdersAsDelivered(self, seqid, iprot, oprot):
-
 
1333
    args = markOrdersAsDelivered_args()
-
 
1334
    args.read(iprot)
-
 
1335
    iprot.readMessageEnd()
-
 
1336
    result = markOrdersAsDelivered_result()
-
 
1337
    try:
-
 
1338
      self._handler.markOrdersAsDelivered(args.providerId, args.deliveredOrders)
-
 
1339
    except TransactionServiceException, ex:
-
 
1340
      result.ex = ex
-
 
1341
    oprot.writeMessageBegin("markOrdersAsDelivered", TMessageType.REPLY, seqid)
-
 
1342
    result.write(oprot)
-
 
1343
    oprot.writeMessageEnd()
-
 
1344
    oprot.trans.flush()
-
 
1345
 
1279
  def process_getAlerts(self, seqid, iprot, oprot):
1346
  def process_getAlerts(self, seqid, iprot, oprot):
1280
    args = getAlerts_args()
1347
    args = getAlerts_args()
1281
    args.read(iprot)
1348
    args.read(iprot)
1282
    iprot.readMessageEnd()
1349
    iprot.readMessageEnd()
1283
    result = getAlerts_result()
1350
    result = getAlerts_result()
Line 4069... Line 4136...
4069
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4136
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4070
 
4137
 
4071
  def __ne__(self, other):
4138
  def __ne__(self, other):
4072
    return not (self == other)
4139
    return not (self == other)
4073
 
4140
 
-
 
4141
class markOrdersAsDelivered_args:
-
 
4142
  """
-
 
4143
  Attributes:
-
 
4144
   - providerId
-
 
4145
   - deliveredOrders
-
 
4146
  """
-
 
4147
 
-
 
4148
  thrift_spec = (
-
 
4149
    None, # 0
-
 
4150
    (1, TType.I64, 'providerId', None, None, ), # 1
-
 
4151
    (2, TType.MAP, 'deliveredOrders', (TType.STRING,None,TType.STRING,None), None, ), # 2
-
 
4152
  )
-
 
4153
 
-
 
4154
  def __init__(self, providerId=None, deliveredOrders=None,):
-
 
4155
    self.providerId = providerId
-
 
4156
    self.deliveredOrders = deliveredOrders
-
 
4157
 
-
 
4158
  def read(self, iprot):
-
 
4159
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4160
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4161
      return
-
 
4162
    iprot.readStructBegin()
-
 
4163
    while True:
-
 
4164
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4165
      if ftype == TType.STOP:
-
 
4166
        break
-
 
4167
      if fid == 1:
-
 
4168
        if ftype == TType.I64:
-
 
4169
          self.providerId = iprot.readI64();
-
 
4170
        else:
-
 
4171
          iprot.skip(ftype)
-
 
4172
      elif fid == 2:
-
 
4173
        if ftype == TType.MAP:
-
 
4174
          self.deliveredOrders = {}
-
 
4175
          (_ktype80, _vtype81, _size79 ) = iprot.readMapBegin() 
-
 
4176
          for _i83 in xrange(_size79):
-
 
4177
            _key84 = iprot.readString();
-
 
4178
            _val85 = iprot.readString();
-
 
4179
            self.deliveredOrders[_key84] = _val85
-
 
4180
          iprot.readMapEnd()
-
 
4181
        else:
-
 
4182
          iprot.skip(ftype)
-
 
4183
      else:
-
 
4184
        iprot.skip(ftype)
-
 
4185
      iprot.readFieldEnd()
-
 
4186
    iprot.readStructEnd()
-
 
4187
 
-
 
4188
  def write(self, oprot):
-
 
4189
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4190
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4191
      return
-
 
4192
    oprot.writeStructBegin('markOrdersAsDelivered_args')
-
 
4193
    if self.providerId != None:
-
 
4194
      oprot.writeFieldBegin('providerId', TType.I64, 1)
-
 
4195
      oprot.writeI64(self.providerId)
-
 
4196
      oprot.writeFieldEnd()
-
 
4197
    if self.deliveredOrders != None:
-
 
4198
      oprot.writeFieldBegin('deliveredOrders', TType.MAP, 2)
-
 
4199
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.deliveredOrders))
-
 
4200
      for kiter86,viter87 in self.deliveredOrders.items():
-
 
4201
        oprot.writeString(kiter86)
-
 
4202
        oprot.writeString(viter87)
-
 
4203
      oprot.writeMapEnd()
-
 
4204
      oprot.writeFieldEnd()
-
 
4205
    oprot.writeFieldStop()
-
 
4206
    oprot.writeStructEnd()
-
 
4207
 
-
 
4208
  def __repr__(self):
-
 
4209
    L = ['%s=%r' % (key, value)
-
 
4210
      for key, value in self.__dict__.iteritems()]
-
 
4211
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4212
 
-
 
4213
  def __eq__(self, other):
-
 
4214
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4215
 
-
 
4216
  def __ne__(self, other):
-
 
4217
    return not (self == other)
-
 
4218
 
-
 
4219
class markOrdersAsDelivered_result:
-
 
4220
  """
-
 
4221
  Attributes:
-
 
4222
   - ex
-
 
4223
  """
-
 
4224
 
-
 
4225
  thrift_spec = (
-
 
4226
    None, # 0
-
 
4227
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
4228
  )
-
 
4229
 
-
 
4230
  def __init__(self, ex=None,):
-
 
4231
    self.ex = ex
-
 
4232
 
-
 
4233
  def read(self, iprot):
-
 
4234
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4235
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4236
      return
-
 
4237
    iprot.readStructBegin()
-
 
4238
    while True:
-
 
4239
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4240
      if ftype == TType.STOP:
-
 
4241
        break
-
 
4242
      if fid == 1:
-
 
4243
        if ftype == TType.STRUCT:
-
 
4244
          self.ex = TransactionServiceException()
-
 
4245
          self.ex.read(iprot)
-
 
4246
        else:
-
 
4247
          iprot.skip(ftype)
-
 
4248
      else:
-
 
4249
        iprot.skip(ftype)
-
 
4250
      iprot.readFieldEnd()
-
 
4251
    iprot.readStructEnd()
-
 
4252
 
-
 
4253
  def write(self, oprot):
-
 
4254
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
4255
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
4256
      return
-
 
4257
    oprot.writeStructBegin('markOrdersAsDelivered_result')
-
 
4258
    if self.ex != None:
-
 
4259
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
4260
      self.ex.write(oprot)
-
 
4261
      oprot.writeFieldEnd()
-
 
4262
    oprot.writeFieldStop()
-
 
4263
    oprot.writeStructEnd()
-
 
4264
 
-
 
4265
  def __repr__(self):
-
 
4266
    L = ['%s=%r' % (key, value)
-
 
4267
      for key, value in self.__dict__.iteritems()]
-
 
4268
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4269
 
-
 
4270
  def __eq__(self, other):
-
 
4271
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4272
 
-
 
4273
  def __ne__(self, other):
-
 
4274
    return not (self == other)
-
 
4275
 
4074
class getAlerts_args:
4276
class getAlerts_args:
4075
  """
4277
  """
4076
  Attributes:
4278
  Attributes:
4077
   - orderId
4279
   - orderId
4078
   - valid
4280
   - valid
Line 4162... Line 4364...
4162
      if ftype == TType.STOP:
4364
      if ftype == TType.STOP:
4163
        break
4365
        break
4164
      if fid == 0:
4366
      if fid == 0:
4165
        if ftype == TType.LIST:
4367
        if ftype == TType.LIST:
4166
          self.success = []
4368
          self.success = []
4167
          (_etype82, _size79) = iprot.readListBegin()
4369
          (_etype91, _size88) = iprot.readListBegin()
4168
          for _i83 in xrange(_size79):
4370
          for _i92 in xrange(_size88):
4169
            _elem84 = Alert()
4371
            _elem93 = Alert()
4170
            _elem84.read(iprot)
4372
            _elem93.read(iprot)
4171
            self.success.append(_elem84)
4373
            self.success.append(_elem93)
4172
          iprot.readListEnd()
4374
          iprot.readListEnd()
4173
        else:
4375
        else:
4174
          iprot.skip(ftype)
4376
          iprot.skip(ftype)
4175
      else:
4377
      else:
4176
        iprot.skip(ftype)
4378
        iprot.skip(ftype)
Line 4183... Line 4385...
4183
      return
4385
      return
4184
    oprot.writeStructBegin('getAlerts_result')
4386
    oprot.writeStructBegin('getAlerts_result')
4185
    if self.success != None:
4387
    if self.success != None:
4186
      oprot.writeFieldBegin('success', TType.LIST, 0)
4388
      oprot.writeFieldBegin('success', TType.LIST, 0)
4187
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4389
      oprot.writeListBegin(TType.STRUCT, len(self.success))
4188
      for iter85 in self.success:
4390
      for iter94 in self.success:
4189
        iter85.write(oprot)
4391
        iter94.write(oprot)
4190
      oprot.writeListEnd()
4392
      oprot.writeListEnd()
4191
      oprot.writeFieldEnd()
4393
      oprot.writeFieldEnd()
4192
    oprot.writeFieldStop()
4394
    oprot.writeFieldStop()
4193
    oprot.writeStructEnd()
4395
    oprot.writeStructEnd()
4194
 
4396