-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: merged supply charts into one endpoint #39
Conversation
WalkthroughThe modifications introduce a new feature that involves the addition of a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Controller
participant Service
User->>+Controller: GET /charts?range={range}
Controller->>+ChartsRangeSchema: Validate range
alt valid range
Controller->>+Service: getCharts(range)
Service-->>-Controller: issuance, growth, burnt data
Controller-->>-User: JSON response with data
else invalid range
Controller-->>-User: Error response (400 Bad Request)
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- src/modules/supply/enums/supply-endpoints.enum.ts (1 hunks)
- src/modules/supply/schemas/charts-range.schema.ts (1 hunks)
- src/modules/supply/services/supply.service.ts (1 hunks)
- src/modules/supply/supply.controller.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- src/modules/supply/enums/supply-endpoints.enum.ts
Additional context used
Biome
src/modules/supply/supply.controller.ts
[error] 22-22: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 35-35: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 43-43: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
Additional comments not posted (3)
src/modules/supply/schemas/charts-range.schema.ts (1)
1-6
: TheChartsRangeSchema
is correctly defined using Joi validation to ensure that only specific predefined options are accepted. This is crucial for maintaining the integrity of the input data for the new charts endpoint.src/modules/supply/supply.controller.ts (1)
41-46
: The newgetCharts
method correctly utilizes theChartsRangeSchema
for validating therange
parameter. This alignment ensures that the endpoint adheres to the expected schema constraints.Tools
Biome
[error] 43-43: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.src/modules/supply/services/supply.service.ts (1)
188-198
: ThegetCharts
method is well-implemented, aggregating various metrics based on the provided range. However, theburnt
value is statically set to 0. If this is a placeholder, consider adding a comment or creating a task to implement this metric fully in the future.
@@ -8,19 +8,19 @@ import { HistoricalRangeSchema } from "./schemas/historical-range.schema"; | |||
import { SupplyService } from "./services/supply.service"; | |||
import { ChangeRangeSchema } from "./schemas/change-range.schema"; | |||
import { Range } from "@core/enums/range.enum"; | |||
import { GrowthRangeSchema } from "./schemas/growth-range.schema"; | |||
import { ChartsRangeSchema } from "./schemas/charts-range.schema"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of decorators on method parameters is flagged as invalid. You need to enable parameter decorators by setting the unsafeParameterDecoratorsEnabled
option to true
in your configuration file.
+ // tsconfig.json
+ {
+ "compilerOptions": {
+ "unsafeParameterDecoratorsEnabled": true
+ }
+ }
Also applies to: 43-43
No description provided.