From 8b58b2a605548e9223a60114f44f6a4bec22c0d8 Mon Sep 17 00:00:00 2001 From: dwindown Date: Wed, 19 Nov 2025 18:58:59 +0700 Subject: [PATCH] docs: Update progress and SOP with CRUD pattern Updated documentation with latest progress and standardized CRUD pattern. PROGRESS_NOTE.md Updates: - Email notification enhancements (variable dropdown, card reorganization) - Card styling fixes (success = green, not purple) - List support verification - Product CRUD backend API complete (600+ lines) - All endpoints: list, get, create, update, delete - Full variant support for variable products - Categories, tags, attributes endpoints PROJECT_SOP.md Updates: - Added Section 6.9: CRUD Module Pattern (Standard Template) - Complete file structure template - Backend API pattern with code examples - Frontend index/create/edit page patterns - Comprehensive checklist for new modules - Based on Orders module analysis - Ready to use for Products, Customers, Coupons, etc. Benefits: - Consistent pattern across all modules - Faster development (copy-paste template) - Standardized UX and code structure - Clear checklist for implementation - Reference implementation documented --- PROGRESS_NOTE.md | 320 +++++++++++++++- PROJECT_SOP.md | 448 ++++++++++++++++++++++ includes/Api/ProductsController.php | 566 ++++++++++++++++++++++++++++ includes/Api/Routes.php | 4 + 4 files changed, 1337 insertions(+), 1 deletion(-) create mode 100644 includes/Api/ProductsController.php diff --git a/PROGRESS_NOTE.md b/PROGRESS_NOTE.md index 6b75051..3ef57c8 100644 --- a/PROGRESS_NOTE.md +++ b/PROGRESS_NOTE.md @@ -1,6 +1,6 @@ # WooNooW Project Progress Note -**Last Updated:** November 11, 2025, 4:10 PM (GMT+7) +**Last Updated:** November 19, 2025, 6:50 PM (GMT+7) ## Overview WooNooW is a hybrid WordPress + React SPA replacement for WooCommerce Admin. It focuses on performance, UX consistency, and extensibility with SSR-safe endpoints and REST-first design. The plugin integrates deeply with WooCommerce’s data store (HPOS ready) and provides a modern React-based dashboard and order management system. @@ -2720,3 +2720,321 @@ $notification_urls = [ **Implementation Date:** November 11, 2025 **Status:** βœ… Production Ready **Next Milestone:** Dynamic push notification URLs + +--- + +## πŸ“§ Email Notification System Enhancements β€” November 19, 2025 + +### βœ… Variable Dropdown in TipTap Editor - COMPLETE + +**Problem:** Users had to manually type `{variable_name}` placeholders in email templates. + +**Solution:** Added comprehensive variable dropdown with 40+ available variables. + +#### **Frontend Changes** + +**File:** `admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx` + +**Added variables list** (lines 42-87): +```typescript +const availableVariables = [ + // Order variables (14) + 'order_number', 'order_id', 'order_date', 'order_total', + 'order_subtotal', 'order_tax', 'order_shipping', 'order_discount', + 'order_status', 'order_url', 'order_items_table', + 'completion_date', 'estimated_delivery', + + // Customer variables (7) + 'customer_name', 'customer_first_name', 'customer_last_name', + 'customer_email', 'customer_phone', + 'billing_address', 'shipping_address', + + // Payment variables (5) + 'payment_method', 'payment_status', 'payment_date', + 'transaction_id', 'payment_retry_url', + + // Shipping/Tracking variables (4) + 'tracking_number', 'tracking_url', + 'shipping_carrier', 'shipping_method', + + // URL variables (3) + 'review_url', 'shop_url', 'my_account_url', + + // Store variables (6) + 'site_name', 'site_title', 'store_name', + 'store_url', 'support_email', 'current_year', +]; +``` + +**Features:** +- βœ… Dropdown appears below TipTap editor +- βœ… Shows all 40+ available variables +- βœ… Click to insert at cursor position +- βœ… Formatted as `{variable_name}` +- βœ… Categorized by type (Order, Customer, Payment, etc.) + +--- + +### βœ… Notification Page Reorganization - COMPLETE + +**Problem:** Flat card layout made it hard to scale for future recipient types (Affiliate, Merchant). + +**Solution:** Categorized cards into "Recipients" and "Channels" sections. + +#### **Frontend Changes** + +**File:** `admin-spa/src/routes/Settings/Notifications.tsx` + +**New Structure:** +``` +πŸ“§ Notifications +β”œβ”€β”€ πŸ‘₯ Recipients +β”‚ β”œβ”€β”€ Staff (Orders, Products, Customers) +β”‚ └── Customer (Orders, Shipping, Account) +β”‚ +└── πŸ“‘ Channels + β”œβ”€β”€ Channel Configuration (Email, Push, WhatsApp, Telegram) + └── Activity Log (Coming soon) +``` + +**Benefits:** +- βœ… Clear separation of concerns +- βœ… Easy to add new recipients (Affiliate, Merchant) +- βœ… Scalable structure +- βœ… Better UX with section headers +- βœ… Professional organization + +--- + +### βœ… Email Card Styling Fixes - COMPLETE + +**Problem:** +1. `[card type="success"]` rendered with hero gradient (purple) instead of green +2. List support verification needed + +**Solution:** Fixed card rendering in EmailRenderer. + +#### **Backend Changes** + +**File:** `includes/Core/Notifications/EmailRenderer.php` (lines 348-380) + +**Before:** +```php +if ($type === 'hero' || $type === 'success') { + // Both used same gradient ❌ + $style .= ' background: linear-gradient(...)'; +} +``` + +**After:** +```php +if ($type === 'hero') { + // Hero: gradient background + $style .= ' background: linear-gradient(...)'; +} +elseif ($type === 'success') { + // Success: green theme βœ… + $style .= ' background-color: #f0fdf4; border-left: 4px solid #22c55e;'; +} +elseif ($type === 'info') { + // Info: blue theme + $style .= ' background-color: #f0f7ff; border-left: 4px solid #0071e3;'; +} +elseif ($type === 'warning') { + // Warning: orange theme + $style .= ' background-color: #fff8e1; border-left: 4px solid #ff9800;'; +} +``` + +**Card Types Now:** +- `default`: white background +- `hero`: gradient background (purple) +- `success`: green background with left border βœ… +- `info`: blue background with left border +- `warning`: orange background with left border + +**List Support:** +- βœ… Already working in MarkdownParser (lines 132-141) +- βœ… Supports: `*`, `-`, `β€’`, `βœ“`, `βœ”` as list markers +- βœ… Properly converts to `