/// 앱 전역 상수 정의 class AppConstants { // API 관련 static const int defaultPageSize = 20; static const int maxPageSize = 100; static const Duration cacheTimeout = Duration(minutes: 5); // 토큰 키 static const String accessTokenKey = 'access_token'; static const String refreshTokenKey = 'refresh_token'; static const String tokenTypeKey = 'token_type'; static const String expiresInKey = 'expires_in'; // 사용자 권한 매핑 static const Map flutterToBackendRole = { 'S': 'admin', // Super user 'M': 'manager', // Manager 'U': 'staff', // User 'V': 'viewer', // Viewer }; static const Map backendToFlutterRole = { 'admin': 'S', 'manager': 'M', 'staff': 'U', 'viewer': 'V', }; // 장비 상태 static const Map equipmentStatus = { 'available': '사용가능', 'in_use': '사용중', 'maintenance': '유지보수', 'disposed': '폐기', 'rented': '대여중', }; // 정렬 옵션 static const Map sortOptions = { 'created_at': '생성일', 'updated_at': '수정일', 'name': '이름', 'status': '상태', }; // 날짜 형식 static const String dateFormat = 'yyyy-MM-dd'; static const String dateTimeFormat = 'yyyy-MM-dd HH:mm:ss'; // 파일 업로드 static const int maxFileSize = 10 * 1024 * 1024; // 10MB static const List allowedFileExtensions = [ 'jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx' ]; // 에러 메시지 static const String networkError = '네트워크 연결을 확인해주세요.'; static const String timeoutError = '요청 시간이 초과되었습니다.'; static const String unauthorizedError = '인증이 필요합니다.'; static const String serverError = '서버 오류가 발생했습니다.'; static const String unknownError = '알 수 없는 오류가 발생했습니다.'; // 정규식 패턴 static final RegExp emailRegex = RegExp( r'^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+', ); static final RegExp phoneRegex = RegExp( r'^01[0-9]{1}-?[0-9]{4}-?[0-9]{4}$', ); static final RegExp businessNumberRegex = RegExp( r'^[0-9]{3}-?[0-9]{2}-?[0-9]{5}$', ); }