feat: 업체별 동적 BOM 계산 시스템 구현

- 데이터베이스 스키마 확장: 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>
This commit is contained in:
2025-09-22 22:09:42 +09:00
parent fa9f8ac707
commit bd678dfea9
15 changed files with 2039 additions and 3 deletions

View File

@@ -13,10 +13,12 @@ class BomTemplate extends Model
protected $fillable = [
'tenant_id','model_version_id','name','is_primary','notes',
'calculation_schema','company_type','formula_version',
];
protected $casts = [
'is_primary' => 'boolean',
'calculation_schema' => 'array',
];
public function modelVersion() {

View File

@@ -10,11 +10,15 @@ class BomTemplateItem extends Model
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() {