-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Implement order events #4018
Implement order events #4018
Conversation
ec9d9a9
to
d763cb8
Compare
Codecov Report
@@ Coverage Diff @@
## master #4018 +/- ##
=========================================
Coverage ? 91.38%
=========================================
Files ? 280
Lines ? 15169
Branches ? 1481
=========================================
Hits ? 13862
Misses ? 910
Partials ? 397
Continue to review full report at Codecov.
|
f2c65a0
to
a3b6f58
Compare
I decided to move the customer events to #4039 as it would make this PR way too big, thus even harder to review. |
7f11133
to
81e1885
Compare
Should I expect this feature on April release? |
@maarcingebala could you double check the OrderEvent model definitions? I'm confused by how the choices are supposed to be populated. For example, But it may work just fine, and seems to be the proper django way. I'm unsure about how django is performing the queries and returning the results, I can't seem to find any piece of documentation on that matter. |
# note this won't work until | ||
# https://github.com/graphql-python/graphene/issues/956 is fixed | ||
deprecation_reason = getattr(enum_cls, '__deprecation_reason__', None) | ||
if deprecation_reason: |
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.
Careful here, its not supposed to be actually in a if statement but a simple setdefault
. This was made like that because it would otherwise actually crash. For that reason it would be good to wait for the graphql-python/graphene#957 fix to be merged.
8d881d5
to
b4d3e24
Compare
43daed1
to
c44aa7c
Compare
c44aa7c
to
32cf150
Compare
Codecov Report
@@ Coverage Diff @@
## master #4018 +/- ##
=========================================
Coverage ? 91.55%
=========================================
Files ? 277
Lines ? 15106
Branches ? 1474
=========================================
Hits ? 13830
Misses ? 878
Partials ? 398
Continue to review full report at Codecov.
|
seems another rebase needed? |
@@ -11,6 +11,35 @@ class ReportingPeriod(graphene.Enum): | |||
THIS_MONTH = 'THIS_MONTH' | |||
|
|||
|
|||
def to_enum(enum_cls, *, type_name=None, **options) -> graphene.Enum: |
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.
Why do we need this function and what were the consequences of not having it before? Are there any problems with enums currently?
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.
It avoids to repetitively have around each graphql package:
graphene.Enum('something',
str_to_enum(code.upper()), code) for code, name in enum_cls.CHOICES)
It would make it more readable and easier to maintain.
61d389b
to
a7bcce5
Compare
a7bcce5
to
c18bb40
Compare
913b24b
to
03ad801
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.
great job.
🎉 Thanks @NyanKiyoshi, great effort! |
user
containing who triggered the event. [4]Update dashboard 1.0 to be compatible with the latest changes (only order side)
Update docs definitions
Document the different parameters generated by the order events (docstrings + sphinx-apidoc)
Update definitions (migrations & GQL)
Introduce new order event types (OrderEventsEnum):
saleor/order/emails.py:46
saleor/dashboard/order/views.py:688
[2] Allows to retrieve additional data from an event (e.g., an amount, a quantity, a message, etc.)
[4] We want to know who triggered the event, even if it's the customer itself or a staff user.
[!] Failed payment expected data (payment id, etc. for user support) https://i.imgur.com/ayYrCjr.png
Pull Request Checklist
Magic Final Words
Closes #2443.