Commit Graph

41 Commits

Author SHA1 Message Date
masoodafar-web c78850f86e docs: update BUSINESS-02, BUSINESS-03, TECH-03
BUSINESS-02:
- فرمول هایبرید: حذف MIN، اضافه validation کیف‌پول اعتباری
- فلوی خرید: اضافه مرحله بررسی موجودی + UserWalletChangeLog
- نام‌گذاری جدید کیف‌پول‌ها: اصلی، اعتباری، پاداش تیمی
- جدول وضعیت: اضافه WalletChangeLog + Validation

BUSINESS-03:
- بخش ۹ جدید: ExpirePendingOrdersService (۱۵ دقیقه)
- دیاگرام Mermaid فلوی انقضا

TECH-03:
- فیکس URL پروداکشن (kbs1→kbs2) + هشدار
- ۴ کامیت جدید در بخش ۹.۲
- بخش ۹.۳ فیکس URL پروداکشن
- بخش ۹.۴ نام‌گذاری کیف‌پول‌ها
2026-02-24 00:29:03 +03:30
masoodafar-web 0115142faf docs: update TECH-03 — K8s Secret for persistent config, branch/appsettings separation, updated CI/CD flow 2026-02-23 22:13:15 +03:30
masoodafar-web 52e6e1530c docs: update TECH-03 — CI/CD pipeline details, fix namespace default, add PVC health check commands, add K8s commit history 2026-02-23 21:40:55 +03:30
masoodafar-web f5173a4def docs: فعال‌سازی درگاه ZarinPal + مرج پروداکشن + بهبود UI ادمین
- CHANGELOG: اضافه Phase 18 BackOffice + فعال‌سازی درگاه FO + تنظیمات محیطی CMS + مرج پروداکشن
- PAYMENT-FINANCE: MerchantId واقعی + تنظیمات محیطی Staging/Production + Magic فاز 6 کامل
- ROADMAP: بروزرسانی درصدها + Magic 100% + Payment 97% + DONE section
- TECH-02: ساختار فولدر + UserAutoComplete + WalletManagement + دکمه‌های درگاه
- BUSINESS-01: Magic Wallet فاز 1-6 کامل
- TECH-04: Migration پروداکشن ExpandDiscountProductFullInformation + حذف u21 تکراری
- TECH-03: جزئیات مرج پروداکشن + تنظیمات appsettings.Production.json
- MAGIC-WALLET-PLAN: وضعیت کامل
- INDEX: بروزرسانی تاریخ
2026-02-22 23:26:36 +03:30
masoodafar-web 6b6173e2be docs: rename 'تخفیفی' to 'اعتباری' across all documentation
- 9 files updated: BUSINESS-01/02/03/04, TECH-02, OVERVIEW-01/03/04, MAGIC-WALLET-SPEC
- فروشگاه تخفیفی → فروشگاه اعتباری
- کیف‌پول تخفیفی → کیف‌پول اعتباری
- Consistent naming with FrontOffice UI
2026-02-22 20:57:05 +03:30
masoodafar-web c14bea6a06 docs: update MAGIC-WALLET-PLAN checklist - all items complete
- Mark migrations as completed (u21 applied + 74 rows seeded)
- Mark ChargeDiscountWallet as fully implemented
- Update status from pending to done with details
2026-02-22 20:41:29 +03:30
masoodafar-web 421a651975 docs: Magic Wallet + VAT 10% documentation update
- All 14 totalDoc files updated with Magic Wallet additions
- MAGIC-WALLET-PLAN.md: Phase 1-6 checklist fully marked complete
- Business docs: Magic Wallet section, commission filter, new entities
- Payment docs: VAT 9%→10%, TransactionType 14+15, ZarinPal 4th usage
- Technical docs: UserWallet fields, ClubMembershipCycle, gRPC RPCs
- Overview docs: Magic flowchart, ER diagram, changelog, glossary, roadmap
2026-02-22 20:09:01 +03:30
masoodafar-web 0e61513b0e docs: add ClubMembershipCycle table to preserve activation date
Problem: ActivateClubMembership overwrites ActivatedAt on re-purchase,
losing the original club activation date. Commission check uses
ActivatedAt to determine 'new member this week'.

Solution: New ClubMembershipCycle table
- Each package purchase creates a new cycle record
- ClubMembership.ActivatedAt = first-time only (never overwritten)
- Commission uses Cycle.PackagePurchasedAt instead of ActivatedAt
- IsCurrentCycle flag tracks active cycle
- Full history preserved for all purchase cycles

