- 데이터베이스 스키마 확장: BOM 테이블에 계산 관련 필드 추가 - 계산 엔진 구현: CalculationEngine, FormulaParser, ParameterValidator - API 구현: 견적 파라미터 추출, 실시간 BOM 계산, 업체별 산출식 관리 - FormRequest 검증: 모든 입력 데이터 검증 및 한국어 에러 메시지 - 라우트 등록: 5개 BOM 계산 API 엔드포인트 추가 주요 기능: • BOM에서 필요한 조건만 동적 추출하여 견적 화면에 표시 • 경동기업 하드코딩 산출식을 동적 시스템으로 전환 • 업체별 산출식 버전 관리 및 실시간 테스트 지원 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
712 B
PHP
28 lines
712 B
PHP
<?php
|
|
|
|
namespace App\Models\Design;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BomTemplateItem extends Model
|
|
{
|
|
protected $table = 'bom_template_items';
|
|
|
|
protected $fillable = [
|
|
'tenant_id','bom_template_id','ref_type','ref_id','qty','waste_rate','uom_id','notes','sort_order',
|
|
'is_calculated','calculation_formula','depends_on','calculation_config',
|
|
];
|
|
|
|
protected $casts = [
|
|
'qty' => 'decimal:6',
|
|
'waste_rate' => 'decimal:6',
|
|
'is_calculated' => 'boolean',
|
|
'depends_on' => 'array',
|
|
'calculation_config' => 'array',
|
|
];
|
|
|
|
public function template() {
|
|
return $this->belongsTo(BomTemplate::class, 'bom_template_id');
|
|
}
|
|
}
|