T003-T018b: Add workspace_baselines.view/manage capabilities, role mappings, baseline_capture/baseline_compare operation labels, severity summary keys, 5 migrations, 4 models, 4 factories, BaselineScope, BaselineReasonCodes, BaselineProfileStatus badge domain + mapper.
41 lines
905 B
PHP
41 lines
905 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Support\Concerns\DerivesWorkspaceIdFromTenant;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class BaselineTenantAssignment extends Model
|
|
{
|
|
use DerivesWorkspaceIdFromTenant;
|
|
use HasFactory;
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $casts = [
|
|
'override_scope_jsonb' => 'array',
|
|
];
|
|
|
|
public function workspace(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Workspace::class);
|
|
}
|
|
|
|
public function tenant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function baselineProfile(): BelongsTo
|
|
{
|
|
return $this->belongsTo(BaselineProfile::class);
|
|
}
|
|
|
|
public function assignedByUser(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'assigned_by_user_id');
|
|
}
|
|
}
|