Commit Graph

270 Commits

Author SHA1 Message Date
masoodafar-web 2874b931df feat: hide product prices from unauthenticated (guest) users
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m48s
Guests can browse products and product details for presentation purposes,
but prices are hidden behind a 'وارد شوید' prompt (lock icon).
Authenticated users see prices as before.

Affected pages:
- Landing page (Index): top-selling regular + discount sections
- Store/Products list
- Store/ProductDetail (desktop price + mobile sticky bar)
- DiscountStore/Products list
- DiscountStore/ProductDetail (full price box)

Each code-behind now checks AuthService.IsAuthenticatedAsync() on init
and stores the result in _isAuthenticated for use in the template.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 19:58:28 +03:30
masoodafar-web e5b1e11895 fix: update product titles in Index.razor for clarity
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m49s
Changed the text for best-selling products in both the main store and credit store sections to improve clarity and consistency. The previous titles "پرخریدترین محصولات فروشگاه" and "پرخریدترین محصولات فروشگاه اعتباری" have been updated to "محصولات پرفروش فروشگاه" and "محصولات پرفروش فروشگاه اعتباری" respectively.
2026-05-14 02:07:46 +03:30
masoodafar-web 0b1cc1c1c8 fix: add kubectl apply to CI workflows and add production K8s manifest
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m19s
Both kub-deploy and prod-deploy were only running kubectl rollout restart,
meaning changes to the deployment manifest (env vars, resources, image tag)
were never applied to the cluster.

- Add scp + kubectl apply before rollout restart in kub-deploy.yml (staging)
- Add scp + kubectl apply before rollout restart in prod-deploy.yml (production)
- Add k8s/production/frontoffice-deployment.yaml with ASPNETCORE_ENVIRONMENT=Production
  and image tag :prod

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 01:44:13 +03:30
masoodafar-web eef13d1471 fix: remove hardcoded GW_URL from Dockerfile and staging manifest
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m15s
GW_URL/GwUrl env vars were baked into the Dockerfile (ENV) and the
staging K8s manifest, overriding appsettings.*.json at runtime.
This meant merging to production still used the staging CMS URL.

Now only ASPNETCORE_ENVIRONMENT is set in the manifest; the correct
GwUrl is read from appsettings.Staging.json or appsettings.Production.json
depending on the environment — as intended.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 01:35:18 +03:30
masoodafar-web 77a835311a fix: move DefaultRequestVersion/Policy to HttpClient (not SocketsHttpHandler)
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m57s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:47:52 +03:30
masoodafar-web 738119cf6d fix: trust staging-ca in container to resolve PartialChain gRPC error
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m0s
Add staging-ca.crt to the Dockerfile so the ASP.NET runtime inside the
container trusts the internal staging CA. This fixes server-side gRPC
calls from FrontOffice (Blazor Server) to https://cms.se.kbs1.ir which
were failing with PartialChain because the container CA store did not
include the staging root certificate.

