Subversion Repositories SmartDukaan

Rev

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

Rev 5591 Rev 6386
Line 84... Line 84...
84
     - purchaseOrderId
84
     - purchaseOrderId
85
     - open
85
     - open
86
    """
86
    """
87
    pass
87
    pass
88
 
88
 
-
 
89
  def getPurchasesForPO(self, purchaseOrderId):
-
 
90
    """
-
 
91
    Returns all purchases for the given purchase order. Throws an exception if no such purchase order exists
-
 
92
 
-
 
93
    Parameters:
-
 
94
     - purchaseOrderId
-
 
95
    """
-
 
96
    pass
-
 
97
 
89
  def getPurchaseOrderForPurchase(self, purchaseId):
98
  def getPurchaseOrderForPurchase(self, purchaseId):
90
    """
99
    """
91
    Returns the purchase order object for a given purchase
100
    Returns the purchase order object for a given purchase
92
 
101
 
93
    Parameters:
102
    Parameters:
Line 427... Line 436...
427
      return result.success
436
      return result.success
428
    if result.e is not None:
437
    if result.e is not None:
429
      raise result.e
438
      raise result.e
430
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
439
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
431
 
440
 
-
 
441
  def getPurchasesForPO(self, purchaseOrderId):
-
 
442
    """
-
 
443
    Returns all purchases for the given purchase order. Throws an exception if no such purchase order exists
-
 
444
 
-
 
445
    Parameters:
-
 
446
     - purchaseOrderId
-
 
447
    """
-
 
448
    self.send_getPurchasesForPO(purchaseOrderId)
-
 
449
    return self.recv_getPurchasesForPO()
-
 
450
 
-
 
451
  def send_getPurchasesForPO(self, purchaseOrderId):
-
 
452
    self._oprot.writeMessageBegin('getPurchasesForPO', TMessageType.CALL, self._seqid)
-
 
453
    args = getPurchasesForPO_args()
-
 
454
    args.purchaseOrderId = purchaseOrderId
-
 
455
    args.write(self._oprot)
-
 
456
    self._oprot.writeMessageEnd()
-
 
457
    self._oprot.trans.flush()
-
 
458
 
-
 
459
  def recv_getPurchasesForPO(self, ):
-
 
460
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
461
    if mtype == TMessageType.EXCEPTION:
-
 
462
      x = TApplicationException()
-
 
463
      x.read(self._iprot)
-
 
464
      self._iprot.readMessageEnd()
-
 
465
      raise x
-
 
466
    result = getPurchasesForPO_result()
-
 
467
    result.read(self._iprot)
-
 
468
    self._iprot.readMessageEnd()
-
 
469
    if result.success is not None:
-
 
470
      return result.success
-
 
471
    if result.e is not None:
-
 
472
      raise result.e
-
 
473
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPurchasesForPO failed: unknown result");
-
 
474
 
432
  def getPurchaseOrderForPurchase(self, purchaseId):
475
  def getPurchaseOrderForPurchase(self, purchaseId):
433
    """
476
    """
434
    Returns the purchase order object for a given purchase
477
    Returns the purchase order object for a given purchase
435
 
478
 
436
    Parameters:
479
    Parameters:
Line 764... Line 807...
764
    self._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrders
807
    self._processMap["getAllPurchaseOrders"] = Processor.process_getAllPurchaseOrders
765
    self._processMap["getSupplier"] = Processor.process_getSupplier
808
    self._processMap["getSupplier"] = Processor.process_getSupplier
766
    self._processMap["startPurchase"] = Processor.process_startPurchase
809
    self._processMap["startPurchase"] = Processor.process_startPurchase
767
    self._processMap["closePurchase"] = Processor.process_closePurchase
810
    self._processMap["closePurchase"] = Processor.process_closePurchase
768
    self._processMap["getAllPurchases"] = Processor.process_getAllPurchases
811
    self._processMap["getAllPurchases"] = Processor.process_getAllPurchases
-
 
812
    self._processMap["getPurchasesForPO"] = Processor.process_getPurchasesForPO
769
    self._processMap["getPurchaseOrderForPurchase"] = Processor.process_getPurchaseOrderForPurchase
813
    self._processMap["getPurchaseOrderForPurchase"] = Processor.process_getPurchaseOrderForPurchase
770
    self._processMap["getPendingPurchaseOrders"] = Processor.process_getPendingPurchaseOrders
814
    self._processMap["getPendingPurchaseOrders"] = Processor.process_getPendingPurchaseOrders
771
    self._processMap["getSuppliers"] = Processor.process_getSuppliers
815
    self._processMap["getSuppliers"] = Processor.process_getSuppliers
772
    self._processMap["fulfillPO"] = Processor.process_fulfillPO
816
    self._processMap["fulfillPO"] = Processor.process_fulfillPO
