add report card logic
This commit is contained in:
@@ -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'] ?? ''),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user