feat : 테넌트 부트스트랩 오케스트레이션

Notion : https://www.notion.so/hamss/2579c8d34ba080d586b6faaae249f476?source=copy_link
This commit is contained in:
2025-08-22 15:57:44 +09:00
parent 189bdbfd80
commit cd81285731
12 changed files with 338 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?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'=>'기본 프로필'
]
);
}
}
}