773
    self._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrder
817
    self._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrder
Line 888... Line 932...
888
    oprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)
932
    oprot.writeMessageBegin("getAllPurchases", TMessageType.REPLY, seqid)
889
    result.write(oprot)
933
    result.write(oprot)
890
    oprot.writeMessageEnd()
934
    oprot.writeMessageEnd()
891
    oprot.trans.flush()
935
    oprot.trans.flush()
892
 
936
 
-
 
937
  def process_getPurchasesForPO(self, seqid, iprot, oprot):
-
 
938
    args = getPurchasesForPO_args()
-
 
939
    args.read(iprot)
-
 
940
    iprot.readMessageEnd()
-
 
941
    result = getPurchasesForPO_result()
-
 
942
    try:
-
 
943
      result.success = self._handler.getPurchasesForPO(args.purchaseOrderId)
-
 
944
    except PurchaseServiceException, e:
-
 
945
      result.e = e
-
 
946
    oprot.writeMessageBegin("getPurchasesForPO", TMessageType.REPLY, seqid)
-
 
947
    result.write(oprot)
-
 
948
    oprot.writeMessageEnd()
-
 
949
    oprot.trans.flush()
-
 
950
 
893
  def process_getPurchaseOrderForPurchase(self, seqid, iprot, oprot):
951
  def process_getPurchaseOrderForPurchase(self, seqid, iprot, oprot):
894
    args = getPurchaseOrderForPurchase_args()
952
    args = getPurchaseOrderForPurchase_args()
895
    args.read(iprot)
953
    args.read(iprot)
896
    iprot.readMessageEnd()
954
    iprot.readMessageEnd()
897
    result = getPurchaseOrderForPurchase_result()
955
    result = getPurchaseOrderForPurchase_result()
Line 2000... Line 2058...
2000
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2058
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2001
 
2059
 
2002
  def __ne__(self, other):
2060
  def __ne__(self, other):
2003
    return not (self == other)
2061
    return not (self == other)
2004
 
2062
 
-
 
2063
class getPurchasesForPO_args:
-
 
2064
  """
-
 
2065
  Attributes:
-
 
2066
   - purchaseOrderId
-
 
2067
  """
-
 
2068
 
-
 
2069
  thrift_spec = (
-
 
2070
    None, # 0
-
 
2071
    (1, TType.I64, 'purchaseOrderId', None, None, ), # 1
-
 
2072
  )
-
 
2073
 
-
 
2074
  def __init__(self, purchaseOrderId=None,):
-
 
2075
    self.purchaseOrderId = purchaseOrderId
-
 
2076
 
-
 
2077
  def read(self, iprot):
-
 
2078
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2079
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2080
      return
-
 
2081
    iprot.readStructBegin()
-
 
2082
    while True:
-
 
2083
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2084
      if ftype == TType.STOP:
-
 
2085
        break
-
 
2086
      if fid == 1:
-
 
2087
        if ftype == TType.I64:
-
 
2088
          self.purchaseOrderId = iprot.readI64();
-
 
2089
        else:
-
 
2090
          iprot.skip(ftype)
-
 
2091
      else:
-
 
2092
        iprot.skip(ftype)
-
 
2093
      iprot.readFieldEnd()
-
 
2094
    iprot.readStructEnd()
-
 
2095
 
-
 
2096
  def write(self, oprot):
-
 
2097
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2098
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2099
      return
-
 
2100
    oprot.writeStructBegin('getPurchasesForPO_args')
-
 
2101
    if self.purchaseOrderId is not None:
-
 
2102
      oprot.writeFieldBegin('purchaseOrderId', TType.I64, 1)
-
 
2103
      oprot.writeI64(self.purchaseOrderId)
-
 
2104
      oprot.writeFieldEnd()
-
 
2105
    oprot.writeFieldStop()
-
 
2106
    oprot.writeStructEnd()
-
 
2107
 
-
 
2108
  def validate(self):
-
 
2109
    return
-
 
2110
 
-
 
2111
 
-
 
2112
  def __repr__(self):
-
 
2113
    L = ['%s=%r' % (key, value)
-
 
2114
      for key, value in self.__dict__.iteritems()]
-
 
2115
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2116
 
-
 
2117
  def __eq__(self, other):
-
 
2118
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2119
 
-
 
2120
  def __ne__(self, other):
-
 
2121
    return not (self == other)
-
 
2122
 
-
 
2123
class getPurchasesForPO_result:
-
 
2124
  """
-
 
2125
  Attributes:
-
 
2126
   - success
-
 
2127
   - e
-
 
2128
  """
-
 
2129
 
-
 
