guibranco / VTEX-SDK-dotnet

🛒 ⚙️ VTEX platform .NET SDK
https://guibranco.github.io/VTEX-SDK-dotnet/
MIT License
12 stars 7 forks source link

GitAuto: [FEATURE] Implement SKU EAN API #334

Closed gitauto-ai[bot] closed 1 week ago

gitauto-ai[bot] commented 1 month ago

Resolves #26

What is the feature

This feature implements support for the SKU EAN API, allowing users to consult, create, or update an SKU's unique identification code (barcode) within the application. By integrating this API, users can manage SKU barcodes directly, enhancing inventory management and product identification processes.

Why we need the feature

Barcodes (EANs) are essential for product identification, inventory tracking, and sales operations. Integrating the SKU EAN API enables efficient management of SKU barcodes within the application, reducing manual efforts and minimizing errors. This feature enhances the application's value by streamlining barcode management and supporting seamless synchronization with VTEX's platform.

How to implement and why

  1. Create a New Client for SKU EAN API:

    • Add a new class SkuEanClient in the Src/VTEX/Clients/Catalog directory.
    • This client will handle all interactions with the SKU EAN endpoints provided by VTEX.
  2. Define the Interface:

    • Define an interface ISkuEanClient in Src/VTEX/Clients/Catalog/Contracts to outline the methods for consulting, creating, and updating SKU EANs.
    • Interfaces promote abstraction and facilitate mocking during unit testing.
  3. Implement API Methods:

    • Consult SKU EAN:
      • Implement Task<IEnumerable<string>> GetSkuEansAsync(int skuId) to retrieve all EANs associated with a specific SKU.
    • Create SKU EAN:
      • Implement Task AddSkuEanAsync(int skuId, string ean) to associate a new EAN with a SKU.
    • Update SKU EAN:
      • Implement Task UpdateSkuEanAsync(int skuId, string oldEan, string newEan) to update an existing EAN for a SKU.
  4. Handle HTTP Requests and Responses:

    • Utilize existing HTTP client infrastructure for sending requests.
    • Implement robust error handling to manage API response codes and exceptions.
  5. Update Dependency Injection Configuration:

    • Register ISkuEanClient and SkuEanClient in the dependency injection container within Src/VTEX/Startup.cs or relevant configuration files.
    • This ensures the client is available for consumption throughout the application.
  6. Add Unit and Integration Tests:

    • In the Tests directory, create corresponding test classes SkuEanClientTests.
    • Write unit tests for each method to validate correct behavior and error handling.
    • If possible, include integration tests that can run against a VTEX sandbox environment.
  7. Update Documentation:

    • Add XML documentation comments to the new classes and methods.
    • Update README.md or relevant documentation files to include usage examples and any setup instructions required for the new client.
  8. Ensure Consistent Coding Standards:

    • Follow the project's coding conventions and style guidelines, possibly defined in .csharpierrc.yaml or similar configuration files.
    • Run any code formatters or linters as specified in the repository.
  9. Versioning:

    • If the project uses semantic versioning, increment the minor version number to reflect the addition of new functionality.

About backward compatibility

This addition maintains backward compatibility since it introduces new classes and interfaces without altering existing ones. Existing functionality remains unaffected, and consumers of the library or application are not required to make any changes unless they choose to utilize the new SKU EAN features. This ensures a seamless upgrade path for users who may want to adopt the new functionality at their convenience.

Test these changes locally

git checkout -b gitauto/issue-#26-3406630a-159a-4a2d-933e-6a973d92b6cc
git pull origin gitauto/issue-#26-3406630a-159a-4a2d-933e-6a973d92b6cc
coderabbitai[bot] commented 1 month ago

[!IMPORTANT]

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@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.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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 using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 1 month ago

Infisical secrets check: ✅ No secrets leaked!

💻 Scan logs ```txt 12:11AM INF scanning for exposed secrets... 12:11AM INF 321 commits scanned. 12:11AM INF scan completed in 254ms 12:11AM INF no leaks found ```