[PR #16199] [MERGED] refactor(mobile): split store into repo and service #14786

Closed
opened 2026-02-05 15:37:47 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/16199
Author: @shenlong-tanwen
Created: 2/18/2025
Status: Merged
Merged: 2/19/2025
Merged by: @alextran1502

Base: mainHead: refactor/store-domain


📝 Commits (4)

  • 0539037 refactor(mobile): migrate store
  • 2ff77f4 Merge branch 'main' into refactor/store-domain
  • 2377743 refactor(mobile): expand abbreviations
  • a6805e1 chore(mobile): fix lint

📊 Changes

33 files changed (+578 additions, -283 deletions)

View changed files

📝 mobile/analysis_options.yaml (+3 -0)
📝 mobile/integration_test/test_utils/general_helper.dart (+6 -2)
mobile/lib/domain/README.md (+34 -0)
mobile/lib/domain/interfaces/db.interface.dart (+3 -0)
mobile/lib/domain/interfaces/store.interface.dart (+17 -0)
mobile/lib/domain/services/store.service.dart (+106 -0)
📝 mobile/lib/entities/store.entity.dart (+62 -208)
mobile/lib/infrastructure/README.md (+31 -0)
mobile/lib/infrastructure/entities/store.entity.dart (+12 -0)
📝 mobile/lib/infrastructure/entities/store.entity.g.dart (+1 -3)
mobile/lib/infrastructure/repositories/db.repository.dart (+19 -0)
mobile/lib/infrastructure/repositories/store.repository.dart (+107 -0)
📝 mobile/lib/interfaces/user.interface.dart (+2 -0)
📝 mobile/lib/main.dart (+28 -22)
📝 mobile/lib/providers/auth.provider.dart (+11 -11)
mobile/lib/providers/infrastructure/db.provider.dart (+7 -0)
mobile/lib/providers/infrastructure/db.provider.g.dart (+24 -0)
mobile/lib/providers/infrastructure/store.provider.dart (+10 -0)
mobile/lib/providers/infrastructure/store.provider.g.dart (+25 -0)
📝 mobile/lib/providers/user.provider.dart (+1 -1)

...and 13 more files

📄 Description

Changes made

The change is split into multiple PRs. This handles the following:

  • Refactored the App Store to use the repository pattern
  • All platform specific implementations will be inside the infrastructure folder

The following changes are to be made in the successive PRs:

  • Move the model and Store to be access from the domain
  • Removed the Store from using converters to and from DB which would make us depend on other repositories such as User repository to provide the current user and such and moved it to store only primitive values.
  • Moved the current user logic to a new Auth Service which will handle all the auth logic in the domain layer and also caches the current user that will be access from across the app.
  • Add test cases for the new service class

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/16199 **Author:** [@shenlong-tanwen](https://github.com/shenlong-tanwen) **Created:** 2/18/2025 **Status:** ✅ Merged **Merged:** 2/19/2025 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `refactor/store-domain` --- ### 📝 Commits (4) - [`0539037`](https://github.com/immich-app/immich/commit/05390378b6a8ff3d222520fa43583cff6093eb11) refactor(mobile): migrate store - [`2ff77f4`](https://github.com/immich-app/immich/commit/2ff77f44da9e615f47ce1d97c6a08d7328ec8b87) Merge branch 'main' into refactor/store-domain - [`2377743`](https://github.com/immich-app/immich/commit/237774399fc8e9fd1fed0ba2a828917c14fe6151) refactor(mobile): expand abbreviations - [`a6805e1`](https://github.com/immich-app/immich/commit/a6805e1df7a5f48c2cd4bbfaf6e81ab472488557) chore(mobile): fix lint ### 📊 Changes **33 files changed** (+578 additions, -283 deletions) <details> <summary>View changed files</summary> 📝 `mobile/analysis_options.yaml` (+3 -0) 📝 `mobile/integration_test/test_utils/general_helper.dart` (+6 -2) ➕ `mobile/lib/domain/README.md` (+34 -0) ➕ `mobile/lib/domain/interfaces/db.interface.dart` (+3 -0) ➕ `mobile/lib/domain/interfaces/store.interface.dart` (+17 -0) ➕ `mobile/lib/domain/services/store.service.dart` (+106 -0) 📝 `mobile/lib/entities/store.entity.dart` (+62 -208) ➕ `mobile/lib/infrastructure/README.md` (+31 -0) ➕ `mobile/lib/infrastructure/entities/store.entity.dart` (+12 -0) 📝 `mobile/lib/infrastructure/entities/store.entity.g.dart` (+1 -3) ➕ `mobile/lib/infrastructure/repositories/db.repository.dart` (+19 -0) ➕ `mobile/lib/infrastructure/repositories/store.repository.dart` (+107 -0) 📝 `mobile/lib/interfaces/user.interface.dart` (+2 -0) 📝 `mobile/lib/main.dart` (+28 -22) 📝 `mobile/lib/providers/auth.provider.dart` (+11 -11) ➕ `mobile/lib/providers/infrastructure/db.provider.dart` (+7 -0) ➕ `mobile/lib/providers/infrastructure/db.provider.g.dart` (+24 -0) ➕ `mobile/lib/providers/infrastructure/store.provider.dart` (+10 -0) ➕ `mobile/lib/providers/infrastructure/store.provider.g.dart` (+25 -0) 📝 `mobile/lib/providers/user.provider.dart` (+1 -1) _...and 13 more files_ </details> ### 📄 Description ### Changes made The change is split into multiple PRs. This handles the following: - Refactored the App Store to use the repository pattern - All platform specific implementations will be inside the infrastructure folder The following changes are to be made in the successive PRs: - Move the model and Store to be access from the domain - Removed the Store from using converters to and from DB which would make us depend on other repositories such as User repository to provide the current user and such and moved it to store only primitive values. - Moved the current user logic to a new Auth Service which will handle all the auth logic in the domain layer and also caches the current user that will be access from across the app. - Add test cases for the new service class --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 15:37:47 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#14786