'대기', self::STATUS_APPROVED => '승인', self::STATUS_REJECTED => '반려', ]; protected $fillable = [ 'document_id', 'user_id', 'step', 'role', 'status', 'comment', 'acted_at', 'created_by', 'updated_by', ]; protected $casts = [ 'step' => 'integer', 'acted_at' => 'datetime', ]; // ========================================================================= // Relationships // ========================================================================= public function document(): BelongsTo { return $this->belongsTo(Document::class); } public function user(): BelongsTo { return $this->belongsTo(User::class); } // ========================================================================= // Accessors // ========================================================================= public function getStatusLabelAttribute(): string { return self::STATUS_LABELS[$this->status] ?? $this->status; } public function getStatusColorAttribute(): string { return match ($this->status) { self::STATUS_PENDING => 'yellow', self::STATUS_APPROVED => 'green', self::STATUS_REJECTED => 'red', default => 'gray', }; } // ========================================================================= // Helper Methods // ========================================================================= public function isPending(): bool { return $this->status === self::STATUS_PENDING; } public function isApproved(): bool { return $this->status === self::STATUS_APPROVED; } public function isRejected(): bool { return $this->status === self::STATUS_REJECTED; } }