feat: 근무/출퇴근 설정 및 현장 관리 API 구현
- 근무 설정 API (GET/PUT /settings/work) - 근무유형, 소정근로시간, 연장근로시간, 근무요일, 출퇴근시간, 휴게시간 - 출퇴근 설정 API (GET/PUT /settings/attendance) - GPS 출퇴근, 허용 반경, 본사 위치 설정 - 현장 관리 API (CRUD /sites) - 현장 등록/수정/삭제, 활성화된 현장 목록(셀렉트박스용) - GPS 좌표 기반 위치 관리 마이그레이션: work_settings, attendance_settings, sites 테이블 모델: WorkSetting, AttendanceSetting, Site (BelongsToTenant, SoftDeletes) 서비스: WorkSettingService, SiteService Swagger 문서 및 i18n 메시지 키 추가
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\WorkSetting;
|
||||
|
||||
use App\Models\Tenants\WorkSetting;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateWorkSettingRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'work_type' => ['sometimes', 'string', Rule::in(WorkSetting::WORK_TYPES)],
|
||||
'standard_hours' => ['sometimes', 'integer', 'min:1', 'max:168'],
|
||||
'overtime_hours' => ['sometimes', 'integer', 'min:0', 'max:52'],
|
||||
'overtime_limit' => ['sometimes', 'integer', 'min:0', 'max:100'],
|
||||
'work_days' => ['sometimes', 'array'],
|
||||
'work_days.*' => ['string', Rule::in(['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'])],
|
||||
'start_time' => ['sometimes', 'date_format:H:i:s'],
|
||||
'end_time' => ['sometimes', 'date_format:H:i:s', 'after:start_time'],
|
||||
'break_minutes' => ['sometimes', 'integer', 'min:0', 'max:180'],
|
||||
'break_start' => ['nullable', 'date_format:H:i:s'],
|
||||
'break_end' => ['nullable', 'date_format:H:i:s', 'after:break_start'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'work_type.in' => __('error.work_setting.invalid_work_type'),
|
||||
'end_time.after' => __('error.work_setting.end_time_after_start'),
|
||||
'break_end.after' => __('error.work_setting.break_end_after_start'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user