- AuditChecklist.php: App\Models\Traits → App\Traits 경로 수정 - QualityDummyDataSeeder: 3개 품질 페이지용 더미 데이터 생성 - 품질관리서 10건, 실적신고 6건, 점검표 2건(Q1/Q2), 항목 54건, 기준문서 114건 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.2 KiB
PHP
58 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Qualitys;
|
|
|
|
use App\Traits\Auditable;
|
|
use App\Traits\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class AuditChecklist extends Model
|
|
{
|
|
use Auditable, BelongsToTenant, SoftDeletes;
|
|
|
|
protected $table = 'audit_checklists';
|
|
|
|
const STATUS_DRAFT = 'draft';
|
|
|
|
const STATUS_IN_PROGRESS = 'in_progress';
|
|
|
|
const STATUS_COMPLETED = 'completed';
|
|
|
|
const TYPE_STANDARD_MANUAL = 'standard_manual';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'year',
|
|
'quarter',
|
|
'type',
|
|
'status',
|
|
'options',
|
|
'created_by',
|
|
'updated_by',
|
|
'deleted_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'year' => 'integer',
|
|
'quarter' => 'integer',
|
|
'options' => 'array',
|
|
];
|
|
|
|
public function categories(): HasMany
|
|
{
|
|
return $this->hasMany(AuditChecklistCategory::class, 'checklist_id')->orderBy('sort_order');
|
|
}
|
|
|
|
public function isDraft(): bool
|
|
{
|
|
return $this->status === self::STATUS_DRAFT;
|
|
}
|
|
|
|
public function isCompleted(): bool
|
|
{
|
|
return $this->status === self::STATUS_COMPLETED;
|
|
}
|
|
}
|