Coverage for src/jtech_installer/core/models.py: 100%

65 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-08-20 15:10 -0300

1""" 

2Data models for JTECH™ Installer 

3""" 

4 

5from dataclasses import dataclass 

6from enum import Enum 

7from pathlib import Path 

8from typing import Any, Dict, List 

9 

10 

11class InstallationType(Enum): 

12 """Tipos de instalação""" 

13 

14 GREENFIELD = "greenfield" 

15 BROWNFIELD = "brownfield" 

16 

17 

18class TeamType(Enum): 

19 """Tipos de equipe""" 

20 

21 ALL = "all" 

22 FULLSTACK = "fullstack" 

23 NO_UI = "no-ui" 

24 IDE_MINIMAL = "ide-minimal" 

25 

26 

27class OSType(Enum): 

28 """Tipos de sistema operacional""" 

29 

30 LINUX = "linux" 

31 MACOS = "macos" 

32 WINDOWS = "windows" 

33 

34 

35@dataclass 

36class SystemInfo: 

37 """Informações do sistema""" 

38 

39 os_type: OSType 

40 python_version: str 

41 git_available: bool 

42 vscode_available: bool 

43 current_directory: Path 

44 architecture: str = "x64" 

45 

46 

47@dataclass 

48class InstallationConfig: 

49 """Configuração da instalação""" 

50 

51 project_path: Path 

52 install_type: InstallationType 

53 team_type: TeamType 

54 vs_code_integration: bool 

55 custom_config: Dict[str, Any] 

56 framework_source_path: Path | None = None 

57 

58 

59@dataclass 

60class InstallationResult: 

61 """Resultado da instalação""" 

62 

63 success: bool 

64 installed_components: List[str] 

65 errors: List[str] 

66 warnings: List[str] 

67 duration: float 

68 config_generated: bool = False 

69 validation_passed: bool = False 

70 

71 

72@dataclass 

73class PerformanceMetrics: 

74 """Métricas de performance da instalação""" 

75 

76 total_duration: float 

77 detection_time: float 

78 file_operations_time: float 

79 config_generation_time: float 

80 validation_time: float 

81 files_processed: int 

82 total_size_mb: float 

83 

84 

85@dataclass 

86class AssetInfo: 

87 """Informações sobre um asset do framework""" 

88 

89 source_path: Path 

90 target_path: Path 

91 file_type: str 

92 required: bool = True 

93 checksum: str | None = None 

94 

95 

96@dataclass 

97class InstallationProgress: 

98 """Progresso da instalação""" 

99 

100 current_phase: str 

101 total_phases: int 

102 current_phase_number: int 

103 files_processed: int 

104 total_files: int 

105 current_file: str | None = None