@@ -29,6 +29,17 @@ class Opportunity extends Model
|
||||
|
||||
protected $hidden = ['management_draft', 'management_creation_key', 'management_version', 'first_submitted_at', 'management_closed_once', 'owner_user_id', 'organization_id', 'workflow_context'];
|
||||
|
||||
protected $appends = ['maturity_catalogue_version'];
|
||||
|
||||
public function getMaturityCatalogueVersionAttribute(): ?string
|
||||
{
|
||||
// Only published metadata is public; never expose the current private draft.
|
||||
$version = data_get($this->workflow_context, 'publication.maturity.catalogue_version');
|
||||
|
||||
return in_array($version, [\App\Services\OpportunityMaturity::VERSION, \App\Services\OpportunityMaturity::LEGACY], true)
|
||||
? $version : null;
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'sector_id', 'reference', 'title', 'slug', 'summary', 'description',
|
||||
'province', 'district', 'promoter_name', 'promoter_type',
|
||||
|
||||
Reference in New Issue
Block a user