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:
masoodafar-web
2026-01-30 08:53:09 +03:30
parent 96daf899c7
commit 658d076bdf
170 changed files with 3770 additions and 4364 deletions
@@ -43,6 +43,37 @@ service UserWalletContract
};
};
// ============= Customer-specific Methods =============
rpc GetCustomerWallet(google.protobuf.Empty) returns (GetCustomerWalletResponse){
option (google.api.http) = {
get: "/Customer/GetWallet"
};
};
rpc GetCustomerWalletChangeLog(GetCustomerWalletChangeLogRequest) returns (GetCustomerWalletChangeLogResponse){
option (google.api.http) = {
post: "/Customer/GetWalletChangeLog"
body: "*"
};
};
rpc CustomerWithdrawBalance(CustomerWithdrawBalanceRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/Customer/WithdrawBalance"
body: "*"
};
};
rpc GetCustomerWithdrawals(GetCustomerWithdrawalsRequest) returns (GetCustomerWithdrawalsResponse){
option (google.api.http) = {
post: "/Customer/GetWithdrawals"
body: "*"
};
};
rpc GetCustomerWithdrawalSettings(google.protobuf.Empty) returns (GetCustomerWithdrawalSettingsResponse){
option (google.api.http) = {
get: "/Customer/GetWithdrawalSettings"
};
};
}
message CreateNewUserWalletRequest
{
@@ -101,3 +132,70 @@ message GetAllUserWalletByFilterResponseModel
int64 balance = 3;
int64 network_balance = 4;
}
// ============= Customer-specific Messages =============
message GetCustomerWalletResponse
{
int64 balance = 1;
int64 network_balance = 2;
int64 discount_balance = 3;
}
message GetCustomerWalletChangeLogRequest
{
google.protobuf.Int64Value reference_id = 1;
google.protobuf.BoolValue is_increase = 2;
}
message GetCustomerWalletChangeLogResponse
{
messages.MetaData meta_data = 1;
repeated CustomerWalletChangeLogModel models = 2;
}
message CustomerWalletChangeLogModel
{
int64 current_balance = 1;
int64 change_value = 2;
int64 current_network_balance = 3;
int64 change_nerwork_value = 4;
bool is_increase = 5;
google.protobuf.Int64Value refrence_id = 6;
google.protobuf.Timestamp created_at = 7;
}
message CustomerWithdrawBalanceRequest
{
int64 payout_id = 1;
int32 withdrawal_method = 2; // 0: Cash, 1: Diamond
google.protobuf.StringValue iban_number = 3;
}
message GetCustomerWithdrawalsRequest
{
google.protobuf.Int32Value status = 1;
}
message GetCustomerWithdrawalsResponse
{
messages.MetaData meta_data = 1;
repeated CustomerWithdrawalModel models = 2;
}
message CustomerWithdrawalModel
{
int64 id = 1;
int64 week_definition_id = 2;
string week_display_name = 3;
int64 total_amount = 4;
int32 status = 5;
google.protobuf.Int32Value withdrawal_method = 6;
string iban_number = 7;
google.protobuf.Timestamp created = 8;
}
message GetCustomerWithdrawalSettingsResponse
{
int64 min_withdrawal_amount = 1;
}