feat: Implement Magic Wallet functionality
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m36s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m36s
- Added ClubMembershipCycle entity and DbSet to IApplicationDbContext. - Updated VAT rate from 9% to 10% in VatCalculator and related areas. - Introduced Magic Wallet settings in SystemConstants. - Enhanced UserWallet entity to support Magic Wallet features. - Updated TransactionType enum to include Magic Wallet transactions. - Configured UserWallet to handle Magic Wallet properties in ApplicationDbContext. - Implemented OrmCommissionCalculationStrategy to exclude Magic Wallet users from commission calculations. - Added Protobuf definitions for Magic Wallet methods and responses. - Created PaymentCallbackController endpoint for handling Magic Wallet charge callbacks. - Updated UserOrderService to manage Magic Wallet state transitions. - Developed UserWalletService to support Magic Wallet operations. - Created ChargeMagicWalletCommand and its handler for initiating Magic Wallet charges. - Implemented VerifyMagicWalletChargeCommand and handler for payment verification. - Added validation for ChargeMagicWalletCommand. - Established ClubMembershipCycle configuration for EF Core. - Introduced WalletMode enum to differentiate between Normal and Magic modes.
This commit is contained in:
@@ -74,6 +74,20 @@ service UserWalletContract
|
||||
get: "/Customer/GetWithdrawalSettings"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Magic Wallet Methods =============
|
||||
|
||||
rpc InitiateMagicCharge(InitiateMagicChargeRequest) returns (InitiateMagicChargeResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/InitiateMagicCharge"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetMagicWalletStatus(google.protobuf.Empty) returns (GetMagicWalletStatusResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetMagicWalletStatus"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserWalletRequest
|
||||
{
|
||||
@@ -140,6 +154,7 @@ message GetCustomerWalletResponse
|
||||
int64 balance = 1;
|
||||
int64 network_balance = 2;
|
||||
int64 discount_balance = 3;
|
||||
int32 wallet_mode = 4; // 0=Normal, 1=Magic
|
||||
}
|
||||
|
||||
message GetCustomerWalletChangeLogRequest
|
||||
@@ -200,4 +215,29 @@ message CustomerWithdrawalModel
|
||||
message GetCustomerWithdrawalSettingsResponse
|
||||
{
|
||||
int64 min_withdrawal_amount = 1;
|
||||
}
|
||||
|
||||
// ============= Magic Wallet Messages =============
|
||||
|
||||
message InitiateMagicChargeRequest
|
||||
{
|
||||
int64 amount = 1; // مبلغ واریزی واقعی (ریال)
|
||||
}
|
||||
|
||||
message InitiateMagicChargeResponse
|
||||
{
|
||||
bool is_success = 1;
|
||||
string gateway_url = 2;
|
||||
string error_message = 3;
|
||||
}
|
||||
|
||||
message GetMagicWalletStatusResponse
|
||||
{
|
||||
int32 wallet_mode = 1; // 0=Normal, 1=Magic
|
||||
int64 magic_total_deposited = 2;
|
||||
int64 magic_total_credited = 3;
|
||||
int64 magic_max_deposit = 4;
|
||||
int64 magic_remaining_deposit = 5;
|
||||
int64 balance = 6;
|
||||
google.protobuf.Timestamp magic_activated_at = 7;
|
||||
}
|
||||
Reference in New Issue
Block a user