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

[Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary #66

Conversation

tiago-freire
Copy link
Contributor

@tiago-freire tiago-freire commented Jan 13, 2025

What problem is this solving?

  • Add fields creatorName, sellerName and childrenQuantity on quote entity
  • Saving masterdata schema hash in settings to update when it changes
  • Create a new quote to marketplace responsibility for remaining items, if exist, when splitting a quote
  • Create a new query to check sellers quotes on frontend
  • Handle parent quote status and subtotal when updating splitted quotes
  • Get all children quotes ordered by lastUpdate DESC once on getChildrenQuotes

How to test it?

  • Link this branch on account bravtexfashionb2b in workspace b2bsellerquoteslocalhost
  • Link branch feat/create-quote-settings-ui of b2b-seller-quotes app on account shopfashion568 in workspace b2bsellerquoteslocalhost (the same workspace name)
  • Create a quote that contains product of seller shopfashion568 (example of seller product) and products from marketplace responsibility.
  • Search documents of quotes entity of b2b-quotes-graphql app to view created quotes with their sellerName's and creatorName's

Workspace

guidobernal-cubos and others added 7 commits January 10, 2025 10:43
* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (vtex-apps#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: provides a route for seller save a quote at marketplace

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (vtex-apps#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Guido Bernal <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: provides a route for seller save a quote at marketplace

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* feat: add split quote query

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (vtex-apps#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Guido Bernal <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link

vtex-io-ci-cd bot commented Jan 13, 2025

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot
Copy link

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@tiago-freire
Copy link
Contributor Author

tiago-freire commented Jan 13, 2025

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)
  • Minor (backwards-compatible functionality)
  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@tiago-freire
Copy link
Contributor Author

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@tiago-freire
Copy link
Contributor Author

@Matheus-Aguilar peço para segurar um pouco a análise desse PR pois estamos fazendo mais algumas alterações.

@tiago-freire tiago-freire changed the title [Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary (WIP) [Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary Jan 14, 2025
@tiago-freire
Copy link
Contributor Author

@Matheus-Aguilar, PR disponível para revisão.

@tiago-freire tiago-freire changed the title (WIP) [Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary [Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary Jan 14, 2025
Copy link

Warnings
⚠️

package.json was changed, but not yarn.lock (vice-versa) [:bulb: are you sure this is right?]

⚠️

Looks like this PR is too large [:bulb: smaller PRs are easy to review and approve]

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 452, PR deletions = 147

Generated by 🚫 dangerJS against 78b4033

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
8 New Code Smells (required ≤ 5)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

}

if (existingQuote.hasChildren && decline) {
const childrenQuotes = await sellerQuotesController.getAllChildrenQuotes(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we declining all children's quotes if the marketplace declines the parent quote? I'm not sure if this is the desired behavior since the seller is responsible for managing quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes perfect sense! Let's analyze the changes that will be needed.

Copy link
Contributor Author

@tiago-freire tiago-freire Jan 22, 2025

Choose a reason for hiding this comment

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

done at a5c77a0

@Matheus-Aguilar Matheus-Aguilar changed the base branch from master to feat/B2BTEAM-1998-b2b-seller-quotes January 22, 2025 17:03
@Matheus-Aguilar Matheus-Aguilar merged commit 318ac3c into vtex-apps:feat/B2BTEAM-1998-b2b-seller-quotes Jan 22, 2025
8 of 9 checks passed
Matheus-Aguilar added a commit that referenced this pull request Jan 23, 2025
#68)

* [Seller Quotes] feat: quote new fields and create children quote for marketplace when splitted if necessary (#66)

* [Seller Quotes] feat: get seller quotes paginated api (#61)

* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>

* [Seller Quotes] feat: endpoint to save a seller quote (#62)

* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: provides a route for seller save a quote at marketplace

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Guido Bernal <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>

* [Seller Quotes] Add query for quote parent id (#63)

* feat: add new markeplace splitting quotes on graphql

* feat: checking new field quotesManagedBy when value is SELLER

* docs: update CHANGELOG

* feat: add configuration for quote creation

* feat: add adjustment for quote seller

* chore: fix prettier errors

* fix: returning ids separated by commas when multiple quotes

* fix: check config and default settings with marketplace option

* feat: new fields for quotes managed by seller

* feat: new fields to save parent quote; change getQuotes query to filter only parent quotes

* feat: create client to notify seller quote

* feat: add changelog

* feat: verify and notify seller quote

* chore: removes console.log from SellerQuotesClient

* docs: update CHANGELOG and prettier fix on markdown

* fix: right splitting of seller quotes

* feat: refactor on creating seller quote map; avoid double check of seller

* refactor: seller quotes client constants

* feat: send creationDate on notify seller quote

* feat: provides a route for seller get a quote by id at marketplace

* docs: update CHANGELOG

* refactor: separating get seller quote into smaller functions

* refactor: function to get org anc cost center names

* refactor: create service class for seller quotes

* fix: removing approvedBySeller field from quote entity

* refactor: renaming seller quotes service to controller

* feat: provides a route for seller save a quote at marketplace

* feat: get seller quotes paginated

* feat: use seller quote controller

* docs: add changelog

* chore: fix misspell

* fix: use array destructuring

* fix: sorting get seller quotes for right pagination

* feat: supporting search and status filters on get seller quotes

* feat: using search filter on quote creator email

* feat: add split quote query

* fix: right dependencies

* fix: remove p-limit from root package.json

* feat: suport for custom sort and where on ger seller quotes paginated

* [Seller Quotes] Add new markeplace splitting quotes on graphql (#57)

* feat: add new markeplace splitting quotes on graphql

* docs: update CHANGELOG

* chore: fix prettier errors

* fix: check config and default settings with marketplace option

* docs: update CHANGELOG and prettier fix on markdown

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>

---------

Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Tiago de Andrade Freire <[email protected]>
Co-authored-by: Guido Bernal <[email protected]>

* Fix code scanning alert no. 4: Incomplete string escaping or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* feat: new quote fields creatorName, sellerName and childrenQuantity

* docs: update CHANGELOG

* fix: update lastUpdate on handle parent quote status and subtotal

* feat: creating parent quote only on multiple quotes; handling creatorName

* feat: handling use, decline and place order of children quotes

* fix: creatorName masterdata type

* fix: seller quote only receive updates from your orders

* feat: add query checkSellerQuotes; remove storeName setting; do not receive seller name

* fix: remove declining children; seller quotes should be created with pending status

---------

Co-authored-by: guidobernal-cubos <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Matheus-Aguilar <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: fixing code smells

* fix: fixing lint issues

* fix: remove more code smells

* fix: solve more sonarcloud issues

---------

Co-authored-by: Tiago Freire <[email protected]>
Co-authored-by: guidobernal-cubos <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

4 participants