> ## Documentation Index
> Fetch the complete documentation index at: https://brokeros.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# The Mobile Lead Calling Queue

> How the pre-sales telecaller daily queue is assembled, prioritized by lead temperature, executed via auto-dialer, and tracked against daily targets.

## What is the Calling Queue?

The calling queue is the prioritized list of prospective buyers a pre-sales agent is assigned to contact during their shift. Mounted directly on the home screen of the `PRE_SALES` workspace (`apps/mobile/app/(dashboard)/pre-sales/index.tsx`), it eliminates manual spreadsheet lookups and ensures high-priority prospects are contacted immediately.

The queue is dynamically generated by the backend based on:

1. **Uncontacted Leads**: Newly ingested leads assigned to the telecaller (`status = PENDING` or `NOT_CONNECTED`).
2. **Scheduled Follow-Ups**: Prospects previously scheduled for follow-up on today's date (`FollowUp.scheduledAt = TODAY`).
3. **Daily Performance Targets**: Daily cold-call targets assigned by the Pre-Sales Manager (`ManagerTask.targetCalls`).

***

## Queue Prioritization Hierarchy

The mobile application sorts available leads according to urgency:

| Priority Rank | Category | Selection Rationale |
| :- | :- | :- |
| **1 (Highest)** | **Follow-ups Due Today** | Explicit commitment made to the homebuyer to contact them today. |
| **2** | **HOT Leads** | High buying intent (budget confirmed, site visit requested). |
| **3** | **WARM Leads** | Engaged buyers comparing floor plans or financing options. |
| **4** | **COLD / New Leads** | Fresh marketing inquiries requiring initial qualification. |

***

## Dialing & Disposition Workflow

**1. Review Lead Details**

The queue card displays the prospect's name, phone number, project of interest, inquiry source (Meta Ads, Google, Website), and notes from previous calls.

**2. Trigger Native Call**

The telecaller taps **Call Next**. The custom native module invokes `dialNumber(phoneNumber)`, initiating an outbound telephone call directly through the device's SIM card.

**3. Live Call Tracking**

The mobile app detects the `onCallStarted` event. The live call timer begins on screen, and the agent's status shifts to **On Call** across manager dashboards.

**4. Call Completion & Disconnection**

When either party disconnects, the native module captures the `onCallEnded` event and displays the **Call Disposition Modal**.

**5. Select Disposition Outcome**

The telecaller selects the outcome of the interaction:

| Disposition | Next System Action |
| :- | :- |
| **Interested** | Marks lead as HOT. Prompts for Site Visit scheduling or follow-up date. |
| **Site Visit Scheduled** | Triggers creation of a `SiteVisit` record for the Sales Executive team. |
| **Call Back Later** | Opens date/time picker. Schedules future reminder in `FollowUp` table. |
| **Not Connected / Busy** | Increments attempt counter. Retains lead in queue for later attempt. |
| **Not Interested / Lost** | Marks lead as lost, requiring mandatory reason selection. |
| **Wrong Number** | Flags contact information for data hygiene verification. |

Telecallers can also dictate or type interaction notes before saving.

**6. Automatic Queue Progression**

Submitting the disposition syncs the call record with the backend and automatically advances to the next lead in the queue.

***

## Daily Target Tracking

At the top of the pre-sales workspace, agents see their live target progress widget:

```
Daily Target:   80 calls
Calls Made:     48 / 80  [==============......] 60%
Connected:      32 calls
Follow-Ups Set: 6 leads
```

Daily targets are assigned each morning by the Pre-Sales Manager via the `ManagerTask` module. If an agent falls behind expected hourly pacing, the progress indicator displays an amber alert; meeting or exceeding targets illuminates a green achievement indicator.

***

## Automated Follow-Up Reminders

When a telecaller sets a follow-up callback:

1. The record is persisted in the database linked to the `Lead` and `User`.
2. At 9:00 AM on the scheduled date, Firebase Cloud Messaging (FCM) transmits a push notification alert.
3. The lead is placed at the top of the telecaller's calling queue (Priority 1).
4. Any follow-ups not completed by the end of the day are flagged in the Pre-Sales Manager's daily performance exceptions report.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.