-
Notifications
You must be signed in to change notification settings - Fork 38
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-30781)[API] feat: add allowed actions to collective offers api #14151
(PC-30781)[API] feat: add allowed actions to collective offers api #14151
Conversation
1e2df26
to
9db6ae0
Compare
Visit the preview URL for this PR (updated for commit 2822470): https://pc-pro-testing--pr14151-pc-30781-eac-back-re-tw59ukbz.web.app (expires Sat, 21 Sep 2024 08:44:35 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1 |
9db6ae0
to
4b6259e
Compare
@@ -19,8 +19,6 @@ | |||
from pcapi.core.educational.api import adage as educational_api_adage | |||
import pcapi.core.educational.api.national_program as national_program_api | |||
from pcapi.core.educational.exceptions import AdageException | |||
from pcapi.core.educational.models import CollectiveOffer |
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.
💚
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.
De façon générale on préfère les imports de modules pour ensuite faire my_module.my_method(...)
@@ -16,6 +16,7 @@ | |||
from pcapi.core.educational.models import CollectiveBooking | |||
from pcapi.core.educational.models import CollectiveBookingStatus | |||
from pcapi.core.educational.models import CollectiveOffer | |||
from pcapi.core.educational.models import CollectiveOfferAllowedAction |
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.
Dans l'idée du premier commentaire, si tu veux faire un petit commit de nettoyage en transformant
from pcapi.core.educational import models as educational_models
Et remplacer CollectiveBooking
(et les autres) par educational_models.CollectiveBooking
. Petit à petit on aura des jolis imports :).
CollectiveOfferAllowedAction.CAN_EDIT_DATES, | ||
CollectiveOfferAllowedAction.CAN_EDIT_DISCOUNT, | ||
CollectiveOfferAllowedAction.CAN_DUPLICATE, | ||
CollectiveOfferAllowedAction.CAN_CANCEL, |
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.
En repassant sur ce tableau je me rends compte que celui-ci n'est pas tout à fait aligné, j'ai mis en rouge les cases qui changent par rapport à ce sur quoi tu t'es basé.
Par exemple ici, on ne doit pas pouvoir annuler une offre publiée (ce sera une amélioration future) et plus bas on ne veut pas pouvoir archiver une offre terminée.
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.
ça marche je change ça
a622dd1
to
07d02d7
Compare
07d02d7
to
0db810d
Compare
0db810d
to
2822470
Compare
But de la pull request
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-30781
Ajout des actions autorisées en fonction du displayedStatus dans les api collective offers
Vérifications