feat: Add ClearCart command and response, implement CancelOrder command with validation, and enhance DeliveryStatus and User models

This commit is contained in:
masoodafar-web
2025-12-02 03:30:36 +03:30
parent 25fc73ae28
commit 78606cc5cc
100 changed files with 12925 additions and 8137 deletions

View File

@@ -43,6 +43,18 @@ service TransactionsContract
};
};
rpc VerifyTransaction(VerifyTransactionRequest) returns (VerifyTransactionResponse){
option (google.api.http) = {
post: "/VerifyTransaction"
body: "*"
};
};
rpc RefundTransaction(RefundTransactionRequest) returns (RefundTransactionResponse){
option (google.api.http) = {
post: "/RefundTransaction"
body: "*"
};
};
}
message CreateNewTransactionsRequest
{
@@ -146,3 +158,36 @@ message GetAllTransactionsByFilterResponseModel
messages.TransactionType type = 7;
}
}
// VerifyTransaction Messages
message VerifyTransactionRequest
{
int64 transaction_id = 1;
string ref_id = 2;
messages.PaymentStatus status = 3;
google.protobuf.Timestamp payment_date = 4;
}
message VerifyTransactionResponse
{
int64 transaction_id = 1;
messages.PaymentStatus status = 2;
string ref_id = 3;
string message = 4;
}
// RefundTransaction Messages
message RefundTransactionRequest
{
int64 transaction_id = 1;
string refund_reason = 2;
google.protobuf.Int64Value refund_amount = 3;
}
message RefundTransactionResponse
{
int64 original_transaction_id = 1;
int64 refund_transaction_id = 2;
int64 refund_amount = 3;
string message = 4;
}

View File

@@ -67,13 +67,14 @@ message CreateNewUserRequest
google.protobuf.StringValue first_name = 1;
google.protobuf.StringValue last_name = 2;
string mobile = 3;
google.protobuf.StringValue national_code = 4;
google.protobuf.StringValue avatar_path = 5;
google.protobuf.Int64Value parent_id = 6;
bool email_notifications = 7;
bool sms_notifications = 8;
bool push_notifications = 9;
google.protobuf.Timestamp birth_date = 10;
google.protobuf.StringValue email = 4;
google.protobuf.StringValue national_code = 5;
google.protobuf.StringValue avatar_path = 6;
google.protobuf.Int64Value parent_id = 7;
bool email_notifications = 8;
bool sms_notifications = 9;
bool push_notifications = 10;
google.protobuf.Timestamp birth_date = 11;
}
message CreateNewUserResponse
{
@@ -84,14 +85,15 @@ 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;
bool is_rules_accepted = 6;
google.protobuf.Timestamp rules_accepted_at = 7;
bool email_notifications = 8;
bool sms_notifications = 9;
bool push_notifications = 10;
google.protobuf.Timestamp birth_date = 11;
google.protobuf.StringValue email = 4;
google.protobuf.StringValue national_code = 5;
google.protobuf.StringValue avatar_path = 6;
bool is_rules_accepted = 7;
google.protobuf.Timestamp rules_accepted_at = 8;
bool email_notifications = 9;
bool sms_notifications = 10;
bool push_notifications = 11;
google.protobuf.Timestamp birth_date = 12;
}
message DeleteUserRequest
{
@@ -107,16 +109,17 @@ message GetUserResponse
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;
bool email_notifications = 11;
bool sms_notifications = 12;
bool push_notifications = 13;
google.protobuf.Timestamp birth_date = 14;
google.protobuf.StringValue email = 5;
google.protobuf.StringValue national_code = 6;
google.protobuf.StringValue avatar_path = 7;
google.protobuf.Int64Value parent_id = 8;
string referral_code = 9;
bool is_mobile_verified = 10;
google.protobuf.Timestamp mobile_verified_at = 11;
bool email_notifications = 12;
bool sms_notifications = 13;
bool push_notifications = 14;
google.protobuf.Timestamp birth_date = 15;
}
message GetAllUserByFilterRequest
{

View File

@@ -43,6 +43,12 @@ service UserCartsContract
};
};
rpc ClearCart(ClearCartRequest) returns (ClearCartResponse){
option (google.api.http) = {
post: "/ClearCart"
body: "*"
};
};
}
message CreateNewUserCartsRequest
{
@@ -105,3 +111,16 @@ message GetAllUserCartsByFilterResponseModel
string product_thumbnail_path = 9;
google.protobuf.Timestamp created = 10;
}
// ClearCart Messages
message ClearCartRequest
{
int64 user_id = 1;
}
message ClearCartResponse
{
int64 user_id = 1;
int32 removed_items_count = 2;
string message = 3;
}

View File

@@ -49,6 +49,12 @@ service UserOrderContract
body: "*"
};
};
rpc CancelOrder(CancelOrderRequest) returns (CancelOrderResponse){
option (google.api.http) = {
post: "/CancelOrder"
body: "*"
};
};
}
message CreateNewUserOrderRequest
{
@@ -225,3 +231,19 @@ message SubmitShopBuyOrderResponse
{
int64 id = 1;
}
// CancelOrder Messages
message CancelOrderRequest
{
int64 order_id = 1;
string cancel_reason = 2;
bool refund_payment = 3;
}
message CancelOrderResponse
{
int64 order_id = 1;
messages.DeliveryStatus status = 2;
string message = 3;
bool refund_processed = 4;
}