diff --git a/src/FrontOffice.Main/ConfigureServices.cs b/src/FrontOffice.Main/ConfigureServices.cs index 702733a..f71e4db 100644 --- a/src/FrontOffice.Main/ConfigureServices.cs +++ b/src/FrontOffice.Main/ConfigureServices.cs @@ -15,7 +15,7 @@ using CMSMicroservice.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.UserCarts; using CMSMicroservice.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserWallet; -using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; +using CMSMicroservice.Protobuf.Protos.UserWalletHistory; using CMSMicroservice.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.Configuration; using CMSMicroservice.Protobuf.Protos.NetworkMembership; @@ -128,7 +128,7 @@ public static class ConfigureServices services.AddScoped(CreateAuthenticatedClient); services.AddScoped(CreateAuthenticatedClient); services.AddScoped(CreateAuthenticatedClient); - services.AddScoped(CreateAuthenticatedClient); + services.AddScoped(CreateAuthenticatedClient); services.AddScoped(CreateAuthenticatedClient); services.AddScoped(CreateAuthenticatedClient); services.AddScoped(CreateAuthenticatedClient); diff --git a/src/FrontOffice.Main/FrontOffice.Main.csproj b/src/FrontOffice.Main/FrontOffice.Main.csproj index 9be664d..c37f88b 100644 --- a/src/FrontOffice.Main/FrontOffice.Main.csproj +++ b/src/FrontOffice.Main/FrontOffice.Main.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/FrontOffice.Main/Pages/Profile/ChargeDiscountWallet.razor b/src/FrontOffice.Main/Pages/Profile/ChargeDiscountWallet.razor index 0847eae..d523c8e 100644 --- a/src/FrontOffice.Main/Pages/Profile/ChargeDiscountWallet.razor +++ b/src/FrontOffice.Main/Pages/Profile/ChargeDiscountWallet.razor @@ -44,11 +44,11 @@ Label="مبلغ (تومان)" Variant="Variant.Outlined" Min="10_000" - Max="100_000_000" + Max="1_000_000_000" Format="N0" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Payments" - HelperText="حداقل ۱۰,۰۰۰ و حداکثر ۱۰۰,۰۰۰,۰۰۰ تومان" /> + HelperText="حداقل ۱۰,۰۰۰ و حداکثر ۱,۰۰۰,۰۰۰,۰۰۰ تومان" /> @* دکمه‌های مبلغ سریع *@ diff --git a/src/FrontOffice.Main/Pages/Profile/Index.razor.cs b/src/FrontOffice.Main/Pages/Profile/Index.razor.cs index 06ee349..727ebcc 100644 --- a/src/FrontOffice.Main/Pages/Profile/Index.razor.cs +++ b/src/FrontOffice.Main/Pages/Profile/Index.razor.cs @@ -55,7 +55,7 @@ public partial class Index new(RouteConstants.Profile.Tree, Icons.Material.Filled.AccountTree, "شجره‌نامه", "ساختار تیم", "background:rgba(99,102,241,.12); color:#6366f1;"), new(RouteConstants.Gateway.StoreChooser, Icons.Material.Filled.Store, "فروشگاه‌ها", "ورود به فروشگاه", "background:rgba(16,185,129,.12); color:#10b981;"), new(RouteConstants.Profile.Wallet, Icons.Material.Filled.AccountBalanceWallet, "کیف پول", "مدیریت و تاریخچه", "background:rgba(16,185,129,.12); color:#10b981;"), - new(RouteConstants.Profile.MagicWallet, Icons.Material.Filled.AutoAwesome, "کیف‌پول جادویی", "شارژ ×2.5", "background:rgba(168,85,247,.12); color:#a855f7;"), + new(RouteConstants.Profile.MagicWallet, Icons.Material.Filled.AutoAwesome, "کیف‌پول جادویی", "شارژ چند‌برابری", "background:rgba(168,85,247,.12); color:#a855f7;"), new(RouteConstants.Profile.WithdrawalRequests, Icons.Material.Filled.RequestPage, "درخواست برداشت", "ثبت و پیگیری", "background:rgba(245,158,11,.12); color:#f59e0b;"), new(RouteConstants.Club.Membership, Icons.Material.Filled.CardMembership, "باشگاه مشتریان", "عضویت و مزایا", "background:rgba(168,85,247,.12); color:#a855f7;"), new(RouteConstants.Network.Statistics, Icons.Material.Filled.Groups, "آمار باشگاه", "جزئیات باشگاه", "background:rgba(59,130,246,.12); color:#3b82f6;"), diff --git a/src/FrontOffice.Main/Pages/Profile/MagicWallet.razor b/src/FrontOffice.Main/Pages/Profile/MagicWallet.razor index 5bc59b7..b9e3b35 100644 --- a/src/FrontOffice.Main/Pages/Profile/MagicWallet.razor +++ b/src/FrontOffice.Main/Pages/Profile/MagicWallet.razor @@ -97,8 +97,8 @@ - مبلغ واریزی شما ×۲.۵ به موجودی اضافه می‌شود. - مثلاً ۱۰ میلیون واریز = ۲۵ میلیون اعتبار. + مبلغ واریزی شما ×@_status.MagicMultiplier.ToString("0.#") به موجودی اضافه می‌شود. + مثلاً ۱۰ میلیون واریز = @FormatToman((long)(10_000_000 * (decimal)_status.MagicMultiplier)) اعتبار. @@ -120,8 +120,8 @@ @FormatToman(_chargeAmount) - اعتبار دریافتی (×۲.۵): - @FormatToman((long)(_chargeAmount * 2.5m)) + اعتبار دریافتی (×@_status.MagicMultiplier.ToString("0.#")): + @FormatToman((long)(_chargeAmount * (decimal)_status.MagicMultiplier)) } @@ -176,13 +176,13 @@ - هر مبلغ واریزی ×۲.۵ به موجودی اضافه می‌شود + هر مبلغ واریزی ×@_status.MagicMultiplier.ToString("0.#") به موجودی اضافه می‌شود - سقف واریز در هر دور: ۱۰۰ میلیون تومان + سقف واریز در هر دور: @FormatPrice(_status.MagicMaxDeposit) - حداکثر اعتبار: ۲۵۰ میلیون تومان (سود ۱۵۰٪) + حداکثر اعتبار: @FormatPrice(_status.MagicMaxCredit) در حالت جادویی، کمیسیون و پاداش تیمی غیرفعال است diff --git a/src/FrontOffice.Main/Utilities/WalletService.cs b/src/FrontOffice.Main/Utilities/WalletService.cs index 6ae3128..5833b33 100644 --- a/src/FrontOffice.Main/Utilities/WalletService.cs +++ b/src/FrontOffice.Main/Utilities/WalletService.cs @@ -1,6 +1,5 @@ using DateTimeConverterCL; using CMSMicroservice.Protobuf.Protos.UserWallet; -using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; using Google.Protobuf.WellKnownTypes; namespace FrontOffice.Main.Utilities; @@ -33,7 +32,9 @@ public record MagicWalletStatus( long MagicRemainingDeposit, long Balance, DateTime? MagicActivatedAt, - int PurchaseCycleCount + int PurchaseCycleCount, + double MagicMultiplier = 2.5, + long MagicMaxCredit = 2_500_000_000 ); public class WalletService @@ -63,7 +64,7 @@ public class WalletService { try { - var request = new GetCustomerWalletChangeLogRequest(); + var request = new GetCustomerWalletHistoryRequest(); if (referenceId.HasValue) { request.ReferenceId = referenceId.Value; @@ -72,7 +73,7 @@ public class WalletService { request.IsIncrease = isIncrease.Value; } - var response = await _client.GetCustomerWalletChangeLogAsync(request); + var response = await _client.GetCustomerWalletHistoryAsync(request); return response.Models .Select(log => new WalletTransaction( @@ -96,7 +97,7 @@ public class WalletService } } - private static string ResolveTransactionDate(CustomerWalletChangeLogModel model) + private static string ResolveTransactionDate(CustomerWalletHistoryModel model) { if (model.CreatedAt is not null) { @@ -114,7 +115,7 @@ public class WalletService return DateTime.Now.MiladiToJalaliWithTime(); } - private static string ResolveDescription(CustomerWalletChangeLogModel model) + private static string ResolveDescription(CustomerWalletHistoryModel model) { var parts = new List(); @@ -214,7 +215,9 @@ public class WalletService response.MagicRemainingDeposit, response.Balance, activatedAt, - response.PurchaseCycleCount + response.PurchaseCycleCount, + response.MagicMultiplier > 0 ? response.MagicMultiplier : 2.5, + response.MagicMaxCredit > 0 ? response.MagicMaxCredit : 2_500_000_000 ); } catch