Also adds GW_URL env support alongside GwUrl for parity with BackOffice.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:42:36 +03:30
masoodafar-web 28a55246df chore: update gateway URL configuration for staging environment
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m25s
- Changed GW_URL and GwUrl in frontoffice-deployment.yaml and Dockerfile to use the internal service URL http://cms-svc:8080 for the staging environment.
- Enhanced ConfigureServices to handle HTTP/1.1 for gRPC when using the internal service URL, ensuring compatibility with Kestrel's requirements.
2026-05-14 00:36:54 +03:30
masoodafar-web ceaf6de226 chore: enhance configuration for gateway URL handling
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m43s
- Added GW_URL and GwUrl environment variables in frontoffice-deployment.yaml and Dockerfile for consistent gateway URL configuration.
- Updated AddGrpcServices method to resolve gateway URL from both environment variables, ensuring proper error handling for missing values.
- Modified TokenNotificationService to prioritize GW_URL over GwUrl for improved configuration flexibility.
2026-05-14 00:27:16 +03:30
masoodafar-web f19711eabc chore: update staging configuration for CMS URL
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m46s
- Changed GwUrl in appsettings.Staging.json from a local HTTP endpoint to a secure HTTPS URL for the CMS service.
2026-05-14 00:00:59 +03:30
masoodafar-web 310400b9e7 refactor: simplify configuration handling for CMS URL
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m24s
- Removed CmsServerBaseUrl utility class and updated references to directly access GwUrl from configuration.
- Adjusted frontoffice-deployment.yaml to remove CmsInternalBaseUrl environment variable.
- Updated appsettings for staging and main environments to reflect the correct CMS service URLs.
- Ensured consistent handling of GwUrl in TokenNotificationService and AddGrpcServices methods.
2026-05-13 23:52:16 +03:30
masoodafar-web 3600fc7709 chore: update Foursat.CMSMicroservice.Protobuf package version to 0.0.197
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m37s
2026-05-13 22:21:13 +03:30
masoodafar-web ae5ab1492e fix: update gRPC service configuration to use CmsServerBaseUrl resolver
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m34s
- Replace direct access to configuration for GwUrl with CmsServerBaseUrl.Resolve in AddGrpcServices and TokenNotificationService.
- Ensure proper error handling for missing GwUrl and add support for optional bypass of public TLS using CmsInternalBaseUrl.
- Adjust channel credentials based on whether the base URL is HTTPS or not.
2026-05-13 22:05:04 +03:30
masoodafar-web 231da2cbaa feat: add top-seller product sections to landing page with guest browsing support
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m10s
- Add two sections to landing page (Index.razor) below the hero:
  - Top 6 best-selling regular products (3-per-row grid)
  - Top 6 best-selling discount store products (3-per-row grid)
  - Each section has a 'More' button linking to /products and /discount-store
- Add GuestActionGate utility service: wraps auth-required actions; shows
  login modal for guests and resumes the original action after successful login
- Register GuestActionGate as scoped service in ConfigureServices
- Add GetTopSellingAsync(count) to ProductService and DiscountProductService
- Add optional sortBy parameter to DiscountProductService.GetProductsAsync
- Hybridize all product pages for guest browsing:
  - Store/Products, Store/ProductDetail: wrap AddToCart with GuestActionGate
  - DiscountStore/Products, DiscountStore/ProductDetail: wrap AddToCart with GuestActionGate
  - Store/Cart, DiscountStore/Cart, Store/CheckoutSummary: soft auth gate on page init
- Fix MembershipPage membership benefit text to be package-agnostic

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 19:48:14 +03:30
masoodafar-web a1d67c5865 update
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 5m21s
2026-05-04 00:02:49 +03:30
masoodafar-web b00af9e326 feat: add referral code support to phone verification form
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 5m9s
2026-04-29 00:46:53 +03:30
masoodafar-web 647e596050 fix: remove local nupkg source from NuGet.config (breaks Docker builds)
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 12m52s
2026-03-12 02:28:29 +03:30
masoodafar-web 7c86353a34 ci: retry build - all NuGet packages pushed to Nexus
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 1m22s
2026-03-12 01:14:32 +03:30
masoodafar-web cd0fb2fa57 Revert "fix: bypass broken Nexus, use nuget.org + local proto build"
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 1m23s
This reverts commit 4dc7b52289.
2026-03-12 00:06:33 +03:30
masoodafar-web 4dc7b52289 fix: bypass broken Nexus, use nuget.org + local proto build
- NuGet.config: nuget.org for standard packages, local nupkg for proto
- Dockerfile: COPY nupkg/ before restore
- CI: build proto from CMS source before Docker build
2026-03-12 00:04:04 +03:30
masoodafar-web c793630962 chore: update proto NuGet to 0.0.192
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 1m15s
2026-03-11 23:46:25 +03:30
masoodafar-web ff3696cda3 feat: implement payment verification methods for magic wallet and discount wallet
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m37s
2026-02-28 03:27:58 +03:30
masoodafar-web 2b1dc47dc7 cleanup: remove CallbackUrl from package purchase requests — CMS reads from config now
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m7s
2026-02-27 22:21:02 +03:30
masoodafar-web 2f9ef15859 fix: remove double ×10 conversion in wallet charge — FO should send Toman, not Rial
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m40s
Root cause: FrontOffice was converting Toman→Rial (×10) before sending to CMS,
but CMS ZarinPalService already does Toman→Rial conversion internally.
This caused double ×10 = amounts shown 10x higher in payment gateway.

