fix: [card] 카드 상세 수정/저장 누락 필드 9개 보강

- 마이그레이션: card_type, alias, cvc_encrypted, payment_day, total_limit, used_amount, remaining_limit, is_manual, memo 컬럼 추가
- Card 모델: $fillable, $casts, $hidden 확장 + CVC 암호화/복호화 메서드 추가
- CardService: store(), update() 메서드에 9개 필드 처리 로직 추가
- StoreCardRequest, UpdateCardRequest: 9개 필드 검증 규칙 추가
This commit is contained in:
김보곤
2026-02-21 00:11:03 +09:00
parent 961ab47bac
commit 83ddfabd7c
5 changed files with 154 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?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::table('cards', function (Blueprint $table) {
$table->string('card_type', 50)->nullable()->after('card_company')->comment('카드 종류 (corporate_1, personal 등)');
$table->string('alias', 100)->nullable()->after('card_name')->comment('카드 별칭');
$table->text('cvc_encrypted')->nullable()->after('card_password_encrypted')->comment('암호화된 CVC/CVV');
$table->unsignedTinyInteger('payment_day')->nullable()->after('cvc_encrypted')->comment('결제일 (1-31)');
$table->decimal('total_limit', 15, 2)->nullable()->after('payment_day')->comment('총 한도');
$table->decimal('used_amount', 15, 2)->nullable()->after('total_limit')->comment('사용 금액');
$table->decimal('remaining_limit', 15, 2)->nullable()->after('used_amount')->comment('잔여 한도');
$table->boolean('is_manual')->default(false)->after('status')->comment('수기 등록 여부');
$table->text('memo')->nullable()->after('assigned_user_id')->comment('메모');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cards', function (Blueprint $table) {
$table->dropColumn([
'card_type',
'alias',
'cvc_encrypted',
'payment_day',
'total_limit',
'used_amount',
'remaining_limit',
'is_manual',
'memo',
]);
});
}
};