Home
Search
Catalogue
Data
Orders
Account
Addresses
Returns
Contact Us
Rewards
APD Admin
    Bob - AI Assistant
    Orders
    Warehouse
    Tickets
    Customers
    Admin Users
    Pricing
    Shipping
    News
    Skin
    U
    apdV8 >
    APD V8 - Copyright © 2025 APD Ltd All rights reserved.
    Changelog | Terms & Conditions | Privacy Policy

    Changelog

    Track all changes, updates, and improvements to the APD Trade Portal

    Version 0.0.10

    January 5, 2025

    Added

    • Copy-to-clipboard functionality for part numbers on search results page with icon button and toast notification
    • Copy-to-clipboard functionality for part numbers on product details page with visual feedback
    • Toast notifications showing "Copied to clipboard" with part number confirmation
    • Manufacturer logos display on search results cards from TecDoc database (t042_datasupplier_logos, t231_graphics_documents)
    • Manufacturer logos display on product details page header next to brand names
    • Logo URL generation from S3 bucket using brandno_PIC folder structure
    • Graceful fallback for missing logos with automatic hiding on load error
    • Comments section on product details page with demo functionality
    • Comment input form with textarea and "Add Comment" button
    • Demo comments showing user avatars, timestamps, and warning/info indicators
    • Comment type indicators: warning (amber) for issues, info (blue) for general notes
    • Stock Availability section showing real-time inventory across all 15 branches
    • Stock summary dashboard with three metrics: In Stock, Low Stock, Out of Stock branches
    • Color-coded stock status indicators: green (in-stock), amber (low-stock), red (out-of-stock)
    • Full-width stock availability layout spanning entire page below product details
    • Three-column responsive grid for branch stock levels (1 mobile, 2 tablet, 3 desktop)
    • Previous Orders section showing 5 most recent orders for the part
    • Previous orders table with 7 columns: Order Number, Date, Customer, Qty, Branch, Status, Value
    • Clickable order numbers with receipt icons for navigation
    • Article Criteria card showing vehicle-specific specifications and packaging details
    • Vehicle-specific criteria: Suspension, Spring Type, Fitting Position, Drive Type, Braking/Dynamics
    • Packaging information: Length, Width, Height, Weight, Net Weight
    • Replacement warning indicator with amber alert box
    • Vehicle Linkage card showing compatible car manufacturers in alphabetical order
    • Seven car manufacturers displayed: Audi, BMW, Ford, Mercedes-Benz, Porsche, Volkswagen, Volvo
    • "View all compatible vehicles" link for expanded vehicle compatibility
    • Packing unit information at top of Product Information card
    • "Packing unit" and "Quantity per packing unit" fields with demo values
    • Scroll position restoration on search page - returns users to exact scroll position when navigating back from product details
    • sessionStorage-based scroll position tracking that preserves location during product browsing
    • Automatic scroll restoration after search results load when returning from product page

    Changed

    • "Back to Search Results" button now uses inline-flex to prevent icon and text wrapping to separate lines
    • Search page now uses URL parameters (?q=partNumber) for preserving search state
    • Product details page includes search query in URL (?from=partNumber) for proper back navigation
    • Back button navigates to search page with preserved query instead of generic browser back
    • Loading spinner color changed from dark blue to bright blue (primary color) across all pages
    • Loading spinner size increased from 30px/40px to 40px/48px for better visibility
    • Loading state layout changed to flex column with centered content
    • Search loading spinner and timer text now properly centered vertically and horizontally
    • Stock availability section moved from right column to full-width layout below both columns
    • Stock availability branch list changed from single column to 3-column responsive grid
    • Stock quantity badges shortened from "12 units" to just "12" for more compact display
    • Stock levels reduced from 120 total units to 5 units (2 in Swindon, 3 in Swindon eCommerce)
    • All branches except Swindon locations show out-of-stock status
    • Stock update frequency message changed from "real-time" to "every 30 minutes"
    • Article Criteria heading size increased from text-sm to text-xl to match Supplier Information
    • Search results load time text color changed from blue to primary for consistency

    Fixed

    • Back button wrapping issue - icon and text now stay on same line with whitespace-nowrap
    • Search state persistence - returning from product details now restores search results
    • Search query not preserved in URL - now properly encoded in query parameters
    • Logo images failing to load gracefully handled with onError hiding

    Version 0.0.9

    November 4, 2025

    Added

    • OpenAI integration for Bob AI Assistant (/admin/bob) with GPT-4o-mini model
    • AI chat API endpoint (/api/ai/chat) with conversation context and error handling
    • OPENAI_API_KEY configuration in .env.local for API authentication
    • Intelligent error handling for AI chat with contextual help messages
    • Rate limit detection with detailed explanation and link to OpenAI usage dashboard
    • API key validation with troubleshooting steps and account management link
    • Network error detection with helpful connection guidance
    • Visual error indicators: amber banner for rate limits, red banner for API key issues
    • System prompt defining Bob's personality as APD company assistant
    • Token usage tracking and console logging for OpenAI API calls
    • Comprehensive image URL console logging on product details page
    • S3 URL generation logging showing original filename, brand number, and final URL
    • Image load failure logging for main images and thumbnails with error details
    • Product details page header logging showing brand number, part number, and media count

    Changed

    • Bob AI Assistant now uses real OpenAI GPT-4o-mini instead of placeholder responses
    • Bob greeting message updated to reflect OpenAI integration
    • Footer text changed from "placeholder" to "powered by OpenAI GPT-4"
    • S3 image URLs standardized to lowercase .jpg extensions for consistency
    • Error messages clear automatically when successful AI response received
    • Conversation history now sent to OpenAI for contextual responses

    Fixed

    • S3 image case sensitivity issue - now uses lowercase .jpg matching bucket standard
    • OpenAI rate limit errors now show helpful troubleshooting instead of generic error
    • API key configuration errors provide clear next steps for resolution
    • Error state properly tracked and displayed in UI footer

    Version 0.0.8

    November 4, 2025

    Added

    • TecDoc product details page (/search/product/[brandNumber]/[partNumber]) with full product specifications
    • Product details API endpoint (/api/tecdoc/product-details) fetching weight, fitting position, RPO number, GTINs, and criteria
    • Additional product details cards: Weight, Fitting Position, RPO Number, GTINs, Technical Criteria, Logistics Criteria
    • TecDoc technical criteria display from tables t210 (article_criteria) and t050 (criteria_table)
    • TecDoc logistics criteria display from tables t213 (article_criteria_logistics) and t053 (criteria_table_logistics)
    • GTIN (Global Trade Item Number) display from table t209_gtin with support for multiple GTINs per product
    • Product details page image gallery with thumbnail selector and full-screen view
    • Recent searches feature with localStorage persistence showing last 10 searches
    • Clickable recent search chips below search input for quick re-searching
    • "Clear all" button for recent searches with localStorage cleanup
    • Exact match highlighting with blue ring border and background tint for MPN matches
    • "⭐ Matches your search text" badge for direct part number matches
    • Smart search result sorting: MPN exact matches first, then OE cross-reference matches
    • Collapsible brand filter (minimized by default) with expand/collapse arrows
    • Collapsible part type filter (minimized by default) extracting unique product descriptions
    • Dynamic part type extraction from search results (e.g., "Sender Unit, fuel tank", "Inner Tie Rod")
    • Brand filter feedback showing "X brands found" below filter title
    • Part type filter feedback showing "X types available" below filter title
    • Colorful gradient background for brand filter card (purple/indigo theme)
    • Colorful gradient background for part type filter card (emerald/teal theme)
    • Combined filtering system - brand and part type filters work independently and together
    • Supplier information display from TecDoc table t040_datasupplier_main_address
    • Supplier details card showing company name, full address, phone, fax, email, and website
    • Clickable images and part numbers that navigate to product details page
    • "Click image for details" hint text below product images
    • Comprehensive S3 image URL debugging with console logging for troubleshooting
    • Image load failure tracking with grouped summary reports by supplier
    • Failed image URL reporting showing filename and attempted S3 path per supplier

    Changed

    • Search results now prioritize exact MPN matches over OE cross-references
    • Filter cards now collapsed by default for cleaner initial page view
    • Filter section headers updated with color-coded count badges (purple for brands, emerald for part types)
    • Success banner now shows filtered count when filters active: "Showing X of Y results"
    • No results state updated to display which filters are currently active
    • "Clear all filters" button repositioned to brand filter header for better accessibility
    • Recent searches automatically convert to uppercase matching search behavior
    • Recent searches list updates when performing new search (moves to top if duplicate)
    • Product details page uses dynamic routing for shareable URLs

    Fixed

    • Filter state now properly resets when performing new search
    • Part type filter correctly extracts trimmed descriptions to avoid whitespace duplicates
    • Brand and part type counts accurately reflect current search results
    • localStorage errors gracefully handled with try-catch blocks
    • Recent searches properly deduplicate entries before saving
    • TecDoc product details API gracefully handles missing data with null values
    • Weight conversion properly handles both kg and g units from logistics criteria
    • Filter collapse arrows properly color-coded to match their respective card themes

    Version 0.0.7

    October 29, 2025

    Added

    • Latest Comments card on VIEW mode showing 3 most recent comments with avatars and timestamps
    • Expected Dispatch Date editing with blue pencil icon and inline date picker
    • Overdue tracking on Expected Dispatch card showing days overdue (e.g., "Overdue (3 days)")
    • Auto-save functionality in CHECK mode - database updates immediately when received quantity changes
    • Batched activity logging system - collects changes and logs once after 30 seconds or when switching modes
    • Visual feedback in CHECK mode: blue spinner while saving → green checkmark when saved (auto-hides after 2s)
    • Full-width CHECK mode layout - removed Delivery and Order Totals sidebar cards for maximum table space
    • Check tab status styling - green when all items checked, amber when partial, matching Payment tab pattern
    • Checked status now reflects reality with three states: Complete (green), In Progress (amber), Pending (gray)
    • Progress count display showing completion ratio (e.g., "In Progress (1/3)")
    • Detailed Order Totals breakdown: Products, Delivery, Total ex VAT, VAT (20%), Grand Total
    • Smart VAT calculation - only applies VAT for UK orders (VAT_Applicable === 1)
    • International order support - non-UK orders display totals without VAT line
    • MAM (Myton Automotive Management) tab and mode for invoice reference tracking
    • MAMMode component with inline editing, auto-save, and success/error feedback
    • MAM invoice reference API endpoint (/api/admin/orders/[orderNumber]/mam-invoice) with PUT and GET methods
    • New SVG-style loading spinners with two-tone circular design (40-48px sizes)
    • Automatic uppercase conversion for search input - all part numbers converted to uppercase as typed
    • Activity logging API endpoint (/api/admin/orders/[orderNumber]/activity) with POST and GET methods
    • Check item auto-save API endpoint (/api/admin/orders/[orderNumber]/check-item) for single item updates
    • Expected dispatch date API endpoint (/api/admin/orders/[orderNumber]/dispatch-date) with activity logging

    Changed

    • Activity descriptions now human-readable: "comment_added" → "added a comment", "items_checked" → "updated item ready status"
    • Activity layout improved - avatar, username, and action consolidated on single line
    • Avatar size in Activity mode increased from 20px to 24px for better visibility
    • CHECK mode removed manual Save button in favor of instant auto-save on field change
    • Received input field in CHECK mode now properly centered under column header
    • Order Totals card now passes shipping cost for accurate total calculation
    • Grand Total label shows "(inc VAT)" only when VAT is applicable (UK orders)
    • Checked status changed from using orderCheckedByStaff to readyStatus for accuracy
    • Check mode database updates now set three fields: ReadyToGo, ReadyToGoDate, ReadyToGoAmountOfParts
    • Loading spinners replaced with new SVG circular design - changed from border animation to two-tone SVG (text-blue-600)
    • All spinners now consistent blue color (text-blue-600) replacing previous orange/primary colors
    • ModeTabs component now includes MAM tab as the last tab after Activity
    • Search page input now converts all text to uppercase automatically for better part number consistency

    Fixed

    • Comment timestamps showing "Invalid Date" - added fallback field names (timestamp || createdAt || dateAdded)
    • Module import error in dispatch-date API route - changed from @/lib/db to @/lib/mysql-db-utils
    • React rendering warnings with falsy values - added !! operator for boolean coercion
    • Latest Comments "(edited)" indicator separated into own div with proper spacing
    • Comments load automatically on view mode for immediate visibility
    • Hydration mismatch warning on body element - added suppressHydrationWarning to prevent browser extension conflicts
    • Hydration mismatch in Dropdown component - added suppressHydrationWarning to DropdownToggle for FloatingUI ID generation
    • Console hydration warnings caused by browser extensions modifying DOM before React hydration

    Version 0.0.6

    October 29, 2025

    Added

    • Multi-mode operational system for order details page with 5 distinct modes accessible via URL parameters
    • VIEW Mode (?mode=view) - Read-only order items table with 7 columns and zebra striping for readability
    • CHECK Mode (?mode=check) - Warehouse receiving interface with editable received quantities and real-time validation
    • EDIT Mode (?mode=edit) - Inline editing of order lines with full CRUD operations (add, edit, delete)
    • DISPATCH Mode (?mode=dispatch) - Shipping workflow with checklist, courier selection, and tracking number entry
    • COMMENTS Mode (?mode=comments) - Team communication system for order discussions with threaded comments
    • Mode tabs navigation bar for seamless switching between operational modes
    • URL-based routing for modes with deep linking support and browser back/forward compatibility
    • Progress bar in CHECK mode showing percentage of items ready to dispatch (e.g., "6/8 items ready - 75%")
    • Color-coded input validation in CHECK mode: gray (not received), amber (partial), green (ready), red (over-received)
    • "Mark All Ready" button in CHECK mode to automatically set all received quantities to ordered amounts
    • Per-row save buttons in CHECK mode with visual feedback and loading states
    • Inline row editing in EDIT mode activated by pencil icon with Save/Cancel buttons
    • "Add Line" functionality in EDIT mode with yellow-highlighted new row for adding items
    • Delete line functionality in EDIT mode with confirmation dialog to prevent accidental deletions
    • Sticky action bar in EDIT mode appearing at bottom when unsaved changes exist
    • "Discard All Changes" and "Save All Changes" buttons in EDIT mode sticky bar
    • Live order totals recalculation as quantities and prices change in EDIT mode
    • Dispatch checklist with checkboxes: Items picked, Packing slip printed, Shipping label created
    • Courier name input field in DISPATCH mode with validation (e.g., DPD, Royal Mail, DHL)
    • Tracking number input field in DISPATCH mode with validation before dispatch
    • "Print Packing Slip" and "Create Label" action buttons in DISPATCH mode
    • "Mark as Dispatched" primary action button with requirement validation in DISPATCH mode
    • Dispatch button disabled state until all requirements met (items picked, courier, tracking)
    • Helpful validation messages in DISPATCH mode showing which requirements are missing
    • Comments system with circular user avatars displaying initials in COMMENTS mode
    • Smart timestamp formatting: "Just now", "X minutes ago", "X hours ago", "X days ago", or full date
    • 6-color avatar system with consistent user colors: Amber, Blue, Green, Red, Purple, Pink
    • Avatar color assignment algorithm ensuring same user always gets same color
    • Comment textarea with auto-resize (3 rows default) and preserved formatting (whitespace-pre-wrap)
    • "Send" button in comments that enables when text is entered and shows loading state
    • Real-time comment count display in COMMENTS mode header (e.g., "Comments (2)")
    • Empty state message in COMMENTS mode encouraging first comment
    • Chronological comment display (oldest first) with gray background cards
    • Order totals sidebar card with subtotal, VAT amount, total, and ready item count
    • GBP currency formatting utilities (/src/lib/currency.js) for consistent British pound display
    • Mock data system (/src/lib/order-mock.js) with realistic seed data for testing all modes
    • Mock API functions: getMockOrder, setReceived, markAllReady, updateLine, deleteLine, addLine, saveLines, markDispatched, addComment
    • OrderActivity model for tracking and auditing order changes over time
    • Countries API endpoint (/api/countries/) for address validation and delivery options
    • Order comments API endpoint (/api/admin/orders/[orderNumber]/comments/) for team communication
    • Order delivery API endpoint (/api/admin/orders/[orderNumber]/delivery/) for shipping updates
    • ViewModeTable component for clean read-only order items display
    • CheckModeTable component with editable inputs and validation styling
    • CheckModeProgress component showing progress bar and bulk actions
    • EditModeTable component with inline editing and per-row controls
    • EditModeActions component for sticky bottom action bar
    • DispatchChecklist component with shipping workflow requirements
    • DispatchModeTable component with minimal 4-column focused layout
    • CommentsMode component with full comment thread UI and posting
    • ModeTabs component for horizontal mode navigation with active indicators
    • OrderTotals component for financial summary in sidebar

    Changed

    • Order details page architecture completely refactored to support multiple operational modes
    • Order items table now displays in mode-specific layouts optimized for each workflow
    • Responsive layout with 2/3 main content and 1/3 sidebar on desktop, fully stacked on mobile
    • Browser navigation (back/forward) now works correctly with mode switching via shallow routing
    • Default mode changed from full details view to VIEW mode when no mode parameter specified
    • Sidebar cards now adapt based on current mode (e.g., shows ready percentage in CHECK mode)
    • CHECK mode uses amber theme to draw attention to receiving operations
    • EDIT mode uses blue theme to indicate editing and modification state
    • DISPATCH mode uses emerald/green theme to convey ready-to-ship and go status
    • DISPATCH mode table reduced to 4 essential columns for focused shipping workflow
    • All modes maintain consistent dark mode support with proper contrast and theming

    Version 0.0.5

    October 27, 2025

    Added

    • Complete order details page (/admin/orders/[orderNumber]) with full order information
    • Order items table displaying products, quantities, prices, surcharges, and line totals
    • VAT calculation and display in order items with VAT applicable flag support
    • Ready status indicators showing which items are ready to dispatch
    • Dispatch status badges on order details page with color-coded states
    • Customer information section with business, contact details, and account number
    • Delivery address display on order details page
    • Payment information section with card details and transaction references
    • Order status timeline showing Confirmed, Checked, Ordered, and Dispatched states
    • Expected dispatch date and ready status percentage tracking

    Changed

    • Site display names: "Myton" → "Myton (quote)", "Myton.parts (New Site)" → "Myton (website)"
    • Load time format changed from milliseconds to seconds with 1 decimal place (e.g., "6.7 sec")
    • Business names in orders table now display in bold text for better visibility
    • Part Number search field repositioned to far right in search filters
    • Removed "Instant filtering" and lightning emoji from UI for cleaner appearance
    • Load time indicator text color changed from green to blue
    • Removed Category column from order items table for cleaner layout
    • Cleaned up debug console.log statements throughout order system

    Fixed

    • Order items not displaying: Fixed column name mismatch (Qty vs Quantity) in database query
    • SQL error in order items query: Changed pg.SubCategory to pg.Sub_Category (correct column name)
    • SQL error: Removed non-existent pg.Image column from products_global JOIN
    • Missing VAT_Applicable field in order object transformation
    • Next.js 15 params warning: Added await for params in dynamic route
    • Order items returning empty array due to SQL column errors

    Version 0.0.4

    October 23, 2025

    Added

    • OE number search functionality - search by OE reference numbers to find all matching parts
    • OE numbers display on search result cards with first 20 shown by default
    • Clickable OE number badges that trigger new searches
    • Brand filtering on search results page with multi-select support
    • Filter result count display showing "X of Y results" when filters active
    • "Matched by OE" badge (green) displayed when part found via OE cross-reference
    • Database indexes recommendation for t203_reference_numbers table (artno, brandno)

    Changed

    • Search now queries both manufacturer part numbers (MPN) and OE reference numbers
    • Updated contact information: trd@apd.co.uk, 01793 83 99 19, hours 8:00am - 5:30pm
    • Data page second card color changed from orange/amber to pink gradient
    • Image placeholder and media count now always display even when 0 media files
    • Details button now always shows for consistency across all search results
    • OE numbers limited to 20 visible by default with expand option via Details button

    Fixed

    • Fixed OE number duplication in search results using DISTINCT in CTE
    • Removed DISTINCT from json_agg to avoid JSON equality comparison errors
    • Pre-aggregated OE numbers and media files to prevent multiplication in joins

    Version 0.0.3

    October 22, 2025

    Added

    • Operational Orders page (/admin/orders) for warehouse dispatch with search filters and status tracking
    • Warehouse Performance dashboard (/admin/warehouse) with dispatch metrics and priority orders
    • Search filters for orders: Part Number, Order Number, Postcode, Last Name
    • Status filter buttons: CURRENT, QUOTES, ISSUES, ALL, RETURNS
    • Detailed operational table with 13 columns including dispatch status and issue tracking
    • Orders Requiring Attention table on warehouse dashboard
    • Dispatch performance metrics cards (Today, Weekly, Monthly, Yearly percentages)
    • Warehouse navigation item with warehouse icon to admin menu

    Changed

    • Removed Status and Comments columns from orders table for better desktop fit
    • Updated warehouse page background to white to match rest of application
    • Changed filter buttons to use primary color when active with subtle gray for inactive
    • Converted "View All →" text link to proper button on customer orders page
    • Table styling updated to match app design system with clean gray borders
    • Info banner changed to amber color scheme for priority order context

    Fixed

    • Fixed duplicate navigation key issue (changed admin orders key from "orders" to "adminOrders")
    • Status indicators now use green checkmarks and subtle gray X marks instead of aggressive red

    Version 0.0.2

    October 22, 2025

    Added

    • TecDoc search functionality with manufacturer part number lookup
    • Brand name display in search results using supplier_list.json lookup system
    • Product descriptions in search results (language code 004 - UK English)
    • TecDoc product images from S3 bucket with brand-specific folder structure
    • Reverse lookup API endpoint (/api/tecdoc/reverse-lookup) for finding parts by image filename
    • Automatic .jpg extension handling for TecDoc image filenames
    • Debug logging for search results, image URLs, and API responses
    • Media file display with primary image selection and expandable gallery

    Changed

    • Updated search UI: "View All Media" button renamed to "Details"
    • Reduced search timer text size for improved visual hierarchy
    • Removed redundant result count number from success banner
    • Removed "Brand Number" field from search result cards
    • TecDoc language code changed from 001 to 004 for proper description support
    • S3 image URLs now use correct bucket and folder structure (brand_number_PIC/)

    Fixed

    • Invalid NaN values in supplier_list.json replaced with null for proper JSON parsing
    • TecDoc image URL construction now handles filenames without extensions
    • Brand name lookup now correctly converts database text brandno to integer
    • Description lookup now uses correct language code with available translations

    Version 0.0.1

    October 21, 2025

    Added

    • APD TRD animated logo with GSAP fade-in effects and blinking arrow
    • JSON-based gradient color system for TRD logo with 5 vibrant color schemes
    • News system with listing page (/news) and individual article pages (/news/[id])
    • Contact form that creates support tickets with priority and type selection
    • "My Orders" page for customers to track their order history and shipments
    • Account Settings page with avatar upload, color picker, and password management
    • Account Settings menu item in user profile dropdown with gear icon
    • Colorful gradient stat cards for Customer Tickets admin page
    • Vibrant news cards with category-specific icons and gradients on home page
    • Colorful Quick Actions cards matching home page theme (My Orders, Download Reports, Need Help)
    • News data JSON file with 3 sample articles including category, icons, and styling
    • Multi-assignee support for tickets with modal selection interface

    Changed

    • Renamed "Requests" to "Tickets" throughout admin system with TKT- prefix
    • Updated ticket stat cards with vibrant gradients (purple, pink, orange, blue, teal)
    • Updated ticket status badges to match stat card colors (pink, orange, blue, teal)
    • Changed Pending status from yellow to blue gradient for better visual distinction
    • Centered welcome section content on home page for improved layout
    • Updated welcome text to "Welcome to the APD Trade Portal" with article
    • Merged pricing seed script into comprehensive test database seed
    • Updated favicon configuration to use favicon.jpg instead of favicon.ico
    • Enhanced TRD> gradient with lighter, more vibrant colors matching home page theme
    • Moved "Rewards" menu item below "Contact Us" in navigation
    • Expanded pricing rules data to include Standard Retail, Wholesale, and Premium Partner pricing

    Fixed

    • TRD> gradient colors now use lighter shades (400-500 range) for better vibrancy
    • Status badge colors now properly match their corresponding stat card gradients

    Version 0.0.0

    October 20, 2025

    Added

    • Brand-specific authentication system for Vika DPA, Borsehung, and Bapmic
    • Dynamic brand theming with custom colors and logos
    • Search functionality in navigation
    • Changelog page for tracking updates

    Changed

    • Updated application branding from Ecme to APD Ltd
    • Simplified navigation menu structure
    • Improved authentication middleware for brand-specific routes

    Removed

    • Example collapse menu items
    • Example group menu items

    Note: This changelog follows the Keep a Changelog format and adheres to Semantic Versioning.