Skip to content

Refactor/Data & Domain Layers, Package Structure, and DI Configuration#68

Merged
K-M-9 merged 25 commits into
developfrom
refactor/structure
May 19, 2025
Merged

Refactor/Data & Domain Layers, Package Structure, and DI Configuration#68
K-M-9 merged 25 commits into
developfrom
refactor/structure

Conversation

@K-M-9

@K-M-9 K-M-9 commented May 17, 2025

Copy link
Copy Markdown
Collaborator
  • Package reorganization

    • Move the CSV files package into local.
    • Move the Mongo package into remote.
    • Rename the logic package to domain.
    • Move the util package into domain.
    • Relocate the screen classes into the console package.
  • DTOs & Mapping

    • Add DTO classes for all remote data.
    • Implement mappers to convert data DTOs → domain models.
  • Data provider split

    • Separate the data provider into: LocalDataSource (CSV), RemoteDataSource (MongoDB)
  • Custom exceptions

    • Introduce DatabaseException in the data layer.
    • Introduce AuthenticationException in the data layer.
    • Introduce FileException in the data layer and apply it to all CSV handlers.
  • Repository enhancements

    • AuditLogMongoDbImpl: apply DTOs & handle DatabaseException.
    • ProjectRepository: apply DTOs & handle DatabaseException.
    • StateRepository: implement DTOs, handle DatabaseException, and unify its interface in the domain layer.
    • TaskRepository: implement DTOs, handle DatabaseException, and unify its interface in the domain layer.
    • UserRepository: implement DTOs, handle DatabaseException, and unify its interface in the domain layer.
    • AuthenticationRepository: implement DTOs, handle DatabaseException, and unify its interface in the domain layer.
  • Entity renaming

    • Move the Entity class into domain (formerly logic) and rename it to Model.
    • Rename State to WorkflowState for greater clarity.
  • Dependency Injection

    • Update AppModule in the DI configuration to reflect all structural changes.

K-M-9 added 25 commits May 17, 2025 15:17
…, and unify the State repository interface in the domain layer to be consistent with the rest of the project.
… and unify the task repository interface in the domain layer to be consistent with the rest of the project.
… and unify the user repository interface in the domain layer to be consistent with the rest of the project.
…epository, and unify the authentication repository interface in the domain layer to be consistent with the rest of the project.
…odel, and rename state model to work flow state for greater clarity.
@github-actions

Copy link
Copy Markdown

Test Results

196 tests  ±0   196 ✅ ±0   2s ⏱️ -1s
 31 suites ±0     0 💤 ±0 
 31 files   ±0     0 ❌ ±0 

Results for commit 1b8eb1e. ± Comparison against base commit cab6dca.

This pull request removes 111 and adds 111 tests. Note that renamed tests count towards both.
data.csvfile.AuthProviderImplTest ‑ shouldDeleteUser_whenDeleteCurrentUser()
data.csvfile.AuthProviderImplTest ‑ shouldStoreUser_whenAddCurrentUser()
data.csvfile.AuthProviderImplTest ‑ shouldThrowFileWriteException_whenAddUserFails()
data.csvfile.AuthProviderImplTest ‑ shouldThrowFileWriteException_whenErrorDeletingUser()
data.csvfile.AuthProviderImplTest ‑ shouldThrowFileWriteException_whenFileCreationFails()
data.csvfile.AuthProviderImplTest ‑ shouldThrowFileWriteException_whenFileWriteFails()
data.csvfile.AuthProviderImplTest ‑ shouldThrowFormatException_whenUserFileIsMalformed()
data.csvfile.AuthProviderImplTest ‑ shouldThrowItemNotFoundException_whenFileIsEmpty()
data.csvfile.AuthProviderImplTest ‑ shouldThrowItemNotFoundException_whenNoUserStored()
data.csvfile.StateCsvImplTest ‑ ensure file exists should return when file already exists()
…
data.csvfile.AuthCsvImplTest ‑ shouldDeleteUser_whenDeleteCurrentUser()
data.csvfile.AuthCsvImplTest ‑ shouldStoreUser_whenAddCurrentUser()
data.csvfile.AuthCsvImplTest ‑ shouldThrowFileWriteException_whenAddUserFails()
data.csvfile.AuthCsvImplTest ‑ shouldThrowFileWriteException_whenErrorDeletingUser()
data.csvfile.AuthCsvImplTest ‑ shouldThrowFileWriteException_whenFileCreationFails()
data.csvfile.AuthCsvImplTest ‑ shouldThrowFileWriteException_whenFileWriteFails()
data.csvfile.AuthCsvImplTest ‑ shouldThrowFormatException_whenUserFileIsMalformed()
data.csvfile.AuthCsvImplTest ‑ shouldThrowItemNotFoundException_whenFileIsEmpty()
data.csvfile.AuthCsvImplTest ‑ shouldThrowItemNotFoundException_whenNoUserStored()
data.csvfile.WorkflowWorkflowStateCsvImplTest ‑ ensure file exists should return when file already exists()
…

@Mostafa-alsaygh

Copy link
Copy Markdown
Collaborator

great work

@K-M-9 K-M-9 merged commit e7319b2 into develop May 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants