feat: I-1 미지급비용 관리 API 개발

- ExpectedExpense 모델 및 마이그레이션 생성
- ExpectedExpenseService 구현 (CRUD, 일괄삭제, 지급일 변경, 요약)
- ExpectedExpenseController REST API 구현
- FormRequest 검증 클래스 3개 생성
- Swagger API 문서 작성
- 라우트 추가 (8개 엔드포인트)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-26 13:23:07 +09:00
parent 0fef26f42a
commit 1f5539db32
9 changed files with 1097 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?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('expected_expenses', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('tenant_id')->comment('테넌트 ID');
$table->date('expected_payment_date')->comment('예상 지급일');
$table->date('settlement_date')->nullable()->comment('결제일');
$table->string('transaction_type', 30)->comment('거래유형: purchase/advance/suspense/rent/salary/insurance/tax/utilities/other');
$table->decimal('amount', 15, 2)->comment('지출금액');
$table->unsignedBigInteger('client_id')->nullable()->comment('거래처 ID');
$table->string('client_name', 100)->nullable()->comment('비회원 거래처명');
$table->unsignedBigInteger('bank_account_id')->nullable()->comment('계좌 ID');
$table->string('account_code', 50)->nullable()->comment('계정과목');
$table->string('payment_status', 20)->default('pending')->comment('지급상태: pending/partial/paid/overdue');
$table->string('approval_status', 20)->default('none')->comment('결재상태: none/pending/approved/rejected');
$table->text('description')->nullable()->comment('적요/메모');
$table->unsignedBigInteger('created_by')->nullable()->comment('생성자 ID');
$table->unsignedBigInteger('updated_by')->nullable()->comment('수정자 ID');
$table->unsignedBigInteger('deleted_by')->nullable()->comment('삭제자 ID');
$table->softDeletes();
$table->timestamps();
$table->index(['tenant_id', 'expected_payment_date'], 'idx_tenant_expected_date');
$table->index(['tenant_id', 'payment_status'], 'idx_tenant_payment_status');
$table->index('client_id', 'idx_client');
$table->index('transaction_type', 'idx_transaction_type');
});
}
public function down(): void
{
Schema::dropIfExists('expected_expenses');
}
};