feat(T4.2+T4.3+F3): conditional payment, re-purchase, PV display
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m33s

T4.2: Conditional Payment in Checkout
- Load package flags via PackageService.GetAllPackagesAsync
- Respect SupportsDirectPurchase/SupportsDayaPurchase flags
- Add Daya loan payment button when supported
- Show alert when no payment method available

T4.3: MyPackages Re-Purchase Logic
- Load MagicWallet status to detect cycle completion
- Show re-purchase CTA when magic cycle is complete
- Show magic wallet progress bar during active cycle
- Display deposit progress, remaining, and credited amounts

F3: PV Display in Order Details
- Add CalculateOrderPVAsync to OrderService
- Show per-product PV and total PV in Store OrderDetail
- Update NuGet to v0.0.188
This commit is contained in:
masoodafar-web
2026-02-26 22:01:55 +03:30
parent a956cb90a1
commit 3bffc13ffd
8 changed files with 180 additions and 10 deletions
+25 -8
View File
@@ -3,6 +3,7 @@ using CMSMicroservice.Protobuf.Protos.Package;
using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MudBlazor;
using Severity = MudBlazor.Severity;
@@ -10,6 +11,7 @@ namespace FrontOffice.Main.Pages;
public partial class Checkout
{
[Inject] private PackageService PackageService { get; set; } = default!;
[Inject] private PackageContract.PackageContractClient PackageClient { get; set; } = default!;
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
@@ -47,15 +49,18 @@ public partial class Checkout
{
try
{
var response = await PackageClient.GetPackageAsync(new() { Id = PackageId.Value });
if (response != null)
var packages = await PackageService.GetAllPackagesAsync();
var pkg = packages.FirstOrDefault(p => p.Id == PackageId.Value);
if (pkg != null)
{
_selectedPackage = new Pack(
Id: response.Id,
Title: response.Title,
Body: response.Description,
Image: response.ImagePath ?? string.Empty,
Price: response.Price
Id: pkg.Id,
Title: pkg.Title,
Body: pkg.Description,
Image: pkg.ImageUrl,
Price: pkg.Price,
SupportsDirectPurchase: pkg.SupportsDirectPurchase,
SupportsDayaPurchase: pkg.SupportsDayaPurchase
);
_finalPrice = _selectedPackage.Price;
}
@@ -213,5 +218,17 @@ public partial class Checkout
}
}
private record Pack(long Id, string Title, string Body, string Image, long Price);
private async Task DayaLoanPayment()
{
if (_selectedAddress == null)
{
Snackbar.Add("لطفاً آدرس را انتخاب کنید.", Severity.Warning);
return;
}
var url = "https://dayadiamond.ir/profile/creditpurchase/?merchantcode=56146364";
await JSRuntime.InvokeVoidAsync("open", url, "_blank");
}
private record Pack(long Id, string Title, string Body, string Image, long Price, bool SupportsDirectPurchase = true, bool SupportsDayaPurchase = false);
}