syntax = "proto3"; package delivery; import "google/protobuf/empty.proto"; import "google/protobuf/wrappers.proto"; option go_package = "github.com/soardigital/klozr-protobuf/delivery"; service DeliveryService { rpc CreateDelivery(CreateDeliveryRequest) returns (Delivery); rpc UpdateDelivery(UpdateDeliveryRequest) returns (google.protobuf.StringValue); rpc GetDelivery(google.protobuf.StringValue) returns (Delivery); rpc GetDeliveries(DeliveryStringsRequest) returns (Deliveries); rpc GetDeliveryByShortCode(google.protobuf.StringValue) returns (Delivery); rpc GetDeliveriesByOwner(google.protobuf.StringValue) returns (Deliveries); rpc GetDeliveryByOwner(DeliveryOwnerRequest) returns (Delivery); rpc UpdateDeliveryStatus(CustomerDeliveryStatusUpdateRequest) returns (google.protobuf.BoolValue); rpc CancelDelivery(DeliveryOwnerRequest) returns (google.protobuf.BoolValue); } service RiderDeliveryService { rpc GetDeliveries(google.protobuf.Empty) returns (Deliveries); rpc AcceptDelivery(RiderAcceptDeliveryRequest) returns (google.protobuf.BoolValue); rpc GetDelivery(google.protobuf.StringValue) returns (Delivery); rpc UpdateDeliveryStatus(RiderDeliveryStatusUpdateRequest) returns (google.protobuf.BoolValue); rpc UpdateDeliveryStage(RiderDeliveryStageUpdateRequest) returns (google.protobuf.BoolValue); } message DeliveryOwnerRequest { string delivery_id_or_short_code = 1; string owner = 2; } message Deliveries { repeated Delivery deliveries = 1; } message DeliveryStringsRequest { repeated string requests = 1; } message CreateDeliveryRequest { RiderType rider_type = 1; Customer customer = 2; google.protobuf.StringValue delivery_destination = 3; google.protobuf.StringValue rider_pid = 4; repeated ProductRequest products = 5; string owner = 6; } message UpdateDeliveryRequest { RiderType rider_type = 1; string pid = 2; Customer customer = 3; google.protobuf.StringValue delivery_destination = 4; google.protobuf.StringValue rider_pid = 5; string short_code = 6; string owner = 7; } message CustomerDeliveryStatusUpdateRequest { string delivery_pid = 1; CustomerDeliveryStatus new_status = 2; string owner = 3; } message RiderDeliveryStatusUpdateRequest { string delivery_pid = 1; RiderDeliveryStatus new_status = 2; } message RiderDeliveryStageUpdateRequest { string delivery_pid = 1; DeliveryStage new_stage = 2; } message Delivery { string short_code = 1; RiderType rider_type = 2; string pid = 3; Customer customer = 4; google.protobuf.StringValue delivery_destination = 5; google.protobuf.StringValue rider_pid = 6; RiderDeliveryStatus rider_delivery_status = 7; string date_created = 8; string last_modified_by = 9; DeliveryStage delivery_stage = 10; repeated ProductResponse products = 11; google.protobuf.StringValue delivery_origin = 12; CustomerDeliveryStatus customer_delivery_status = 13; google.protobuf.StringValue tracking_code = 14; string owner = 15; } message RiderAcceptDeliveryRequest { google.protobuf.BoolValue accepted = 1; string delivery_pid = 2; } enum RiderType { SELF = 0; EXTERNAL = 1; OWNED = 2; INSTANT = 3; } enum RiderDeliveryStatus { ACCEPTED = 0; WAITING_FOR_PICKUP = 1; RECIPIENT = 2; DELIVERED = 3; REJECTED = 4; } enum CustomerDeliveryStatus { BOOKED = 0; DISPATCHED = 1; CUSTOMER = 2; DELIVERD = 3; CANCELLED = 4; } enum DeliveryStage { PENDING = 0; PROGRESS = 1; COMPLETED = 2; } message Customer { google.protobuf.StringValue name = 1; google.protobuf.StringValue email = 2; google.protobuf.StringValue phone_number = 3; string address = 4; } message ProductResponse { string product = 1; int64 quantity = 2; float amount = 3; ProductCategoryResponse category = 4; repeated string images = 6; string pid = 7; google.protobuf.StringValue description = 8; map more_details = 9; } message ProductRequest { string product = 1; int64 quantity = 2; float amount = 3; google.protobuf.StringValue category_id = 4; repeated string sub_category_ids = 5; repeated string images = 6; google.protobuf.StringValue description = 8; map more_details = 9; } service ProductCategoryService { rpc AddCategory(ProductCategoryRequest) returns (ProductCategoryResponse); rpc RemoveCategory(google.protobuf.StringValue) returns (google.protobuf.BoolValue); rpc GetAllCategories(ProductCategoryPageableRequest) returns (ProductCategoryPageableResponse); rpc GetCategoryByPid(google.protobuf.StringValue) returns (ProductCategoryResponse); rpc GetCategoriesByPids(DeliveryStringsRequest) returns (ProductCategories); rpc GetCategoriesForOwner(google.protobuf.StringValue) returns (ProductCategories); } message ProductCategories { repeated ProductCategoryResponse categories = 1; } message ProductCategoryResponse { string name = 1; repeated ProductCategoryResponse sub_categories = 2; string pid = 3; string owner_pid = 4; } message ProductCategoryRequest { string name = 1; repeated ProductCategoryRequest sub_categories = 2; } message ProductCategoryPageableRequest { google.protobuf.Int64Value numberPerPage = 1; google.protobuf.StringValue lastItemId = 2; } message ProductCategoryPageableResponse { repeated ProductCategoryResponse data = 1; google.protobuf.Int64Value numberPerPage = 2; google.protobuf.StringValue lastItemId = 3; google.protobuf.Int64Value total = 4; google.protobuf.Int64Value noOfItemsInBatch = 5; }