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(search): Implement the search products #46

Merged
merged 1 commit into from
May 9, 2024

Conversation

yvanddniyo
Copy link
Collaborator

What does this PR do ?

This PR focus on searching products where users can search different products depend on their preference and can retrieve precisely products based on their searches.

Description of the PR

  • A user with the role seller should only allowed to view the own product when he or she searches.
  • A user with the role that are not seller can view the all products depends on their searches.

How should this be manually tested?

  1. Clone the repository.
  2. Checkout to the branch ft-search-product-#187419190.
  3. Run npm install to install dependencies.
  4. Run npm run dev to start the development server.
  5. Open a web browser and navigate to the /docs endpoint (e.g., http://localhost:PORT/docs).
  6. Verify that the Swagger UI loads correctly.
  7. Scroll down to the bottom and click on the search endpoints in Products section and you can search you want.

What are the relevant pivotal tracker stories?

[Delivers #187419190]

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

Attention: Patch coverage is 78.68852% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 79.55%. Comparing base (975954c) to head (a01d398).

Files Patch % Lines
src/services/product.service.ts 71.79% 11 Missing ⚠️
src/controllers/productControllers.ts 85.71% 1 Missing ⚠️
src/utils/isSellerOrNormalUser.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #46      +/-   ##
==========================================
- Coverage   79.65%   79.55%   -0.11%     
==========================================
  Files          64       65       +1     
  Lines        1057     1115      +58     
  Branches      149      163      +14     
==========================================
+ Hits          842      887      +45     
- Misses        215      225      +10     
- Partials        0        3       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yvanddniyo yvanddniyo force-pushed the ft-search-product-#187419190 branch 2 times, most recently from 045c477 to e201c78 Compare May 8, 2024 06:40
Copy link

gitguardian bot commented May 8, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10820488 Triggered Generic Password a01d398 test/product.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Collaborator

@MugemaneBertin2001 MugemaneBertin2001 left a comment

Choose a reason for hiding this comment

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

LGTM

export const searchParams = {
properties: {
type:"params",
name: {
type: "string"
},
minPrice: {
type: "number"
},
maxPrice: {
type: "number"
},
category: {
type: "string"
},
}
}

export const getProducts = {
Copy link
Member

Choose a reason for hiding this comment

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

are you using this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I'm not using it. I forgot to delete

@yvanddniyo yvanddniyo force-pushed the ft-search-product-#187419190 branch from e201c78 to ee03b6f Compare May 8, 2024 13:27
 - Seller should allowed to search their own products
 - other users which are not seller should see all products

[Delives #187419190]
@yvanddniyo yvanddniyo force-pushed the ft-search-product-#187419190 branch from ee03b6f to a01d398 Compare May 8, 2024 16:52
@teerenzo teerenzo merged commit 782b136 into dev May 9, 2024
3 checks passed
MugemaneBertin2001 pushed a commit that referenced this pull request May 9, 2024
feat(search): Implement the search products
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants