Subversion Repositories SmartDukaan

Rev

Rev 763 | Rev 1730 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

namespace java in.shop2020.logistics
namespace py shop2020.thriftpy.logistics

enum StationType{
        OWN_STATION = 0,                //The service provider's own station.
        ASSOCIATE_STATION = 1   //An associate's station
}

enum WarehouseLocation{
        Delhi = 0,
        Mumbai = 1,
        Bangalore = 2,
        Kolkata = 3
}

struct Provider{
        1:i64 id,
        2:string name,
        3:string accountNo
}

struct AwbUpdate{
    1:string awbNumber,
    2:string providerName,
    3:string location,
    4:i64 entryDate,
    5:string description
}

struct LogisticsInfo{
        1:i64 warehouseId,
        2:i64 providerId,
        3:i64 deliveryTime,
        4:string airway_billno
}

exception LogisticsServiceException{
        1:i64 id,
        2:string message
}

service LogisticsService{
        /**
        * For closing the open session in sqlalchemy
        */
        void closeSession(),
        
        /**
         Returns a provider for a given provider ID. Throws an exception if none found.
        */
        Provider getProvider(1:i64 providerId) throws (1:LogisticsServiceException lse),
        
        /**
         Returns a list containing all the providers.
        */
        list<Provider> getAllProviders() throws (1:LogisticsServiceException lse),
        
        /**
         Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
         Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
         is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised. 
         */
        LogisticsInfo getLogisticsEstimation(1:i64 itemId, 2:string destination_pin) throws (1:LogisticsServiceException se),
        
        /**
         Same as above excpet that an airway bill number is also allocated and returned.
        */
        LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:i64 item_id) throws (1:LogisticsServiceException se),
        
        /**
         Returns an unused AWB number for the given provider.
        */
        string getEmptyAWB(1:i64 providerId) throws (1:LogisticsServiceException se),

        /**
         Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
        */
        list<AwbUpdate> getShipmentInfo(1:string awb, 2:i64 providerId) throws (1:LogisticsServiceException se),
        
        /**
         Returns the short three letter code of a pincode for the given provider.
     Raises an exception if the pin code is not serviced by the given provider.
        */
        string getDestinationCode(1:i64 providerId, 2:string pinCode) throws (1:LogisticsServiceException se),
        
        /**
        Returns the number of unused AWB numbers for the given provider  
        */
        i64 getFreeAwbCount(1:i64 providerId)
}