Skip to content

[LOCKLITE-104] Refactor backend#63

Merged
vbetsch merged 75 commits intodevelopfrom
api/refactor/104
Aug 3, 2025
Merged

[LOCKLITE-104] Refactor backend#63
vbetsch merged 75 commits intodevelopfrom
api/refactor/104

Conversation

@vbetsch
Copy link
Owner

@vbetsch vbetsch commented Aug 3, 2025

No description provided.

@vbetsch vbetsch added the Code refactoring Code refactoring (for the release changelog) label Aug 3, 2025
@notion-workspace
Copy link

Refactor user story

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the backend architecture by reorganizing DTOs into input/output directories, implementing a standardized logging system, and improving error handling with Prisma database operations.

  • Reorganized DTO structure from generic responses/requests to specific input/output directories
  • Implemented centralized logging system with Logger, UiLogger, and ApiLogger classes
  • Added comprehensive Prisma error handling with specific error types and HTTP status codes

Reviewed Changes

Copilot reviewed 45 out of 46 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/modules/shared/dto/ Restructured DTOs into input/output organization with new data/response types
src/modules/shared/logs/ Added base Logger class with color-coded console output and tag system
src/modules/ui/logs/ui.logger.ts UI-specific logger that only outputs in development mode
src/modules/api/logs/api.logger.ts API-specific logger with color-coded output for development
src/modules/api/helpers/prisma/ Added Prisma error handling with specific HTTP error mappings
src/modules/shared/services/abstract/request.service.ts Refactored to return structured output with status and data
src/modules/ui/services/locklite-api-request.service.ts Implemented custom fetch logic with error handling
src/modules/api/usecases/vaults/ Updated to use new DTO structure and added vault existence validation
Comments suppressed due to low confidence (5)

src/modules/api/usecases/vaults/delete-vault.usecase.ts:4

  • The import uses CreateVaultParams for a delete operation. This should be renamed to DeleteVaultParams or use a more generic IdParams type to better reflect its usage in the delete context.
import { CreateVaultParams } from '@shared/dto/input/params/create-vault.params';

src/modules/api/usecases/vaults/delete-vault.usecase.ts:8

  • The interface uses CreateVaultParams for a delete operation. This should use DeleteVaultParams or a more generic IdParams type to better reflect the delete operation.
  implements IUseCaseWithInput<CreateVaultParams, void>

src/modules/api/usecases/vaults/delete-vault.usecase.ts:15

  • The parameter uses CreateVaultParams for a delete operation. This should use DeleteVaultParams or a more generic IdParams type to better reflect the delete operation.
  public async handle(params: CreateVaultParams): Promise<void> {

src/app/api/vaults/[id]/route.ts:7

  • The import uses CreateVaultParams for a delete route. This should be renamed to DeleteVaultParams or use a more generic IdParams type to better reflect its usage in the delete context.
import type { CreateVaultParams } from '@shared/dto/input/params/create-vault.params';

src/app/api/vaults/[id]/route.ts:42

  • The parameter uses CreateVaultParams for a delete route. This should use DeleteVaultParams or a more generic IdParams type to better reflect the delete operation.
  options: HttpOptions<CreateVaultParams>

@vbetsch vbetsch merged commit 8303afd into develop Aug 3, 2025
4 checks passed
@vbetsch vbetsch deleted the api/refactor/104 branch August 3, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code refactoring Code refactoring (for the release changelog)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants