Subversion Repositories SmartDukaan

Rev

Rev 22721 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22721 Rev 23446
Line 86... Line 86...
86
     - warehouse_id
86
     - warehouse_id
87
     - item_id
87
     - item_id
88
    """
88
    """
89
    pass
89
    pass
90
 
90
 
91
  def getItemAvailabilityAtLocation(self, itemId, sourceId):
91
  def getItemAvailabilityAtLocation(self, itemId, sourceId, stateId):
92
    """
92
    """
93
    Determines the warehouse that should be used to fulfil an order for the given item.
93
    Determines the warehouse that should be used to fulfil an order for the given item.
94
    It first checks all the warehouses which are in the logistics location given by the
94
    It first checks all the warehouses which are in the logistics location given by the
95
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
95
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
96
    preferred warehouse for the item is used.
96
    preferred warehouse for the item is used.
Line 101... Line 101...
101
    3. Id of the billing warehouse which was finally picked up.
101
    3. Id of the billing warehouse which was finally picked up.
102
 
102
 
103
    Parameters:
103
    Parameters:
104
     - itemId
104
     - itemId
105
     - sourceId
105
     - sourceId
-
 
106
     - stateId
106
    """
107
    """
107
    pass
108
    pass
108
 
109
 
109
  def getAllWarehouses(self, isActive):
110
  def getAllWarehouses(self, isActive):
110
    """
111
    """
Line 998... Line 999...
998
      return result.success
999
      return result.success
999
    if result.cex is not None:
1000
    if result.cex is not None:
1000
      raise result.cex
1001
      raise result.cex
1001
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
1002
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
1002
 
1003
 
1003
  def getItemAvailabilityAtLocation(self, itemId, sourceId):
1004
  def getItemAvailabilityAtLocation(self, itemId, sourceId, stateId):
1004
    """
1005
    """
1005
    Determines the warehouse that should be used to fulfil an order for the given item.
1006
    Determines the warehouse that should be used to fulfil an order for the given item.
1006
    It first checks all the warehouses which are in the logistics location given by the
1007
    It first checks all the warehouses which are in the logistics location given by the
1007
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
1008
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
1008
    preferred warehouse for the item is used.
1009
    preferred warehouse for the item is used.
Line 1013... Line 1014...
1013
    3. Id of the billing warehouse which was finally picked up.
1014
    3. Id of the billing warehouse which was finally picked up.
1014
 
1015
 
1015
    Parameters:
1016
    Parameters:
1016
     - itemId
1017
     - itemId
1017
     - sourceId
1018
     - sourceId
-
 
1019
     - stateId
1018
    """
1020
    """
1019
    self.send_getItemAvailabilityAtLocation(itemId, sourceId)
1021
    self.send_getItemAvailabilityAtLocation(itemId, sourceId, stateId)
1020
    return self.recv_getItemAvailabilityAtLocation()
1022
    return self.recv_getItemAvailabilityAtLocation()
1021
 
1023
 
1022
  def send_getItemAvailabilityAtLocation(self, itemId, sourceId):
1024
  def send_getItemAvailabilityAtLocation(self, itemId, sourceId, stateId):
1023
    self._oprot.writeMessageBegin('getItemAvailabilityAtLocation', TMessageType.CALL, self._seqid)
1025
    self._oprot.writeMessageBegin('getItemAvailabilityAtLocation', TMessageType.CALL, self._seqid)
1024
    args = getItemAvailabilityAtLocation_args()
1026
    args = getItemAvailabilityAtLocation_args()
1025
    args.itemId = itemId
1027
    args.itemId = itemId
1026
    args.sourceId = sourceId
1028
    args.sourceId = sourceId
-
 
1029
    args.stateId = stateId
1027
    args.write(self._oprot)
1030
    args.write(self._oprot)
1028
    self._oprot.writeMessageEnd()
1031
    self._oprot.writeMessageEnd()
1029
    self._oprot.trans.flush()
1032
    self._oprot.trans.flush()
1030
 
1033
 
1031
  def recv_getItemAvailabilityAtLocation(self, ):
1034
  def recv_getItemAvailabilityAtLocation(self, ):
Line 3736... Line 3739...
3736
    args = getItemAvailabilityAtLocation_args()
3739
    args = getItemAvailabilityAtLocation_args()
3737
    args.read(iprot)
3740
    args.read(iprot)
3738
    iprot.readMessageEnd()
3741
    iprot.readMessageEnd()
