Skip to Content
Ranlanka CRM documentation — pre-release, subject to change.
FeaturesCustomer Management

Customer Management

Onboarding & Pre-Verification

Consultants or admins onboard new clients via a structured two-step workflow designed to prevent duplicate client profiles:

  • Step 1: Mandatory Identity & Duplicate Check — Before remaining customer fields unlock, staff enter the customer’s NIC Number, Passport Number, and Primary Phone Number.
    • The system performs a backend duplicate lookup matching against existing customer records (checking NIC, primary phone, primary passport number, and dual citizenship passport number).
    • If a duplicate match is found, an inline warning displays the existing customer’s name and matched identity field, providing a direct 1-click navigation link to open their existing Dossier rather than creating a duplicate profile.
    • When verified, all three identity fields (NIC, Passport Number, and Primary Phone) are securely locked and disabled (disabled={true}) to preserve verification integrity.
  • Step 2: Profile Completion & Automatic Pre-Filling — Once verified, the customer’s remaining details (Full Name, Date of Birth, Email, Nationality, Secondary Phone, Residential Address, Staff Assignment, Notes, and Initial Document Slots) unlock.
    • The verified Passport Number is automatically carried over, pre-filled, and shown disabled in the customer form and any subsequent Passport Details filling modals.
    • On submission, the customer profile is created and their passport number is automatically saved.
    • On creation, the customer receives an automated, branded welcome email introducing their assigned consultant.

Assignment & transfers

Admins assign customers to specific staff at creation, or transfer them later — a transfer triggers an automated notification email to the customer. Client transfer (CustomerService.transferCustomer) is an administrative and cross-consultant workflow and is deliberately exempt from @RequireOwnership restrictions, ensuring consultants and managers can reallocate client accounts without permission conflicts.

Client directory

A paginated, searchable directory is available from the sidebar to every role, with staff-assignment tracking — but the rows shown differ by role: admins/owners see every client in the system, while other staff see only clients assigned to them. The scoping happens on the backend, so it’s the same page and list view for everyone, just different data underneath.

Client dossier

A dedicated view per client showing all their cases, documents, and preferences. Consultants manage their own clients; admins are restricted from editing another staff member’s client (add-service / edit-profile actions are disabled for anyone but the assigned consultant or an admin acting within their own scope).

Lifetime spend & past journeys

The dossier’s stat tiles show real, aggregated numbers — total paid-invoice amount and completed visa/flight case count for the customer — computed live rather than mocked.

Preferences

Dietary, aviation, and accommodation preferences are tracked per client and surface throughout the booking workflow.

Documents & File Vault

Customers have a dedicated Documents & Files tab in the client dossier providing a structured, high-performance file repository:

  • Human-Readable Cloudflare R2 Hierarchy — Files are organized deterministically by client name and UUID (e.g. customers/{name}_{id}/visas/{visaId}/issued_visa/, customers/{name}_{id}/tickets/{flightId}/issued_ticket/, customers/{name}_{id}/passports/, customers/{name}_{id}/documents/{type}/).
  • Deterministic File Annotation — Documents are automatically assigned standardized filenames based on context (e.g. 2026-08-23_eVisa_business_3M_SE_3fa85f64.pdf, 2026-08-23_Ticket_EK_PNR-ABC123_3fa85f64.pdf, 2026-08-23_passport_N8912345_3fa85f64.pdf), with custom descriptions and staff override support.
  • Two-Tier Safe Download Engine — Downloads leverage a dual-strategy engine in downloadUtils.ts:
    • Tier 1 (Blob In-Memory): Fetches binary content directly into memory and downloads via createObjectURL(blob), bypassing browser pop-up blockers and strictly preserving custom annotated filenames.
    • Tier 2 (Anchor Fallback): Automatically falls back to a clean top-level anchor with download attribute and rel="noopener noreferrer" (without target="_blank"), preventing modern browser download interventions.
    • Presigned URL Self-Healing: If a cached signed link expires or returns a 403/404, download actions automatically request a fresh presigned URL from the backend and retry without user friction.
  • Sticky Actions Column — The Documents table features a pinned sticky right-0 actions column with aligned headers, ensuring download and delete actions remain accessible when scrolling wide file lists.
  • Passport Vault & Multi-Scan Viewer — Clicking any passport card in the vault opens a comprehensive viewer modal:
    • Multi-Scan Pill Switcher: Easily switch between multiple uploaded scans (renewals, dual passports, stamped pages) with actual filenames and upload dates.
    • Newest-First Chronology: Passport files are sorted by upload timestamp descending, displaying a green Latest badge on the most recent scan.
    • Image Error Boundary & Recovery: If a storage key is archived or unreachable, the modal displays a styled recovery card with options to Download File Directly or Retry Link rather than an unhelpful broken image icon.
    • Interactive Controls: Features click-to-zoom (Fit / 125% Zoom), Open in New Tab, Upload New Scan, and Edit Details.
  • Strict Magic-Byte Validation — The backend enforces byte-level signature detection for PDF (%PDF-), PNG, and JPEG formats, preventing MIME spoofing and disguised executables.
  • Category Filtering & Search — Filter instantly by Passports, Visas, Tickets, Bank Statements, or Employment Letters, and search by filename or notes.

Customer deletion & recovery

Deleting a customer is a soft delete, not a hard delete — nothing is actually destroyed. It also cascades: every related record (invoices, receipts, visa requests, flight requests, tickets, quotes, documents) is soft-deleted along with the customer, and all of it is transparently hidden from normal views and searches from that point on.

There is currently no in-app restore for a deleted customer. Recovery is technically possible — the data is still in the database — but only a developer can do it, by clearing the deletion marker directly at the database level. If you delete a customer by mistake, treat it as recoverable-but-not-self-service: contact whoever manages the database rather than assuming an undo button exists somewhere.

Last updated on