feat: 2.3 카드/계좌 관리 API 구현
- cards, bank_accounts 테이블 마이그레이션 - Card, BankAccount 모델 (카드번호 암호화) - CardService, BankAccountService - CardController, BankAccountController + FormRequest 4개 - API 엔드포인트 15개 (카드 7개, 계좌 8개) - Swagger 문서 (CardApi.php, BankAccountApi.php)
This commit is contained in:
43
database/migrations/2025_12_17_120000_create_cards_table.php
Normal file
43
database/migrations/2025_12_17_120000_create_cards_table.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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('cards', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('tenant_id')->comment('테넌트 ID');
|
||||
$table->string('card_company', 50)->comment('카드사');
|
||||
$table->text('card_number_encrypted')->comment('암호화된 카드번호');
|
||||
$table->string('card_number_last4', 4)->comment('카드번호 끝 4자리');
|
||||
$table->string('expiry_date', 5)->comment('유효기간 (MM/YY)');
|
||||
$table->text('card_password_encrypted')->nullable()->comment('암호화된 비밀번호 앞2자리');
|
||||
$table->string('card_name', 100)->comment('카드 별칭');
|
||||
$table->string('status', 20)->default('active')->comment('상태: active/inactive');
|
||||
$table->unsignedBigInteger('assigned_user_id')->nullable()->comment('담당자 ID');
|
||||
$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', 'idx_cards_tenant');
|
||||
$table->index('status', 'idx_cards_status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cards');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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('bank_accounts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('tenant_id')->comment('테넌트 ID');
|
||||
$table->string('bank_code', 10)->comment('은행 코드');
|
||||
$table->string('bank_name', 50)->comment('은행명');
|
||||
$table->string('account_number', 30)->comment('계좌번호');
|
||||
$table->string('account_holder', 50)->comment('예금주');
|
||||
$table->string('account_name', 100)->comment('계좌 별칭');
|
||||
$table->string('status', 20)->default('active')->comment('상태: active/inactive');
|
||||
$table->unsignedBigInteger('assigned_user_id')->nullable()->comment('담당자 ID');
|
||||
$table->boolean('is_primary')->default(false)->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', 'idx_bank_accounts_tenant');
|
||||
$table->index('status', 'idx_bank_accounts_status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bank_accounts');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user