feat(construction): 구조검토관리 API 구현

- Migration: structure_reviews 테이블 생성
- Model: StructureReview (BelongsToTenant, SoftDeletes)
- Service: StructureReviewService (CRUD + 통계 + 일괄삭제)
- Controller: StructureReviewController (7 endpoints)
- FormRequest: Store/Update 검증 규칙

API Endpoints:
- GET    /construction/structure-reviews (목록)
- POST   /construction/structure-reviews (생성)
- GET    /construction/structure-reviews/stats (통계)
- DELETE /construction/structure-reviews/bulk (일괄삭제)
- GET    /construction/structure-reviews/{id} (상세)
- PUT    /construction/structure-reviews/{id} (수정)
- DELETE /construction/structure-reviews/{id} (삭제)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-09 21:31:27 +09:00
parent d49dc1d878
commit e6a4bf0870
7 changed files with 672 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('structure_reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->comment('테넌트 ID');
$table->string('review_number', 50)->nullable()->comment('검토번호');
$table->foreignId('partner_id')->nullable()->comment('거래처 ID');
$table->string('partner_name', 100)->nullable()->comment('거래처명');
$table->foreignId('site_id')->nullable()->comment('현장 ID');
$table->string('site_name', 200)->nullable()->comment('현장명');
$table->date('request_date')->nullable()->comment('구조검토 의뢰일');
$table->string('review_company', 100)->nullable()->comment('구조검토 회사');
$table->string('reviewer_name', 50)->nullable()->comment('구조검토자');
$table->date('review_date')->nullable()->comment('구조검토일');
$table->date('completion_date')->nullable()->comment('구조검토 완료일');
$table->string('status', 20)->default('pending')->comment('상태: pending, completed');
$table->string('file_url', 500)->nullable()->comment('구조검토 파일 URL');
$table->text('remarks')->nullable()->comment('비고');
$table->boolean('is_active')->default(true)->comment('활성화 여부');
$table->foreignId('created_by')->nullable()->comment('생성자 ID');
$table->foreignId('updated_by')->nullable()->comment('수정자 ID');
$table->foreignId('deleted_by')->nullable()->comment('삭제자 ID');
$table->timestamps();
$table->softDeletes();
// 인덱스
$table->index('tenant_id');
$table->index('partner_id');
$table->index('site_id');
$table->index('status');
$table->index('request_date');
$table->index('created_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('structure_reviews');
}
};