From c9970d65fd2c08c551e9d42df9ffe082176d86f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Mon, 2 Feb 2026 21:47:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EB=B2=95=EC=9D=B8=EC=B0=A8=EB=9F=89?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20(corporate=5Fvehicles)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기본 정보: 차량번호, 모델, 종류, 구분, 연식, 운전자, 상태, 주행거리, 메모 - 법인차량 전용: 취득일, 취득가 - 렌트/리스 전용: 계약일자, 회사명, 연락처, 기간, 약정운행거리, 차량가격, 잔존가액, 보증금, 월 렌트료(공급가/세액), 보험사 정보 Co-Authored-By: Claude Opus 4.5 --- ...220000_create_corporate_vehicles_table.php | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 database/migrations/2026_02_02_220000_create_corporate_vehicles_table.php diff --git a/database/migrations/2026_02_02_220000_create_corporate_vehicles_table.php b/database/migrations/2026_02_02_220000_create_corporate_vehicles_table.php new file mode 100644 index 0000000..0c60238 --- /dev/null +++ b/database/migrations/2026_02_02_220000_create_corporate_vehicles_table.php @@ -0,0 +1,56 @@ +id(); + $table->unsignedBigInteger('tenant_id')->index(); + + // 기본 정보 + $table->string('plate_number', 20)->comment('차량번호'); + $table->string('model', 100)->comment('모델명'); + $table->string('vehicle_type', 20)->comment('종류: 승용차, 승합차, 화물차, SUV'); + $table->enum('ownership_type', ['corporate', 'rent', 'lease'])->default('corporate')->comment('구분: 법인, 렌트, 리스'); + $table->year('year')->nullable()->comment('연식'); + $table->string('driver', 50)->nullable()->comment('운전자'); + $table->enum('status', ['active', 'maintenance', 'disposed'])->default('active')->comment('상태'); + $table->unsignedInteger('mileage')->default(0)->comment('주행거리(km)'); + $table->text('memo')->nullable()->comment('메모'); + + // 법인차량 전용 + $table->date('purchase_date')->nullable()->comment('취득일'); + $table->unsignedBigInteger('purchase_price')->default(0)->comment('취득가'); + + // 렌트/리스 전용 + $table->date('contract_date')->nullable()->comment('계약일자'); + $table->string('rent_company', 100)->nullable()->comment('렌트/리스회사명'); + $table->string('rent_company_tel', 20)->nullable()->comment('회사 연락처'); + $table->string('rent_period', 20)->nullable()->comment('렌트/리스기간'); + $table->string('agreed_mileage', 20)->nullable()->comment('약정운행거리'); + $table->unsignedBigInteger('vehicle_price')->default(0)->comment('차량가격'); + $table->unsignedBigInteger('residual_value')->default(0)->comment('추정잔존가액'); + $table->unsignedBigInteger('deposit')->default(0)->comment('보증금'); + $table->unsignedBigInteger('monthly_rent')->default(0)->comment('월 렌트료 공급가액'); + $table->unsignedBigInteger('monthly_rent_tax')->default(0)->comment('월 렌트료 세액'); + $table->string('insurance_company', 100)->nullable()->comment('보험사명'); + $table->string('insurance_company_tel', 20)->nullable()->comment('보험사 연락처'); + + $table->timestamps(); + $table->softDeletes(); + + $table->index(['tenant_id', 'ownership_type']); + $table->index(['tenant_id', 'status']); + }); + } + + public function down(): void + { + Schema::dropIfExists('corporate_vehicles'); + } +};