- Migration: structure_reviews 테이블 생성
- Model: StructureReview (BelongsToTenant, SoftDeletes)
- Service: StructureReviewService (CRUD + 통계 + 일괄삭제)
- Controller: StructureReviewController (7 endpoints)
- FormRequest: Store/Update 검증 규칙
API Endpoints:
- GET /construction/structure-reviews (목록)
- POST /construction/structure-reviews (생성)
- GET /construction/structure-reviews/stats (통계)
- DELETE /construction/structure-reviews/bulk (일괄삭제)
- GET /construction/structure-reviews/{id} (상세)
- PUT /construction/structure-reviews/{id} (수정)
- DELETE /construction/structure-reviews/{id} (삭제)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Construction;
|
|
|
|
use App\Models\Construction\StructureReview;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StructureReviewUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
// 검토 정보
|
|
'review_number' => 'sometimes|string|max:50',
|
|
|
|
// 거래처 정보
|
|
'partner_id' => 'nullable|integer',
|
|
'partner_name' => 'nullable|string|max:100',
|
|
|
|
// 현장 정보
|
|
'site_id' => 'nullable|integer',
|
|
'site_name' => 'nullable|string|max:200',
|
|
|
|
// 검토 일정
|
|
'request_date' => 'nullable|date',
|
|
'review_date' => 'nullable|date',
|
|
'completion_date' => 'nullable|date|after_or_equal:request_date',
|
|
|
|
// 검토자 정보
|
|
'review_company' => 'nullable|string|max:100',
|
|
'reviewer_name' => 'nullable|string|max:50',
|
|
|
|
// 상태 정보
|
|
'status' => [
|
|
'nullable',
|
|
Rule::in([StructureReview::STATUS_PENDING, StructureReview::STATUS_COMPLETED]),
|
|
],
|
|
|
|
// 기타
|
|
'file_url' => 'nullable|string|max:500',
|
|
'remarks' => 'nullable|string',
|
|
'is_active' => 'nullable|boolean',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'review_number.max' => __('validation.max.string', ['attribute' => '검토번호', 'max' => 50]),
|
|
'completion_date.after_or_equal' => __('validation.after_or_equal', ['attribute' => '완료일', 'date' => '의뢰일']),
|
|
];
|
|
}
|
|
} |