- CommonComponents.php: ApiResponse/ErrorResponse 글로벌 스키마 수정 - property="status" → property="success" (boolean) - property="data" → property="error" (object with code/details) - AuthApi, AdminApi, UserApi: 개별 응답 스키마 수정 - signup(): allOf 구조로 변경 - index(): Laravel LengthAwarePaginator 구조 적용 - updateMe(): Member schema 참조로 변경 - PermissionApi, MaterialApi, DepartmentApi: 로컬 스키마 재정의 제거 - ClientGroupService: 삭제된 데이터 자동 복원 기능 구현 - store(): withTrashed()로 삭제된 데이터 확인 후 restore() - update(): 삭제된 코드 존재 시 에러 반환 - ClientApi: client_group_id 필드 추가 - Client, ClientCreateRequest, ClientUpdateRequest 스키마에 추가 - lang/ko/error.php, lang/en/error.php: 에러 메시지 추가 - duplicate_code, has_clients, code_exists_in_deleted - Swagger 문서 재생성 및 검증 완료
80 lines
2.9 KiB
PHP
80 lines
2.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* System/Domain error messages (client-facing, fixed strings)
|
|
* - Not DB-driven
|
|
* - Used in global handler/service exceptions
|
|
* - Example: throw new NotFoundHttpException(__('error.not_found'));
|
|
*/
|
|
return [
|
|
|
|
// 4xx Common
|
|
'not_found' => 'The requested URI or data was not found.', // 404
|
|
'tenant_id' => 'No active tenant is set.', // 400 (Service::tenantId() missing)
|
|
'unauthenticated' => 'Authentication failed.', // 401
|
|
'forbidden' => 'You do not have permission for this request.', // 403
|
|
'bad_request' => 'Invalid request.', // 400
|
|
|
|
// Validation / Parameters
|
|
'validation_failed' => 'Request data validation failed.', // 422
|
|
'missing_parameter' => 'A required parameter is missing.', // 400
|
|
|
|
// Resource-specific (optional, with :resource placeholder)
|
|
'not_found_resource' => ':resource could not be found.', // 404
|
|
|
|
// Business rules
|
|
'duplicate' => 'Duplicate data exists.',
|
|
'conflict' => 'The request conflicts with the current state.', // 409
|
|
'state_invalid' => 'The current state does not allow this operation.', // 400/409
|
|
|
|
// Server errors
|
|
'server_error' => 'An internal server error occurred.', // 5xx
|
|
|
|
// Estimate related errors
|
|
'estimate' => [
|
|
'cannot_delete_sent_or_approved' => 'Cannot delete estimates that have been sent or approved.',
|
|
'invalid_status_transition' => 'Cannot change status from the current state.',
|
|
],
|
|
|
|
// BOM template related
|
|
'bom_template' => [
|
|
'not_found' => 'No applicable BOM template found.',
|
|
],
|
|
|
|
// Model set related
|
|
'modelset' => [
|
|
'has_dependencies' => 'Cannot delete due to associated products or subcategories.',
|
|
],
|
|
|
|
// Settings management related
|
|
'settings' => [
|
|
'field_not_found' => 'Field setting not found.',
|
|
'option_group_not_found' => 'Option group not found.',
|
|
'common_code_duplicate' => 'Duplicate common code exists.',
|
|
'invalid_field_type' => 'Invalid field type.',
|
|
],
|
|
|
|
// Materials management related
|
|
'materials' => [
|
|
'not_found' => 'Material information not found.',
|
|
'duplicate_code' => 'Duplicate material code.',
|
|
'in_use_cannot_delete' => 'Cannot delete material that is currently in use.',
|
|
],
|
|
|
|
// File management related
|
|
'file' => [
|
|
'not_found' => 'File not found.',
|
|
'upload_failed' => 'File upload failed.',
|
|
'invalid_file_type' => 'Invalid file type.',
|
|
'file_too_large' => 'File size is too large.',
|
|
],
|
|
|
|
// Client group related
|
|
'duplicate_code' => 'Duplicate group code.',
|
|
'has_clients' => 'Cannot delete the client group because it has associated clients.',
|
|
'code_exists_in_deleted' => 'The same code exists in deleted data. Please permanently delete that code first or use a different code.',
|
|
|
|
];
|