3739
    result = getItemAvailabilityAtLocation_result()
3742
    result = getItemAvailabilityAtLocation_result()
3740
    try:
3743
    try:
3741
      result.success = self._handler.getItemAvailabilityAtLocation(args.itemId, args.sourceId)
3744
      result.success = self._handler.getItemAvailabilityAtLocation(args.itemId, args.sourceId, args.stateId)
3742
    except InventoryServiceException, isex:
3745
    except InventoryServiceException, isex:
3743
      result.isex = isex
3746
      result.isex = isex
3744
    oprot.writeMessageBegin("getItemAvailabilityAtLocation", TMessageType.REPLY, seqid)
3747
    oprot.writeMessageBegin("getItemAvailabilityAtLocation", TMessageType.REPLY, seqid)
3745
    result.write(oprot)
3748
    result.write(oprot)
3746
    oprot.writeMessageEnd()
3749
    oprot.writeMessageEnd()
Line 5788... Line 5791...
5788
class getItemAvailabilityAtLocation_args:
5791
class getItemAvailabilityAtLocation_args:
5789
  """
5792
  """
5790
  Attributes:
5793
  Attributes:
5791
   - itemId
5794
   - itemId
5792
   - sourceId
5795
   - sourceId
-
 
5796
   - stateId
5793
  """
5797
  """
5794
 
5798
 
5795
  thrift_spec = (
5799
  thrift_spec = (
5796
    None, # 0
5800
    None, # 0
5797
    (1, TType.I64, 'itemId', None, None, ), # 1
5801
    (1, TType.I64, 'itemId', None, None, ), # 1
5798
    (2, TType.I64, 'sourceId', None, None, ), # 2
5802
    (2, TType.I64, 'sourceId', None, None, ), # 2
-
 
5803
    (3, TType.I64, 'stateId', None, None, ), # 3
5799
  )
5804
  )
5800
 
5805
 
5801
  def __init__(self, itemId=None, sourceId=None,):
5806
  def __init__(self, itemId=None, sourceId=None, stateId=None,):
5802
    self.itemId = itemId
5807
    self.itemId = itemId
5803
    self.sourceId = sourceId
5808
    self.sourceId = sourceId
-
 
5809
    self.stateId = stateId
5804
 
5810
 
5805
  def read(self, iprot):
5811
  def read(self, iprot):
5806
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
5812
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
5807
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
5813
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
5808
      return
5814
      return
Line 5819... Line 5825...
5819
      elif fid == 2:
5825
      elif fid == 2:
5820
        if ftype == TType.I64:
5826
        if ftype == TType.I64:
5821
          self.sourceId = iprot.readI64();
5827
          self.sourceId = iprot.readI64();
5822
        else:
5828
        else:
5823
          iprot.skip(ftype)
5829
          iprot.skip(ftype)
-
 
5830
      elif fid == 3:
-
 
5831
        if ftype == TType.I64:
-
 
5832
          self.stateId = iprot.readI64();
-
 
5833
        else:
-
 
5834
          iprot.skip(ftype)
5824
      else:
5835
      else:
5825
        iprot.skip(ftype)
5836
        iprot.skip(ftype)
5826
      iprot.readFieldEnd()
5837
      iprot.readFieldEnd()
5827
    iprot.readStructEnd()
5838
    iprot.readStructEnd()
5828
 
5839
 
Line 5837... Line 5848...
5837
      oprot.writeFieldEnd()
5848
      oprot.writeFieldEnd()
5838
    if self.sourceId is not None:
5849
    if self.sourceId is not None:
5839
      oprot.writeFieldBegin('sourceId', TType.I64, 2)
5850
      oprot.writeFieldBegin('sourceId', TType.I64, 2)
5840
      oprot.writeI64(self.sourceId)
5851
      oprot.writeI64(self.sourceId)
5841
      oprot.writeFieldEnd()
5852
      oprot.writeFieldEnd()
-
 
5853
    if self.stateId is not None:
-
 
5854
      oprot.writeFieldBegin('stateId', TType.I64, 3)
-
 
5855
      oprot.writeI64(self.stateId)
-
 
5856
      oprot.writeFieldEnd()
5842
    oprot.writeFieldStop()
5857
    oprot.writeFieldStop()
5843
    oprot.writeStructEnd()
5858
    oprot.writeStructEnd()
5844
 
5859
 
5845
  def validate(self):
5860
  def validate(self):
5846
    return
5861
    return