Customer Management: Complete Dashboard Guide

BSTD's Customer Management module provides a centralized, powerful dashboard to view, organize, and maintain all your customer data and linked logistics documents. This comprehensive guide covers every feature, interaction, and workflow available in the customer table.

From cross-field search across customer and quotation data, linking 9 different document types, instant PDF viewing with zero caching, secure token-based sharing, and smart viewport-aware dropdowns — this page documents everything you need to master your customer operations.

Customer Table & Cards

The dashboard displays customers in two responsive layouts: a detailed table for desktop and compact cards for mobile. Both views show the same rich information organized for optimal scanning.

Desktop Table Columns

  • # (Index): Sequential row number for easy reference.
  • Customer:Displays the customer's party name (from linked quotation), a colored avatar with the first initial, customer ID, and clickable phone number.
  • Route: Shows origin city and destination city with a directional arrow, plus the creation date formatted via formatDate.
  • Docs:A badge showing the count of linked documents out of 9 total possible types (e.g., "3/9"). Click to open the Link Docs modal.
  • Actions: A three-dot menu button that opens the comprehensive action dropdown.

Mobile Card Layout

On mobile devices (below the md breakpoint), the table transforms into stacked cards. Each card shows:

  • Customer avatar with initial, party name, customer ID, and phone number
  • Route (origin → destination) with document count badge
  • Creation date and the three-dot action menu

Customer Information Display

  • Avatar: A rounded square avatar with the first letter of the party name, using theme-aware background colors (gray-100 in light, gray-800 in dark).
  • Party Name:The primary customer name from the linked quotation. If no quotation is linked, displays "N/A".
  • Customer ID: The unique internal identifier for the customer record.
  • Phone Link:The customer's mobile number is a clickable tel:link that opens your device's calling application.
  • Route Colors: Origin city is styled with success text color (green), destination with danger text color (red), making the direction visually intuitive.

Document Linking System

The document linking system is the core of the Customer Management module. It allows you to associate up to 9 different logistics document types with each customer, creating a centralized document repository.

Linked Document Badge

Each customer row displays a pill-shaped badge showing the count of linked documents (e.g., "3/9"). The badge styling changes based on linkage status:

  • Linked (≥1): Uses the brand theme background color, indicating active document associations.
  • Unlinked (0): Uses a neutral gray background, indicating no documents have been linked yet.
  • Click to Link: Clicking the badge opens the LinkDocsModal where you can associate documents.

Link Docs Modal

The Link Docs modal provides an interface to connect existing documents to a customer profile. It accepts the customer ID and pre-populates with any existing linked data.

  • Pre-populated Data: If documents are already linked, the modal loads them automatically for editing.
  • Success Feedback:After successful linking, a green success toast appears ("Documents linked successfully") and the parent data refreshes via the onLinkDocsSuccess callback.
  • Company Theme:The modal inherits the company's theme colors for consistent branding.

Document Number Storage

Each document type stores its unique number in the customer record:

DocumentStorage KeyExample Value
LRlr_numberLR-2024-001
Invoiceinvoice_numberINV-2024-089
Vehicle Conditionvc_numberVC-2024-012
Packing Listgr_numberGR-2024-023
Money Receiptrec_numberMR-2024-067
FOVfov_numberFOV-2024-005
NOCnoc_numberNOC-2024-003
TWStws_numberTWS-2024-018

9 Document Types Supported

BSTD supports linking and managing 9 distinct logistics document types. Each type has its own page route, API endpoint, and document number field.

LR

Lorry Receipt

Route: /v1/lr · API: lr · Key: lr_number

INV

Tax Invoice

Route: /v1/invoice · API: invoice · Key: invoice_number

VC

Vehicle Condition

Route: /v1/vehicle-condition · API: vc · Key: vc_number

PL

Packing List

Route: /v1/packing-list · API: gr · Key: gr_number

MR

Money Receipt

Route: /v1/money-receipt · API: mr · Key: rec_number

FOV

Freight on Value