2130
  thrift_spec = (
-
 
2131
    (0, TType.LIST, 'success', (TType.STRUCT,(Purchase, Purchase.thrift_spec)), None, ), # 0
-
 
2132
    (1, TType.STRUCT, 'e', (PurchaseServiceException, PurchaseServiceException.thrift_spec), None, ), # 1
-
 
2133
  )
-
 
2134
 
-
 
2135
  def __init__(self, success=None, e=None,):
-
 
2136
    self.success = success
-
 
2137
    self.e = e
-
 
2138
 
-
 
2139
  def read(self, iprot):
-
 
2140
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2141
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2142
      return
-
 
2143
    iprot.readStructBegin()
-
 
2144
    while True:
-
 
2145
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2146
      if ftype == TType.STOP:
-
 
2147
        break
-
 
2148
      if fid == 0:
-
 
2149
        if ftype == TType.LIST:
-
 
2150
          self.success = []
-
 
2151
          (_etype24, _size21) = iprot.readListBegin()
-
 
2152
          for _i25 in xrange(_size21):
-
 
2153
            _elem26 = Purchase()
-
 
2154
            _elem26.read(iprot)
-
 
2155
            self.success.append(_elem26)
-
 
2156
          iprot.readListEnd()
-
 
2157
        else:
-
 
2158
          iprot.skip(ftype)
-
 
2159
      elif fid == 1:
-
 
2160
        if ftype == TType.STRUCT:
-
 
2161
          self.e = PurchaseServiceException()
-
 
2162
          self.e.read(iprot)
-
 
2163
        else:
-
 
2164
          iprot.skip(ftype)
-
 
2165
      else:
-
 
2166
        iprot.skip(ftype)
-
 
2167
      iprot.readFieldEnd()
-
 
2168
    iprot.readStructEnd()
-
 
2169
 
-
 
2170
  def write(self, oprot):
-
 
2171
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2172
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2173
      return
-
 
2174
    oprot.writeStructBegin('getPurchasesForPO_result')
-
 
2175
    if self.success is not None:
-
 
2176
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
2177
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
2178
      for iter27 in self.success:
-
 
2179
        iter27.write(oprot)
-
 
2180
      oprot.writeListEnd()
-
 
2181
      oprot.writeFieldEnd()
-
 
2182
    if self.e is not None:
-
 
2183
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
-
 
2184
      self.e.write(oprot)
-
 
2185
      oprot.writeFieldEnd()
-
 
2186
    oprot.writeFieldStop()
-
 
2187
    oprot.writeStructEnd()
-
 
2188
 
-
 
2189
  def validate(self):
-
 
2190
    return
-
 
2191
 
-
 
2192
 
-
 
2193
  def __repr__(self):
-
 
2194
    L = ['%s=%r' % (key, value)
-
 
2195
      for key, value in self.__dict__.iteritems()]
-
 
2196
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2197
 
-
 
2198
  def __eq__(self, other):
-
 
2199
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2200
 
-
 
2201
  def __ne__(self, other):
-
 
2202
    return not (self == other)
-
 
2203
 
2005
class getPurchaseOrderForPurchase_args:
2204
class getPurchaseOrderForPurchase_args:
2006
  """
2205
  """
2007
  Attributes:
2206
  Attributes:
2008
   - purchaseId
2207
   - purchaseId
2009
  """
2208
  """
Line 2208... Line 2407...
2208
      if ftype == TType.STOP:
2407
      if ftype == TType.STOP:
2209
        break
2408
        break
2210
      if fid == 0:
2409
      if fid == 0:
2211
        if ftype == TType.LIST:
2410
        if ftype == TType.LIST:
2212
          self.success = []
2411
          self.success = []
2213
          (_etype24, _size21) = iprot.readListBegin()
2412
          (_etype31, _size28) = iprot.readListBegin()
2214
          for _i25 in xrange(_size21):
2413
          for _i32 in xrange(_size28):
2215
            _elem26 = PurchaseOrder()
2414
            _elem33 = PurchaseOrder()
2216
            _elem26.read(iprot)
2415
            _elem33.read(iprot)
2217
            self.success.append(_elem26)
2416
            self.success.append(_elem33)
2218
          iprot.readListEnd()
2417
          iprot.readListEnd()
2219
        else:
2418
        else:
2220
          iprot.skip(ftype)
2419
          iprot.skip(ftype)
2221
      elif fid == 1:
2420
      elif fid == 1:
2222
        if ftype == TType.STRUCT:
2421
        if ftype == TType.STRUCT:
Line 2235... Line 2434...
2235
      return
2434
      return
2236
    oprot.writeStructBegin('getPendingPurchaseOrders_result')
2435
    oprot.writeStructBegin('getPendingPurchaseOrders_result')
2237
    if self.success is not None:
2436
    if self.success is not None:
2238
      oprot.writeFieldBegin('success', TType.LIST, 0)
