Files
sam-api/app/Services/TenantBootstrap/Steps/CapabilityProfilesStep.php
hskwon cc206fdbed style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
2025-11-06 17:45:49 +09:00

36 lines
1.4 KiB
PHP

<?php
namespace App\Services\TenantBootstrap\Steps;
use App\Services\TenantBootstrap\Contracts\TenantBootstrapStep;
use Illuminate\Support\Facades\DB;
class CapabilityProfilesStep implements TenantBootstrapStep
{
public function key(): string
{
return 'capability_profiles';
}
public function run(int $tenantId): void
{
$profiles = [
['FINISHED_GOOD', '완제품', ['is_sellable' => 1, 'is_purchasable' => 0, 'is_producible' => 1, 'is_stock_managed' => 1]],
['SUB_ASSEMBLY', '서브어셈블리', ['is_sellable' => 0, 'is_purchasable' => 0, 'is_producible' => 1, 'is_stock_managed' => 1]],
['PURCHASED_PART', '구매부품', ['is_sellable' => 0, 'is_purchasable' => 1, 'is_producible' => 0, 'is_stock_managed' => 1]],
['PHANTOM', '팬텀(가상)', ['is_sellable' => 0, 'is_purchasable' => 0, 'is_producible' => 1, 'is_stock_managed' => 0]],
];
foreach ($profiles as [$code,$name,$attrs]) {
DB::table('common_codes')->updateOrInsert(
['tenant_id' => $tenantId, 'code_group' => 'capability_profile', 'code' => $code],
[
'name' => $name,
'attributes' => json_encode($attrs, JSON_UNESCAPED_UNICODE),
'is_active' => 1, 'sort_order' => 0,
'description' => '기본 프로필',
]
);
}
}
}