'boolean', 'is_purchasable' => 'boolean', 'is_producible' => 'boolean', 'is_variable_size' => 'boolean', 'bending_details' => 'array', 'certification_start_date' => 'date', 'certification_end_date' => 'date', ]; /** * 품목 (부모) */ public function item() { return $this->belongsTo(Item::class); } // ────────────────────────────────────────────────────────────── // Products 전용 헬퍼 // ────────────────────────────────────────────────────────────── /** * 판매 가능 여부 */ public function isSellable(): bool { return $this->is_sellable ?? false; } /** * 구매 가능 여부 */ public function isPurchasable(): bool { return $this->is_purchasable ?? false; } /** * 생산 가능 여부 */ public function isProducible(): bool { return $this->is_producible ?? false; } /** * 인증서 유효 여부 */ public function isCertificationValid(): bool { if (! $this->certification_end_date) { return false; } return $this->certification_end_date->isFuture(); } // ────────────────────────────────────────────────────────────── // Materials 전용 헬퍼 // ────────────────────────────────────────────────────────────── /** * 검사 필요 여부 */ public function requiresInspection(): bool { return $this->is_inspection === 'Y'; } }