style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수 - 302개 파일 스타일 이슈 자동 수정 - 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
use App\Models\Products\Product;
|
||||
use App\Models\Products\ProductComponent;
|
||||
use App\Services\Products\ProductComponentResolver;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -37,44 +37,46 @@ public function index(int $parentProductId, array $params)
|
||||
->get();
|
||||
|
||||
// 리졸브(제품/자재)
|
||||
$productIds = $items->where('ref_type', 'PRODUCT')->pluck('child_product_id')->filter()->unique()->values();
|
||||
$productIds = $items->where('ref_type', 'PRODUCT')->pluck('child_product_id')->filter()->unique()->values();
|
||||
$materialIds = $items->where('ref_type', 'MATERIAL')->pluck('material_id')->filter()->unique()->values();
|
||||
|
||||
$products = $productIds->isNotEmpty()
|
||||
? Product::query()->where('tenant_id', $tenantId)->whereIn('id', $productIds)->get(['id','code','name','product_type','category_id'])->keyBy('id')
|
||||
$products = $productIds->isNotEmpty()
|
||||
? Product::query()->where('tenant_id', $tenantId)->whereIn('id', $productIds)->get(['id', 'code', 'name', 'product_type', 'category_id'])->keyBy('id')
|
||||
: collect();
|
||||
|
||||
$materials = $materialIds->isNotEmpty()
|
||||
? Material::query()->where('tenant_id', $tenantId)->whereIn('id', $materialIds)->get(['id','material_code as code','name','unit','category_id'])->keyBy('id')
|
||||
? Material::query()->where('tenant_id', $tenantId)->whereIn('id', $materialIds)->get(['id', 'material_code as code', 'name', 'unit', 'category_id'])->keyBy('id')
|
||||
: collect();
|
||||
|
||||
return $items->map(function ($row) use ($products, $materials) {
|
||||
$base = [
|
||||
'id' => (int)$row->id,
|
||||
'ref_type' => $row->ref_type,
|
||||
'quantity' => $row->quantity,
|
||||
'sort_order' => (int)$row->sort_order,
|
||||
'is_default' => (int)$row->is_default,
|
||||
'id' => (int) $row->id,
|
||||
'ref_type' => $row->ref_type,
|
||||
'quantity' => $row->quantity,
|
||||
'sort_order' => (int) $row->sort_order,
|
||||
'is_default' => (int) $row->is_default,
|
||||
];
|
||||
|
||||
if ($row->ref_type === 'PRODUCT') {
|
||||
$p = $products->get($row->child_product_id);
|
||||
|
||||
return $base + [
|
||||
'ref_id' => (int)$row->child_product_id,
|
||||
'code' => $p?->code,
|
||||
'name' => $p?->name,
|
||||
'product_type' => $p?->product_type,
|
||||
'category_id' => $p?->category_id,
|
||||
];
|
||||
'ref_id' => (int) $row->child_product_id,
|
||||
'code' => $p?->code,
|
||||
'name' => $p?->name,
|
||||
'product_type' => $p?->product_type,
|
||||
'category_id' => $p?->category_id,
|
||||
];
|
||||
} else { // MATERIAL
|
||||
$m = $materials->get($row->material_id);
|
||||
|
||||
return $base + [
|
||||
'ref_id' => (int)$row->material_id,
|
||||
'code' => $m?->code,
|
||||
'name' => $m?->name,
|
||||
'unit' => $m?->unit,
|
||||
'category_id' => $m?->category_id,
|
||||
];
|
||||
'ref_id' => (int) $row->material_id,
|
||||
'code' => $m?->code,
|
||||
'name' => $m?->name,
|
||||
'unit' => $m?->unit,
|
||||
'category_id' => $m?->category_id,
|
||||
];
|
||||
}
|
||||
})->values();
|
||||
}
|
||||
@@ -86,41 +88,44 @@ public function index(int $parentProductId, array $params)
|
||||
public function bulkUpsert(int $parentProductId, array $items): array
|
||||
{
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
$userId = $this->apiUserId();
|
||||
|
||||
$this->assertProduct($tenantId, $parentProductId);
|
||||
|
||||
if (!is_array($items) || empty($items)) {
|
||||
if (! is_array($items) || empty($items)) {
|
||||
throw new BadRequestHttpException(__('error.empty_items'));
|
||||
}
|
||||
|
||||
$created = 0; $updated = 0;
|
||||
$created = 0;
|
||||
$updated = 0;
|
||||
|
||||
DB::transaction(function () use ($tenantId, $userId, $parentProductId, $items, &$created, &$updated) {
|
||||
foreach ($items as $it) {
|
||||
$payload = $this->validateItem($it);
|
||||
|
||||
// ref 확인 & 자기참조 방지
|
||||
$this->assertReference($tenantId, $parentProductId, $payload['ref_type'], (int)$payload['ref_id']);
|
||||
$this->assertReference($tenantId, $parentProductId, $payload['ref_type'], (int) $payload['ref_id']);
|
||||
|
||||
if (!empty($it['id'])) {
|
||||
if (! empty($it['id'])) {
|
||||
$pc = ProductComponent::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('parent_product_id', $parentProductId)
|
||||
->find((int)$it['id']);
|
||||
if (!$pc) throw new BadRequestHttpException(__('error.not_found'));
|
||||
->find((int) $it['id']);
|
||||
if (! $pc) {
|
||||
throw new BadRequestHttpException(__('error.not_found'));
|
||||
}
|
||||
|
||||
// ref 변경 허용 시: 충돌 검사
|
||||
[$childProductId, $materialId] = $this->splitRef($payload);
|
||||
|
||||
$pc->update([
|
||||
'ref_type' => $payload['ref_type'],
|
||||
'ref_type' => $payload['ref_type'],
|
||||
'child_product_id' => $childProductId,
|
||||
'material_id' => $materialId,
|
||||
'quantity' => $payload['quantity'],
|
||||
'sort_order' => $payload['sort_order'] ?? $pc->sort_order,
|
||||
'is_default' => $payload['is_default'] ?? $pc->is_default,
|
||||
'updated_by' => $userId,
|
||||
'material_id' => $materialId,
|
||||
'quantity' => $payload['quantity'],
|
||||
'sort_order' => $payload['sort_order'] ?? $pc->sort_order,
|
||||
'is_default' => $payload['is_default'] ?? $pc->is_default,
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
$updated++;
|
||||
} else {
|
||||
@@ -128,15 +133,15 @@ public function bulkUpsert(int $parentProductId, array $items): array
|
||||
[$childProductId, $materialId] = $this->splitRef($payload);
|
||||
|
||||
ProductComponent::create([
|
||||
'tenant_id' => $tenantId,
|
||||
'tenant_id' => $tenantId,
|
||||
'parent_product_id' => $parentProductId,
|
||||
'ref_type' => $payload['ref_type'],
|
||||
'child_product_id' => $childProductId,
|
||||
'material_id' => $materialId,
|
||||
'quantity' => $payload['quantity'],
|
||||
'sort_order' => $payload['sort_order'] ?? 0,
|
||||
'is_default' => $payload['is_default'] ?? 0,
|
||||
'created_by' => $userId,
|
||||
'ref_type' => $payload['ref_type'],
|
||||
'child_product_id' => $childProductId,
|
||||
'material_id' => $materialId,
|
||||
'quantity' => $payload['quantity'],
|
||||
'sort_order' => $payload['sort_order'] ?? 0,
|
||||
'is_default' => $payload['is_default'] ?? 0,
|
||||
'created_by' => $userId,
|
||||
]);
|
||||
$created++;
|
||||
}
|
||||
@@ -150,7 +155,7 @@ public function bulkUpsert(int $parentProductId, array $items): array
|
||||
public function update(int $parentProductId, int $itemId, array $data)
|
||||
{
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
$userId = $this->apiUserId();
|
||||
$this->assertProduct($tenantId, $parentProductId);
|
||||
|
||||
$pc = ProductComponent::query()
|
||||
@@ -158,12 +163,14 @@ public function update(int $parentProductId, int $itemId, array $data)
|
||||
->where('parent_product_id', $parentProductId)
|
||||
->find($itemId);
|
||||
|
||||
if (!$pc) throw new BadRequestHttpException(__('error.not_found'));
|
||||
if (! $pc) {
|
||||
throw new BadRequestHttpException(__('error.not_found'));
|
||||
}
|
||||
|
||||
$v = Validator::make($data, [
|
||||
'ref_type' => 'sometimes|in:PRODUCT,MATERIAL',
|
||||
'ref_id' => 'sometimes|integer',
|
||||
'quantity' => 'sometimes|numeric|min:0.0001',
|
||||
'ref_type' => 'sometimes|in:PRODUCT,MATERIAL',
|
||||
'ref_id' => 'sometimes|integer',
|
||||
'quantity' => 'sometimes|numeric|min:0.0001',
|
||||
'sort_order' => 'sometimes|integer|min:0',
|
||||
'is_default' => 'sometimes|in:0,1',
|
||||
]);
|
||||
@@ -171,9 +178,9 @@ public function update(int $parentProductId, int $itemId, array $data)
|
||||
|
||||
if (isset($payload['ref_type']) || isset($payload['ref_id'])) {
|
||||
$refType = $payload['ref_type'] ?? $pc->ref_type;
|
||||
$refId = isset($payload['ref_id'])
|
||||
? (int)$payload['ref_id']
|
||||
: ($pc->ref_type === 'PRODUCT' ? (int)$pc->child_product_id : (int)$pc->material_id);
|
||||
$refId = isset($payload['ref_id'])
|
||||
? (int) $payload['ref_id']
|
||||
: ($pc->ref_type === 'PRODUCT' ? (int) $pc->child_product_id : (int) $pc->material_id);
|
||||
|
||||
$this->assertReference($tenantId, $parentProductId, $refType, $refId);
|
||||
[$childProductId, $materialId] = $this->splitRef(['ref_type' => $refType, 'ref_id' => $refId]);
|
||||
@@ -183,9 +190,15 @@ public function update(int $parentProductId, int $itemId, array $data)
|
||||
$pc->material_id = $materialId;
|
||||
}
|
||||
|
||||
if (isset($payload['quantity'])) $pc->quantity = $payload['quantity'];
|
||||
if (isset($payload['sort_order'])) $pc->sort_order = $payload['sort_order'];
|
||||
if (isset($payload['is_default'])) $pc->is_default = $payload['is_default'];
|
||||
if (isset($payload['quantity'])) {
|
||||
$pc->quantity = $payload['quantity'];
|
||||
}
|
||||
if (isset($payload['sort_order'])) {
|
||||
$pc->sort_order = $payload['sort_order'];
|
||||
}
|
||||
if (isset($payload['is_default'])) {
|
||||
$pc->is_default = $payload['is_default'];
|
||||
}
|
||||
|
||||
$pc->updated_by = $userId;
|
||||
$pc->save();
|
||||
@@ -204,7 +217,9 @@ public function destroy(int $parentProductId, int $itemId): void
|
||||
->where('parent_product_id', $parentProductId)
|
||||
->find($itemId);
|
||||
|
||||
if (!$pc) throw new BadRequestHttpException(__('error.not_found'));
|
||||
if (! $pc) {
|
||||
throw new BadRequestHttpException(__('error.not_found'));
|
||||
}
|
||||
$pc->delete();
|
||||
}
|
||||
|
||||
@@ -214,16 +229,20 @@ public function reorder(int $parentProductId, array $items): void
|
||||
$tenantId = $this->tenantId();
|
||||
$this->assertProduct($tenantId, $parentProductId);
|
||||
|
||||
if (!is_array($items)) throw new BadRequestHttpException(__('error.invalid_payload'));
|
||||
if (! is_array($items)) {
|
||||
throw new BadRequestHttpException(__('error.invalid_payload'));
|
||||
}
|
||||
|
||||
DB::transaction(function () use ($tenantId, $parentProductId, $items) {
|
||||
foreach ($items as $row) {
|
||||
if (!isset($row['id'], $row['sort_order'])) continue;
|
||||
if (! isset($row['id'], $row['sort_order'])) {
|
||||
continue;
|
||||
}
|
||||
ProductComponent::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('parent_product_id', $parentProductId)
|
||||
->where('id', (int)$row['id'])
|
||||
->update(['sort_order' => (int)$row['sort_order']]);
|
||||
->where('id', (int) $row['id'])
|
||||
->update(['sort_order' => (int) $row['sort_order']]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -239,16 +258,16 @@ public function summary(int $parentProductId): array
|
||||
->where('parent_product_id', $parentProductId)
|
||||
->get();
|
||||
|
||||
$cnt = $items->count();
|
||||
$cntP = $items->where('ref_type','PRODUCT')->count();
|
||||
$cntM = $items->where('ref_type','MATERIAL')->count();
|
||||
$qtySum = (string)$items->sum('quantity');
|
||||
$cnt = $items->count();
|
||||
$cntP = $items->where('ref_type', 'PRODUCT')->count();
|
||||
$cntM = $items->where('ref_type', 'MATERIAL')->count();
|
||||
$qtySum = (string) $items->sum('quantity');
|
||||
|
||||
return [
|
||||
'count' => $cnt,
|
||||
'count' => $cnt,
|
||||
'count_product' => $cntP,
|
||||
'count_material'=> $cntM,
|
||||
'quantity_sum' => $qtySum,
|
||||
'count_material' => $cntM,
|
||||
'quantity_sum' => $qtySum,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -271,20 +290,20 @@ public function validateBom(int $parentProductId): array
|
||||
if ($row->quantity <= 0) {
|
||||
$errors[] = ['id' => $row->id, 'error' => 'INVALID_QUANTITY'];
|
||||
}
|
||||
$key = $row->ref_type . ':' . ($row->ref_type === 'PRODUCT' ? $row->child_product_id : $row->material_id);
|
||||
$key = $row->ref_type.':'.($row->ref_type === 'PRODUCT' ? $row->child_product_id : $row->material_id);
|
||||
if (isset($seen[$key])) {
|
||||
$errors[] = ['id' => $row->id, 'error' => 'DUPLICATE_ITEM'];
|
||||
} else {
|
||||
$seen[$key] = true;
|
||||
}
|
||||
// 자기참조
|
||||
if ($row->ref_type === 'PRODUCT' && (int)$row->child_product_id === (int)$parentProductId) {
|
||||
if ($row->ref_type === 'PRODUCT' && (int) $row->child_product_id === (int) $parentProductId) {
|
||||
$errors[] = ['id' => $row->id, 'error' => 'SELF_REFERENCE'];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'valid' => count($errors) === 0,
|
||||
'valid' => count($errors) === 0,
|
||||
'errors' => $errors,
|
||||
];
|
||||
}
|
||||
@@ -294,13 +313,14 @@ public function validateBom(int $parentProductId): array
|
||||
private function validateItem(array $it): array
|
||||
{
|
||||
$v = Validator::make($it, [
|
||||
'id' => 'nullable|integer',
|
||||
'ref_type' => 'required|in:PRODUCT,MATERIAL',
|
||||
'ref_id' => 'required|integer',
|
||||
'quantity' => 'required|numeric|min:0.0001',
|
||||
'id' => 'nullable|integer',
|
||||
'ref_type' => 'required|in:PRODUCT,MATERIAL',
|
||||
'ref_id' => 'required|integer',
|
||||
'quantity' => 'required|numeric|min:0.0001',
|
||||
'sort_order' => 'nullable|integer|min:0',
|
||||
'is_default' => 'nullable|in:0,1',
|
||||
]);
|
||||
|
||||
return $v->validate();
|
||||
}
|
||||
|
||||
@@ -308,15 +328,16 @@ private function splitRef(array $payload): array
|
||||
{
|
||||
// returns [child_product_id, material_id]
|
||||
if ($payload['ref_type'] === 'PRODUCT') {
|
||||
return [(int)$payload['ref_id'], null];
|
||||
return [(int) $payload['ref_id'], null];
|
||||
}
|
||||
return [null, (int)$payload['ref_id']];
|
||||
|
||||
return [null, (int) $payload['ref_id']];
|
||||
}
|
||||
|
||||
private function assertProduct(int $tenantId, int $productId): void
|
||||
{
|
||||
$exists = Product::query()->where('tenant_id', $tenantId)->where('id', $productId)->exists();
|
||||
if (!$exists) {
|
||||
if (! $exists) {
|
||||
// ko: 제품 정보를 찾을 수 없습니다.
|
||||
throw new NotFoundHttpException(__('error.not_found_resource', ['resource' => '제품']));
|
||||
}
|
||||
@@ -329,10 +350,14 @@ private function assertReference(int $tenantId, int $parentProductId, string $re
|
||||
throw new BadRequestHttpException(__('error.invalid_payload')); // 자기참조 방지
|
||||
}
|
||||
$ok = Product::query()->where('tenant_id', $tenantId)->where('id', $refId)->exists();
|
||||
if (!$ok) throw new BadRequestHttpException(__('error.not_found'));
|
||||
if (! $ok) {
|
||||
throw new BadRequestHttpException(__('error.not_found'));
|
||||
}
|
||||
} else {
|
||||
$ok = Material::query()->where('tenant_id', $tenantId)->where('id', $refId)->exists();
|
||||
if (!$ok) throw new BadRequestHttpException(__('error.not_found'));
|
||||
if (! $ok) {
|
||||
throw new BadRequestHttpException(__('error.not_found'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,22 +374,22 @@ public function replaceBom(int $productId, array $payload): array
|
||||
}
|
||||
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
$userId = $this->apiUserId();
|
||||
|
||||
// 0) ====== 빈 카테고리 제거 ======
|
||||
$rawCats = Arr::get($payload, 'categories', []);
|
||||
$normalized = [];
|
||||
|
||||
foreach ((array) $rawCats as $cat) {
|
||||
$catId = Arr::get($cat, 'id');
|
||||
$catId = Arr::get($cat, 'id');
|
||||
$catName = Arr::get($cat, 'name');
|
||||
|
||||
$items = array_values(array_filter((array) Arr::get($cat, 'items', []), function ($it) {
|
||||
$type = Arr::get($it, 'ref_type');
|
||||
$id = (int) Arr::get($it, 'ref_id');
|
||||
$qty = Arr::get($it, 'quantity');
|
||||
$id = (int) Arr::get($it, 'ref_id');
|
||||
$qty = Arr::get($it, 'quantity');
|
||||
|
||||
return in_array($type, ['MATERIAL','PRODUCT'], true)
|
||||
return in_array($type, ['MATERIAL', 'PRODUCT'], true)
|
||||
&& $id > 0
|
||||
&& is_numeric($qty);
|
||||
}));
|
||||
@@ -374,8 +399,8 @@ public function replaceBom(int $productId, array $payload): array
|
||||
}
|
||||
|
||||
$normalized[] = [
|
||||
'id' => $catId,
|
||||
'name' => $catName,
|
||||
'id' => $catId,
|
||||
'name' => $catName,
|
||||
'items' => $items,
|
||||
];
|
||||
}
|
||||
@@ -387,9 +412,9 @@ public function replaceBom(int $productId, array $payload): array
|
||||
->delete();
|
||||
|
||||
return [
|
||||
'deleted_count' => $deleted,
|
||||
'deleted_count' => $deleted,
|
||||
'inserted_count' => 0,
|
||||
'message' => '모든 BOM 항목이 비어 기존 데이터를 삭제했습니다.',
|
||||
'message' => '모든 BOM 항목이 비어 기존 데이터를 삭제했습니다.',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -397,14 +422,14 @@ public function replaceBom(int $productId, array $payload): array
|
||||
$v = Validator::make(
|
||||
['categories' => $normalized],
|
||||
[
|
||||
'categories' => ['required', 'array', 'min:1'],
|
||||
'categories.*.id' => ['nullable', 'integer'],
|
||||
'categories.*.name' => ['nullable', 'string', 'max:100'],
|
||||
'categories.*.items' => ['required', 'array', 'min:1'],
|
||||
'categories.*.items.*.ref_type' => ['required', 'in:MATERIAL,PRODUCT'],
|
||||
'categories.*.items.*.ref_id' => ['required', 'integer', 'min:1'],
|
||||
'categories.*.items.*.quantity' => ['required', 'numeric', 'min:0'],
|
||||
'categories.*.items.*.sort_order' => ['nullable', 'integer', 'min:0'],
|
||||
'categories' => ['required', 'array', 'min:1'],
|
||||
'categories.*.id' => ['nullable', 'integer'],
|
||||
'categories.*.name' => ['nullable', 'string', 'max:100'],
|
||||
'categories.*.items' => ['required', 'array', 'min:1'],
|
||||
'categories.*.items.*.ref_type' => ['required', 'in:MATERIAL,PRODUCT'],
|
||||
'categories.*.items.*.ref_id' => ['required', 'integer', 'min:1'],
|
||||
'categories.*.items.*.quantity' => ['required', 'numeric', 'min:0'],
|
||||
'categories.*.items.*.sort_order' => ['nullable', 'integer', 'min:0'],
|
||||
]
|
||||
);
|
||||
if ($v->fails()) {
|
||||
@@ -413,25 +438,25 @@ public function replaceBom(int $productId, array $payload): array
|
||||
|
||||
// 2) ====== 플랫 레코드 생성 (note 제거) ======
|
||||
$rows = [];
|
||||
$now = now();
|
||||
$now = now();
|
||||
foreach ($normalized as $cat) {
|
||||
$catId = Arr::get($cat, 'id');
|
||||
$catId = Arr::get($cat, 'id');
|
||||
$catName = Arr::get($cat, 'name');
|
||||
|
||||
foreach ($cat['items'] as $idx => $item) {
|
||||
$rows[] = [
|
||||
'tenant_id' => $tenantId,
|
||||
'tenant_id' => $tenantId,
|
||||
'parent_product_id' => $productId,
|
||||
'category_id' => $catId,
|
||||
'category_name' => $catName,
|
||||
'ref_type' => $item['ref_type'],
|
||||
'ref_id' => (int) $item['ref_id'],
|
||||
'quantity' => (string) $item['quantity'],
|
||||
'sort_order' => isset($item['sort_order']) ? (int)$item['sort_order'] : $idx,
|
||||
'created_by' => $userId,
|
||||
'updated_by' => $userId,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
'category_id' => $catId,
|
||||
'category_name' => $catName,
|
||||
'ref_type' => $item['ref_type'],
|
||||
'ref_id' => (int) $item['ref_id'],
|
||||
'quantity' => (string) $item['quantity'],
|
||||
'sort_order' => isset($item['sort_order']) ? (int) $item['sort_order'] : $idx,
|
||||
'created_by' => $userId,
|
||||
'updated_by' => $userId,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -444,23 +469,24 @@ public function replaceBom(int $productId, array $payload): array
|
||||
|
||||
$inserted = 0;
|
||||
foreach (array_chunk($rows, 500) as $chunk) {
|
||||
$ok =ProductComponent::insert($chunk);
|
||||
$ok = ProductComponent::insert($chunk);
|
||||
$inserted += $ok ? count($chunk) : 0;
|
||||
}
|
||||
|
||||
return [
|
||||
'deleted_count' => $deleted,
|
||||
'deleted_count' => $deleted,
|
||||
'inserted_count' => $inserted,
|
||||
'message' => 'BOM 저장 성공',
|
||||
'message' => 'BOM 저장 성공',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 제품별: 현재 BOM에 쓰인 카테고리 */
|
||||
public function listCategoriesForProduct(int $productId): array
|
||||
{
|
||||
if ($productId <= 0) throw new BadRequestHttpException(__('error.bad_request'));
|
||||
if ($productId <= 0) {
|
||||
throw new BadRequestHttpException(__('error.bad_request'));
|
||||
}
|
||||
|
||||
$tenantId = $this->tenantId();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user