feat:바로빌 과금 정책 DB 관리 기능 추가

- BarobillPricingPolicy 모델 추가
- BarobillPricingPolicySeeder 추가 (초기 정책 데이터)
- 과금관리 페이지에 정책 관리 탭 추가 (본사 전용)
- 정책 수정 모달 및 API 엔드포인트 추가
- BarobillUsageService에서 DB 정책 사용하도록 수정

정책 항목:
- 법인카드 등록: 기본 3장, 추가 1장당 5,000원
- 계산서 발행: 기본 100건, 추가 50건당 5,000원
- 계좌조회 수집: 기본 1계좌, 추가 1계좌당 10,000원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
pro
2026-01-27 15:17:25 +09:00
parent a050904fc3
commit d036be1ec3
7 changed files with 659 additions and 43 deletions

View File

@@ -0,0 +1,63 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\Barobill\BarobillPricingPolicy;
class BarobillPricingPolicySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$policies = [
[
'service_type' => 'card',
'name' => '법인카드 등록',
'description' => '법인카드 등록 기본 3장 제공, 추가 시 장당 과금',
'free_quota' => 3,
'free_quota_unit' => '장',
'additional_unit' => 1,
'additional_unit_label' => '장',
'additional_price' => 5000,
'is_active' => true,
'sort_order' => 1,
],
[
'service_type' => 'tax_invoice',
'name' => '계산서 발행',
'description' => '전자세금계산서 발행 기본 100건 제공, 추가 50건 단위 과금',
'free_quota' => 100,
'free_quota_unit' => '건',
'additional_unit' => 50,
'additional_unit_label' => '건',
'additional_price' => 5000,
'is_active' => true,
'sort_order' => 2,
],
[
'service_type' => 'bank_account',
'name' => '계좌조회 수집',
'description' => '주거래 통장 계좌 기본 1개 제공, 추가 계좌당 과금',
'free_quota' => 1,
'free_quota_unit' => '개',
'additional_unit' => 1,
'additional_unit_label' => '계좌',
'additional_price' => 10000,
'is_active' => true,
'sort_order' => 3,
],
];
foreach ($policies as $policy) {
BarobillPricingPolicy::updateOrCreate(
['service_type' => $policy['service_type']],
$policy
);
}
$this->command->info('바로빌 과금 정책 시딩 완료!');
}
}