175 lines
4.2 KiB
Protocol Buffer
175 lines
4.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package user;
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "google/protobuf/wrappers.proto";
|
|
import "google/protobuf/duration.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
import "google/api/annotations.proto";
|
|
|
|
option csharp_namespace = "FrontOffice.BFF.User.Protobuf.Protos.User";
|
|
|
|
service UserContract
|
|
{
|
|
rpc UpdateUser(UpdateUserRequest) returns (google.protobuf.Empty){
|
|
option (google.api.http) = {
|
|
put: "/UpdateUser"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty){
|
|
option (google.api.http) = {
|
|
delete: "/DeleteUser"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc GetUser(GetUserRequest) returns (GetUserResponse){
|
|
option (google.api.http) = {
|
|
get: "/GetUser"
|
|
|
|
};
|
|
};
|
|
rpc GetAllUserByFilter(GetAllUserByFilterRequest) returns (GetAllUserByFilterResponse){
|
|
option (google.api.http) = {
|
|
get: "/GetAllUserByFilter"
|
|
|
|
};
|
|
};
|
|
rpc CreateNewOtpToken(CreateNewOtpTokenRequest) returns (CreateNewOtpTokenResponse){
|
|
option (google.api.http) = {
|
|
post: "/CreateNewOtpToken"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc VerifyOtpToken(VerifyOtpTokenRequest) returns (VerifyOtpTokenResponse){
|
|
option (google.api.http) = {
|
|
post: "/VerifyOtpToken"
|
|
body: "*"
|
|
};
|
|
};
|
|
}
|
|
message UpdateUserRequest
|
|
{
|
|
int64 id = 1;
|
|
google.protobuf.StringValue first_name = 2;
|
|
google.protobuf.StringValue last_name = 3;
|
|
google.protobuf.StringValue national_code = 4;
|
|
google.protobuf.StringValue avatar_path = 5;
|
|
UserAvatarFileModel avatar_file = 6;
|
|
}
|
|
message UserAvatarFileModel
|
|
{
|
|
google.protobuf.StringValue file_name = 1;
|
|
google.protobuf.StringValue file_mime = 2;
|
|
bytes file = 3;
|
|
}
|
|
message DeleteUserRequest
|
|
{
|
|
int64 id = 1;
|
|
}
|
|
message GetUserRequest
|
|
{
|
|
int64 id = 1;
|
|
}
|
|
message GetUserResponse
|
|
{
|
|
int64 id = 1;
|
|
google.protobuf.StringValue first_name = 2;
|
|
google.protobuf.StringValue last_name = 3;
|
|
string mobile = 4;
|
|
google.protobuf.StringValue national_code = 5;
|
|
google.protobuf.StringValue avatar_path = 6;
|
|
google.protobuf.Int64Value parent_id = 7;
|
|
string token = 8;
|
|
string referral_code = 9;
|
|
bool is_mobile_verified = 10;
|
|
google.protobuf.Timestamp mobile_verified_at = 11;
|
|
}
|
|
message GetAllUserByFilterRequest
|
|
{
|
|
PaginationState pagination_state = 1;
|
|
google.protobuf.StringValue sort_by = 2;
|
|
GetAllUserByFilterFilter filter = 3;
|
|
}
|
|
message GetAllUserByFilterFilter
|
|
{
|
|
google.protobuf.Int64Value id = 1;
|
|
google.protobuf.StringValue first_name = 2;
|
|
google.protobuf.StringValue last_name = 3;
|
|
google.protobuf.StringValue mobile = 4;
|
|
google.protobuf.StringValue national_code = 5;
|
|
google.protobuf.StringValue avatar_path = 6;
|
|
google.protobuf.Int64Value parent_id = 7;
|
|
google.protobuf.StringValue referral_code = 8;
|
|
google.protobuf.BoolValue is_mobile_verified = 9;
|
|
}
|
|
message GetAllUserByFilterResponse
|
|
{
|
|
MetaData meta_data = 1;
|
|
repeated GetAllUserByFilterResponseModel models = 2;
|
|
}
|
|
message GetAllUserByFilterResponseModel
|
|
{
|
|
int64 id = 1;
|
|
google.protobuf.StringValue first_name = 2;
|
|
google.protobuf.StringValue last_name = 3;
|
|
string mobile = 4;
|
|
google.protobuf.StringValue national_code = 5;
|
|
google.protobuf.StringValue avatar_path = 6;
|
|
google.protobuf.Int64Value parent_id = 7;
|
|
string referral_code = 8;
|
|
bool is_mobile_verified = 9;
|
|
google.protobuf.Timestamp mobile_verified_at = 10;
|
|
}
|
|
message CreateNewOtpTokenRequest
|
|
{
|
|
string mobile = 1;
|
|
string purpose = 2;
|
|
}
|
|
message CreateNewOtpTokenResponse
|
|
{
|
|
bool success = 1;
|
|
string message = 2;
|
|
}
|
|
message VerifyOtpTokenRequest
|
|
{
|
|
string mobile = 1;
|
|
string purpose = 2;
|
|
string code = 3;
|
|
}
|
|
message VerifyOtpTokenResponse
|
|
{
|
|
bool success = 1;
|
|
string message = 2;
|
|
google.protobuf.StringValue token = 3;
|
|
}
|
|
|
|
message PaginationState
|
|
{
|
|
int32 page_number = 1;
|
|
|
|
int32 page_size = 2;
|
|
}
|
|
message MetaData
|
|
{
|
|
int64 current_page = 1;
|
|
|
|
int64 total_page = 2;
|
|
|
|
int64 page_size = 3;
|
|
|
|
int64 total_count = 4;
|
|
|
|
bool has_previous = 5;
|
|
|
|
bool has_next = 6;
|
|
}
|
|
message DecimalValue
|
|
{
|
|
|
|
int64 units = 1;
|
|
|
|
sfixed32 nanos = 2;
|
|
}
|