Add external import sources, work history, screening fields and Phase 1 docs

- New ExternalImportSource and ExternalWorkHistoryEntry models, controller and migrations
- Screening fields on external profile imports
- Admin and provider profile views, routes and workflow tests updated
- Phase 1 validation, route inventory, gap report template and roadmap docs
- Add the Google Sheets work-order parser tool (tools/google-sheets-wo-parser)
This commit is contained in:
Codex
2026-10-02 15:50:18 -05:00
parent 0670f48878
commit 62220186af
37 changed files with 3284 additions and 4 deletions
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('external_import_sources', function (Blueprint $table) {
$table->id();
$table->foreignId('provider_profile_id')->constrained()->cascadeOnDelete();
$table->foreignId('external_profile_import_id')->nullable()->constrained()->nullOnDelete();
$table->foreignId('uploaded_by_id')->constrained('users')->cascadeOnDelete();
$table->string('platform');
$table->string('source_type');
$table->string('parse_status')->default('pending');
$table->string('review_status')->default('needs_review');
$table->string('disk')->default('local');
$table->string('path');
$table->string('original_name');
$table->string('mime_type')->nullable();
$table->unsignedBigInteger('size')->default(0);
$table->text('provider_notes')->nullable();
$table->json('parsed_payload')->nullable();
$table->json('parse_warnings')->nullable();
$table->timestamp('uploaded_at')->nullable();
$table->timestamps();
$table->index(['provider_profile_id', 'platform']);
$table->index(['parse_status', 'review_status']);
});
}
public function down(): void
{
Schema::dropIfExists('external_import_sources');
}
};
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('external_work_history_entries', function (Blueprint $table) {
$table->id();
$table->foreignId('provider_profile_id')->constrained()->cascadeOnDelete();
$table->foreignId('external_profile_import_id')->constrained()->cascadeOnDelete();
$table->foreignId('external_import_source_id')->nullable()->constrained()->nullOnDelete();
$table->string('platform');
$table->string('external_work_order_id')->nullable();
$table->string('service_title');
$table->date('performed_on')->nullable();
$table->string('customer_name')->nullable();
$table->string('work_type')->nullable();
$table->string('location')->nullable();
$table->decimal('rating', 3, 2)->nullable();
$table->string('status')->nullable();
$table->string('source_url')->nullable();
$table->string('visibility')->default('private');
$table->json('raw_payload')->nullable();
$table->timestamps();
$table->index(['provider_profile_id', 'platform', 'performed_on']);
$table->index(['external_profile_import_id', 'performed_on']);
$table->unique(['external_profile_import_id', 'platform', 'external_work_order_id'], 'external_work_history_unique_order');
});
}
public function down(): void
{
Schema::dropIfExists('external_work_history_entries');
}
};
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('external_profile_imports', function (Blueprint $table) {
$table->string('background_check_status')->nullable()->after('verification_status');
$table->string('background_check_date')->nullable()->after('background_check_status');
$table->string('drug_test_status')->nullable()->after('background_check_date');
$table->string('drug_test_date')->nullable()->after('drug_test_status');
});
}
public function down(): void
{
Schema::table('external_profile_imports', function (Blueprint $table) {
$table->dropColumn([
'background_check_status',
'background_check_date',
'drug_test_status',
'drug_test_date',
]);
});
}
};