fix: [items] 품목 규격 accessor + 감사로그 + bom_category 마이그레이션

- Item 모델에 specification accessor 추가 (attributes.spec 조회)
- ItemService.update()에 AuditLogger 감사 로그 추가
- items.options에 bom_category 추가 마이그레이션
This commit is contained in:
2026-03-17 13:55:44 +09:00
parent afc31be642
commit 0863afc8d0
4 changed files with 131 additions and 1 deletions

View File

@@ -51,6 +51,24 @@ class Item extends Model
'deleted_at',
];
protected $appends = [
'specification',
];
/**
* 규격 accessor — attributes JSON 내 spec/specification 값을 최상위 필드로 노출
*/
public function getSpecificationAttribute(): ?string
{
$attrs = $this->getAttributeValue('attributes');
if (is_array($attrs)) {
return $attrs['spec'] ?? $attrs['specification'] ?? null;
}
return null;
}
/**
* item_type 상수
*/