F6+F7: مقادیر داینامیک کیفپول جادویی، اصلاح rename، افزایش سقف تخفیفی
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m34s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m34s
F6: MagicWallet.razor — جایگزینی ×2.5 و سقفهای ثابت با مقادیر از API
- WalletService: MagicMultiplier + MagicMaxCredit از gRPC response
- Index.razor.cs: 'شارژ ×2.5' → 'شارژ چندبرابری' (تایل داشبورد)
F7: ChargeDiscountWallet.razor — Max از 100M تومان به 1B تومان
اصلاح rename:
- ConfigureServices: UserWalletChangeLog → UserWalletHistory
- WalletService: اصلاح تمام رفرنسها
NuGet: v0.0.189
This commit is contained in:
@@ -15,7 +15,7 @@ using CMSMicroservice.Protobuf.Protos.User;
|
|||||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
using CMSMicroservice.Protobuf.Protos.UserWalletHistory;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||||
@@ -128,7 +128,7 @@ public static class ConfigureServices
|
|||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserCarts.UserCartsContract.UserCartsContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserCarts.UserCartsContract.UserCartsContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.City.CityContract.CityContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.City.CityContract.CityContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserAddress.UserAddressContract.UserAddressContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserAddress.UserAddressContract.UserAddressContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserWalletChangeLog.UserWalletChangeLogContract.UserWalletChangeLogContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserWalletHistory.UserWalletHistoryContract.UserWalletHistoryContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.ClubMembership.ClubMembershipContract.ClubMembershipContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.ClubMembership.ClubMembershipContract.ClubMembershipContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.OtpToken.OtpTokenContract.OtpTokenContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.OtpToken.OtpTokenContract.OtpTokenContractClient>);
|
||||||
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Configuration.ConfigurationContract.ConfigurationContractClient>);
|
services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Configuration.ConfigurationContract.ConfigurationContractClient>);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
|
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
|
||||||
<!-- Replace all FrontOffice.BFF protobuf packages with CMS protobuf -->
|
<!-- Replace all FrontOffice.BFF protobuf packages with CMS protobuf -->
|
||||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.188" />
|
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.189" />
|
||||||
<!-- <ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />-->
|
<!-- <ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />-->
|
||||||
<PackageReference Include="MudBlazor" Version="8.14.0" />
|
<PackageReference Include="MudBlazor" Version="8.14.0" />
|
||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
||||||
|
|||||||
@@ -44,11 +44,11 @@
|
|||||||
Label="مبلغ (تومان)"
|
Label="مبلغ (تومان)"
|
||||||
Variant="Variant.Outlined"
|
Variant="Variant.Outlined"
|
||||||
Min="10_000"
|
Min="10_000"
|
||||||
Max="100_000_000"
|
Max="1_000_000_000"
|
||||||
Format="N0"
|
Format="N0"
|
||||||
Adornment="Adornment.Start"
|
Adornment="Adornment.Start"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Payments"
|
AdornmentIcon="@Icons.Material.Filled.Payments"
|
||||||
HelperText="حداقل ۱۰,۰۰۰ و حداکثر ۱۰۰,۰۰۰,۰۰۰ تومان" />
|
HelperText="حداقل ۱۰,۰۰۰ و حداکثر ۱,۰۰۰,۰۰۰,۰۰۰ تومان" />
|
||||||
|
|
||||||
@* دکمههای مبلغ سریع *@
|
@* دکمههای مبلغ سریع *@
|
||||||
<MudStack Row="true" Spacing="1" Class="flex-wrap">
|
<MudStack Row="true" Spacing="1" Class="flex-wrap">
|
||||||
|
|||||||
@@ -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.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.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.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.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.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;"),
|
new(RouteConstants.Network.Statistics, Icons.Material.Filled.Groups, "آمار باشگاه", "جزئیات باشگاه", "background:rgba(59,130,246,.12); color:#3b82f6;"),
|
||||||
|
|||||||
@@ -97,8 +97,8 @@
|
|||||||
</MudText>
|
</MudText>
|
||||||
|
|
||||||
<MudAlert Severity="MudBlazor.Severity.Info" Dense="true" Class="mb-3" Icon="@Icons.Material.Filled.Info">
|
<MudAlert Severity="MudBlazor.Severity.Info" Dense="true" Class="mb-3" Icon="@Icons.Material.Filled.Info">
|
||||||
مبلغ واریزی شما <strong>×۲.۵</strong> به موجودی اضافه میشود.
|
مبلغ واریزی شما <strong>×@_status.MagicMultiplier.ToString("0.#")</strong> به موجودی اضافه میشود.
|
||||||
مثلاً ۱۰ میلیون واریز = ۲۵ میلیون اعتبار.
|
مثلاً ۱۰ میلیون واریز = @FormatToman((long)(10_000_000 * (decimal)_status.MagicMultiplier)) اعتبار.
|
||||||
</MudAlert>
|
</MudAlert>
|
||||||
|
|
||||||
<MudStack Spacing="2">
|
<MudStack Spacing="2">
|
||||||
@@ -120,8 +120,8 @@
|
|||||||
<MudText Typo="Typo.body2">@FormatToman(_chargeAmount)</MudText>
|
<MudText Typo="Typo.body2">@FormatToman(_chargeAmount)</MudText>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||||
<MudText Typo="Typo.body2" Color="Color.Success"><strong>اعتبار دریافتی (×۲.۵):</strong></MudText>
|
<MudText Typo="Typo.body2" Color="Color.Success"><strong>اعتبار دریافتی (×@_status.MagicMultiplier.ToString("0.#")):</strong></MudText>
|
||||||
<MudText Typo="Typo.body2" Color="Color.Success"><strong>@FormatToman((long)(_chargeAmount * 2.5m))</strong></MudText>
|
<MudText Typo="Typo.body2" Color="Color.Success"><strong>@FormatToman((long)(_chargeAmount * (decimal)_status.MagicMultiplier))</strong></MudText>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
}
|
}
|
||||||
@@ -176,13 +176,13 @@
|
|||||||
<MudExpansionPanel Text="قوانین کیفپول جادویی" MaxHeight="500" IsInitiallyExpanded="false">
|
<MudExpansionPanel Text="قوانین کیفپول جادویی" MaxHeight="500" IsInitiallyExpanded="false">
|
||||||
<MudList T="string" Dense="true">
|
<MudList T="string" Dense="true">
|
||||||
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
||||||
هر مبلغ واریزی ×۲.۵ به موجودی اضافه میشود
|
هر مبلغ واریزی ×@_status.MagicMultiplier.ToString("0.#") به موجودی اضافه میشود
|
||||||
</MudListItem>
|
</MudListItem>
|
||||||
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
||||||
سقف واریز در هر دور: ۱۰۰ میلیون تومان
|
سقف واریز در هر دور: @FormatPrice(_status.MagicMaxDeposit)
|
||||||
</MudListItem>
|
</MudListItem>
|
||||||
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
||||||
حداکثر اعتبار: ۲۵۰ میلیون تومان (سود ۱۵۰٪)
|
حداکثر اعتبار: @FormatPrice(_status.MagicMaxCredit)
|
||||||
</MudListItem>
|
</MudListItem>
|
||||||
<MudListItem T="string" Icon="@Icons.Material.Filled.Warning" IconColor="Color.Warning">
|
<MudListItem T="string" Icon="@Icons.Material.Filled.Warning" IconColor="Color.Warning">
|
||||||
در حالت جادویی، کمیسیون و پاداش تیمی غیرفعال است
|
در حالت جادویی، کمیسیون و پاداش تیمی غیرفعال است
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using DateTimeConverterCL;
|
using DateTimeConverterCL;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
using Google.Protobuf.WellKnownTypes;
|
||||||
|
|
||||||
namespace FrontOffice.Main.Utilities;
|
namespace FrontOffice.Main.Utilities;
|
||||||
@@ -33,7 +32,9 @@ public record MagicWalletStatus(
|
|||||||
long MagicRemainingDeposit,
|
long MagicRemainingDeposit,
|
||||||
long Balance,
|
long Balance,
|
||||||
DateTime? MagicActivatedAt,
|
DateTime? MagicActivatedAt,
|
||||||
int PurchaseCycleCount
|
int PurchaseCycleCount,
|
||||||
|
double MagicMultiplier = 2.5,
|
||||||
|
long MagicMaxCredit = 2_500_000_000
|
||||||
);
|
);
|
||||||
|
|
||||||
public class WalletService
|
public class WalletService
|
||||||
@@ -63,7 +64,7 @@ public class WalletService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var request = new GetCustomerWalletChangeLogRequest();
|
var request = new GetCustomerWalletHistoryRequest();
|
||||||
if (referenceId.HasValue)
|
if (referenceId.HasValue)
|
||||||
{
|
{
|
||||||
request.ReferenceId = referenceId.Value;
|
request.ReferenceId = referenceId.Value;
|
||||||
@@ -72,7 +73,7 @@ public class WalletService
|
|||||||
{
|
{
|
||||||
request.IsIncrease = isIncrease.Value;
|
request.IsIncrease = isIncrease.Value;
|
||||||
}
|
}
|
||||||
var response = await _client.GetCustomerWalletChangeLogAsync(request);
|
var response = await _client.GetCustomerWalletHistoryAsync(request);
|
||||||
|
|
||||||
return response.Models
|
return response.Models
|
||||||
.Select(log => new WalletTransaction(
|
.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)
|
if (model.CreatedAt is not null)
|
||||||
{
|
{
|
||||||
@@ -114,7 +115,7 @@ public class WalletService
|
|||||||
return DateTime.Now.MiladiToJalaliWithTime();
|
return DateTime.Now.MiladiToJalaliWithTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ResolveDescription(CustomerWalletChangeLogModel model)
|
private static string ResolveDescription(CustomerWalletHistoryModel model)
|
||||||
{
|
{
|
||||||
var parts = new List<string>();
|
var parts = new List<string>();
|
||||||
|
|
||||||
@@ -214,7 +215,9 @@ public class WalletService
|
|||||||
response.MagicRemainingDeposit,
|
response.MagicRemainingDeposit,
|
||||||
response.Balance,
|
response.Balance,
|
||||||
activatedAt,
|
activatedAt,
|
||||||
response.PurchaseCycleCount
|
response.PurchaseCycleCount,
|
||||||
|
response.MagicMultiplier > 0 ? response.MagicMultiplier : 2.5,
|
||||||
|
response.MagicMaxCredit > 0 ? response.MagicMaxCredit : 2_500_000_000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user