init backend presensi
This commit is contained in:
34
app/Modules/Notification/Entities/Parent.php
Normal file
34
app/Modules/Notification/Entities/Parent.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Notification\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Parent Entity
|
||||
*
|
||||
* Represents a parent in the system.
|
||||
*/
|
||||
class Parent extends Entity
|
||||
{
|
||||
/**
|
||||
* Attributes that can be mass assigned
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $allowedFields = [
|
||||
'name',
|
||||
'phone_number',
|
||||
];
|
||||
|
||||
/**
|
||||
* Attributes that should be cast to specific types
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
44
app/Modules/Notification/Entities/StudentParent.php
Normal file
44
app/Modules/Notification/Entities/StudentParent.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Notification\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Student Parent Entity
|
||||
*
|
||||
* Represents the relationship between a student and a parent.
|
||||
*/
|
||||
class StudentParent extends Entity
|
||||
{
|
||||
/**
|
||||
* Relationship constants
|
||||
*/
|
||||
public const RELATIONSHIP_AYAH = 'AYAH';
|
||||
public const RELATIONSHIP_IBU = 'IBU';
|
||||
public const RELATIONSHIP_WALI = 'WALI';
|
||||
|
||||
/**
|
||||
* Attributes that can be mass assigned
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $allowedFields = [
|
||||
'student_id',
|
||||
'parent_id',
|
||||
'relationship',
|
||||
];
|
||||
|
||||
/**
|
||||
* Attributes that should be cast to specific types
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'student_id' => 'integer',
|
||||
'parent_id' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
51
app/Modules/Notification/Entities/TelegramAccount.php
Normal file
51
app/Modules/Notification/Entities/TelegramAccount.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Notification\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Telegram Account Entity
|
||||
*
|
||||
* Represents a Telegram account linked to the system.
|
||||
*/
|
||||
class TelegramAccount extends Entity
|
||||
{
|
||||
/**
|
||||
* Attributes that can be mass assigned
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $allowedFields = [
|
||||
'telegram_user_id',
|
||||
'username',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'is_verified',
|
||||
'parent_id',
|
||||
];
|
||||
|
||||
/**
|
||||
* Attributes that should be cast to specific types
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'telegram_user_id' => 'integer',
|
||||
'parent_id' => 'integer',
|
||||
'is_verified' => 'boolean',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Check if account is verified
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isVerified(): bool
|
||||
{
|
||||
return (bool) $this->attributes['is_verified'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user