Skip to content

Commit ba02cff

Browse files
authored
new filter by submission_status (#154)
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 760d51b commit ba02cff

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

app/Http/Controllers/Apis/Protected/Summit/Strategies/events/RetrieveSummitEventsStrategy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ protected function getValidFilters()
201201
'duration' => ['>', '<', '<=', '>=', '=='],
202202
'speakers_count' => ['>', '<', '<=', '>=', '=='],
203203
'streaming_type' => ['=='],
204+
'submission_status' => ['=='],
204205
];
205206
}
206207

@@ -248,6 +249,7 @@ protected function getFilterValidatorRules(): array
248249
'streaming_url' => 'sometimes|string',
249250
'etherpad_link' => 'sometimes|string',
250251
'streaming_type' => 'sometimes|string|in:VOD,LIVE',
252+
'submission_status' => 'sometimes|string|in:Accepted,Received,NonReceived',
251253
];
252254
}
253255
}

app/Repositories/Summit/DoctrineSummitEventRepository.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,23 @@ protected function getCustomFilterMappings(int $current_member_id, int $current_
250250
'created' => 'e.created:datetime_epoch',
251251
'last_edited' => 'e.last_edited:datetime_epoch',
252252
'tags' => "t.tag",
253+
'submission_status' => new DoctrineSwitchFilterMapping
254+
(
255+
[
256+
'Accepted' => new DoctrineCaseFilterMapping(
257+
'Accepted',
258+
"p.status = 'Received' AND e.published = 1"
259+
),
260+
'Received' => new DoctrineCaseFilterMapping(
261+
'Received',
262+
"p.status = 'Received' AND e.published = 0"
263+
),
264+
'NonReceived' => new DoctrineCaseFilterMapping(
265+
'NonReceived',
266+
"p.status is null"
267+
)
268+
]
269+
),
253270
'summit_id' => new DoctrineJoinFilterMapping
254271
(
255272
'e.summit',

0 commit comments

Comments
 (0)