-
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
fix: supply historical fix #61
Conversation
WalkthroughOverall, the changes revolve around removing the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SupplyService
participant Database
Client->>SupplyService: Request current supply
SupplyService->>Database: Query current supply
Database-->>SupplyService: Return supply data
SupplyService->>Client: Return current supply (without `change`)
Client->>SupplyService: Request supply intervals
SupplyService->>Database: Query supply intervals
Database-->>SupplyService: Return supply interval data
SupplyService->>Client: Return `SupplyIntervalDto`
Client->>SupplyService: Calculate supply growth
SupplyService->>Database: Query past and current supply
Database-->>SupplyService: Return past and current supply data
SupplyService->>SupplyService: Calculate supply growth percentage
SupplyService->>Client: Return supply growth result
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- prisma/migrations/20240715092517_historical_supply_change_supply/migration.sql (1 hunks)
- prisma/schema.prisma (1 hunks)
- src/modules/supply/dtos/current-supply.dto.ts (1 hunks)
- src/modules/supply/dtos/supply-interval.dto.ts (1 hunks)
- src/modules/supply/dtos/time-bucket.dto.ts (1 hunks)
- src/modules/supply/services/supply.service.ts (7 hunks)
Files skipped from review due to trivial changes (3)
- prisma/migrations/20240715092517_historical_supply_change_supply/migration.sql
- prisma/schema.prisma
- src/modules/supply/dtos/supply-interval.dto.ts
Additional comments not posted (7)
src/modules/supply/dtos/current-supply.dto.ts (1)
1-4
: LGTM! The interface is simplified.The removal of the
change
property fromCurrentSupplyDto
is consistent with the overall refactor.src/modules/supply/dtos/time-bucket.dto.ts (1)
2-4
: LGTM! The property name and type change are appropriate.The renaming of
sum_change
toavg_supply
and the type change tostring
align with the overall refactor.src/modules/supply/services/supply.service.ts (5)
Line range hint
67-71
:
LGTM! The SQL query changes are correct.The update to select
avg_supply
instead ofsum_change
is consistent with the new schema.
76-79
: LGTM! The mapping is consistent.The
fromBucket
method correctly mapsavg_supply
tochange
in theSupplyIntervalDto
.
113-122
: LGTM! The type change and logic adjustments are correct.The method correctly handles
newSupply
andpastSupply
as strings and calculates the supply change percentage.
192-205
: LGTM! The logic for calculating supply growth is correct.The method correctly calculates supply growth based on current and past supply values.
211-215
: LGTM! The inclusion ofgrowth
is correct.The method correctly includes
growth
in the returned object and calculates it usingBig
.
No description provided.