Documentation Index Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
Use this file to discover all available pages before exploring further.
Framework
Introduction
gRPC is a high-performance, open-source universal RPC framework that puts data first. It provides a simple, efficient, and scalable way to build distributed systems.
Getting Started
syntax = "proto3" ;
package stateset.return_order ;
import "google/protobuf/timestamp.proto" ;
import "common.proto" ;
message Return {
string id = 1 ;
string order_id = 2 ;
string customer_id = 3 ;
repeated ReturnItem items = 4 ;
string status = 5 ;
string reason = 6 ;
google.protobuf.Timestamp created_at = 7 ;
google.protobuf.Timestamp updated_at = 8 ;
}
message ReturnItem {
string product_id = 1 ;
int32 quantity = 2 ;
string reason = 3 ;
}
message CreateReturnRequest {
Return return = 1 ;
}
message CreateReturnResponse {
string return_id = 1 ;
string status = 2 ;
}
message GetReturnRequest {
string return_id = 1 ;
}
message GetReturnResponse {
Return return = 1 ;
}
message UpdateReturnStatusRequest {
string return_id = 1 ;
string new_status = 2 ;
}
message UpdateReturnStatusResponse {
string return_id = 1 ;
string status = 2 ;
}
message ListReturnsRequest {
string customer_id = 1 ;
string order_id = 2 ;
string status = 3 ;
google.protobuf.Timestamp start_date = 4 ;
google.protobuf.Timestamp end_date = 5 ;
common.PaginationRequest pagination = 6 ;
}
message ListReturnsResponse {
repeated Return returns = 1 ;
common.PaginationResponse pagination = 2 ;
}
service ReturnService {
rpc CreateReturn ( CreateReturnRequest ) returns ( CreateReturnResponse );
rpc GetReturn ( GetReturnRequest ) returns ( GetReturnResponse );
rpc UpdateReturnStatus ( UpdateReturnStatusRequest ) returns ( UpdateReturnStatusResponse );
rpc ListReturns ( ListReturnsRequest ) returns ( ListReturnsResponse );
}
We can now build our handlers and services to handle the requests and responses.
Protocol Buffers To learn more about Protocol Buffers, check out this article .