Phase 3: Package layer overhaul — fix critical bugs + proto enhancement
Proto (package.proto): - Add 11 new Package fields to Create/Update/Get/GetAll messages - Add 8 new fields to CustomerPackageModel for frontend Critical Bug Fixes: - VerifyGoldenPackagePurchase: Replace hardcoded ×2 with package.DiscountMultiplier from DB Query Fixes: - GetAllPackageByFilter: Add IsDeleted filter (was returning soft-deleted packages) - GetCustomerPackages: Apply IsDeleted+IncludeInactive filters, sort by SortOrder, return new fields - GetCustomerPackageDetails: Load PackageFeatures from DB (was hardcoded), add IsDeleted filter, return new fields - GetCustomerPurchaseHistory: Include Transaction (was null → ReferenceCode always empty) UpdatePackage: Add 12 new fields (SortOrder, IsActive, IsBasePackage, etc.) Build: 0 errors
This commit is contained in:
@@ -114,6 +114,18 @@ message CreateNewPackageRequest
|
||||
string image_path = 3;
|
||||
int64 price = 4;
|
||||
BoostCardFileModel image_file = 5;
|
||||
int32 sort_order = 6;
|
||||
bool is_active = 7;
|
||||
bool is_base_package = 8;
|
||||
bool supports_daya_purchase = 9;
|
||||
bool supports_direct_purchase = 10;
|
||||
int64 activation_fee = 11;
|
||||
double discount_multiplier = 12;
|
||||
double magic_wallet_multiplier = 13;
|
||||
int32 max_balances_per_leg = 14;
|
||||
int32 max_network_level = 15;
|
||||
int64 magic_wallet_max_deposit = 16;
|
||||
int64 magic_wallet_max_credit = 17;
|
||||
}
|
||||
message CreateNewPackageResponse
|
||||
{
|
||||
@@ -127,6 +139,18 @@ message UpdatePackageRequest
|
||||
string image_path = 4;
|
||||
int64 price = 5;
|
||||
BoostCardFileModel image_file = 6;
|
||||
int32 sort_order = 7;
|
||||
bool is_active = 8;
|
||||
bool is_base_package = 9;
|
||||
bool supports_daya_purchase = 10;
|
||||
bool supports_direct_purchase = 11;
|
||||
int64 activation_fee = 12;
|
||||
double discount_multiplier = 13;
|
||||
double magic_wallet_multiplier = 14;
|
||||
int32 max_balances_per_leg = 15;
|
||||
int32 max_network_level = 16;
|
||||
int64 magic_wallet_max_deposit = 17;
|
||||
int64 magic_wallet_max_credit = 18;
|
||||
}
|
||||
message DeletePackageRequest
|
||||
{
|
||||
@@ -143,6 +167,18 @@ message GetPackageResponse
|
||||
string description = 3;
|
||||
string image_path = 4;
|
||||
int64 price = 5;
|
||||
int32 sort_order = 6;
|
||||
bool is_active = 7;
|
||||
bool is_base_package = 8;
|
||||
bool supports_daya_purchase = 9;
|
||||
bool supports_direct_purchase = 10;
|
||||
int64 activation_fee = 11;
|
||||
double discount_multiplier = 12;
|
||||
double magic_wallet_multiplier = 13;
|
||||
int32 max_balances_per_leg = 14;
|
||||
int32 max_network_level = 15;
|
||||
int64 magic_wallet_max_deposit = 16;
|
||||
int64 magic_wallet_max_credit = 17;
|
||||
}
|
||||
message GetAllPackageByFilterRequest
|
||||
{
|
||||
@@ -170,6 +206,18 @@ message GetAllPackageByFilterResponseModel
|
||||
string description = 3;
|
||||
string image_path = 4;
|
||||
int64 price = 5;
|
||||
int32 sort_order = 6;
|
||||
bool is_active = 7;
|
||||
bool is_base_package = 8;
|
||||
bool supports_daya_purchase = 9;
|
||||
bool supports_direct_purchase = 10;
|
||||
int64 activation_fee = 11;
|
||||
double discount_multiplier = 12;
|
||||
double magic_wallet_multiplier = 13;
|
||||
int32 max_balances_per_leg = 14;
|
||||
int32 max_network_level = 15;
|
||||
int64 magic_wallet_max_deposit = 16;
|
||||
int64 magic_wallet_max_credit = 17;
|
||||
}
|
||||
|
||||
// Package Purchase Messages
|
||||
@@ -350,8 +398,17 @@ message CustomerPackageModel
|
||||
int32 validity_days = 9;
|
||||
bool is_popular = 10;
|
||||
string short_description = 11;
|
||||
string title = 12; // Alias for frontend compatibility (uses name)
|
||||
string image_path = 13; // Alias for frontend compatibility (uses image_url)
|
||||
string title = 12;
|
||||
string image_path = 13;
|
||||
// New package-based fields
|
||||
int64 activation_fee = 14;
|
||||
double discount_multiplier = 15;
|
||||
double magic_wallet_multiplier = 16;
|
||||
int64 magic_wallet_max_deposit = 17;
|
||||
int64 magic_wallet_max_credit = 18;
|
||||
bool is_base_package = 19;
|
||||
bool supports_daya_purchase = 20;
|
||||
bool supports_direct_purchase = 21;
|
||||
}
|
||||
|
||||
message PackageFeature
|
||||
|
||||
Reference in New Issue
Block a user