-
Notifications
You must be signed in to change notification settings - Fork 41
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
(PC-33575)[API] feat: add addressId
param in GET Events and GET Products API endpoints
#15512
(PC-33575)[API] feat: add addressId
param in GET Events and GET Products API endpoints
#15512
Conversation
Have yourself a merry little break and learn a few facts about the year 463. |
Visit the preview URL for this PR (updated for commit bc2bf3c): https://pc-pro-testing--pr15512-tcoudray-pass-pc-335-qrn9dls7.web.app (expires Wed, 18 Dec 2024 12:20:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1 |
3a0bc10
to
8aab847
Compare
4887617
to
a802d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple relecture sans tester.
"required": [ | ||
"venueId" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question : est-il donc autorisé de n'avoir ni venueId
ni addressId
?
(je ne sais pas si le format permet d'avoir une contrainte sur « l'un ou l'autre »)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes cette contrainte n'a pas vraiment de sens. Pourquoi forcément obliger de filtrer sur une venueId
ou sur une addressId
alors que de toute façon la requête est paginée ?
api/tests/routes/public/individual_offers/v1/get_products_test.py
Outdated
Show resolved
Hide resolved
a802d5e
to
8fc1093
Compare
8fc1093
to
1a44dee
Compare
response = client.with_explicit_token(plain_api_key).get(self.endpoint_url) | ||
|
||
assert response.status_code == 200 | ||
assert [product["id"] for product in response.json["products"]] == [offer.id for offer in offers] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(détail) il y a toujours un petit risque avec les comparaisons de listes comme ça, surtout que l'ordre n'est pas très important ici et qu'il pourrait changer à l'avenir.
assert [product["id"] for product in response.json["products"]] == [offer.id for offer in offers] | |
assert {product["id"] for product in response.json["products"]} == {offer.id for offer in offers} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alors si justement parce que ce endpoint renvoie les produits par ordre croissant d'id (c'est ce qui permet la pagination par index).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on n'a rien vu, on n'a rien vu 😶🌫️
offers = offers_factories.ThingOfferFactory.create_batch( | ||
12, venue=venue_provider.venue | ||
) + offers_factories.ThingOfferFactory.create_batch(12, venue=venue2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est-il nécessaire de créer autant d'objets ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non c'est assez arbitraire pour le coup
api/tests/routes/public/individual_offers/v1/get_products_test.py
Outdated
Show resolved
Hide resolved
…ducts API endpoints drop required constraint on `venueId`
1a44dee
to
bc2bf3c
Compare
Drop required constraint on
venueId
.But de la pull request
Ticket Jira : https://passculture.atlassian.net/browse/PC-33575
Vérifications