219 lines
5.7 KiB
Protocol Buffer
219 lines
5.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package userorder;
|
|
|
|
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.UserOrder.Protobuf.Protos.UserOrder";
|
|
|
|
service UserOrderContract
|
|
{
|
|
rpc CreateNewUserOrder(CreateNewUserOrderRequest) returns (CreateNewUserOrderResponse){
|
|
option (google.api.http) = {
|
|
post: "/CreateNewUserOrder"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc UpdateUserOrder(UpdateUserOrderRequest) returns (google.protobuf.Empty){
|
|
option (google.api.http) = {
|
|
put: "/UpdateUserOrder"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc DeleteUserOrder(DeleteUserOrderRequest) returns (google.protobuf.Empty){
|
|
option (google.api.http) = {
|
|
delete: "/DeleteUserOrder"
|
|
body: "*"
|
|
};
|
|
};
|
|
rpc GetUserOrder(GetUserOrderRequest) returns (GetUserOrderResponse){
|
|
option (google.api.http) = {
|
|
get: "/GetUserOrder"
|
|
|
|
};
|
|
};
|
|
rpc GetAllUserOrderByFilter(GetAllUserOrderByFilterRequest) returns (GetAllUserOrderByFilterResponse){
|
|
option (google.api.http) = {
|
|
get: "/GetAllUserOrderByFilter"
|
|
|
|
};
|
|
};
|
|
rpc SubmitShopBuyOrder(SubmitShopBuyOrderRequest) returns (SubmitShopBuyOrderResponse){
|
|
option (google.api.http) = {
|
|
post: "/SubmitShopBuyOrder"
|
|
body: "*"
|
|
};
|
|
};
|
|
}
|
|
message CreateNewUserOrderRequest
|
|
{
|
|
int64 price = 1;
|
|
int64 package_id = 2;
|
|
google.protobuf.Int64Value transaction_id = 3;
|
|
bool payment_status = 4;
|
|
google.protobuf.Timestamp payment_date = 5;
|
|
int64 user_address_id = 6;
|
|
}
|
|
message CreateNewUserOrderResponse
|
|
{
|
|
int64 id = 1;
|
|
}
|
|
message UpdateUserOrderRequest
|
|
{
|
|
int64 id = 1;
|
|
google.protobuf.Int64Value transaction_id = 2;
|
|
}
|
|
message DeleteUserOrderRequest
|
|
{
|
|
int64 id = 1;
|
|
}
|
|
message GetUserOrderRequest
|
|
{
|
|
int64 id = 1;
|
|
}
|
|
message GetUserOrderResponse
|
|
{
|
|
int64 id = 1;
|
|
int64 amount = 2;
|
|
int64 package_id = 3;
|
|
google.protobuf.Int64Value transaction_id = 4;
|
|
oneof PaymentStatus_item
|
|
{
|
|
PaymentStatus payment_status = 5;
|
|
}
|
|
google.protobuf.Timestamp payment_date = 6;
|
|
int64 user_id = 7;
|
|
int64 user_address_id = 8;
|
|
oneof PaymentMethod_item
|
|
{
|
|
PaymentMethod payment_method = 9;
|
|
}
|
|
google.protobuf.StringValue user_address_text = 10;
|
|
repeated GetUserOrderResponseFactorDetail factor_details = 11;
|
|
// VAT information
|
|
OrderVATInfo vat_info = 12;
|
|
}
|
|
|
|
// اطلاعات مالیات بر ارزش افزوده
|
|
message OrderVATInfo
|
|
{
|
|
double vat_rate = 1; // نرخ مالیات (مثلاً 0.09)
|
|
int64 base_amount = 2; // مبلغ پایه (قبل از مالیات)
|
|
int64 vat_amount = 3; // مبلغ مالیات
|
|
int64 total_amount = 4; // مبلغ کل (پایه + مالیات)
|
|
bool is_paid = 5; // آیا پرداخت شده
|
|
}
|
|
enum PaymentStatus
|
|
{
|
|
Success = 0;
|
|
Reject = 1;
|
|
Pending = 2;
|
|
}
|
|
enum PaymentMethod
|
|
{
|
|
IPG = 0;
|
|
Wallet = 1;
|
|
}
|
|
message GetUserOrderResponseFactorDetail
|
|
{
|
|
int64 product_id = 1;
|
|
string product_title = 2;
|
|
google.protobuf.StringValue product_thumbnail_path = 3;
|
|
google.protobuf.Int64Value unit_price = 4;
|
|
google.protobuf.Int32Value count = 5;
|
|
google.protobuf.Int64Value unit_discount_price = 6;
|
|
}
|
|
message GetAllUserOrderByFilterRequest
|
|
{
|
|
PaginationState pagination_state = 1;
|
|
google.protobuf.StringValue sort_by = 2;
|
|
GetAllUserOrderByFilterFilter filter = 3;
|
|
}
|
|
message GetAllUserOrderByFilterFilter
|
|
{
|
|
google.protobuf.Int64Value id = 1;
|
|
google.protobuf.Int64Value amount = 2;
|
|
google.protobuf.Int64Value package_id = 3;
|
|
google.protobuf.Int64Value transaction_id = 4;
|
|
google.protobuf.BoolValue payment_status = 5;
|
|
google.protobuf.Timestamp payment_date = 6;
|
|
google.protobuf.Int64Value user_id = 7;
|
|
google.protobuf.Int64Value user_address_id = 8;
|
|
}
|
|
message GetAllUserOrderByFilterResponse
|
|
{
|
|
MetaData meta_data = 1;
|
|
repeated GetAllUserOrderByFilterResponseModel models = 2;
|
|
}
|
|
message GetAllUserOrderByFilterResponseModel
|
|
{
|
|
int64 id = 1;
|
|
int64 amount = 2;
|
|
int64 package_id = 3;
|
|
google.protobuf.Int64Value transaction_id = 4;
|
|
oneof PaymentStatus_item
|
|
{
|
|
PaymentStatus payment_status = 5;
|
|
}
|
|
google.protobuf.Timestamp payment_date = 6;
|
|
int64 user_id = 7;
|
|
int64 user_address_id = 8;
|
|
oneof PaymentMethod_item
|
|
{
|
|
PaymentMethod payment_method = 9;
|
|
}
|
|
google.protobuf.StringValue user_address_text = 10;
|
|
repeated GetAllUserOrderByFilterResponseModelFactorDetail factor_details = 11;
|
|
}
|
|
message GetAllUserOrderByFilterResponseModelFactorDetail
|
|
{
|
|
int64 product_id = 1;
|
|
string product_title = 2;
|
|
google.protobuf.StringValue product_thumbnail_path = 3;
|
|
google.protobuf.Int64Value unit_price = 4;
|
|
google.protobuf.Int32Value count = 5;
|
|
google.protobuf.Int64Value unit_discount_price = 6;
|
|
}
|
|
message SubmitShopBuyOrderRequest
|
|
{
|
|
int64 total_amount = 1;
|
|
}
|
|
message SubmitShopBuyOrderResponse
|
|
{
|
|
int64 id = 1;
|
|
// VAT information for checkout confirmation
|
|
OrderVATInfo vat_info = 2;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|