fix:테넌트 전환 시 고유 코드 자동 생성
- code 필드 추가 (T + 날짜 + 랜덤 4자리) - 예: T260128ABC1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -103,9 +103,13 @@ public function update(
|
||||
public function convertToTenant(TenantProspect $prospect, int $convertedBy): Tenant
|
||||
{
|
||||
return DB::transaction(function () use ($prospect, $convertedBy) {
|
||||
// 고유 테넌트 코드 생성 (T + 타임스탬프 + 랜덤)
|
||||
$tenantCode = 'T' . now()->format('ymd') . strtoupper(substr(uniqid(), -4));
|
||||
|
||||
// 테넌트 생성
|
||||
$tenant = Tenant::create([
|
||||
'company_name' => $prospect->company_name,
|
||||
'code' => $tenantCode,
|
||||
'business_num' => $prospect->business_number,
|
||||
'ceo_name' => $prospect->ceo_name,
|
||||
'phone' => $prospect->contact_phone,
|
||||
|
||||
Reference in New Issue
Block a user