/// 앱 전역 상수 정의 class AppConstants { // API 관련 static const int defaultPageSize = 10; static const int maxPageSize = 100; static const Duration cacheTimeout = Duration(minutes: 5); // 페이지네이션 상수 (중앙 집중 관리) static const int minPageSize = 5; // 최소 페이지 크기 static const int largePageSize = 20; // 대용량 데이터용 static const int smallPageSize = 5; // 테스트/미리보기용 static const int bulkPageSize = 100; // 대량 조회용 static const int maxBulkPageSize = 1000; // 전체 데이터 조회용 // 테이블별 기본 페이지 크기 (데이터 특성에 맞춰 최적화) static const int equipmentPageSize = 10; // 장비 목록 (상세 정보 많음) static const int userPageSize = 20; // 사용자 목록 (일반적인 리스트) static const int companyPageSize = 10; // 회사 목록 (계층 구조 고려) static const int warehousePageSize = 10; // 창고 목록 (위치 정보 포함) static const int adminPageSize = 10; // 관리자 목록 (소수 데이터) static const int vendorPageSize = 10; // 제조사 목록 static const int modelPageSize = 20; // 모델 목록 static const int historyPageSize = 10; // 이력 목록 (상세 정보 많음) static const int rentPageSize = 20; // 대여 목록 static const int maintenancePageSize = 10; // 유지보수 목록 // API 타임아웃 (Phase 8 2단계: 30초로 단축하여 빠른 오류 감지) static const Duration apiConnectTimeout = Duration(seconds: 30); static const Duration apiReceiveTimeout = Duration(seconds: 30); static const Duration healthCheckTimeout = Duration(seconds: 10); static const Duration loginTimeout = Duration(seconds: 10); // 디바운스 시간 static const Duration searchDebounce = Duration(milliseconds: 500); static const Duration licenseSearchDebounce = Duration(milliseconds: 300); // 애니메이션 시간 static const Duration autocompleteAnimation = Duration(milliseconds: 200); static const Duration formAnimation = Duration(milliseconds: 300); static const Duration loginAnimation = Duration(milliseconds: 1000); static const Duration loginSubAnimation = Duration(milliseconds: 800); // 라이선스 만료 기간 static const int licenseExpiryWarningDays = 30; static const int licenseExpiryCautionDays = 60; static const int licenseExpiryInfoDays = 90; // 헬스체크 주기 static const Duration healthCheckInterval = Duration(seconds: 300); // 토큰 키 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}$', ); }