feat: H-1 입고 관리 API 구현
- ReceivingController: CRUD 및 목록 조회 API - ReceivingService: 입고 비즈니스 로직 - Receiving 모델: 다중 테넌트 지원 - FormRequest 검증 클래스 - Swagger 문서화 - receivings 테이블 마이그레이션 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?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('receivings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('tenant_id')->comment('테넌트 ID');
|
||||
$table->string('receiving_number', 30)->comment('입고번호');
|
||||
$table->string('order_no', 30)->nullable()->comment('발주번호');
|
||||
$table->date('order_date')->nullable()->comment('발주일자');
|
||||
$table->unsignedBigInteger('item_id')->nullable()->comment('품목 ID');
|
||||
$table->string('item_code', 50)->comment('품목코드');
|
||||
$table->string('item_name', 200)->comment('품목명');
|
||||
$table->string('specification', 200)->nullable()->comment('규격');
|
||||
$table->string('supplier', 100)->comment('공급업체');
|
||||
$table->decimal('order_qty', 15, 2)->comment('발주수량');
|
||||
$table->string('order_unit', 20)->default('EA')->comment('발주단위');
|
||||
$table->date('due_date')->nullable()->comment('납기일');
|
||||
$table->decimal('receiving_qty', 15, 2)->nullable()->comment('입고수량');
|
||||
$table->date('receiving_date')->nullable()->comment('입고일자');
|
||||
$table->string('lot_no', 50)->nullable()->comment('입고 LOT번호');
|
||||
$table->string('supplier_lot', 50)->nullable()->comment('공급업체 LOT');
|
||||
$table->string('receiving_location', 100)->nullable()->comment('입고위치');
|
||||
$table->string('receiving_manager', 50)->nullable()->comment('입고담당');
|
||||
$table->string('status', 30)->default('order_completed')->comment('상태: order_completed/shipping/inspection_pending/receiving_pending/completed');
|
||||
$table->text('remark')->nullable()->comment('비고');
|
||||
$table->unsignedBigInteger('created_by')->nullable()->comment('생성자');
|
||||
$table->unsignedBigInteger('updated_by')->nullable()->comment('수정자');
|
||||
$table->unsignedBigInteger('deleted_by')->nullable()->comment('삭제자');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
// 인덱스
|
||||
$table->unique(['tenant_id', 'receiving_number'], 'uk_tenant_receiving_number');
|
||||
$table->index(['tenant_id', 'status'], 'idx_tenant_status');
|
||||
$table->index(['tenant_id', 'receiving_date'], 'idx_tenant_receiving_date');
|
||||
$table->index('item_id', 'idx_item');
|
||||
$table->index('order_no', 'idx_order_no');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('receivings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user