protobufs/transactions.proto

76 lines
1.4 KiB
Protocol Buffer
Raw Normal View History

2022-07-17 01:09:09 +00:00
syntax = "proto3";
2022-07-17 01:41:57 +00:00
option go_package = "git.itzana.me/strafesnet/protobufs/rpc/transactions";
2022-07-17 01:09:09 +00:00
package transactions;
2022-07-17 06:23:42 +00:00
import "users.proto";
2022-07-17 01:09:09 +00:00
import "google/protobuf/struct.proto";
service TransactionsService {
rpc Create(TransactionCreate) returns (IdMessage);
rpc Update(TransactionUpdate) returns (NullResponse);
rpc Delete(IdMessage) returns (NullResponse);
rpc Balance(UserIdMessage) returns (BalanceResponse);
rpc Get(IdMessage) returns (TransactionItem);
rpc List(ListRequest) returns (TransactionList);
}
message TransactionCreate {
int64 UserID = 1;
int64 Value = 2;
int32 StateID = 3;
google.protobuf.Struct Data = 4;
}
message TransactionUpdate {
string ID = 1;
optional int64 Value = 2;
optional int64 StateID = 3;
optional google.protobuf.Struct Data = 4;
}
message TransactionItem {
string ID = 1;
users.UserResponse User = 2;
int64 Value = 3;
int32 StateID = 4;
int64 Created = 5;
int64 Updated = 6;
google.protobuf.Struct Data = 7;
}
message TransactionFilter {
optional int64 UserID = 1;
optional int32 StateID = 2;
}
message ListRequest {
TransactionFilter Filter = 1;
Pagination Page = 2;
}
message Pagination {
int32 Size = 1;
int32 Number = 2;
}
message TransactionList {
repeated TransactionItem Transactions = 1;
}
message BalanceResponse {
int64 Balance = 1;
}
message IdMessage {
string ID = 1;
}
message UserIdMessage {
int64 UserID = 1;
}
message NullResponse {
}