first commit
Some checks failed
tests / ci (8.5) (push) Has been cancelled
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled

This commit is contained in:
brusnitsyn
2026-04-03 17:20:05 +09:00
commit 3edc8e667e
358 changed files with 39258 additions and 0 deletions

40
app/Models/Department.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
namespace App\Models;
use Database\Factories\DepartmentFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Department extends Model
{
/** @use HasFactory<DepartmentFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
protected $fillable = [
'code',
'name',
'hospital_unit_id',
'is_active',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'hospital_unit_id' => 'integer',
'is_active' => 'boolean',
];
}
public function hospitalUnit(): BelongsTo
{
return $this->belongsTo(HospitalUnit::class);
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Database\Factories\HospitalUnitFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class HospitalUnit extends Model
{
/** @use HasFactory<HospitalUnitFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
protected $fillable = [
'profile_id',
'name',
'slug',
'is_reporting_unit',
'report_input_type',
'is_active',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'profile_id' => 'integer',
'is_reporting_unit' => 'boolean',
'is_active' => 'boolean',
];
}
public function profile(): BelongsTo
{
return $this->belongsTo(Profile::class);
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Database\Factories\MedicalReportFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MedicalReport extends Model
{
/** @use HasFactory<MedicalReportFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
protected $fillable = [
'name',
'year',
'input_overrides',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'input_overrides' => 'array',
'year' => 'integer',
];
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Database\Factories\MedicalReportFormTemplateFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class MedicalReportFormTemplate extends Model
{
/** @use HasFactory<MedicalReportFormTemplateFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
protected $fillable = [
'hospital_unit_id',
'department_key',
'name',
'description',
'schema',
'is_active',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'hospital_unit_id' => 'integer',
'schema' => 'array',
'is_active' => 'boolean',
];
}
public function hospitalUnit(): BelongsTo
{
return $this->belongsTo(HospitalUnit::class);
}
}

37
app/Models/Profile.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
namespace App\Models;
use Database\Factories\ProfileFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Profile extends Model
{
/** @use HasFactory<ProfileFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
protected $fillable = [
'name',
'sort_order',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'sort_order' => 'integer',
];
}
public function hospitalUnits(): HasMany
{
return $this->hasMany(HospitalUnit::class)->orderBy('name');
}
}

34
app/Models/User.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
#[Fillable(['name', 'email', 'password'])]
#[Hidden(['password', 'two_factor_secret', 'two_factor_recovery_codes', 'remember_token'])]
class User extends Authenticatable
{
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable, TwoFactorAuthenticatable;
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'two_factor_confirmed_at' => 'datetime',
];
}
}