# Lead Prospecting — apply

    cp -R lead-prospecting/app/*      ./app/
    cp -R lead-prospecting/config/*   ./config/
    cp -R lead-prospecting/database/* ./database/
    cp -R lead-prospecting/resources/* ./resources/
    cp -R lead-prospecting/tests/*    ./tests/

## 1. Routes — inside the auth group:
    Route::get('/prospecting', [\App\Http\Controllers\ProspectingController::class, 'index'])->name('prospecting');
    Route::post('/prospecting/rematch', [\App\Http\Controllers\ProspectingController::class, 'rematch'])->name('prospecting.rematch');

## 2. Register the command in bootstrap/app.php ->withCommands([...]) or rely on
   auto-discovery if app/Prospecting/Console is scanned.

## 3. Sidebar — add "Prospecting" (Target icon) to the Platform nav.

## 4. Migrate + test
    php artisan migrate --force
    php artisan test --filter=Prospecting

## 5. Give locations coordinates (needed for radius search)
Locations gained latitude/longitude/zip columns. Populate them once — from the Rentec
property address, a geocoder, or by hand for 14 rows.

## 6. Load ZIP centroids (free, one-off)
The `zip_centroids` table drives distance without per-address geocoding. Import any
public ZIP-centroid dataset (e.g. a US ZIP code database CSV with zip, lat, lng):

    -- example
    LOAD DATA LOCAL INFILE 'zips.csv' INTO TABLE zip_centroids
    FIELDS TERMINATED BY ',' IGNORE 1 LINES (zip, latitude, longitude, city, state);

## 7. Import licence data
    php artisan prospects:import /path/to/tdlr-cosmetology.csv --profession=cosmetology --match
    php artisan prospects:import /path/to/tdlr-barbers.csv --profession=barber --match

The importer accepts whatever headers the registry uses — it maps common aliases
(License Number / License # / Lic No …) and keeps the untouched row in `raw`.

## ⚠️ What's built vs what you still need
BUILT: schema, alias-tolerant importer, ZIP-centroid geocoding, tenant + Salesforce
cross-referencing, haversine radius search, the six profession sub-tabs, all filters,
stat tiles and CSV export — with tests.

NOT BUILT: the scraper itself. The reference tool pulls from public state licence
registries; that's a per-state scraping job (TDLR search pages, pagination, throttling)
and belongs in its own scheduled command. Right now data comes in via CSV, which also
means a state that publishes bulk downloads needs no scraper at all.

Also note the reference "Competition" column appears to group salons sharing an address —
easy to add once real data is loaded and the pattern is visible.
