Rewrite tabulation #14

Merged
okorpheus merged 43 commits from rewrite-tabulation into master 2024-07-14 05:36:29 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 1501764a51 - Show all commits

View File

@ -39,6 +39,7 @@ class DoublerService
*/
protected function findDoublersForEvent(Event $event, string $mode = 'seating'): array
{
// TODO add scoped entry queries to the event model
$this->validateEvent($event);
$entries = $event->entries()->with('audition')->with('student')->get();
$entries = match ($mode) {

View File

@ -67,12 +67,12 @@ it('returns doublers for an event', function () {
$return = $this->doublerService->doublersForEvent($concertEvent);
expect(count($return))->toBe(2)
->and($return[1000]['student']->id)->toBe($allSaxDude->id)
->and($return[1000]['student_id'])->toBe($allSaxDude->id)
->and($return[1000]['entries']->count())->toBe(3)
->and($return[1001]['entries']->count())->toBe(2);
assertArrayNotHasKey(1002, $return);
$return = $this->doublerService->doublersForEvent($jazzEvent);
expect(count($return))->toBe(1)
->and($return[1000]['student']->id)->toBe($allSaxDude->id)
->and($return[1000]['student_id'])->toBe($allSaxDude->id)
->and($return[1000]['entries']->count())->toBe(3);
});