Also updated:
- SPEC: section 7.5 (entity), 7.6 (migration), 8.2 (SP change), 8.3 (handler)
- PLAN: phase 1 (entity), phase 2 (activate handler), phase 4 (date query)
- Checklist: added 4 new items
2026-02-19 02:58:14 +03:30
masoodafar-web b1dd69b31f docs: fix Magic Mode exit condition — BOTH Balance=0 AND cap reached
- Exit requires BOTH simultaneously: Balance==0 AND TotalDeposited>=100M
- If Balance=0 but cap not reached → still Magic (can charge more)
- If cap reached but Balance>0 → still Magic (can spend more)
- Added examples: partial deposit (50M/100M) stays in Magic
- Fixed handler 8.1 pseudo-code
- Updated test scenarios in PLAN (7 scenarios covering edge cases)
2026-02-19 02:32:04 +03:30
masoodafar-web 2f0d43aa81 docs: clarify Magic Wallet cap is per-cycle, not lifetime
- Cap resets every time user buys a new 56M package and re-enters Magic
- MagicTotalDeposited & MagicTotalCredited reset to 0 on each new cycle
- Added multi-cycle example (cycle 1, 2, 3... ∞)
- Added section 4.3: reset behavior on re-entry
- Added test scenarios for cycle reset
- PurchaseCycleCount tracks cycles but has no limit
2026-02-19 02:17:10 +03:30
masoodafar-web a94d0dbe95 docs: add Magic Wallet spec & implementation plan
- New folder: roadmap/ for upcoming features
- MAGIC-WALLET-SPEC: full business rules, state machine, x2.5 multiplier,
  100M deposit cap, API flow, data model changes, transaction logging
- MAGIC-WALLET-PLAN: 6-phase implementation, checklist, time estimates
- Note: ChargeDiscountWallet completion is independent (not Magic Wallet)
- Note: WalletChangeLog is mandatory (not optional)
- Updated master index with roadmap section
2026-02-19 02:08:28 +03:30
masoodafar-web b861b66cda docs: fix Regular Store payment — wallet-only, no IPG/ZarinPal
- Regular Store: Balance deduction only (SubmitShopBuyOrderCommandHandler)
  NO ZarinPal redirect, NO payment gateway
- Discount Store: DiscountBalance + ZarinPal IPG for remainder
  Added gatewayAmount=0 edge case (discount covers 100%)
- VAT: Both stores use 9% (ShopVAT=0.1 is stale/unused constant)
- Added ZarinPal usage scope note (only: Discount Store, Wallet Top-up, Package Purchase)
- Fixed BUSINESS-02: sections 2, 5.2, 5.3, 7
- Fixed BUSINESS-03: store comparison chart
- Fixed OVERVIEW-01: user journey + both store flowcharts
- Fixed OVERVIEW-03: timeline entry
2026-02-18 23:52:35 +03:30
masoodafar-web 1b04ba5326 docs: convert all ASCII charts to Mermaid diagrams
Converted 40+ ASCII art diagrams across 12 files to Mermaid:
- flowchart TD/LR for process flows and architecture
- erDiagram for entity relationships
- graph TD for tree structures (binary tree, categories)
- gantt for roadmap sprints

Files: BUSINESS-01 to 05, TECH-01/03/04/05, OVERVIEW-01/02/05
Directory tree structures kept as plain code blocks (Mermaid N/A)
2026-02-18 23:36:39 +03:30
masoodafar-web aef6861e21 docs: fix IPG DiscountBalance 56M → 112M (2× BasePackageAmount)
Matches code fix — IPG now charges DiscountBalance = BasePackageAmount × 2
Same as DayaLoan and ManualPayment. Total for all methods: 56M + 112M = 168M
2026-02-18 23:12:24 +03:30
masoodafar-web 3c729304db docs: fix all discrepancies based on comprehensive code audit
Corrections verified against actual CMS/BackOffice/FrontOffice source code:

