From 9182cbc1b3666c43bda5b523ee7e008469ba1234 Mon Sep 17 00:00:00 2001 From: pro Date: Tue, 27 Jan 2026 22:39:30 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=98=81=EC=97=85=EA=B6=8C(=EB=AA=85?= =?UTF-8?q?=ED=95=A8=EB=93=B1=EB=A1=9D)=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tenant_prospects 테이블 생성 - 영업권 2개월 유효, 1개월 쿨다운 정책 지원 - 테넌트 전환 추적 기능 포함 Co-Authored-By: Claude Opus 4.5 --- ...7_221000_create_tenant_prospects_table.php | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 database/migrations/2026_01_27_221000_create_tenant_prospects_table.php diff --git a/database/migrations/2026_01_27_221000_create_tenant_prospects_table.php b/database/migrations/2026_01_27_221000_create_tenant_prospects_table.php new file mode 100644 index 0000000..3b7a7de --- /dev/null +++ b/database/migrations/2026_01_27_221000_create_tenant_prospects_table.php @@ -0,0 +1,75 @@ +id(); + + // 회사 정보 + $table->string('business_number', 20)->index()->comment('사업자번호 (중복체크 키)'); + $table->string('company_name', 100)->comment('회사명'); + $table->string('ceo_name', 50)->nullable()->comment('대표자명'); + $table->string('contact_phone', 20)->nullable()->comment('연락처'); + $table->string('contact_email', 100)->nullable()->comment('이메일'); + $table->string('address', 500)->nullable()->comment('주소'); + + // 영업파트너 정보 + $table->foreignId('registered_by') + ->constrained('users') + ->cascadeOnDelete() + ->comment('등록한 영업파트너 ID'); + + // 명함 이미지 + $table->string('business_card_path', 500)->nullable()->comment('명함 이미지 경로'); + + // 영업권 상태 + $table->string('status', 20)->default('active')->index()->comment('active, expired, converted'); + $table->timestamp('registered_at')->useCurrent()->comment('등록일'); + $table->timestamp('expires_at')->comment('만료일 (등록일 + 2개월)'); + $table->timestamp('cooldown_ends_at')->comment('쿨다운 종료일 (만료일 + 1개월)'); + + // 테넌트 전환 정보 + $table->foreignId('tenant_id') + ->nullable() + ->constrained('tenants') + ->nullOnDelete() + ->comment('전환된 테넌트 ID'); + $table->timestamp('converted_at')->nullable()->comment('테넌트 전환일'); + $table->foreignId('converted_by') + ->nullable() + ->constrained('users') + ->nullOnDelete() + ->comment('전환 처리자 ID'); + + // 메모 + $table->text('memo')->nullable()->comment('메모'); + + $table->timestamps(); + $table->softDeletes(); + + // 복합 인덱스: 사업자번호 + 상태 (중복 체크용) + $table->index(['business_number', 'status']); + }); + } + + public function down(): void + { + Schema::dropIfExists('tenant_prospects'); + } +};