Route: /v1/fov · API: fov · Key: fov_number

NOC

No Objection Certificate

Route: /v1/noc · API: noc · Key: noc_number

TWS

Transport Work Sheet

Route: /v1/tws · API: tws · Key: tws_number

Edit vs. Create Workflow

From the dropdown menu, each document type provides smart routing:

  • Edit Existing: If a document number exists for that type, the link opens the document editor in edit mode (e.g., /v1/lr?edit=LR-2024-001).
  • Create New:If no document is linked, the link opens the document creator pre-filled with the customer's quotation number (e.g., /v1/lr?quotation=QT-2024-001).
  • Visual Indicators:Each document row in the dropdown shows a pencil icon and clearly labels whether you're editing an existing document or creating a new one.

Instant PDF Viewer

For any linked document, you can instantly view its PDF without navigating away from the customer dashboard. The PDF viewer is optimized for zero caching and memory leak prevention.

PDF Generation

  • No Cache: Every PDF request appends a cache-busting query parameter (_cb=timestamp) to ensure you always see the latest version.
  • Blob URL Lifecycle: PDFs are fetched as blobs, converted to temporary object URLs, opened in a new tab, and automatically revoked after 8 seconds to prevent memory leaks.
  • Popup Blocker Safe: PDFs open via a hidden anchor element with target="_blank" andrel="noopener noreferrer", avoiding popup blocker issues and double-window problems.
  • Debounced Clicks: A 1.2-second lock prevents accidental double-clicks from generating duplicate PDF requests.

Supported PDF Types

The PDF viewer supports all 9 document types through dedicated API endpoints:

  • LR PDF — Generated via api.lr.generatePdf(docId, "consignor", cacheBuster)
  • Tax Invoice PDF — api.invoices.generatePdf(docId, cacheBuster)
  • Vehicle Condition PDF — api.vc.generatePdf(docId, cacheBuster)
  • Packing List PDF — api.gr.generatePdf(docId, cacheBuster)
  • Money Receipt PDF — api.mr.generatePdf(docId, cacheBuster)
  • FOV PDF — api.fov.generatePdf(docId, cacheBuster)
  • NOC PDF — api.noc.generatePdf(docId, cacheBuster)
  • TWS PDF — api.tws.generatePdf(docId, cacheBuster)
Note:The PDF viewer eye icon only appears in the dropdown menu when a document is actually linked. If no document number exists for a type, the view button is hidden and only the "New [Type]" option is shown.

Secure Document Sharing

The Share feature allows you to generate secure, token-based links for sharing customer documents with clients via WhatsApp, email, or any messaging platform.

Share Modal

  • Customer ID: The modal is scoped to the selected customer, ensuring only their documents are included in the share.
  • Customer Phone:The customer's phone number (from the linked quotation) is passed to the modal for pre-filling sharing options.
  • Token-Based Security: Generated links use encrypted tokens to ensure secure, time-limited access. Links expire automatically and cannot be accessed without the proper token.
  • WhatsApp Integration: The modal supports direct WhatsApp sharing with automatic message formatting.
  • Company Theme:The Share Modal inherits the company's theme colors for consistent branding.
Security Note: Shared links are never publicly indexed or permanently available. Each link is tied to a specific customer and document set, and access is controlled through encrypted tokens that can be revoked at any time.

Deleting Customers

Customer deletion is protected by multiple safeguards to prevent accidental data loss.

Delete Flow

  1. Click Delete: From the dropdown menu, select Delete. The menu closes immediately.
  2. Confirmation Modal:A styled modal appears (not a native browser alert) with a red warning icon, the customer's party name prominently displayed, and a clear warning that the action cannot be undone.
  3. Cancel Option: Clicking Cancel, the backdrop, or the X button safely dismisses the modal without any deletion.
  4. Confirm Delete: Clicking the red Delete button triggers the onDelete callback, which makes a single API call to remove the customer.
  5. Toast Feedback:After deletion, a success toast appears ("Customer deleted successfully"). If the API call fails, an error toast displays the error message.

