chore: [env] .env.example 업데이트 및 .gitignore 정리
- .env.example을 SAM 프로젝트 실제 키 구조로 업데이트 - .gitignore에 !.env.example 예외 추가 - GCS_* 중복 키 제거, Gemini/Claude/Vertex 키 섹션 추가
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Tenants\TaxInvoice;
|
||||
use App\Models\Tenants\Tenant;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -272,105 +271,6 @@ public function checkStatus(int $id): TaxInvoice
|
||||
return $this->barobillService->checkNtsSendStatus($taxInvoice);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 공급자 설정
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* 공급자 설정 조회 (BarobillSetting 기반, 미설정 시 Tenant 정보 Fallback)
|
||||
*/
|
||||
public function getSupplierSettings(): array
|
||||
{
|
||||
$setting = $this->barobillService->getSetting();
|
||||
|
||||
if ($setting && $this->hasSupplierData($setting)) {
|
||||
return [
|
||||
'business_number' => $setting->corp_num,
|
||||
'company_name' => $setting->corp_name,
|
||||
'representative_name' => $setting->ceo_name,
|
||||
'address' => $setting->addr,
|
||||
'business_type' => $setting->biz_type,
|
||||
'business_item' => $setting->biz_class,
|
||||
'contact_name' => $setting->contact_name,
|
||||
'contact_phone' => $setting->contact_tel,
|
||||
'contact_email' => $setting->contact_id,
|
||||
];
|
||||
}
|
||||
|
||||
// BarobillSetting 미설정 시 Tenant 정보를 기본값으로 반환
|
||||
return $this->getSupplierSettingsFromTenant();
|
||||
}
|
||||
|
||||
/**
|
||||
* BarobillSetting에 공급자 정보가 입력되어 있는지 확인
|
||||
*/
|
||||
private function hasSupplierData($setting): bool
|
||||
{
|
||||
return ! empty($setting->corp_num) || ! empty($setting->corp_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tenant 정보에서 공급자 설정 기본값 조회
|
||||
*/
|
||||
private function getSupplierSettingsFromTenant(): array
|
||||
{
|
||||
$tenant = Tenant::find($this->tenantId());
|
||||
|
||||
if (! $tenant) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$options = $tenant->options ?? [];
|
||||
|
||||
return [
|
||||
'business_number' => $tenant->business_num ?? '',
|
||||
'company_name' => $tenant->company_name ?? '',
|
||||
'representative_name' => $tenant->ceo_name ?? '',
|
||||
'address' => $tenant->address ?? '',
|
||||
'business_type' => $options['business_type'] ?? '',
|
||||
'business_item' => $options['business_category'] ?? '',
|
||||
'contact_name' => $options['tax_invoice_contact'] ?? '',
|
||||
'contact_phone' => $tenant->phone ?? '',
|
||||
'contact_email' => $options['tax_invoice_email'] ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 공급자 설정 저장
|
||||
*/
|
||||
public function saveSupplierSettings(array $data): array
|
||||
{
|
||||
$this->barobillService->saveSetting([
|
||||
'corp_num' => $data['business_number'] ?? null,
|
||||
'corp_name' => $data['company_name'] ?? null,
|
||||
'ceo_name' => $data['representative_name'] ?? null,
|
||||
'addr' => $data['address'] ?? null,
|
||||
'biz_type' => $data['business_type'] ?? null,
|
||||
'biz_class' => $data['business_item'] ?? null,
|
||||
'contact_name' => $data['contact_name'] ?? null,
|
||||
'contact_tel' => $data['contact_phone'] ?? null,
|
||||
'contact_id' => $data['contact_email'] ?? null,
|
||||
]);
|
||||
|
||||
return $this->getSupplierSettings();
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 생성+발행 통합
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* 세금계산서 생성 후 즉시 발행
|
||||
*/
|
||||
public function createAndIssue(array $data): TaxInvoice
|
||||
{
|
||||
return DB::transaction(function () use ($data) {
|
||||
$taxInvoice = $this->create($data);
|
||||
|
||||
return $this->barobillService->issueTaxInvoice($taxInvoice);
|
||||
});
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 통계
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user