Skip to content

Commit

Permalink
Fill missing webhook enum descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofwolski committed Apr 8, 2021
1 parent 34a069d commit 0fcc6a0
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions saleor/graphql/webhook/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@


def description(enum):
if enum == WebhookEventTypeEnum.CHECKOUT_CREATED:
if enum == None:
return "Enum determining type of webhook."
elif enum == WebhookEventTypeEnum.CHECKOUT_CREATED:
return "A new checkout is created."
elif enum == WebhookEventTypeEnum.CHECKOUT_UPDATED:
return "A checkout is updated. Also triggers for all updates related to a checkout."
elif enum == WebhookEventTypeEnum.CUSTOMER_CREATED:
return "A new customer account is created."
elif enum == WebhookEventTypeEnum.CUSTOMER_UPDATED:
return "A customer account is updated."
elif enum == WebhookEventTypeEnum.NOTIFY_USER:
return "User notification triggered."
elif enum == WebhookEventTypeEnum.ORDER_CREATED:
return "A new order is placed."
elif enum == WebhookEventTypeEnum.ORDER_CONFIRMED:
Expand All @@ -25,10 +31,24 @@ def description(enum):
return "An order is fulfilled."
elif enum == WebhookEventTypeEnum.FULFILLMENT_CREATED:
return "A new fulfillment is created."
elif enum == WebhookEventTypeEnum.PAGE_CREATED:
return "A new page is created."
elif enum == WebhookEventTypeEnum.PAGE_UPDATED:
return "A page is updated."
elif enum == WebhookEventTypeEnum.PAGE_DELETED:
return "A page is deleted."
elif enum == WebhookEventTypeEnum.PRODUCT_CREATED:
return "A new product is created."
elif enum == WebhookEventTypeEnum.PRODUCT_UPDATED:
return "A product is updated."
elif enum == WebhookEventTypeEnum.PRODUCT_DELETED:
return "A product is deleted."
elif enum == WebhookEventTypeEnum.PRODUCT_VARIANT_CREATED:
return "A new product variant is created."
elif enum == WebhookEventTypeEnum.PRODUCT_VARIANT_UPDATED:
return "A product variant is updated."
elif enum == WebhookEventTypeEnum.PRODUCT_VARIANT_DELETED:
return "A product variant is deleted."
elif enum == WebhookEventTypeEnum.INVOICE_REQUESTED:
return "An invoice for order requested."
elif enum == WebhookEventTypeEnum.INVOICE_DELETED:
Expand All @@ -37,7 +57,7 @@ def description(enum):
return "Invoice has been send."
elif enum == WebhookEventTypeEnum.ANY_EVENTS:
return "All the events."
return "Enum determining type of webhook."
return


WebhookEventTypeEnum = graphene.Enum(
Expand Down

0 comments on commit 0fcc6a0

Please sign in to comment.