Skip to content
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

feat: added supply growth metric #7

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

yevhen-burkovskyi
Copy link
Contributor

No description provided.

@yevhen-burkovskyi yevhen-burkovskyi self-assigned this May 8, 2024
Copy link

coderabbitai bot commented May 8, 2024

Walkthrough

The recent updates involve renaming the ChangeSupplyRange enum to Range and integrating it across various modules, replacing old enums for consistency. New enum values have been added, and methods and schema validations have been updated accordingly. This standardizes the handling of time ranges across different functionalities like price and supply management, enhancing maintainability and clarity in the codebase.

Changes

File Path Change Summary
.../enums/range.enum.ts Renamed ChangeSupplyRange to Range and added new values ALL, THREE_MONTH, YEAR.
.../price/price.controller.ts Removed PriceRange enum usage, replaced with Range.
.../price/schemas/range.schema.ts Updated imports and validations to use new Range enum values.
.../price/services/price.cache.ts Updated to use Range enum in method signatures and caching logic.
.../supply/enums/supply-endpoints.enum.ts Added GROWTH to SupplyEndpoints enum.
.../supply/schemas/... Updated several schemas (change-range.schema.ts, growth-range.schema.ts, historical-range.schema.ts) to use Range enum for validations.
.../supply/services/... Updated SupplyCache and SupplyService to use Range enum in methods and caching. Added new methods related to supply growth in SupplyService.
.../supply/supply.controller.ts Replaced specific enums with Range in methods, added new method getSupplyGrowth using Range.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 24303ac and 6391975.
Files selected for processing (11)
  • src/core/enums/range.enum.ts (1 hunks)
  • src/modules/price/price.controller.ts (2 hunks)
  • src/modules/price/schemas/range.schema.ts (1 hunks)
  • src/modules/price/services/price.cache.ts (4 hunks)
  • src/modules/supply/enums/supply-endpoints.enum.ts (1 hunks)
  • src/modules/supply/schemas/change-range.schema.ts (1 hunks)
  • src/modules/supply/schemas/growth-range.schema.ts (1 hunks)
  • src/modules/supply/schemas/historical-range.schema.ts (1 hunks)
  • src/modules/supply/services/supply.cache.ts (4 hunks)
  • src/modules/supply/services/supply.service.ts (3 hunks)
  • src/modules/supply/supply.controller.ts (3 hunks)
Files skipped from review due to trivial changes (3)
  • src/modules/price/services/price.cache.ts
  • src/modules/supply/enums/supply-endpoints.enum.ts
  • src/modules/supply/services/supply.cache.ts
Additional comments not posted (15)
src/modules/supply/schemas/historical-range.schema.ts (1)

1-1: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for the Range enum, @core/enums/range.enum, is consistently used across multiple files in the project. This confirms that the import path is correct and consistently applied in various modules, as evidenced by the successful execution of the corrected script and its output.

  • src/modules/supply/schemas/historical-range.schema.ts
  • src/modules/supply/schemas/growth-range.schema.ts
  • src/modules/supply/schemas/change-range.schema.ts
  • src/modules/price/price.controller.ts
  • src/modules/price/services/price.cache.ts
  • src/modules/price/schemas/range.schema.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files with corrected regex.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import \{ Range \} from '@core/enums/range.enum';"

Length of output: 636

src/core/enums/range.enum.ts (1)

1-9: The updated Range enum correctly includes the new values THREE_MONTH and YEAR. This aligns with the PR objectives to standardize time range specifications.

src/modules/supply/schemas/change-range.schema.ts (1)

1-1: Ensure the import path for Range is correct and consistent across the project.

src/modules/supply/schemas/growth-range.schema.ts (1)

1-1: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for Range from @core/enums/range.enum is consistently used across multiple files in the project. This confirms that the import path is correct and consistent as per the review comment.

  • src/modules/supply/supply.controller.ts
  • src/modules/supply/services/supply.service.ts
  • src/modules/supply/services/supply.cache.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all TypeScript files.

# Corrected Test: Search for the import statement of `Range` with escaped curly braces. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all TypeScript files.