- ClubActivationFee: 25,200,000 (not 25,000,000)
- Tree depth: no limit (15 is commission calculation depth only)
- IPG wallet charge: Balance=56M + Discount=56M
- DayaLoan wallet charge: Balance=56M + Discount=112M (2×)
- Discount: per-product MaxDiscountPercent (not fixed 30%)
- VAT: 10% (ShopVAT) vs 9% (discount store PlaceOrder)
- Kavenegar template: 'Afrino' only (not verify-foursat)
- SMS sender: 1000001110100
- DayaLoan job: every 20min (not 15min)
- Commission job: Sunday 00:05 (not Saturday)
- Network tree: on User entity (not separate NetworkNode table)
- UserWallets entity (not UserWalletBalances)
- OTP: 6 digits, 5 attempts, 2min TTL, 60s cooldown
- Removed non-existent constants (ClubJoiningPercentage, ClubActivationThreshold)
- Fixed Hangfire Chatika interval: every 5min
- Removed InventorySync from recurring jobs list
2026-02-18 22:58:40 +03:30
masoodafar-web efff5e9cd5 docs: consolidate 53 files into 15 structured files in 3 folders
- business/ (5): club-commission, payment, ecommerce, membership, content
- technical/ (5): cms-arch, ui, deployment, migration, api
- overview/ (5): flowcharts, index, changelog, glossary, roadmap
- Removed all old folders: backoffice, cms, deployment, docs, frontoffice, migration, ui-modernization, business (old)
- Updated internal links with relative folder paths
2026-02-18 22:29:37 +03:30
masoodafar-web d7c32dab2a consolidate: move all project-level docs to totalDoc
- BackOffice/docs → totalDoc/backoffice/ (AUDIT + CHANGELOG)
- FrontOffice/docs → totalDoc/frontoffice/ (CHANGELOG + UI-UNIFICATION-PLAN)
- CMS/README.md → totalDoc/cms/CMS-README.md
- DataMigration/README.md → totalDoc/migration/DATAMIGRATION-README.md
- deployment/README.md → totalDoc/deployment/DEPLOYMENT-README.md
- Updated INDEX.md with new paths and sections
2026-02-18 21:43:59 +03:30
masoodafar-web 0aa0141cec docs: add inventory improvements + product images square docs, update index 2026-02-18 01:05:39 +03:30
masoodafar-web ce74377012 feat: Implement structured page settings for simplified site management 2026-02-17 02:57:11 +03:30
masoodafar-web 21b8965c10 docs: مشکل ۱۴-۱۶ — K8S_SERVER اشتباه, نبود appsettings.Production, nginx image path 2026-02-17 02:11:39 +03:30
masoodafar-web 4ef4bfbeef docs: بروزرسانی کامل مستندات — باگ‌ها، فیکس‌ها، دیپلوی Production، CI/CD cross-deploy
- payment-gateway.md: سکشن ۸-۱۳ (ZarinPal callback, تخفیف ۱۰۰٪, VAT, ExpirePendingOrders, DeliveryStatus mapping, Production deploy)
- CICD-PIPELINE-GUIDE.md: باگ cross-deploy, قالب workflow Production, جدول مقایسه دو محیط
- INFRASTRUCTURE-GUIDE.md: سرور Production (45.149.79.127), DB KBS, Proto v0.0.179
- DISCOUNT-STORE-STATUS.md: وضعیت Production Deploy, فلوی پرداخت جدید
- SERVER-MIRRORS-CONFIG.md: registries.yaml سرور Production
- INDEX.md: تاریخ, توضیحات بروز, لینک‌های سریع جدید
2026-02-17 01:44:05 +03:30
masoodafar-web ad31c8be97 Refactor code structure for improved readability and maintainability 2026-02-16 00:59:16 +03:30
masoodafar-web 956a9ff6d6 feat: Add documentation for Admin/Customer separation fix and CI/CD pipeline guide 2026-02-11 00:41:43 +03:30
masoodafar-web 5149b9a89c Refactor code structure for improved readability and maintainability 2026-02-10 22:06:46 +03:30
masoodafar-web 8f02cec22f Refactor code structure for improved readability and maintainability 2026-02-05 23:02:01 +03:30
masoodafar-web 5965b98728 update 2026-01-03 18:27:49 +03:30
masoodafar-web 0369292d7f feat: Update inventory system plan with completion date and BFF synchronization details 2026-01-03 16:00:37 +03:30
masoodafar-web 86c4d9ce70 Refactor code structure for improved readability and maintainability 2026-01-03 07:38:05 +03:30
masoodafar-web 73e1971cc3 feat: Implement Discount Shop Completion Plan with Product Image Gallery, Admin APIs, VAT Calculation, and Sales Reports
- Added DiscountProductImage entity and related configurations for product image gallery.
- Created commands and queries for managing product images.
- Developed GetAllDiscountOrders API for admin order management with various filters.
- Implemented VAT calculation service and integrated it into order processing.
- Created Sales Reports API with support for daily, weekly, and monthly reports.
- Completed gRPC services for BackOffice.BFF to expose new APIs.
- Updated Proto files and project references accordingly.
2026-01-02 00:46:08 +03:30
masoodafar-web df650c3886 feat: Update changelog and documentation for version 2.7, including Commission Data Flow Fix, UI improvements, and terminology cleanup 2025-12-29 00:40:13 +03:30
masoodafar-web 4f999033bd feat: Update documentation with recent fixes and enhancements including Commission System and mapping issues 2025-12-27 22:03:21 +03:30
masoodafar-web 6220049161 feat: Enhance CMS Microservice with SystemConstants and SmsTemplates
- Added SystemConstants class to centralize hardcoded values for club configuration, commission configuration, and package amounts.
- Introduced SmsTemplates class to manage SMS message templates for various user notifications.
- Implemented automatic SMS sending for Daya Loan approval notifications.
- Updated BackOffice UI to include App Version management features.
- Fixed mapping issues in Mapster profiles for improved data handling.
- Updated changelog and documentation to reflect recent changes and configurations.
2025-12-27 05:07:33 +03:30
masoodafar-web 6380517ba2 docs: Add CHANGELOG-2025-12-26 and update documentation
- Add CHANGELOG-2025-12-26.md for App Version Management feature
- Update 00-INDEX.md with latest achievements and version 2.5
- Update BackOffice README with App Version Management info
- Update BackOffice.BFF README with new package versions
- Update FrontOffice README with ReferralCode feature
2025-12-26 06:12:24 +03:30
masoodafar-web 858933daa5 docs: add CHANGELOG-2025-12-25 - Chatika flag, DayaLoan fix, BackOffice tree rewrite with org-chart, SP_GetNetworkTree 2025-12-25 02:23:00 +03:30
masoodafar-web e7d979117c feat: Add Chatika integration and Club Features system documentation
- Implement Chatika account activation via background job
- Create IChatikaApiService interface and its implementation
- Add Club Features system documentation detailing features and entities
- Introduce ClubFeatureType enum to replace hardcoded IDs
- Update SQL scripts for Club Membership migration
- Fix various bugs in BackOffice UI and improve Products page functionality
2025-12-24 01:07:49 +03:30
masoodafar-web 002e99f6bf Implement Persian Date Conversion and Enhance User Network Information Service
- Added PersianDateTimeService for converting Gregorian dates to Persian format in the BackOffice frontend.
- Updated multiple frontend pages (Dashboard, UserPayouts, WorkerControl, UserNetworkInfo) to utilize the new Persian date service.
- Enhanced GetUserNetworkPositionDto with 28+ new fields for comprehensive user network data.
- Updated GetUserNetworkPositionQueryHandler to include new methods for calculating network statistics.
- Modified Protobuf messages to accommodate the new fields, increasing from 14 to 42.
- Refined week number calculation algorithm to ensure consistency across C# and SQL implementations.
- Created new CSV and Excel files for binary plan calculations.
- Ensured all changes are tested and validated for accuracy and performance.
2025-12-20 06:15:59 +03:30
masoodafar-web 13a3489765 Add initial documentation for Merchant Services API including contract status service details 2025-12-08 01:31:29 +03:30
masoodafar-web 201915d8c5 update 2025-12-05 17:28:24 +03:30
masoodafar-web 4c76690e84 feat: Update commission calculation documentation and mark tasks as completed 2025-12-04 19:56:11 +03:30
masoodafar-web 996a6e885b feat: Update CURRENT-SPRINT.md with progress and task completion details
- Added last updated date and refined project status for Backend and Frontend.
- Updated completion percentages for FrontOffice UI and BFF.
- Documented completed tasks for BackOffice in the current sprint.
- Added new high-priority tasks related to commission calculation fixes.
- Resolved blockers and minor issues, providing a clearer progress summary.

docs: Create commission-calculation-fix.md for weekly commission calculation analysis

- Documented critical issues affecting commission calculations.
- Provided a detailed plan for fixing the commission calculation logic.
- Included code analysis, affected files, and step-by-step tasks for implementation.
- Outlined the expected timeline and important notes regarding changes.
2025-12-04 19:54:08 +03:30
masoodafar-web 119e870a26 feat: Complete overhaul of FourSat documentation structure and content
- Added FINAL-STATUS.md detailing project completion and key metrics
- Created QUICK-REFERENCE.md for quick access to essential documents
- Updated README.md with project overview and quick start guide
- Established STRUCTURE.md outlining the final documentation structure
- Organized and archived old files, ensuring a clean and efficient directory
- Enhanced documentation quality with comprehensive metrics and checklists
2025-12-04 17:32:31 +03:30