Fixes:
- MagicWallet.razor.cs: remove ×10 conversion, send _chargeAmount (Toman) directly
- MagicWallet.razor: fix Max field (no /10), fix preset filter (no ×10)
- MagicWallet.razor.cs: fix FormatPrice — values from CMS are Toman, not Rial
- ChargeDiscountWallet.razor.cs: same fix — send Toman directly
- ClubMembershipContractDialog.razor: fix Price display (no /10)
2026-02-27 21:53:01 +03:30
masoodafar-web 5ded91a58a fix: payment success page — show TransactionId, real wallet balance, fix back button
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m53s
- کد ارجاعی: از TransactionId جدول تراکنش‌ها بجای RefId زرین‌پال
- موجودی: از WalletService.GetBalancesAsync() موجودی واقعی کیف پول اصلی
- حذف نمایش موجودی کیف پول اعتباری (نیازی نیست)
- دکمه بازگشت: Href=/profile بجای history.back() (که به درگاه می‌رفت)
2026-02-27 21:31:45 +03:30
masoodafar-web 71b7e40994 fix: revert Price/10 — DB stores Toman, display directly
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m37s
Previous fix incorrectly divided by 10 assuming DB was Rial.
DB values are in Toman, so FormattedPrice shows Price directly.
2026-02-27 21:02:54 +03:30
masoodafar-web 3c1a8ffd53 fix: 4 UI fixes for package display
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m54s
1. Toman/Rial mismatch — Price from server is in Rial, now divides by 10 for correct Toman display
2. ضریب تخفیف → ضریب اعتبار label change in dialog + packages page
3. Back button already functional (ArrowForward in TitleContent) — verified
4. HTML rendering in package description via MarkupString
2026-02-27 20:44:18 +03:30
masoodafar-web a3681a8bcd feat: داشبورد — لیست کاشی پکیج‌ها + مدال انتخاب روش پرداخت
- حذف متن hardcoded 'پکیج پایه ۵۶ میلیون تومان' و دیالوگ inline
- ایجاد PackagePurchaseDialog — کامپوننت مستقل 2 مرحله‌ای:
  مرحله ۱: نمایش کاشی‌های پکیج (ریسپانسیو ۲-۳ تایی)
  مرحله ۲: انتخاب روش پرداخت (درگاه بانکی / دایا الماس)
