Add guided imported history wizard

This commit is contained in:
Codex
2026-07-10 17:33:27 -05:00
parent 24f73084fa
commit 3b856b5e46
12 changed files with 371 additions and 29 deletions
+42 -1
View File
@@ -9,16 +9,37 @@ use Illuminate\Database\Eloquent\Model;
#[Fillable([
'provider_profile_id', 'platform', 'external_id', 'profile_url', 'status',
'rating', 'review_count', 'completed_jobs', 'metrics', 'review_snapshots',
'visibility', 'verification_status', 'verified_by_id', 'verified_at',
'rating', 'review_count', 'completed_jobs', 'work_categories', 'endorsements',
'operational_metrics', 'metrics', 'review_snapshots', 'selected_reviews',
'notes', 'imported_at',
])]
class ExternalProfileImport extends Model
{
public const VISIBILITIES = [
'private' => 'Private only',
'summary' => 'Public summary only',
'selected_reviews' => 'Public selected reviews',
'proof_public' => 'Public proof attachments',
];
public const VERIFICATION_STATUSES = [
'unverified' => 'Unverified imported history',
'provider_attested' => 'Provider attested',
'admin_verified' => 'Admin verified',
'needs_more_proof' => 'Needs more proof',
];
protected function casts(): array
{
return [
'work_categories' => 'array',
'endorsements' => 'array',
'operational_metrics' => 'array',
'metrics' => 'array',
'review_snapshots' => 'array',
'selected_reviews' => 'array',
'verified_at' => 'datetime',
'imported_at' => 'datetime',
];
}
@@ -28,8 +49,28 @@ class ExternalProfileImport extends Model
return $this->belongsTo(ProviderProfile::class);
}
public function verifiedBy(): BelongsTo
{
return $this->belongsTo(User::class, 'verified_by_id');
}
public function attachments(): MorphMany
{
return $this->morphMany(Attachment::class, 'attachable');
}
public function publiclyVisible(): bool
{
return $this->visibility !== 'private';
}
public function canShowSelectedReviews(): bool
{
return in_array($this->visibility, ['selected_reviews', 'proof_public'], true);
}
public function canShowProofAttachments(): bool
{
return $this->visibility === 'proof_public';
}
}