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
@@ -76,6 +76,36 @@ service PackageContract
body: "*"
};
};
// ============= Customer-specific Methods =============
rpc GetCustomerPackages(GetCustomerPackagesRequest) returns (GetCustomerPackagesResponse){
option (google.api.http) = {
get: "/Customer/GetPackages"
};
};
rpc GetCustomerPackageDetails(GetCustomerPackageDetailsRequest) returns (GetCustomerPackageDetailsResponse){
option (google.api.http) = {
get: "/Customer/GetPackageDetails"
};
};
rpc CustomerPurchasePackage(CustomerPurchasePackageRequest) returns (CustomerPurchasePackageResponse){
option (google.api.http) = {
post: "/Customer/PurchasePackage"
body: "*"
};
};
rpc CustomerVerifyPackagePurchase(CustomerVerifyPackagePurchaseRequest) returns (CustomerVerifyPackagePurchaseResponse){
option (google.api.http) = {
post: "/Customer/VerifyPackagePurchase"
body: "*"
};
};
rpc GetCustomerPurchaseHistory(GetCustomerPurchaseHistoryRequest) returns (GetCustomerPurchaseHistoryResponse){
option (google.api.http) = {
get: "/Customer/GetPurchaseHistory"
};
};
}
message CreateNewPackageRequest
{
@@ -226,3 +256,151 @@ message VerifyBasePackagePaymentResponse
int64 wallet_balance = 6;
int64 discount_balance = 7;
}
// ============= Customer Message Types =============
message GetCustomerPackagesRequest
{
bool include_inactive = 1;
PackageTypeEnum package_type_filter = 2;
}
message GetCustomerPackagesResponse
{
repeated CustomerPackageModel packages = 1;
}
message GetCustomerPackageDetailsRequest
{
int64 package_id = 1;
}
message GetCustomerPackageDetailsResponse
{
CustomerPackageModel package = 1;
repeated PackageFeature features = 2;
PurchaseRequirements requirements = 3;
}
message CustomerPurchasePackageRequest
{
int64 package_id = 1;
PurchaseMethodEnum purchase_method = 2;
string callback_url = 3;
}
message CustomerPurchasePackageResponse
{
bool success = 1;
string message = 2;
int64 order_id = 3;
string payment_gateway_url = 4;
string authority = 5;
}
message CustomerVerifyPackagePurchaseRequest
{
int64 order_id = 1;
string authority = 2;
string status = 3;
}
message CustomerVerifyPackagePurchaseResponse
{
bool success = 1;
string message = 2;
int64 transaction_id = 3;
string reference_code = 4;
PackagePurchaseInfo purchase_info = 5;
}
message GetCustomerPurchaseHistoryRequest
{
int64 user_id = 1;
messages.PaginationState pagination_state = 2;
PackageTypeEnum package_type_filter = 3;
google.protobuf.Timestamp from_date = 4;
google.protobuf.Timestamp to_date = 5;
}
message GetCustomerPurchaseHistoryResponse
{
messages.MetaData meta_data = 1;
repeated PackagePurchaseHistory purchases = 2;
}
message CustomerPackageModel
{
int64 id = 1;
string name = 2;
string description = 3;
int64 price = 4;
string currency = 5;
PackageTypeEnum package_type = 6;
bool is_available = 7;
string image_url = 8;
int32 validity_days = 9;
bool is_popular = 10;
string short_description = 11;
}
message PackageFeature
{
string title = 1;
string description = 2;
string icon = 3;
bool is_highlighted = 4;
}
message PurchaseRequirements
{
bool requires_membership = 1;
int64 minimum_wallet_balance = 2;
repeated string restrictions = 3;
}
message PackagePurchaseInfo
{
int64 package_id = 1;
string package_name = 2;
int64 amount_paid = 3;
google.protobuf.Timestamp purchase_date = 4;
google.protobuf.Timestamp expiry_date = 5;
}
message PackagePurchaseHistory
{
int64 id = 1;
int64 package_id = 2;
string package_name = 3;
int64 amount = 4;
PackageTypeEnum package_type = 5;
google.protobuf.Timestamp purchase_date = 6;
google.protobuf.Timestamp expiry_date = 7;
PaymentStatusEnum status = 8;
string status_message = 9;
string reference_code = 10;
}
enum PackageTypeEnum
{
PACKAGE_TYPE_BASIC = 0;
PACKAGE_TYPE_GOLDEN = 1;
PACKAGE_TYPE_PREMIUM = 2;
PACKAGE_TYPE_SPECIAL = 3;
}
enum PurchaseMethodEnum
{
PURCHASE_METHOD_WALLET = 0;
PURCHASE_METHOD_GATEWAY = 1;
PURCHASE_METHOD_MIXED = 2;
}
enum PaymentStatusEnum
{
PAYMENT_STATUS_PENDING = 0;
PAYMENT_STATUS_SUCCESS = 1;
PAYMENT_STATUS_FAILED = 2;
PAYMENT_STATUS_REFUNDED = 3;
}