feat: Phase 8.3 회사 추가 API 구현
- 사업자등록번호 유효성 검사 API (바로빌 연동) - 회사 추가 신청/승인/반려 워크플로우 - 신청 승인 시 테넌트 자동 생성 및 사용자 연결 - 관리자용 신청 목록/상세 조회 - 사용자용 내 신청 목록 조회 - Swagger 문서 및 i18n 메시지 추가
This commit is contained in:
28
app/Http/Requests/V1/Company/CheckBusinessNumberRequest.php
Normal file
28
app/Http/Requests/V1/Company/CheckBusinessNumberRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Company;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CheckBusinessNumberRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'business_number' => 'required|string|min:10|max:13',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'business_number.required' => __('validation.required', ['attribute' => '사업자등록번호']),
|
||||
'business_number.min' => __('validation.min.string', ['attribute' => '사업자등록번호', 'min' => 10]),
|
||||
];
|
||||
}
|
||||
}
|
||||
20
app/Http/Requests/V1/Company/CompanyRequestActionRequest.php
Normal file
20
app/Http/Requests/V1/Company/CompanyRequestActionRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Company;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CompanyRequestActionRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'reason' => 'nullable|string|max:500',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/V1/Company/CompanyRequestIndexRequest.php
Normal file
29
app/Http/Requests/V1/Company/CompanyRequestIndexRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Company;
|
||||
|
||||
use App\Models\CompanyRequest;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class CompanyRequestIndexRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['nullable', Rule::in(CompanyRequest::STATUSES)],
|
||||
'search' => 'nullable|string|max:100',
|
||||
'start_date' => 'nullable|date',
|
||||
'end_date' => 'nullable|date|after_or_equal:start_date',
|
||||
'sort_by' => ['nullable', Rule::in(['created_at', 'company_name', 'status', 'processed_at'])],
|
||||
'sort_dir' => ['nullable', Rule::in(['asc', 'desc'])],
|
||||
'per_page' => 'nullable|integer|min:1|max:100',
|
||||
'page' => 'nullable|integer|min:1',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/V1/Company/CompanyRequestStoreRequest.php
Normal file
34
app/Http/Requests/V1/Company/CompanyRequestStoreRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Company;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CompanyRequestStoreRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'business_number' => 'required|string|min:10|max:13',
|
||||
'company_name' => 'required|string|max:200',
|
||||
'ceo_name' => 'nullable|string|max:50',
|
||||
'address' => 'nullable|string|max:300',
|
||||
'phone' => 'nullable|string|max:30',
|
||||
'email' => 'nullable|email|max:100',
|
||||
'message' => 'nullable|string|max:1000',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'business_number.required' => __('validation.required', ['attribute' => '사업자등록번호']),
|
||||
'company_name.required' => __('validation.required', ['attribute' => '회사명']),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user