# Adjusted Test: Use double quotes for the regex pattern to avoid shell syntax issues. Expect: Consistent import paths.
rg --type ts 'import { Range } from "@core/enums/range.enum";'

Length of output: 203



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all TypeScript files.

# Corrected Test: Escape curly braces in the regex pattern to treat them as literals. Expect: Consistent import paths.
rg --type ts 'import \{ Range \} from "@core/enums/range.enum";'

Length of output: 340

src/modules/price/schemas/range.schema.ts (2)

3-3: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for Range from @core/enums/range.enum is consistently used across multiple files in the project. This confirms that the import path is correct and consistently applied as per the project's standards.

  • Files using the import path:
    • src/modules/supply/schemas/growth-range.schema.ts
    • src/modules/supply/schemas/change-range.schema.ts
    • src/modules/price/price.controller.ts
    • src/modules/price/services/price.cache.ts
    • src/modules/price/schemas/range.schema.ts
    • src/modules/supply/schemas/historical-range.schema.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all TypeScript files, with corrected regex.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';" --fixed-strings

Length of output: 650


6-6: The RangeSchema correctly includes all the new and existing Range values. This is well-aligned with the PR objectives to standardize the use of time range specifications.

src/modules/price/price.controller.ts (2)

5-5: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for the Range enum is consistently used across multiple files in the project, as verified by the successful execution of the script. All referenced files import Range from the same path @core/enums/range.enum.

  • src/modules/supply/schemas/historical-range.schema.ts
  • src/modules/supply/schemas/growth-range.schema.ts
  • src/modules/supply/schemas/change-range.schema.ts
  • src/modules/price/price.controller.ts
  • src/modules/price/services/price.cache.ts
  • src/modules/price/schemas/range.schema.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';" --fixed-strings

Length of output: 650


19-19: The method getHistoricalPrice correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.

src/modules/supply/supply.controller.ts (4)

10-10: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for the Range enum is consistently used across multiple files in the project as @core/enums/range.enum. This confirms that the import path is correct and consistent, aligning with the project's structure and the PR objectives.

  • Files using the consistent import path:
    • src/modules/supply/schemas/historical-range.schema.ts
    • src/modules/supply/schemas/change-range.schema.ts
    • src/modules/price/price.controller.ts
    • src/modules/supply/schemas/growth-range.schema.ts
    • src/modules/price/services/price.cache.ts
    • src/modules/price/schemas/range.schema.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range\.enum';"

Length of output: 211



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts --fixed-strings "import { Range } from '@core/enums/range.enum';"

Length of output: 650


23-23: The method getHistoricalSupply correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.


36-36: The method getSupplyChange correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.


44-44: The method getSupplyGrowth correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.

src/modules/supply/services/supply.service.ts (3)

10-10: Ensure the import path for Range is correct and consistent across the project.

Verification successful

The import path for the Range enum is consistently used across various files in the project as @core/enums/range.enum. This confirms that the import path is correct and consistently applied in the codebase.

  • src/modules/supply/schemas/growth-range.schema.ts
  • src/modules/supply/schemas/change-range.schema.ts
  • src/modules/price/services/price.cache.ts
  • src/modules/price/price.controller.ts
  • src/modules/price/schemas/range.schema.ts
  • src/modules/supply/schemas/historical-range.schema.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import { Range } from '@core/enums/range.enum';"

Length of output: 209



Script:

#!/bin/bash
# Description: Verify the import path for `Range` across all files.

# Test: Search for the import statement of `Range`. Expect: Consistent import paths.
rg --type ts "import \{ Range \} from '@core/enums/range.enum';"

Length of output: 636


66-66: The method getSupplyChange correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.


105-105: The method getSupplyGrowth correctly uses the Range enum for its parameter type, aligning with the PR's goal of standardizing time range specifications.

@dbatarin dbatarin merged commit 8121e07 into main May 9, 2024
6 checks passed
@yevhen-burkovskyi yevhen-burkovskyi deleted the feat/supply-growth-metric branch May 9, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants