Add response DTOs for withdrawal and club activation commands
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</PackageId>
|
||||
<Version>0.0.1</Version>
|
||||
<Authors>FourSat</Authors>
|
||||
<Company>FourSat</Company>
|
||||
<Product>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</Product>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
|
||||
<PackageReference Include="Grpc.Core.Api" Version="2.54.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.72.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="Protos\networkmembership.proto" GrpcServices="Client" AdditionalImportDirs="..\BackOffice.BFF.Common.Protobuf\Protos"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BackOffice.BFF.Common.Protobuf\BackOffice.BFF.Common.Protobuf.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,124 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package networkmembership;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option csharp_namespace = "BackOffice.BFF.NetworkMembership.Protobuf";
|
||||
|
||||
service NetworkMembershipContract
|
||||
{
|
||||
rpc JoinNetwork(JoinNetworkRequest) returns (google.protobuf.Empty);
|
||||
rpc ChangeNetworkParent(ChangeNetworkParentRequest) returns (google.protobuf.Empty);
|
||||
rpc RemoveFromNetwork(RemoveFromNetworkRequest) returns (google.protobuf.Empty);
|
||||
rpc GetUserNetwork(GetUserNetworkRequest) returns (GetUserNetworkResponse);
|
||||
rpc GetNetworkTree(GetNetworkTreeRequest) returns (GetNetworkTreeResponse);
|
||||
rpc GetNetworkMembershipHistory(GetNetworkMembershipHistoryRequest) returns (GetNetworkMembershipHistoryResponse);
|
||||
}
|
||||
|
||||
// JoinNetwork Command
|
||||
message JoinNetworkRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int64 parent_id = 2;
|
||||
int32 leg = 3; // NetworkLeg enum: Left=0, Right=1
|
||||
google.protobuf.StringValue referral_code = 4;
|
||||
}
|
||||
|
||||
// ChangeParent Command
|
||||
message ChangeNetworkParentRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int64 new_parent_id = 2;
|
||||
int32 new_leg = 3; // NetworkLeg enum
|
||||
string reason = 4;
|
||||
}
|
||||
|
||||
// Remove Command
|
||||
message RemoveFromNetworkRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
string reason = 2;
|
||||
}
|
||||
|
||||
// GetUserNetwork Query
|
||||
message GetUserNetworkRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
}
|
||||
|
||||
message GetUserNetworkResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
string user_name = 3;
|
||||
google.protobuf.Int64Value parent_id = 4;
|
||||
string parent_name = 5;
|
||||
int32 network_leg = 6; // NetworkLeg enum
|
||||
google.protobuf.Int64Value left_child_id = 7;
|
||||
string left_child_name = 8;
|
||||
google.protobuf.Int64Value right_child_id = 9;
|
||||
string right_child_name = 10;
|
||||
int32 network_level = 11;
|
||||
string referral_code = 12;
|
||||
google.protobuf.Timestamp joined_at = 13;
|
||||
google.protobuf.Timestamp created = 14;
|
||||
}
|
||||
|
||||
// GetNetworkTree Query
|
||||
message GetNetworkTreeRequest
|
||||
{
|
||||
int64 root_user_id = 1;
|
||||
google.protobuf.Int32Value max_depth = 2;
|
||||
google.protobuf.BoolValue only_active = 3;
|
||||
}
|
||||
|
||||
message GetNetworkTreeResponse
|
||||
{
|
||||
repeated NetworkTreeNodeModel nodes = 1;
|
||||
}
|
||||
|
||||
message NetworkTreeNodeModel
|
||||
{
|
||||
int64 user_id = 1;
|
||||
string user_name = 2;
|
||||
google.protobuf.Int64Value parent_id = 3;
|
||||
int32 network_leg = 4;
|
||||
int32 network_level = 5;
|
||||
bool is_active = 6;
|
||||
google.protobuf.Timestamp joined_at = 7;
|
||||
}
|
||||
|
||||
// GetHistory Query
|
||||
message GetNetworkMembershipHistoryRequest
|
||||
{
|
||||
google.protobuf.Int64Value user_id = 1;
|
||||
google.protobuf.Int64Value parent_id = 2;
|
||||
int32 page_index = 3;
|
||||
int32 page_size = 4;
|
||||
}
|
||||
|
||||
message GetNetworkMembershipHistoryResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated NetworkMembershipHistoryModel models = 2;
|
||||
}
|
||||
|
||||
message NetworkMembershipHistoryModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
google.protobuf.Int64Value old_parent_id = 3;
|
||||
google.protobuf.Int64Value new_parent_id = 4;
|
||||
google.protobuf.Int32Value old_network_leg = 5;
|
||||
google.protobuf.Int32Value new_network_leg = 6;
|
||||
google.protobuf.Int32Value old_network_level = 7;
|
||||
google.protobuf.Int32Value new_network_level = 8;
|
||||
int32 action = 9; // NetworkMembershipAction enum
|
||||
string performed_by = 10;
|
||||
string reason = 11;
|
||||
google.protobuf.Timestamp created = 12;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package messages;
|
||||
|
||||
option csharp_namespace = "BackOffice.BFF.Protobuf.Common";
|
||||
service PublicMessageContract{}
|
||||
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;
|
||||
}
|
||||
enum PaymentStatus
|
||||
{
|
||||
Success = 0;
|
||||
Reject = 1;
|
||||
Pending = 2;
|
||||
}
|
||||
// وضعیت ارسال سفارش
|
||||
enum DeliveryStatus
|
||||
{
|
||||
// نامشخص / نیاز به ارسال ندارد (مثلا سفارش پکیج)
|
||||
DeliveryStatus_None = 0;
|
||||
// ثبت شده و در انتظار آمادهسازی/ارسال
|
||||
DeliveryStatus_Pending = 1;
|
||||
// تحویل پست/حملونقل شده است
|
||||
DeliveryStatus_InTransit = 2;
|
||||
// توسط مشتری دریافت شده است
|
||||
DeliveryStatus_Delivered = 3;
|
||||
// مرجوع شده
|
||||
DeliveryStatus_Returned = 4;
|
||||
}
|
||||
enum TransactionType
|
||||
{
|
||||
Buy = 0;
|
||||
DepositIpg = 1;
|
||||
DepositExternal1 = 2;
|
||||
Withdraw = 3;
|
||||
}
|
||||
enum ContractType
|
||||
{
|
||||
Main = 0;
|
||||
CMS = 1;
|
||||
}
|
||||
enum PaymentMethod
|
||||
{
|
||||
IPG = 0;
|
||||
Wallet = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user