refactor: [barobill] 바로빌 연동 코드 전면 개선

- config/services.php에 barobill 설정 등록 (운영/테스트 모드 분기 정상화)
- BarobillSetting 모델에 BelongsToTenant 적용 및 use_* 필드 casts 추가
- BarobillService API URL을 baroservice.com(SOAP)으로 수정
- BarobillService callApi 메서드 경로 하드코딩 제거 (서비스별 분기)
- BarobillService 예외 이중 래핑 문제 수정
- BarobillController URL 메서드 중복 코드 제거
- 누락 모델 16개 생성 (MNG 패턴 준수, BelongsToTenant 적용)
- 바로빌 전 테이블 options JSON 컬럼 추가 마이그레이션
This commit is contained in:
김보곤
2026-03-11 18:16:59 +09:00
parent 0be88f95ca
commit 18a6f3e7aa
21 changed files with 1390 additions and 79 deletions

View File

@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* 바로빌 관련 테이블에 options JSON 컬럼 추가
*
* SAM options 컬럼 정책에 따라 모든 비즈니스 테이블에
* 확장 가능한 options JSON 컬럼을 추가한다.
*
* @see docs/standards/options-column-policy.md
*/
return new class extends Migration
{
/**
* options 컬럼을 추가할 테이블 목록
*/
private array $tables = [
'barobill_settings',
'barobill_configs',
'barobill_members',
'barobill_subscriptions',
'barobill_billing_records',
'barobill_monthly_summaries',
'barobill_pricing_policies',
'barobill_bank_transactions',
'barobill_bank_transaction_overrides',
'barobill_bank_transaction_splits',
'barobill_bank_sync_status',
'barobill_card_transactions',
'barobill_card_transaction_splits',
'barobill_card_transaction_amount_logs',
'barobill_card_transaction_hides',
];
public function up(): void
{
foreach ($this->tables as $table) {
if (Schema::hasTable($table) && ! Schema::hasColumn($table, 'options')) {
Schema::table($table, function (Blueprint $table) {
$table->json('options')->nullable()->after('id');
});
}
}
}
public function down(): void
{
foreach ($this->tables as $table) {
if (Schema::hasTable($table) && Schema::hasColumn($table, 'options')) {
Schema::table($table, function (Blueprint $table) {
$table->dropColumn('options');
});
}
}
}
};