feat: [견적] 제어기 타입 체계 변경 (basic/smart/premium → exposed/embedded/embedded_no_box)

- QuoteBomBulkCalculateRequest: controller validation 값 변경, 기본값 exposed
- QuoteBomCalculateRequest: 동일 변경
- FormulaEvaluatorService: CT → controller_type 매핑 추가 (exposed→노출형, embedded→매립형)
- FormulaEvaluatorService: CT 값에 따라 backbox_qty 자동 설정 (embedded만 뒷박스 포함)
- QuoteService: CT 기본값 exposed로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 16:54:40 +09:00
parent f0b1b5e33a
commit b55cbc2ec4
4 changed files with 25 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ public function rules(): array
'items.*.productCategory' => 'nullable|string|in:SCREEN,STEEL',
'items.*.guideRailType' => 'nullable|string|in:wall,ceiling,floor,mixed',
'items.*.motorPower' => 'nullable|string|in:single,three',
'items.*.controller' => 'nullable|string|in:basic,smart,premium',
'items.*.controller' => 'nullable|string|in:exposed,embedded,embedded_no_box',
'items.*.wingSize' => 'nullable|numeric|min:0|max:500',
'items.*.inspectionFee' => 'nullable|numeric|min:0',
@@ -45,7 +45,7 @@ public function rules(): array
'items.*.PC' => 'nullable|string|in:SCREEN,STEEL',
'items.*.GT' => 'nullable|string|in:wall,ceiling,floor,mixed',
'items.*.MP' => 'nullable|string|in:single,three',
'items.*.CT' => 'nullable|string|in:basic,smart,premium',
'items.*.CT' => 'nullable|string|in:exposed,embedded,embedded_no_box',
'items.*.WS' => 'nullable|numeric|min:0|max:500',
'items.*.INSP' => 'nullable|numeric|min:0',
@@ -128,7 +128,7 @@ private function normalizeInputVariables(array $item): array
'PC' => $item['productCategory'] ?? $item['PC'] ?? 'SCREEN',
'GT' => $item['guideRailType'] ?? $item['GT'] ?? 'wall',
'MP' => $item['motorPower'] ?? $item['MP'] ?? 'single',
'CT' => $item['controller'] ?? $item['CT'] ?? 'basic',
'CT' => $item['controller'] ?? $item['CT'] ?? 'exposed',
'WS' => (float) ($item['wingSize'] ?? $item['WS'] ?? 50),
'INSP' => (float) ($item['inspectionFee'] ?? $item['INSP'] ?? 50000),
];

View File

@@ -30,7 +30,7 @@ public function rules(): array
'PC' => 'nullable|string|in:SCREEN,STEEL',
'GT' => 'nullable|string|in:wall,ceiling,floor,mixed',
'MP' => 'nullable|string|in:single,three',
'CT' => 'nullable|string|in:basic,smart,premium',
'CT' => 'nullable|string|in:exposed,embedded,embedded_no_box',
'WS' => 'nullable|numeric|min:0|max:500',
'INSP' => 'nullable|numeric|min:0',
@@ -82,7 +82,7 @@ public function getInputVariables(): array
'PC' => $validated['PC'] ?? 'SCREEN',
'GT' => $validated['GT'] ?? 'wall',
'MP' => $validated['MP'] ?? 'single',
'CT' => $validated['CT'] ?? 'basic',
'CT' => $validated['CT'] ?? 'exposed',
'WS' => (float) ($validated['WS'] ?? 50),
'INSP' => (float) ($validated['INSP'] ?? 50000),
];

View File

@@ -633,7 +633,7 @@ public function calculateBomWithDebug(
'PC' => $inputVariables['PC'] ?? '',
'GT' => $inputVariables['GT'] ?? 'wall',
'MP' => $inputVariables['MP'] ?? 'single',
'CT' => $inputVariables['CT'] ?? 'basic',
'CT' => $inputVariables['CT'] ?? 'exposed',
'WS' => $inputVariables['WS'] ?? 50,
'INSP' => $inputVariables['INSP'] ?? 50000,
'finished_goods' => $finishedGoodsCode,
@@ -1708,6 +1708,22 @@ private function calculateTenantBom(
default => '220V',
};
// 제어기 타입: 프론트 CT(exposed/embedded/embedded_no_box) → controller_type(노출형/매립형) 매핑
// - exposed: 노출형 (뒷박스 불필요)
// - embedded: 매립형 (뒷박스 포함)
// - embedded_no_box: 매립형 (뒷박스 제외 — 업체 자체 보유)
$ctValue = $inputVariables['CT'] ?? 'exposed';
$controllerType = $inputVariables['controller_type'] ?? match ($ctValue) {
'embedded', 'embedded_no_box' => '매립형',
'exposed' => '노출형',
default => '노출형',
};
// 뒷박스: embedded만 포함, exposed/embedded_no_box는 제외
$backboxQty = (int) ($inputVariables['backbox_qty'] ?? match ($ctValue) {
'embedded' => 1,
default => 0,
});
$calculatedVariables = array_merge($inputVariables, [
'W0' => $W0,
'H0' => $H0,
@@ -1724,6 +1740,8 @@ private function calculateTenantBom(
'finishing_type' => $finishingType,
'installation_type' => $installationType,
'motor_voltage' => $motorVoltage,
'controller_type' => $controllerType,
'backbox_qty' => $backboxQty,
]);
$this->addDebugStep(3, '변수계산', [

View File

@@ -237,7 +237,7 @@ private function calculateBomMaterials(Quote $quote): array
'PC' => $input['productCategory'] ?? 'SCREEN',
'GT' => $input['guideRailType'] ?? 'wall',
'MP' => $input['motorPower'] ?? 'single',
'CT' => $input['controller'] ?? 'basic',
'CT' => $input['controller'] ?? 'exposed',
'WS' => (float) ($input['wingSize'] ?? 50),
'INSP' => (float) ($input['inspectionFee'] ?? 50000),
];