- دایا الماس فقط برای پکیج پایه + دور اول نمایش داده میشه
- پکیج‌ها داینامیک از API بارگذاری میشن
- تغییر متن CTA از 'شروع فرآیند تامین اعتبار' به 'تهیه پکیج'
- تغییر متن راهنما از 'پکیج پایه را تهیه کنید' به 'یکی از پکیج‌ها را تهیه کنید'
- CSS: hover effects + badge + responsive tiles
2026-02-27 20:14:40 +03:30
masoodafar-web ecc4f447ba F6+F7: مقادیر داینامیک کیف‌پول جادویی، اصلاح rename، افزایش سقف تخفیفی
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
2026-02-27 09:01:12 +03:30
masoodafar-web 474d364a25 feat(Q28): UI Guidance alerts across FrontOffice (G1-G7)
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m53s
Q28: Added informational/warning alerts to 7 FO pages:
G1: Packages — package system explanation
G2: Checkout — package benefits summary
G3: MyPackages — cycle completion guidance
G4: MagicWallet — per-package settings warning
G5: Commission — independent pool explanation
G6: Membership — single-sign contract info
G7: ActivationSection — estimated cost note
2026-02-27 05:40:04 +03:30
masoodafar-web 816dcb70d1 fix: remove hardcoded 56M amounts — dynamic package pricing
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2m52s
- ActivationSection: load base package price via PackageService on init
- ClubMembershipContractDialog: dynamic package name/price in contract text
2026-02-27 02:41:24 +03:30
masoodafar-web 3bffc13ffd 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
2026-02-26 22:01:55 +03:30
masoodafar-web a956cb90a1 feat(commission): add per-package filtering to commission pages
- CommissionDtos: add PackageId + PackageTitle to CommissionPayoutDto and WeeklyBalanceDto
- CommissionService: add packageId parameter to GetMyCommissionPayoutsAsync and GetMyWeeklyBalanceAsync
- CommissionDashboardPage: add package filter dropdown + package column in desktop/mobile views
- WeeklyBalancePage: add package filter dropdown + package chip in balance info section
- Update NuGet Foursat.CMSMicroservice.Protobuf to v0.0.187
2026-02-26 21:08:30 +03:30
masoodafar-web 40882c8b80 Phase 8d: NuGet bump 0.0.185 → 0.0.186 (proto cleanup) 2026-02-26 18:00:47 +03:30
masoodafar-web d71d463668 Phase 8c: FO Package pages — Customer RPCs + dynamic features
- NuGet: 0.0.182 → 0.0.185 + local feed source
- PackageDetail: GetPackageAsync → GetCustomerPackageDetailsAsync
  Features & specs now driven by API (PackageFeature) not hardcoded
- Packages.razor: Un-excluded from build, dynamic feature bullets
  from CustomerPackageModel (DiscountMultiplier, MagicWallet, etc.)
- PackageService: Enriched PackageDto with 8 new package fields
  GetUserPackageStatusAsync connected to real RPC (was stub)
2026-02-26 17:52:37 +03:30
masoodafar-web 0bbc11e82c Phase 8a: Wire up Checkout page to Customer* RPCs
- Checkout.razor.cs: Rewrite ProcessPayment() to use
  CustomerPurchasePackageAsync instead of disabled dead code
  (old TransactionsContract + UserOrderContract flow removed)
- Callback URL now points to /profile/payment-callback
  (reuses existing verify page with CustomerVerifyPackagePurchase)
- Remove unused DI: UserOrderContract, TransactionContract
- Remove unused usings: Transactions, UserOrder, WellKnownTypes
- Profile/Index.razor.cs: Rename basePackage → selectedPackage,
  tempCallbackUrl → callbackUrl (cosmetic)
- Build: 0 errors
2026-02-26 03:33:58 +03:30
masoodafar-web 71f391ac80 Phase 7b: Migrate deprecated RPCs to Customer* RPCs
- Profile/Index: InitiateBasePackagePayment → CustomerPurchasePackage
  - Fetches base package via GetCustomerPackages, passes PackageId + PurchaseMethod
- Profile/PaymentCallback: VerifyBasePackagePayment → CustomerVerifyPackagePurchase
  - Uses Authority/Status (from ZarinPal callback) + orderId (from embedded URL param)
  - TransactionId no longer required (CMS finds it internally)
2026-02-26 02:35:59 +03:30
masoodafar-web b82cac4af1 Cleanup: Remove hardcoded 'پکیج طلایی' labels, add PackageTitle to DTO
- MyPackages.razor: dynamic PackageTitle from DTO instead of hardcoded 'پکیج طلایی'
- Packages.razor: generic text for purchase status and info section
- PackageService.cs: add PackageTitle to UserPackageStatusDto record
2026-02-26 02:01:54 +03:30
masoodafar-web ab8693b381 fix: rename wallet labels — اصلی، اعتباری، پاداش تیمی
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m11s
- عادی → اصلی (کیف پول اصلی)
- شبکه → پاداش تیمی
- پورسانت → پاداش تیمی
- موجودی کیف پول → موجودی کیف پول اصلی

Files: Wallet.razor, WalletService.cs, MagicWallet.razor,
       Profile/Index.razor, PaymentCallback.razor
