fix logic and tests, update docker CI file

This commit is contained in:
root
2026-03-09 15:58:44 -04:00
parent 1cb3573d4b
commit 79e44fe037
188 changed files with 1776 additions and 524 deletions
@@ -0,0 +1,27 @@
<?php
namespace Database\Factories;
use App\Models\ClassSection;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ClassSection>
*/
class ClassSectionFactory extends Factory
{
protected $model = ClassSection::class;
public function definition(): array
{
$sectionId = fake()->numberBetween(1, 999);
return [
'class_id' => fake()->numberBetween(1, 20),
'class_section_id' => $sectionId,
'class_section_name' => (string) $sectionId . fake()->randomElement(['A', 'B', 'C']),
'semester' => 'Fall',
'school_year' => '2025-2026',
];
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use App\Models\Student;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Student>
*/
class StudentFactory extends Factory
{
protected $model = Student::class;
public function definition(): array
{
return [
'school_id' => 'S-' . fake()->numberBetween(100, 999),
'firstname' => fake()->firstName(),
'lastname' => fake()->lastName(),
'age' => fake()->numberBetween(6, 18),
'gender' => fake()->randomElement(['Male', 'Female']),
'is_active' => 1,
'registration_grade' => 'Grade ' . fake()->numberBetween(1, 8),
'is_new' => 1,
'photo_consent' => 1,
'parent_id' => fake()->numberBetween(1, 50),
'tuition_paid' => 0,
'semester' => 'Fall',
'year_of_registration' => '2025',
'school_year' => '2025-2026',
];
}
}
+13 -6
View File
@@ -24,11 +24,20 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => fake()->name(),
'school_id' => fake()->numberBetween(1, 5),
'firstname' => fake()->firstName(),
'lastname' => fake()->lastName(),
'gender' => fake()->randomElement(['Male', 'Female']),
'cellphone' => fake()->numerify('##########'),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'address_street' => fake()->streetAddress(),
'city' => fake()->city(),
'state' => fake()->stateAbbr(),
'zip' => fake()->postcode(),
'accept_school_policy' => 1,
'semester' => 'Fall',
'school_year' => '2025-2026',
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
@@ -37,8 +46,6 @@ class UserFactory extends Factory
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
return $this->state(fn (array $attributes) => $attributes);
}
}
@@ -11,7 +11,10 @@ return new class extends Migration
App\Support\SqliteCompat::statement(<<<'SQL'
CREATE TABLE `event_charges` (
`id` int UNSIGNED NOT NULL,
`event_id` int UNSIGNED NOT NULL,
`event_id` int UNSIGNED DEFAULT NULL,
`event_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_general_ci,
`amount` decimal(10,2) DEFAULT NULL,
`parent_id` int UNSIGNED DEFAULT NULL,
`student_id` int UNSIGNED DEFAULT NULL,
`participation` enum('yes','no') COLLATE utf8mb4_general_ci DEFAULT NULL,
@@ -43,4 +46,4 @@ SQL
{
Schema::dropIfExists('event_charges');
}
};
};