feat: dont rely on sellerName when creating a request#195
feat: dont rely on sellerName when creating a request#195
Conversation
|
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:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
filafb
left a comment
There was a problem hiding this comment.
Sorry for taking this long to review. I added a couple of questions / change requests. I mentioned a endpoint @cesarocampov mentioned to me, but I am not familiar with it. I am suggesting this because I am not sure if the seller name inside the order gets updated when it changes. Not sure how to test it, but we should try to test it. And if we go down the route to use this endpoint, we need to understand what it returns if an account is no longer a seller in a marketplace. It's worth discussing it.
|
|
||
| - Add IBAN validation in frontend and backend | ||
| - Remove IBAN and accountHolderNumber if refund method different than bank | ||
| - Stop relying on saving the sellerName at the creation of a return request. Instead get the seller name when resolving the objects that serve it to the front end. |
There was a problem hiding this comment.
Please rebase and make sure changelog is right. The changes listed above are already released.
| unitMultiplier: Float! | ||
| sellerId: String! | ||
| sellerName: String! | ||
| sellerName: String |
There was a problem hiding this comment.
Since we are resolving it before sending the response, we can keep it as non-nullable.
It's important to note that when you change something on GraphQL (also routes on node), depending on the changes we get a warning in the terminal like the below one. If we proceed with these change, we would have to release a new major.

| "unitMultiplier": { "type": "number" }, | ||
| "sellerId": { "type": "string" }, | ||
| "sellerName": { "type": "string" }, | ||
| "sellerName": { "type": ["string", "null"] }, |
There was a problem hiding this comment.
We don't need to make it null as well. The field is not listed as a required one, so it can be undefined.
| const { orderId, items: itemsList } = await returnRequestClient.get( | ||
| id as string, | ||
| ['orderId', 'items'] | ||
| ) |
There was a problem hiding this comment.
We don't need to make another request to get the request. It is passed into this function as root, hence the type it has. Moreover, not sure the order should be the source of truth here. @cesarocampov told me about a endpoint that brings the seller name giving the seller id.
What problem is this solving?
Rely only on the sellerId to link a product to a seller. The solution was to get the seller name when resolving the objects that serve it to the front end.
How to test it?
Workspace
The requestId provided here is useful for testing because the sellerName was saved as an empty string. If you look for the
sellerNameon the graphqlIDE you should see the correct sellerName