2437
      oprot.writeFieldBegin('success', TType.LIST, 0)
2239
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2438
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2240
      for iter27 in self.success:
2439
      for iter34 in self.success:
2241
        iter27.write(oprot)
2440
        iter34.write(oprot)
2242
      oprot.writeListEnd()
2441
      oprot.writeListEnd()
2243
      oprot.writeFieldEnd()
2442
      oprot.writeFieldEnd()
2244
    if self.e is not None:
2443
    if self.e is not None:
2245
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2444
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2246
      self.e.write(oprot)
2445
      self.e.write(oprot)
Line 2331... Line 2530...
2331
      if ftype == TType.STOP:
2530
      if ftype == TType.STOP:
2332
        break
2531
        break
2333
      if fid == 0:
2532
      if fid == 0:
2334
        if ftype == TType.LIST:
2533
        if ftype == TType.LIST:
2335
          self.success = []
2534
          self.success = []
2336
          (_etype31, _size28) = iprot.readListBegin()
2535
          (_etype38, _size35) = iprot.readListBegin()
2337
          for _i32 in xrange(_size28):
2536
          for _i39 in xrange(_size35):
2338
            _elem33 = Supplier()
2537
            _elem40 = Supplier()
2339
            _elem33.read(iprot)
2538
            _elem40.read(iprot)
2340
            self.success.append(_elem33)
2539
            self.success.append(_elem40)
2341
          iprot.readListEnd()
2540
          iprot.readListEnd()
2342
        else:
2541
        else:
2343
          iprot.skip(ftype)
2542
          iprot.skip(ftype)
2344
      elif fid == 1:
2543
      elif fid == 1:
2345
        if ftype == TType.STRUCT:
2544
        if ftype == TType.STRUCT:
Line 2358... Line 2557...
2358
      return
2557
      return
2359
    oprot.writeStructBegin('getSuppliers_result')
2558
    oprot.writeStructBegin('getSuppliers_result')
2360
    if self.success is not None:
2559
    if self.success is not None:
2361
      oprot.writeFieldBegin('success', TType.LIST, 0)
2560
      oprot.writeFieldBegin('success', TType.LIST, 0)
2362
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2561
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2363
      for iter34 in self.success:
2562
      for iter41 in self.success:
2364
        iter34.write(oprot)
2563
        iter41.write(oprot)
2365
      oprot.writeListEnd()
2564
      oprot.writeListEnd()
2366
      oprot.writeFieldEnd()
2565
      oprot.writeFieldEnd()
2367
    if self.e is not None:
2566
    if self.e is not None:
2368
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2567
      oprot.writeFieldBegin('e', TType.STRUCT, 1)
2369
      self.e.write(oprot)
2568
      self.e.write(oprot)
Line 2881... Line 3080...
2881
      if ftype == TType.STOP:
3080
      if ftype == TType.STOP:
2882
        break
3081
        break
2883
      if fid == 0:
3082
      if fid == 0:
2884
        if ftype == TType.LIST:
3083
        if ftype == TType.LIST:
2885
          self.success = []
3084
          self.success = []
2886
          (_etype38, _size35) = iprot.readListBegin()
3085
          (_etype45, _size42) = iprot.readListBegin()
2887
          for _i39 in xrange(_size35):
3086
          for _i46 in xrange(_size42):
2888
            _elem40 = Invoice()
3087
            _elem47 = Invoice()
2889
            _elem40.read(iprot)
3088
            _elem47.read(iprot)
2890
            self.success.append(_elem40)
3089
            self.success.append(_elem47)
2891
          iprot.readListEnd()
3090
          iprot.readListEnd()
2892
        else:
3091
        else:
2893
          iprot.skip(ftype)
3092
          iprot.skip(ftype)
2894
      else:
3093
      else:
2895
        iprot.skip(ftype)
3094
        iprot.skip(ftype)
Line 2902... Line 3101...
2902
      return
3101
      return
2903
    oprot.writeStructBegin('getInvoices_result')
3102
    oprot.writeStructBegin('getInvoices_result')
2904
    if self.success is not None:
3103
    if self.success is not None:
2905
      oprot.writeFieldBegin('success', TType.LIST, 0)
3104
      oprot.writeFieldBegin('success', TType.LIST, 0)
2906
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3105
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2907
      for iter41 in self.success:
3106
      for iter48 in self.success:
2908
        iter41.write(oprot)
3107
        iter48.write(oprot)
2909
      oprot.writeListEnd()
3108
      oprot.writeListEnd()
2910
      oprot.writeFieldEnd()
3109
      oprot.writeFieldEnd()
2911
    oprot.writeFieldStop()
3110
    oprot.writeFieldStop()
2912
    oprot.writeStructEnd()
3111
    oprot.writeStructEnd()
2913
 
3112