add report card logic

This commit is contained in:
root
2026-03-10 17:33:03 -04:00
parent c235fd2170
commit a82f7aedbc
16 changed files with 2502 additions and 1998 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Resources\Reports\ReportCards;
use Illuminate\Http\Resources\Json\JsonResource;
class ReportCardAcknowledgementResource extends JsonResource
{
public function toArray($request): array
{
return [
'student_id' => (int) ($this['student_id'] ?? 0),
'school_year' => (string) ($this['school_year'] ?? ''),
'semester' => (string) ($this['semester'] ?? ''),
'viewed_at' => $this['viewed_at'] ?? null,
'signed_at' => $this['signed_at'] ?? null,
'signed_name' => $this['signed_name'] ?? null,
];
}
}
@@ -0,0 +1,18 @@
<?php
namespace App\Http\Resources\Reports\ReportCards;
use Illuminate\Http\Resources\Json\JsonResource;
class ReportCardClassSectionResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'class_section_id' => (int) ($this['class_section_id'] ?? ($this['id'] ?? 0)),
'class_section_name' => (string) ($this['class_section_name'] ?? ''),
'school_year' => (string) ($this['school_year'] ?? ''),
];
}
}
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Resources\Reports\ReportCards;
use Illuminate\Http\Resources\Json\JsonResource;
class ReportCardCompletenessStudentResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'name' => (string) ($this['name'] ?? ''),
'missing' => array_values($this['missing'] ?? []),
'warnings' => array_values($this['warnings'] ?? []),
'complete' => (bool) ($this['complete'] ?? false),
'viewed_at' => $this['viewed_at'] ?? null,
'signed_at' => $this['signed_at'] ?? null,
'signed_name' => $this['signed_name'] ?? null,
];
}
}
@@ -0,0 +1,18 @@
<?php
namespace App\Http\Resources\Reports\ReportCards;
use Illuminate\Http\Resources\Json\JsonResource;
class ReportCardStudentMetaResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'firstname' => (string) ($this['firstname'] ?? ''),
'lastname' => (string) ($this['lastname'] ?? ''),
'class_section_name' => (string) ($this['class_section_name'] ?? ''),
];
}
}