Skip to content

Commit

Permalink
Eam: Extend order payload (#816)
Browse files Browse the repository at this point in the history
* Extend the order payload for translated names, attributes and price details

* Add changeset
  • Loading branch information
krzysztofwolski authored Jul 27, 2023
1 parent a725720 commit 54901f8
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-pigs-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-app-emails-and-messages": patch
---

Added new fields to the order related payload: attributes, price details, translated names
157 changes: 157 additions & 0 deletions apps/emails-and-messages/graphql/fragments/OrderDetails.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
fragment OrderDetails on Order {
id
number
status
languageCodeEnum
userEmail
created
redirectUrl
channel {
slug
}
Expand All @@ -17,28 +21,103 @@ fragment OrderDetails on Order {
email
firstName
lastName
languageCode
}
billingAddress {
firstName
lastName
companyName
streetAddress1
streetAddress2
city
cityArea
postalCode
country {
country
}
phone
}
shippingAddress {
firstName
lastName
companyName
streetAddress1
streetAddress2
city
cityArea
postalCode
country {
country
}
phone
}
lines {
id
digitalContentUrl {
id
url
}
isShippingRequired
metadata {
key
value
}
privateMetadata {
key
value
}
productName
translatedProductName
variantName
translatedVariantName
productSku
variant {
preorder{
endDate
}
weight{
unit
value
}
attributes {
attribute {
id
name
slug
}
values {
id
name
slug
file {
url
contentType
}
}
}
product {
attributes {
attribute {
id
name
slug
}
values {
id
name
slug
file{
url
contentType
}

}
}
}
}
quantity
quantityFulfilled
taxRate
thumbnail {
url
alt
Expand All @@ -48,30 +127,108 @@ fragment OrderDetails on Order {
currency
amount
}
net {
currency
amount
}
tax {
currency
amount
}
}
totalPrice {
gross {
currency
amount
}
net {
currency
amount
}
tax {
currency
amount
}
}
unitDiscount {
currency
amount
}
unitDiscountReason
unitDiscountType
unitDiscountValue
undiscountedUnitPrice{
gross {
currency
amount
}
net {
currency
amount
}
tax {
currency
amount
}
}
}
subtotal {
gross {
amount
currency
}
net {
currency
amount
}
tax {
currency
amount
}
}
shippingPrice {
gross {
amount
currency
}
net {
currency
amount
}
tax {
currency
amount
}
}
total {
gross {
amount
currency
}
net {
currency
amount
}
tax {
currency
amount
}
}
undiscountedTotal {
gross {
amount
currency
}
net {
currency
amount
}
tax {
currency
amount
}
}
displayGrossPrices
isShippingRequired
shippingMethodName
}
Loading

0 comments on commit 54901f8

Please sign in to comment.