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

ecommerce description & info add on api #4966

Merged
merged 1 commit into from
Feb 16, 2024
Merged

ecommerce description & info add on api #4966

merged 1 commit into from
Feb 16, 2024

Conversation

Gerelsukh
Copy link
Collaborator

Ecommerce plugin api improve

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Enhancement

PR Summary: The pull request introduces enhancements to the ecommerce plugin API by adding 'description' and 'info' fields to the product review functionality. This includes updates to the GraphQL schema, resolver mutations, and the model definitions to accommodate the new fields. The changes aim to enrich the product review capabilities, allowing for more detailed reviews and additional information to be stored and processed.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Consider implementing validation for the new 'description' and 'info' fields to ensure data integrity and security. This could include type checks, length constraints, and schema validation for the JSON content of the 'info' field.
  • Review the use of the 'any' type for the 'info' field in the model definitions. A more specific type or interface could provide better type safety and clarity about the expected structure of the data.
  • Ensure that the enhancements introduced by this PR are well-documented, including any new requirements or constraints on the data for the 'description' and 'info' fields. This will help developers and users of the API understand how to effectively use the new features.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

) => {
const { productId, customerId, review } = params;
const { productId, customerId, review, description, info } = params;
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): Ensure that the newly added description and info fields are properly validated for type and content before being processed. This is crucial for maintaining data integrity and preventing potential injection attacks.

@@ -4,6 +4,8 @@ export const types = `
productId: String!
customerId : String
review: Float
description: String
Copy link

Choose a reason for hiding this comment

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

question (llm): Given that description is a new field, consider if there should be any constraints on its content, such as length or format, to ensure consistency and data quality.

@@ -4,6 +4,8 @@
productId: String!
customerId : String
review: Float
description: String
info: JSON
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): Storing info as JSON provides flexibility but also poses a risk for unstructured or unexpected data. It's advisable to have a schema validation in place for the JSON content to prevent potential issues.

@@ -5,6 +5,8 @@ export interface IProductreview {
productId: string;
customerId: string;
review: number;
description: string;
info: any;
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): Using any type for the info field lacks type safety. If possible, define a more specific type or interface that reflects the expected structure of info to enhance code reliability and maintainability.

Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@nandinboldn nandinboldn merged commit 45de622 into dev Feb 16, 2024
3 of 4 checks passed
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.

None yet

2 participants