Delete Confirmation Modal Design

  • Red Warning Icon: A circular red background with a trash icon visually signals the destructive nature.
  • Customer Name Display: The party name (or customer ID as fallback) is shown in bold to confirm the target.
  • Theme-aware Styling:The modal uses the current theme's card background, border, and text colors for consistent appearance.

Infinite Scroll Pagination

The customer list uses infinite scroll pagination to handle large datasets efficiently without overwhelming the browser or the user.

How It Works

  • Batch Size: Initially loads 10 customers. As you scroll, additional batches of 10 are loaded automatically.
  • Sorting: Customers are sorted by creation date in descending order (newest first) before pagination is applied.
  • Loading Indicator:When fetching the next batch, a spinning loader with "Loading more..." text appears at the bottom of the list.
  • Search Compatibility: Infinite scroll works seamlessly with search filtering — only filtered results are paginated.
  • Hook-based: Powered by theuseInfiniteScroll custom hook for clean, reusable logic.

Responsive Design

The Customer Management module is fully responsive, adapting its layout from mobile phones to large desktop monitors.

Layout Breakpoints

Mobile (< 768px)

  • • Stacked card layout
  • • Full-width customer cards
  • • Compact action dropdown
  • • Search bar stacks below header

Desktop (≥ 768px)

  • • Full data table with columns
  • • Horizontal header with search
  • • Row-based document badges
  • • Optimized for wide screens
  • Table Overflow: The desktop table supports horizontal scrolling via overflow-x-auto for narrow viewports that still meet the desktop breakpoint.
  • Touch Targets: All interactive elements (buttons, dropdown triggers) maintain adequate touch target sizes for mobile usability.
  • Text Truncation: Long party names are truncated with truncate and min-w-0classes to prevent layout breaking.

Dark Mode & Theme Support

The entire Customer Management module adapts seamlessly to both light and dark themes through the useThemeColors hook.

  • Dynamic Colors: All backgrounds, borders, text, and input colors are determined by the theme hook and update instantly when the system theme changes.
  • Avatar Backgrounds: Customer avatars use gray-100 in light mode and gray-800in dark mode for optimal contrast.
  • Table Hover: Row hover states use theme-aware colors for subtle highlighting without jarring transitions.
  • Dropdown Styling: The fixed dropdown menu inherits card background, border, and text colors from the active theme.
  • Company Theme Override: If a company has a custom theme configured, it is passed to all child components (modals, dropdowns, toasts) for brand consistency.

Security & User Experience

BSTD implements multiple layers of security safeguards and UX optimizations to ensure reliable, safe customer data management.

UX Safeguards

  • Toast Notifications: All actions (delete, link, PDF open) provide immediate visual feedback via positioned toast notifications that auto-dismiss after 3 seconds.
  • Confirmation Modals: Destructive actions (delete) require explicit confirmation through styled modal dialogs, not native browser alerts.
  • PDF Debouncing: 1.2-second click lock prevents duplicate PDF generation requests and server overload.
  • Memory Management: Blob URLs are revoked after 8 seconds to prevent browser memory leaks from accumulated object URLs.
  • Error Handling: Failed API calls (PDF generation, deletion) display descriptive error toasts instead of silent failures.
  • No Cache PDFs: Cache-busting timestamps ensure every PDF view reflects the latest document state, preventing stale data display.

Data Security

  • Authenticated Access: All API calls are protected through authenticated user sessions.
  • Token-Based Sharing: Shared document links use encrypted, time-limited tokens that cannot be guessed or reverse-engineered.
  • No Public Indexing: Customer data and shared content are never exposed publicly or indexed by search engines.
  • CSRF Protection: All state-changing operations include CSRF token validation.
Note: This module is meticulously optimized for seamless experiences across web, mobile, and tablet devices. The responsive table-to-card layout, viewport-aware dropdowns, and infinite scroll ensure smooth performance even with thousands of customer records. No sensitive API endpoints are directly exposed in the front-end, ensuring robust security measures are maintained at all times.