-
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.
- Loading branch information
1 parent
25070fc
commit 7301c7f
Showing
30 changed files
with
452 additions
and
490 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
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
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ class Field extends Model | |
use HasUlids; | ||
|
||
protected $fillable = [ | ||
"id", | ||
"name", | ||
"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
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 |
---|---|---|
|
@@ -5,12 +5,16 @@ | |
namespace Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
use Keating\Enums\SemesterName; | ||
use Keating\Models\Course; | ||
use Keating\Models\CourseSemester; | ||
use Keating\Models\Field; | ||
use Keating\Models\Grade; | ||
use Keating\Models\GradeColumn; | ||
use Keating\Models\Group; | ||
use Keating\Models\Section; | ||
use Keating\Models\SectionSettings; | ||
use Keating\Models\Semester; | ||
use Keating\Models\Setting; | ||
use Keating\Models\Student; | ||
use Keating\Models\User; | ||
|
@@ -20,6 +24,7 @@ class DatabaseSeeder extends Seeder | |
public function run(): void | ||
{ | ||
User::factory()->create(["email" => "[email protected]"]); | ||
|
||
Setting::factory()->create(); | ||
Section::factory(4)->counter()->create(); | ||
Section::factory(3)->about()->create(); | ||
|
@@ -29,12 +34,63 @@ public function run(): void | |
"counters_enabled" => true, | ||
"contact_enabled" => true, | ||
]); | ||
$this->seedGrades(); | ||
|
||
$this->seedRealData(); | ||
} | ||
|
||
protected function seedGrades(): void | ||
protected function seedRealData(): void | ||
{ | ||
$courses = CourseSemester::factory(5)->create(); | ||
$semesters = Semester::factory()->count(5)->sequence( | ||
["name" => "zimowy 2022/23", "active" => false], | ||
["name" => "letni 2022/23", "active" => false], | ||
["name" => "zimowy 2023/24", "active" => false], | ||
["name" => "letni 2023/24", "active" => false], | ||
["name" => "zimowy 2024/25", "active" => true], | ||
)->create(); | ||
|
||
$fields = Field::factory()->count(3)->sequence( | ||
["name" => "Informatyka", "abbreviation" => "INF"], | ||
["name" => "Informatyka, specjalność Programowanie", "abbreviation" => "INF/PAM"], | ||
["name" => "Informatyka, specjalność Grafika", "abbreviation" => "INF/GK"], | ||
)->create(); | ||
|
||
$courses = Course::factory()->count(3)->sequence( | ||
[ | ||
"name" => "Programowanie obiektowe", | ||
"abbreviation" => "PO", | ||
"semester" => 3, | ||
"type" => "laboratory", | ||
"field_id" => $fields[1]->id, | ||
"semester_name" => SemesterName::Winter->value, | ||
], | ||
[ | ||
"name" => "Programowanie systemów internetowych", | ||
"abbreviation" => "PSI", | ||
"semester" => 4, | ||
"type" => "lecture", | ||
"field_id" => $fields[2]->id, | ||
"semester_name" => SemesterName::Summer->value, | ||
], | ||
[ | ||
"name" => "Programowanie systemów internetowych", | ||
"abbreviation" => "PSI", | ||
"semester" => 4, | ||
"type" => "project", | ||
"field_id" => $fields[2]->id, | ||
"semester_name" => SemesterName::Summer->value, | ||
], | ||
)->create(); | ||
|
||
$courses = CourseSemester::factory(7)->sequence( | ||
["course_id" => $courses[0]->id, "semester_id" => $semesters[4]->id], | ||
["course_id" => $courses[1]->id, "semester_id" => $semesters[3]->id], | ||
["course_id" => $courses[2]->id, "semester_id" => $semesters[3]->id], | ||
["course_id" => $courses[0]->id, "semester_id" => $semesters[2]->id], | ||
["course_id" => $courses[1]->id, "semester_id" => $semesters[1]->id], | ||
["course_id" => $courses[2]->id, "semester_id" => $semesters[1]->id], | ||
["course_id" => $courses[0]->id, "semester_id" => $semesters[0]->id], | ||
)->create(); | ||
|
||
$students = Student::factory(100)->create(); | ||
|
||
foreach ($courses as $course) { | ||
|
This file was deleted.
Oops, something went wrong.
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
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.