fix invalid token
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 49s
Tests / PHPUnit (push) Successful in 1m20s

This commit is contained in:
root
2026-08-30 21:10:35 -04:00
parent 140be9922d
commit 332b0d1007
9 changed files with 217 additions and 112 deletions
@@ -47,6 +47,49 @@ class ParentAccountService
return true;
}
public function administratorParentList(): array
{
return $this->userModel->where('role', 'parent')->findAll();
}
public function parentById(int $id): ?array
{
$parent = $this->userModel->find($id);
return is_array($parent) ? $parent : null;
}
public function createAdministratorParent(array $post): bool|int|string
{
return $this->userModel->insert([
'firstname' => $post['firstname'] ?? null,
'lastname' => $post['lastname'] ?? null,
'email' => strtolower((string) ($post['email'] ?? '')),
'password' => password_hash((string) ($post['password'] ?? ''), PASSWORD_DEFAULT),
'role' => 'parent',
]);
}
public function updateAdministratorParent(int $id, array $post): bool
{
$data = [
'firstname' => $post['firstname'] ?? null,
'lastname' => $post['lastname'] ?? null,
'email' => strtolower((string) ($post['email'] ?? '')),
];
if (! empty($post['password'])) {
$data['password'] = password_hash((string) $post['password'], PASSWORD_DEFAULT);
}
return (bool) $this->userModel->update($id, $data);
}
public function deleteParent(int $id): bool
{
return (bool) $this->userModel->delete($id);
}
public function createRelatedUser(array $userData, string $relationToStudent, string $semester, string $schoolYear): int|false
{
$schoolIdService = new SchoolIdService();