Tag: packing lists

  • Fulfillment – Daily Changelog – October 29, 2025

    Fulfillment – Daily Changelog – October 29, 2025

    Changelog – October 29, 2025

    🚀 New Features & Improvements

    Raffle Sticker Batch Page Enhancements

    • Visual Order Grouping: Split domestic orders into two distinct sections on raffle sticker batch page
    • “Single Sticker Orders” section for orders with exactly 1 sticker
    • “Multiple Sticker Orders” section for orders with 2+ stickers
    • Each section shows order count and total sticker count for easy packing workflow
    • Color-Coded Quantity Badges: Added brand-approved color-coded badges to quantity display
    • Single sticker (1): Gray – subtle, low priority
    • 2-5 stickers: Green – moderate attention
    • 6-10 stickers: Blue – higher attention
    • 11+ stickers: Primary gold – highest attention
    • Section-Specific Selection: Each order group has its own “Select All” checkbox while maintaining global selection functionality
    • Packing Workflow Optimization: Visual grouping makes it easier to prepare packages by quantity, improving packing efficiency

    4×6 Packing Label Enhancements

    • Multiple Quantity Badge: Added prominent visual indicator on 4×6 packing labels for orders with more than 1 sticker
    • Black badge displaying “X STICKERS” appears in header area next to order number
    • Only shows when quantity > 1 to draw attention to multi-sticker orders
    • Prevents packing errors by making quantity immediately apparent
    • Label Generation Updates: Modified both production and debug label routes to calculate and display total quantity
    • Updated label header layout to accommodate badge
    • Bold, high-contrast styling ensures visibility during physical packing

    Avery Packing Label Enhancements (5160 & 5167)

    • Quantity Badge on Sticky Labels: Added visual quantity badges to Avery label formats for multi-item orders
    • Displays total item quantity (e.g., “3”) in a bold black badge next to order number
    • Works on both Avery 5160 (30 labels/sheet) and Avery 5167 (80 labels/sheet) formats
    • Compact sizing optimized for small label dimensions
    • Only appears when order has more than 1 item
    • Order Picking Optimization: Helps employees quickly identify orders requiring multiple items during pick/pack operations
    • High-contrast black badge with white text for instant visibility
    • Positioned next to order number in flexible layout
    • Scales appropriately for compact (5167) vs standard (5160) label sizes

    🔧 Technical Improvements

    Frontend Components

    • src/app/(authenticated)/batches/[id]/raffle-page.tsx:
    • Added useMemo hook to group domestic orders by quantity
    • Created getQuantityBadgeColor helper function for color-coded badges
    • Created renderOrderRow helper function to DRY up order table rendering
    • Split single orders table into two sections with independent selection logic
    • Updated selection handlers to work across both order groups

    API Route Updates

    • src/app/api/orders/labels-4x6/route.ts: Added quantity badge logic to production 4×6 label generation
    • src/app/api/orders/labels-4x6/debug/route.ts: Added quantity badge logic to debug 4×6 label generation
    • Calculate total quantity across all line items
    • Conditionally render badge HTML when quantity > 1
    • Updated CSS to style badge with high visibility
    • src/app/api/orders/labels/route.ts: Added quantity badge support for Avery label formats (5160 & 5167)
    • Added .order-with-badge and .qty-badge CSS classes
    • Implemented flexible layout to accommodate badge next to order number
    • Responsive sizing for both compact (5167) and standard (5160) formats
    • Uses existing itemCount field which contains total quantity sum

    Styling Updates

    • Added .order-info CSS class for flexible layout of order number and badge
    • Added .qty-badge CSS class with bold styling (black background, white text, increased letter-spacing)
    • Updated header alignment from align-items: baseline to align-items: flex-start for proper badge positioning

    🎯 User Experience Improvements

    • Packing Efficiency: Visual separation of single vs. multiple sticker orders streamlines the physical packing process
    • Error Prevention: Prominent quantity badges on labels reduce risk of packing incorrect number of stickers
    • Quick Identification: Color-coded badges allow instant recognition of order complexity at a glance
    • Workflow Preservation: All existing functionality (send to ShippingEasy, bulk operations) remains unchanged

    Files Modified: 4
    Major Features Added: Order quantity grouping, visual quantity badges on all label types (4×6 packing lists & Avery sticky labels)
    Focus: Packing workflow optimization and error prevention for physical fulfillment operations

    🖨️ Packing Lists Overhaul (Batches)

    • Fixed print layout to hide all app UI (nav, sidebar, submenus) and only render packing lists
    • Ensured one page per order with reliable page breaks and no blank pages
    • Added manual Print button plus auto-print after data load
    • Added professional header:
    • Mama Tried logo and business address (4188 S. Kinnickinnic Ave., St Francis, WI 53235)
    • Moved order number and date to top-right; removed duplicate “#” prefix
    • Removed unused icon import to satisfy lint and unblock deploy

    Files:

    • src/app/(authenticated)/batches/[id]/packing-lists/page.tsx
    • src/app/api/batches/[id]/bulk-packing-lists/route.ts
    • src/app/api/batches/[id]/packing-list/route.ts

    🧰 Database Transaction Leak Remediation (Critical)

    • Audited and fixed transaction handling across 24+ API routes (29 transactions)
    • Replaced db.query('BEGIN'|'COMMIT'|'ROLLBACK') with per-request client via db.connect()
    • Added finally { client.release() } and 10s statement timeout on transactions
    • Resolved pool exhaustion that previously froze the app under load

    Representative routes fixed (subset):

    • orders/[id]/create-reprint, orders/fix-line-items
    • products/* (tags, files, production-files, display-files, toggle-pod, placement-preview)
    • warehouse-items/*, warehouse-inventory/* (transfer, move, reserve, import, pod)
    • navbar/*, available-pages, settings/batch-stages, price-*, roles/*, users/public-pages, art-file-previews

    📦 Warehouse & POD Inventory Improvements

    • Added POD inventory endpoints and UI dialogs
    • Introduced migration for POD blank inventory
    • Fixed lint in inventory dialogs to allow deployment

    Files:

    • database_migrations/add_pod_blank_inventory.sql
    • src/app/api/warehouse-inventory/pod/route.ts
    • src/components/warehouse-inventory/{pod-inventory-view,adjust-pod-inventory-dialog,pod-blank-item-dialog}.tsx

    🛍️ Shopify Product Metadata Sync in Order Processing

    • Added metadata sync from Shopify during order import to improve product classification
    • Order processing now continues even if metadata sync fails (better resilience)

    Files:

    • src/lib/orderUtils.ts
    • ORDER_TYPE_FIX.md

    🔤 New Supporting APIs

    • Added sizes API route to support inventory/product flows

    Files:

    • src/app/api/sizes/route.ts