Complete FrontOffice BFF to CMS Migration
- Migrated all 9 services from FrontOffice.BFF to CMS architecture - Enhanced user.proto with 7 additional Customer API endpoints: * UpdateCustomerProfile, GetCustomerProfile * ChangeCustomerPassword with validation * GetCustomerReferrals with commission stats * UploadCustomerAvatar with file validation * GetCustomerSettings, UpdateCustomerSettings - All services now support Customer endpoints with /Customer/ prefix - Mock implementations with realistic Persian data - Fixed namespace conflicts and compilation issues - Comprehensive testing completed for all endpoints - Services migrated: Categories, City, UserCarts, Products, UserWallet, Transaction, UserOrder, Package, User (enhanced)
This commit is contained in:
@@ -55,6 +55,31 @@ service TransactionsContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc GetCustomerTransaction(GetCustomerTransactionRequest) returns (GetCustomerTransactionResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetTransaction"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerTransactionsByFilter(GetCustomerTransactionsByFilterRequest) returns (GetCustomerTransactionsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetTransactions"
|
||||
};
|
||||
};
|
||||
rpc CustomerPaymentRequest(CustomerPaymentRequestRequest) returns (CustomerPaymentRequestResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/PaymentRequest"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CustomerPaymentVerification(CustomerPaymentVerificationRequest) returns (CustomerPaymentVerificationResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/PaymentVerification"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewTransactionsRequest
|
||||
{
|
||||
@@ -191,3 +216,131 @@ message RefundTransactionResponse
|
||||
int64 refund_amount = 3;
|
||||
string message = 4;
|
||||
}
|
||||
|
||||
// ============= Customer-specific Messages =============
|
||||
|
||||
// Customer Transaction Models
|
||||
message GetCustomerTransactionRequest
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue authority = 2;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string merchant_id = 2;
|
||||
int64 amount = 3;
|
||||
string callback_url = 4;
|
||||
string description = 5;
|
||||
google.protobuf.StringValue mobile = 6;
|
||||
google.protobuf.StringValue email = 7;
|
||||
google.protobuf.Int32Value request_status_code = 8;
|
||||
google.protobuf.StringValue request_status_message = 9;
|
||||
google.protobuf.StringValue authority = 10;
|
||||
google.protobuf.StringValue fee_type = 11;
|
||||
google.protobuf.Int64Value fee = 12;
|
||||
CurrencyEnum currency = 13;
|
||||
bool payment_status = 14;
|
||||
google.protobuf.Int32Value verification_status_code = 15;
|
||||
google.protobuf.StringValue verification_status_message = 16;
|
||||
google.protobuf.StringValue card_hash = 17;
|
||||
google.protobuf.StringValue card_pan = 18;
|
||||
google.protobuf.StringValue ref_id = 19;
|
||||
google.protobuf.StringValue order_id = 20;
|
||||
TransactionTypeEnum type = 21;
|
||||
}
|
||||
|
||||
// Customer Filter Messages
|
||||
message GetCustomerTransactionsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetCustomerTransactionsByFilterFilter filter = 3;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value amount = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue authority = 4;
|
||||
google.protobuf.BoolValue payment_status = 5;
|
||||
google.protobuf.StringValue ref_id = 6;
|
||||
google.protobuf.StringValue order_id = 7;
|
||||
CurrencyEnum currency = 8;
|
||||
TransactionTypeEnum type = 9;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetCustomerTransactionsByFilterResponseModel models = 2;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string merchant_id = 2;
|
||||
int64 amount = 3;
|
||||
string callback_url = 4;
|
||||
string description = 5;
|
||||
google.protobuf.StringValue mobile = 6;
|
||||
google.protobuf.StringValue email = 7;
|
||||
google.protobuf.StringValue authority = 8;
|
||||
google.protobuf.Int64Value fee = 9;
|
||||
CurrencyEnum currency = 10;
|
||||
bool payment_status = 11;
|
||||
google.protobuf.StringValue card_hash = 12;
|
||||
google.protobuf.StringValue card_pan = 13;
|
||||
google.protobuf.StringValue ref_id = 14;
|
||||
google.protobuf.StringValue order_id = 15;
|
||||
TransactionTypeEnum type = 16;
|
||||
}
|
||||
|
||||
// Customer Payment Request/Verification
|
||||
message CustomerPaymentRequestRequest
|
||||
{
|
||||
int64 amount = 1;
|
||||
string callback_url = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue mobile = 4;
|
||||
google.protobuf.StringValue email = 5;
|
||||
CurrencyEnum currency = 6;
|
||||
TransactionTypeEnum type = 7;
|
||||
google.protobuf.StringValue order_id = 8;
|
||||
}
|
||||
|
||||
message CustomerPaymentRequestResponse
|
||||
{
|
||||
string payment_g_w_url = 1;
|
||||
}
|
||||
|
||||
message CustomerPaymentVerificationRequest
|
||||
{
|
||||
string authority = 1;
|
||||
string status = 2;
|
||||
}
|
||||
|
||||
message CustomerPaymentVerificationResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
bool payment_status = 2;
|
||||
string message = 3;
|
||||
google.protobuf.StringValue ref_id = 4;
|
||||
google.protobuf.StringValue order_id = 5;
|
||||
google.protobuf.Int32Value verification_status_code = 6;
|
||||
}
|
||||
|
||||
// Enums for Customer API
|
||||
enum CurrencyEnum
|
||||
{
|
||||
IRR = 0;
|
||||
IRT = 1;
|
||||
}
|
||||
|
||||
enum TransactionTypeEnum
|
||||
{
|
||||
Real = 0;
|
||||
Sandbox = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user