Skip to content

Commit aa3dbff

Browse files
tmbattey-2021bpow
authored andcommitted
enhance group events DEX message for additional fields such as scope description
1 parent 27972a8 commit aa3dbff

5 files changed

Lines changed: 74 additions & 23 deletions

File tree

app/Modules/Group/Events/GroupStatusUpdated.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class GroupStatusUpdated extends GroupEvent
2323
*/
2424
public function __construct(public Group $group, public GroupStatus $newStatus, public GroupStatus $oldStatus)
2525
{
26+
27+
// Only process the event if the status is 2 or 5
28+
if (!in_array($this->group->group_status_id, [2, 3, 4, 5])) {
29+
return;
30+
}
2631
}
2732

2833
public function getLogEntry(): string

app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,28 @@ public function getEventType(): string
1818
}
1919

2020
public function getPublishableMessage(): array
21-
{
22-
return [
23-
'expert_panel' => [
24-
'id' => $this->group->uuid,
25-
'name' => $this->group->displayName,
26-
'type' => $this->group->fullType->name,
27-
'affiliation_id' => $this->group->expertPanel->affiliation_id
28-
],
29-
];
30-
}
21+
{
22+
return [
23+
'expert_panel' => array_merge([
24+
'id' => $this->group->uuid,
25+
'long_name' => $this->group->name,
26+
'short_name' => $this->group->expertPanel->short_base_name,
27+
'status' => optional($this->group->groupStatus)->name, // Retrieve the status name
28+
'group updated date' => $this->group->updated_at,
29+
'parent_group' => optional($this->group->parentGroup)->name,
30+
'type' => $this->group->fullType->name,
31+
'affiliation_id' => $this->group->expertPanel->affiliation_id,
32+
'scope description' => $this->group->expertPanel->scope_description,
33+
],
34+
// Conditionally add vcep fields below if type is 'vcep'
35+
$this->group->fullType->name === 'vcep' ? ['clinvar_id' => null] : [],
36+
$this->group->fullType->name === 'vcep' ? ['clinvar_url' => null] : [],
37+
$this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [],
38+
$this->group->fullType->name === 'vcep' ? ['vspec_web_address' => null] : [],
39+
)
40+
];
41+
}
42+
3143

3244
public function mapGeneForMessage($gene): array
3345
{

app/Modules/Group/groups.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,26 @@
9797
'display_name' => 'Biocurator trainer',
9898
'description' => 'Biocurator trainer designation. No default permissions.',
9999
],
100+
'grant-liaison' => [
101+
'id' => 107,
102+
'name' => 'grant-liaison',
103+
'display_name' => 'Grant Liaison',
104+
'description' => 'Group Grant Liaison.',
105+
],
106+
'annotator' => [
107+
'id' => 108,
108+
'name' => 'annotator',
109+
'display_name' => 'Annotator',
110+
'description' => 'Annotator',
111+
],
112+
113+
'private-member' => [
114+
'id' => 109,
115+
'name' => 'private-member',
116+
'display_name' => 'Private Member',
117+
'description' => 'Private Member of Affinity Group',
118+
],
119+
100120
],
101121
'permissions' => [
102122
'info-edit' => [
@@ -151,4 +171,7 @@
151171
'role_permissions' => [
152172
'coordinator' => [1001,1002,1003,1004,1005,1006, 1007, 1008]
153173
],
154-
];
174+
'role_permissions' => [
175+
'grant-liaison' => [1008]
176+
],
177+
];

config/dx.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
* The current schema version of messsages sent to a particular topic.
5656
*/
5757
'schema_versions' => [
58-
'gpm-general-events' => '1.1.0',
59-
'gpm-person-events' => '1.1.0'
58+
'gpm-general-events' => '2.0.0',
59+
'gpm-person-events' => '2.0.0'
6060
]
6161

6262
];

resources/app/src/configs.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
}
8888
},
8989
"mailFrom": {
90-
"address": "cdwg_oversightcommittee@clinicalgenome.org",
91-
"name": "ClinGen CDWG Oversight Committee"
90+
"address": null,
91+
"name": "GPM"
9292
},
9393
"groups": {
9494
"types": {
@@ -186,6 +186,24 @@
186186
"name": "biocurator-trainer",
187187
"display_name": "Biocurator trainer",
188188
"description": "Biocurator trainer designation. No default permissions."
189+
},
190+
"grant-liaison": {
191+
"id": 107,
192+
"name": "grant-liaison",
193+
"display_name": "Grant Liaison",
194+
"description": "Group Grant Liaison."
195+
},
196+
"annotator": {
197+
"id": 108,
198+
"name": "annotator",
199+
"display_name": "Annotator",
200+
"description": "Annotator"
201+
},
202+
"private-member": {
203+
"id": 109,
204+
"name": "private-member",
205+
"display_name": "Private Member",
206+
"description": "Private Member of Affinity Group"
189207
}
190208
},
191209
"permissions": {
@@ -239,14 +257,7 @@
239257
}
240258
},
241259
"rolePermissions": {
242-
"coordinator": [
243-
1001,
244-
1002,
245-
1003,
246-
1004,
247-
1005,
248-
1006,
249-
1007,
260+
"grant-liaison": [
250261
1008
251262
]
252263
}

0 commit comments

Comments
 (0)