Files
sam-api/app/Http/Requests/V1/Payroll/StorePayrollRequest.php
권혁성 5448f0e57d deploy: 2026-03-12 배포
- feat: [barobill] 바로빌 카드/은행/홈택스 REST API 구현
- feat: [equipment] 설비관리 API 백엔드 구현
- feat: [payroll] 급여관리 계산 엔진 및 일괄 처리 API
- feat: [QMS] 점검표 템플릿 관리 + 로트심사 개선
- feat: [생산/출하] 수주 단위 출하 자동생성 + 상태 흐름 개선
- feat: [receiving] 입고 성적서 파일 연결
- feat: [견적] 제어기 타입 체계 변경
- feat: [email] 테넌트 메일 설정 마이그레이션 및 모델
- feat: [pmis] 시공관리 테이블 마이그레이션
- feat: [R2] 파일 업로드 커맨드 + filesystems 설정
- feat: [배포] Jenkinsfile 롤백 기능 추가
- fix: [approval] SAM API 규칙 준수 코드 개선
- fix: [account-codes] 계정과목 중복 데이터 정리
- fix: [payroll] 일괄 생성 시 삭제된 사용자 건너뛰기
- fix: [db] codebridge DB 분리 후 깨진 FK 제약조건 제거
- refactor: [barobill] 바로빌 연동 코드 전면 개선
2026-03-12 15:20:20 +09:00

66 lines
3.1 KiB
PHP

<?php
namespace App\Http\Requests\V1\Payroll;
use Illuminate\Foundation\Http\FormRequest;
class StorePayrollRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'user_id' => ['required', 'integer', 'exists:users,id'],
'pay_year' => ['required', 'integer', 'min:2000', 'max:2100'],
'pay_month' => ['required', 'integer', 'min:1', 'max:12'],
'base_salary' => ['required', 'numeric', 'min:0'],
'overtime_pay' => ['nullable', 'numeric', 'min:0'],
'bonus' => ['nullable', 'numeric', 'min:0'],
'allowances' => ['nullable', 'array'],
'allowances.*.name' => ['required_with:allowances', 'string', 'max:50'],
'allowances.*.amount' => ['required_with:allowances', 'numeric', 'min:0'],
'income_tax' => ['nullable', 'numeric', 'min:0'],
'resident_tax' => ['nullable', 'numeric', 'min:0'],
'health_insurance' => ['nullable', 'numeric', 'min:0'],
'pension' => ['nullable', 'numeric', 'min:0'],
'employment_insurance' => ['nullable', 'numeric', 'min:0'],
'deductions' => ['nullable', 'array'],
'deductions.*.name' => ['required_with:deductions', 'string', 'max:50'],
'deductions.*.amount' => ['required_with:deductions', 'numeric', 'min:0'],
'deduction_overrides' => ['nullable', 'array'],
'deduction_overrides.income_tax' => ['nullable', 'numeric', 'min:0'],
'deduction_overrides.resident_tax' => ['nullable', 'numeric', 'min:0'],
'deduction_overrides.health_insurance' => ['nullable', 'numeric', 'min:0'],
'deduction_overrides.long_term_care' => ['nullable', 'numeric', 'min:0'],
'deduction_overrides.pension' => ['nullable', 'numeric', 'min:0'],
'deduction_overrides.employment_insurance' => ['nullable', 'numeric', 'min:0'],
'family_count' => ['nullable', 'integer', 'min:1', 'max:11'],
'note' => ['nullable', 'string', 'max:1000'],
];
}
public function attributes(): array
{
return [
'user_id' => __('validation.attributes.user_id'),
'pay_year' => __('validation.attributes.pay_year'),
'pay_month' => __('validation.attributes.pay_month'),
'base_salary' => __('validation.attributes.base_salary'),
'overtime_pay' => __('validation.attributes.overtime_pay'),
'bonus' => __('validation.attributes.bonus'),
'allowances' => __('validation.attributes.allowances'),
'income_tax' => __('validation.attributes.income_tax'),
'resident_tax' => __('validation.attributes.resident_tax'),
'health_insurance' => __('validation.attributes.health_insurance'),
'pension' => __('validation.attributes.pension'),
'employment_insurance' => __('validation.attributes.employment_insurance'),
'deductions' => __('validation.attributes.deductions'),
'note' => __('validation.attributes.note'),
];
}
}