-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into #126-problem-with-dep…
…loyment # Conflicts: # .github/workflows/deploy-to-beta-by-push.yml
- Loading branch information
Showing
120 changed files
with
501 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,6 @@ concurrency: | |
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Keating\Enums\ClassType; | ||
use Keating\Models\Course; | ||
|
||
readonly class CourseData | ||
{ | ||
public function __construct( | ||
public string $id, | ||
public string $name, | ||
public string $abbreviation, | ||
public string $description, | ||
public string $semester, | ||
public string $type, | ||
) {} | ||
|
||
public static function fromModel(Course $course): self | ||
{ | ||
return new self( | ||
id: $course->id, | ||
name: $course->name, | ||
abbreviation: $course->abbreviation, | ||
description: $course->description, | ||
semester: $course->getRomanizedSemester(), | ||
type: ClassType::labels()[$course->type], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Illuminate\Support\Collection; | ||
use Keating\Enums\ClassType; | ||
use Keating\Enums\SemesterName; | ||
use Keating\Models\Course; | ||
|
||
readonly class CoursePublicData | ||
{ | ||
public function __construct( | ||
public string $id, | ||
public string $name, | ||
public string $abbreviation, | ||
public string $slug, | ||
public string $description, | ||
public string $semester, | ||
public string $semesterName, | ||
public string $type, | ||
public string $typeAbbreviation, | ||
public string $field, | ||
public string $fieldAbbreviation, | ||
public bool $active, | ||
) {} | ||
|
||
public static function fromModel(Course $course, ?Collection $activeSemesters = null): self | ||
{ | ||
return new self( | ||
id: $course->id, | ||
name: $course->name, | ||
abbreviation: $course->abbreviation, | ||
slug: $course->slug, | ||
description: $course->description, | ||
semester: $course->getRomanizedSemester(), | ||
semesterName: SemesterName::labels()[$course->semester_name], | ||
type: ClassType::labels()[$course->type], | ||
typeAbbreviation: ClassType::abbreviationLabels()[$course->type], | ||
field: $course->field->name, | ||
fieldAbbreviation: $course->field->abbreviation, | ||
active: $activeSemesters && ($activeSemesters->contains($course->getRomanizedSemester()) || $activeSemesters->contains($course->semester)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Keating\Models\CourseSemester; | ||
|
||
readonly class CourseSemesterData | ||
{ | ||
public function __construct( | ||
public string $id, | ||
public string $course, | ||
public string $semester, | ||
public string $semesterId, | ||
public int $groupsCount, | ||
) {} | ||
|
||
public static function fromModel(CourseSemester $course): self | ||
{ | ||
return new self( | ||
id: $course->id, | ||
course: $course->course->name, | ||
semester: $course->semester->name, | ||
semesterId: $course->semester->id, | ||
groupsCount: $course->groups_count ?? $course->groups->count(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Keating\Models\Field; | ||
|
||
readonly class FieldData | ||
{ | ||
public function __construct( | ||
public string $id, | ||
public string $name, | ||
public string $abbreviation, | ||
) {} | ||
|
||
public static function fromModel(Field $field): self | ||
{ | ||
return new self( | ||
id: $field->id, | ||
name: $field->name, | ||
abbreviation: $field->abbreviation, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Keating\Enums\StudyForm; | ||
use Keating\Models\Group; | ||
|
||
readonly class GroupData | ||
{ | ||
public function __construct( | ||
public string $id, | ||
public string $name, | ||
public string $formAbbreviation, | ||
public string $form, | ||
) {} | ||
|
||
public static function fromModel(Group $group): self | ||
{ | ||
return new self( | ||
id: $group->id, | ||
name: $group->name, | ||
formAbbreviation: StudyForm::abbreviationLabels()[$group->form->value], | ||
form: $group->form->value, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
namespace Keating\Enums; | ||
|
||
enum ClassType: string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
namespace Keating\Enums; | ||
|
||
enum Icons: string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
namespace Keating\Enums; | ||
|
||
enum SectionType: string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
namespace Keating\Enums; | ||
|
||
enum SemesterName: string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
namespace Keating\Enums; | ||
|
||
enum StudyForm: string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.