feat: 공정 단계(ProcessStep) CRUD API 구현
- process_steps 테이블 마이그레이션 생성 (step_code, sort_order, boolean 플래그 등)
- ProcessStep 모델 생성 (child entity 패턴, HasFactory만 사용)
- ProcessStepService: CRUD + reorder + STP-001 자동채번
- ProcessStepController: DI + ApiResponse::handle 패턴
- FormRequest 3개: Store, Update, Reorder
- Process 모델에 steps() HasMany 관계 추가
- ProcessService eager-load에 steps 추가 (5곳)
- Nested routes: /processes/{processId}/steps
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('process_steps', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('process_id')
|
||||
->comment('공정 ID')
|
||||
->constrained('processes')
|
||||
->cascadeOnDelete();
|
||||
$table->string('step_code', 20)->comment('단계코드 (STP-001)');
|
||||
$table->string('step_name', 100)->comment('단계명');
|
||||
$table->boolean('is_required')->default(false)->comment('필수여부');
|
||||
$table->boolean('needs_approval')->default(false)->comment('승인필요여부');
|
||||
$table->boolean('needs_inspection')->default(false)->comment('검사필요여부');
|
||||
$table->boolean('is_active')->default(true)->comment('사용여부');
|
||||
$table->unsignedInteger('sort_order')->default(0)->comment('정렬순서');
|
||||
$table->string('connection_type', 20)->nullable()->comment('연결유형 (팝업/없음)');
|
||||
$table->string('connection_target', 255)->nullable()->comment('연결대상');
|
||||
$table->string('completion_type', 30)->nullable()->comment('완료유형 (선택완료시완료/클릭시완료)');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['process_id', 'step_code']);
|
||||
$table->index(['process_id', 'is_active', 'sort_order']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('process_steps');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user