Subversion Repositories SmartDukaan

Rev

Rev 442 | Rev 477 | 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

//struct AWB{
//    1:string awb_number,
//    2:bool is_available,
//    3:i64 provider_id
//}

struct ItemLogistics{
        1:i64 warehouseId,
        2:i64 availability,
        3:i64 shippingTime
}


struct ShipmentUpdate{
        1:string pin,
        2:i64 timestamp,
        3:string description
}

struct ShipmentStatusInfo{
        1:string awb,
        2:i64 provider_id,
        3:list<ShipmentUpdate> updates,
        4:ShipmentUpdate currentUpdate
}

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

struct Shipment{
        1:string warehouse_name,
        2:string awb,
        3:string origin,
        4:string destination,
        5:i64 timestamp,
        6:string recepient_name,
        7:string recepient_address,
        8:string recepient_pincode,
        9:string recepient_phone,
        10:string shipment_weight,
        11:string shipment_contents
}

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

service LogisticsService{

        //This call would return the logistic estimate 
        ItemLogistics getLogisticsEstimation(1:i64 itemId, 2:string destination_pin, 3:i64 provider_id ) throws (1:LogisticsServiceException se),
        void addDeliveryEstimate(1:i64 warahouse_id, 2:string destination_pin, 3:i64 provider_id, 4:i64 delivery_time),
        //APIs to be used by shop2020 components
        void addEmptyAWBs(1:list<string> numbers, 2:i64 provider_id),
        string getEmptyAWB(1:i64 provider_id),
        list<Provider> getProviders(),
        Provider getProvider(1:i64 provider_id),
        void createShipment(1:Shipment shipment),
        void updateShipmentStatus(1:string awb, 2:ShipmentUpdate shipment_update),
        ShipmentStatusInfo getShipmentInfo(1:string awb),

        //APIs to be used by logistic provider
        list<Shipment> getShipments(1:i64 warehouse_id, 2:i64 from_date, 3:i64 to_date, 4:i64 provider_id),
        list<Shipment> getTodaysShipments(1:i64 warehouse_id,2:i64 provider_id)
                
}