diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 5f6e62b19..80d347f7f 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -20,15 +20,24 @@ public function getEventType(): string public function getPublishableMessage(): array { return [ - 'expert_panel' => [ - 'id' => $this->group->uuid, - 'name' => $this->group->displayName, - 'type' => $this->group->fullType->name, - 'affiliation_id' => $this->group->expertPanel->affiliation_id - ], + 'expert_panel' => array_merge( + [ + 'id' => $this->group->uuid, + 'name' => $this->group->name, + 'short_name' => $this->group->expertPanel->short_base_name, + 'status' => $this->group->groupStatus->name, + 'parent_group' => $this->group->parentGroup?->name, // TODO: check representation when no parent: null or empty string? + 'type' => $this->group->fullType->name, + 'affiliation_id' => $this->group->expertPanel->affiliation_id, + 'scope_description' => $this->group->expertPanel->scope_description, + ], + // Conditionally add vcep field below if type is 'vcep' + $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], + ) ]; } + public function mapGeneForMessage($gene): array { $messageGene = [ diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index 6fbb777b3..0a9d11ed7 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -268,4 +268,9 @@ protected static function newFactory() { return new GroupFactory(); } + + public function parentGroup(): BelongsTo + { + return $this->belongsTo(Group::class, 'parent_id', 'id'); + } } diff --git a/config/dx.php b/config/dx.php index cae08a0eb..a0bf85b0c 100644 --- a/config/dx.php +++ b/config/dx.php @@ -55,8 +55,8 @@ * The current schema version of messsages sent to a particular topic. */ 'schema_versions' => [ - 'gpm-general-events' => '1.1.0', - 'gpm-person-events' => '1.1.0' + 'gpm-general-events' => '1.9.9', + 'gpm-person-events' => '1.9.9' ] ];