feat: Phase 5.1-1 사용자 초대 + Phase 5.2 알림 설정 API 연동
- 사용자 초대 API: role 문자열 지원 추가 (React 호환) - 알림 설정 API: 그룹 기반 계층 구조 구현 - notification_setting_groups 테이블 추가 - notification_setting_group_items 테이블 추가 - notification_setting_group_states 테이블 추가 - GET/PUT /api/v1/settings/notifications 엔드포인트 추가 - Pint 코드 스타일 정리
This commit is contained in:
@@ -15,12 +15,25 @@ public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'role' => ['nullable', 'string', 'in:admin,manager,user'],
|
||||
'role_id' => ['nullable', 'integer', 'exists:roles,id'],
|
||||
'message' => ['nullable', 'string', 'max:1000'],
|
||||
'expires_days' => ['nullable', 'integer', 'min:1', 'max:30'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 추가 유효성 검사: role과 role_id 중 하나만 사용
|
||||
*/
|
||||
public function withValidator($validator): void
|
||||
{
|
||||
$validator->after(function ($validator) {
|
||||
if ($this->filled('role') && $this->filled('role_id')) {
|
||||
$validator->errors()->add('role', __('validation.custom.role_conflict'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user