2026-02-23 23:24:29 +03:30
masoodafar-web 86f43d8fdd chore: prevent appsettings.Production.json from merging — keep ours strategy
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m0s
2026-02-23 00:02:31 +03:30
masoodafar-web 2fa9dbc900 feat: enable gateway buttons - remove بزودی disabled state
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m40s
- ChargeDiscountWallet: active payment button with StartDiscountCharge
- MagicWallet: active payment button with StartMagicCharge
- Index: both branch buttons call DirectPayment with loading state
2026-02-22 22:13:23 +03:30
masoodafar-web 8e1f7d7a0c fix: change ریال to تومان in MagicWallet helper text
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m2s
2026-02-22 21:30:26 +03:30
masoodafar-web 93b7375db5 feat: add VAT display to all DiscountStore pages — Products (note), ProductDetail (breakdown), Cart (summary line), Checkout (refactor to VATService), OrderDetail (financial summary)
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
2026-02-22 21:26:01 +03:30
masoodafar-web 00da4b98dd refactor: rename 'تخفیف' to 'اعتبار' in DiscountStore pages
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m1s
- Products.razor: X% تخفیف → X% اعتبار
- ProductDetail.razor: تخفیف از کیف اعتباری → اعتبار از کیف اعتباری
- Cart.razor: سقف تخفیف/تخفیف → سقف اعتبار/اعتبار (desktop + mobile)
- Checkout.razor: تخفیف از کیف اعتباری → اعتبار، مبلغ پس از تخفیف → مبلغ پس از اعتبار
- OrderDetail.razor: سقف تخفیف/تخفیف → سقف اعتبار/اعتبار
2026-02-22 21:03:10 +03:30
masoodafar-web 7371a263e8 refactor: rename 'تخفیفی' to 'اعتباری' in all user-facing UI
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- ChargeDiscountWallet.razor: فروشگاه تخفیفی → فروشگاه اعتباری
- PaymentCallback.razor: اعتبار تخفیف → کیف پول اعتباری
- Profile/Index.razor: تخفیف باشگاه → کیف اعتباری
2026-02-22 20:56:38 +03:30
masoodafar-web 214fe9efbd refactor: update CMS protobuf package to version 0.0.182
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
2026-02-22 20:48:08 +03:30
masoodafar-web 8cef475877 temp: disable gateway payment buttons - show 'بزودی' until gateway is activated
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- MagicWallet.razor: disable charge button
- ChargeDiscountWallet.razor: disable charge button
- Profile/Index.razor: disable IPG package purchase button for all cycles
2026-02-22 20:44:22 +03:30
masoodafar-web 28695a88f8 feat: ChargeDiscountWallet UI - page, route, client method & wallet link
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- Add ChargeDiscountWallet.razor page with charge form and preset amounts
- Add ChargeDiscountWallet.razor.cs code-behind with gateway redirect logic
- Add InitiateDiscountChargeAsync client method in WalletService
- Add ChargeDiscountWallet route constant
- Add charge button link on main Wallet page
2026-02-22 20:22:52 +03:30
masoodafar-web a2e1e1fead feat: Magic Wallet Phase 6 UI + purchase cycle controls
- FrontOffice.Main.csproj: switch to ProjectReference for CMS Protobuf
- MagicWallet.razor.cs: update default record with PurchaseCycleCount
- WalletService.cs: add PurchaseCycleCount to MagicWalletStatus record
- Profile/Index.razor.cs: load _purchaseCycleCount from MagicWalletStatus
- Profile/Index.razor: conditional purchase dialog (IPG vs Daya by cycle)
- Licenses.razor: fix grid column size xs=6
2026-02-22 20:04:44 +03:30
masoodafar-web be2633ddaf refactor: update CMS protobuf package to version 0.0.181
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m28s
2026-02-21 20:20:47 +03:30
masoodafar-web 104e4df1a6 feat: implement Magic Wallet feature with charging and status display
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 6m25s
2026-02-21 19:50:43 +03:30