Conversation
This reverts commit 683dc05.
Contributor
There was a problem hiding this comment.
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/requeststo specificinput/outputdirectories - Implemented centralized logging system with
Logger,UiLogger, andApiLoggerclasses - 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.