[PR #1077] [CLOSED] refactor(server): services #8891

Closed
opened 2026-02-05 13:54:59 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1077
Author: @jrasm91
Created: 12/9/2022
Status: Closed

Base: mainHead: refactor/services


📝 Commits (8)

  • f311a41 refactor(server): move device-info service to common
  • 7c49af3 refactor(server): move server-info to common
  • f8e7b88 refactor(server): tag service to common module
  • 1fab5f3 refactor(server): user service to common module
  • 13607d8 refactor: reduce changes
  • 78d7ab8 chore: merge
  • 5c871e1 fix: user count test and password logic
  • c559bd9 refacor: asset service interfaces

📊 Changes

81 files changed (+2728 additions, -2286 deletions)

View changed files

📝 server/apps/cli/src/app.module.ts (+2 -3)
📝 server/apps/cli/src/commands/reset-admin-password.command.ts (+5 -18)
📝 server/apps/immich/src/api-v1/album/album.module.ts (+3 -10)
📝 server/apps/immich/src/api-v1/album/album.service.spec.ts (+1 -23)
📝 server/apps/immich/src/api-v1/album/album.service.ts (+0 -2)
server/apps/immich/src/api-v1/api-v1.module.ts (+12 -0)
📝 server/apps/immich/src/api-v1/asset/asset-repository.ts (+4 -3)
📝 server/apps/immich/src/api-v1/asset/asset.module.ts (+2 -7)
📝 server/apps/immich/src/api-v1/auth/auth.module.ts (+1 -2)
📝 server/apps/immich/src/api-v1/auth/auth.service.spec.ts (+12 -16)
📝 server/apps/immich/src/api-v1/auth/auth.service.ts (+4 -5)
📝 server/apps/immich/src/api-v1/auth/response-dto/admin-signup-response.dto.ts (+2 -2)
📝 server/apps/immich/src/api-v1/auth/response-dto/login-response.dto.ts (+2 -2)
📝 server/apps/immich/src/api-v1/device-info/device-info.controller.ts (+1 -1)
server/apps/immich/src/api-v1/device-info/device-info.module.ts (+0 -12)
server/apps/immich/src/api-v1/device-info/device-info.service.ts (+0 -29)
📝 server/apps/immich/src/api-v1/device-info/dto/upsert-device-info.dto.ts (+2 -2)
📝 server/apps/immich/src/api-v1/device-info/response-dto/device-info-response.dto.ts (+2 -2)
📝 server/apps/immich/src/api-v1/job/job.module.ts (+0 -7)
📝 server/apps/immich/src/api-v1/oauth/oauth.module.ts (+1 -2)

...and 61 more files

📄 Description

This PR refactors the DeviceInfoService, ServerInfoService, TagService, and UserService.

Each service has:

  • 100% code coverage
  • A corresponding repository implementation (without any business logic)
  • No dependency on TypeORM
  • (Cleaner) interfaces that are variations of the original entity

Most of the changes are renaming and moving files, with some refactoring. Long term goals would be simplify the dtos used in the controllers and web/mobile clients to allow a lot of the mapping/renaming to be removed.


🔄 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/1077 **Author:** [@jrasm91](https://github.com/jrasm91) **Created:** 12/9/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/services` --- ### 📝 Commits (8) - [`f311a41`](https://github.com/immich-app/immich/commit/f311a4121a7ffd44824ebdd78a91ef626d6aae09) refactor(server): move device-info service to common - [`7c49af3`](https://github.com/immich-app/immich/commit/7c49af3d7531cb38a2163bffbfd968309ae212d3) refactor(server): move server-info to common - [`f8e7b88`](https://github.com/immich-app/immich/commit/f8e7b88e6f4c8945056a33d8dd4d544d3aa22c5b) refactor(server): tag service to common module - [`1fab5f3`](https://github.com/immich-app/immich/commit/1fab5f3a3155ac8f97e6609e7774e5d90ade9e18) refactor(server): user service to common module - [`13607d8`](https://github.com/immich-app/immich/commit/13607d8d9379904fe1e6ffa28801f31a4504487a) refactor: reduce changes - [`78d7ab8`](https://github.com/immich-app/immich/commit/78d7ab8fe92661b6bb4668b0de99a8b369feb5bb) chore: merge - [`5c871e1`](https://github.com/immich-app/immich/commit/5c871e178bedcd7fd4612e3540e0a044327ddec2) fix: user count test and password logic - [`c559bd9`](https://github.com/immich-app/immich/commit/c559bd90607b94896ff4473803d10d59fe173092) refacor: asset service interfaces ### 📊 Changes **81 files changed** (+2728 additions, -2286 deletions) <details> <summary>View changed files</summary> 📝 `server/apps/cli/src/app.module.ts` (+2 -3) 📝 `server/apps/cli/src/commands/reset-admin-password.command.ts` (+5 -18) 📝 `server/apps/immich/src/api-v1/album/album.module.ts` (+3 -10) 📝 `server/apps/immich/src/api-v1/album/album.service.spec.ts` (+1 -23) 📝 `server/apps/immich/src/api-v1/album/album.service.ts` (+0 -2) ➕ `server/apps/immich/src/api-v1/api-v1.module.ts` (+12 -0) 📝 `server/apps/immich/src/api-v1/asset/asset-repository.ts` (+4 -3) 📝 `server/apps/immich/src/api-v1/asset/asset.module.ts` (+2 -7) 📝 `server/apps/immich/src/api-v1/auth/auth.module.ts` (+1 -2) 📝 `server/apps/immich/src/api-v1/auth/auth.service.spec.ts` (+12 -16) 📝 `server/apps/immich/src/api-v1/auth/auth.service.ts` (+4 -5) 📝 `server/apps/immich/src/api-v1/auth/response-dto/admin-signup-response.dto.ts` (+2 -2) 📝 `server/apps/immich/src/api-v1/auth/response-dto/login-response.dto.ts` (+2 -2) 📝 `server/apps/immich/src/api-v1/device-info/device-info.controller.ts` (+1 -1) ➖ `server/apps/immich/src/api-v1/device-info/device-info.module.ts` (+0 -12) ➖ `server/apps/immich/src/api-v1/device-info/device-info.service.ts` (+0 -29) 📝 `server/apps/immich/src/api-v1/device-info/dto/upsert-device-info.dto.ts` (+2 -2) 📝 `server/apps/immich/src/api-v1/device-info/response-dto/device-info-response.dto.ts` (+2 -2) 📝 `server/apps/immich/src/api-v1/job/job.module.ts` (+0 -7) 📝 `server/apps/immich/src/api-v1/oauth/oauth.module.ts` (+1 -2) _...and 61 more files_ </details> ### 📄 Description This PR refactors the `DeviceInfoService`, `ServerInfoService`, `TagService`, and `UserService`. Each service has: - 100% code coverage - A corresponding repository implementation (without any business logic) - No dependency on TypeORM - (Cleaner) interfaces that are variations of the original entity Most of the changes are renaming and moving files, with some refactoring. Long term goals would be simplify the dtos used in the controllers and web/mobile clients to allow a lot of the mapping/renaming to be removed. --- <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 13:54:59 +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#8891