Order Confirmation

This commit is contained in:
tedraykov
2024-06-28 18:21:44 +03:00
parent 68039b1a6e
commit f4f6edcd9a
39 changed files with 2386 additions and 363 deletions

View File

@@ -0,0 +1,17 @@
const addressFragment = /* GraphQL */ `
fragment Address on CustomerAddress {
id
address1
address2
firstName
lastName
provinceCode: zoneCode
city
zip
countryCodeV2: territoryCode
company
phone: phoneNumber
}
`;
export default addressFragment;

View File

@@ -0,0 +1,56 @@
const orderMetafieldsFragment = /* GraphQL */ `
fragment OrderMetafields on Order {
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
value
id
key
}
warrantyActivationDeadline: metafield(
namespace: "custom"
key: "warranty_activation_deadline"
) {
value
id
key
}
warrantyActivationOdometer: metafield(
namespace: "custom"
key: "warranty_activation_odometer"
) {
value
id
key
}
warrantyActivationInstallation: metafield(
namespace: "custom"
key: "warranty_activation_installation"
) {
value
id
key
}
warrantyActivationSelfInstall: metafield(
namespace: "custom"
key: "warranty_activation_self_install"
) {
value
id
key
}
warrantyActivationVIN: metafield(namespace: "custom", key: "warranty_activation_vin") {
value
id
key
}
warrantyActivationMileage: metafield(namespace: "custom", key: "warranty_activation_mileage") {
value
id
key
}
orderConfirmation: metafield(namespace: "custom", key: "customer_confirmation") {
value
}
}
`;
export default orderMetafieldsFragment;

View File

@@ -0,0 +1,38 @@
const orderTransactionFragment = /* GraphQL */ `
fragment OrderTransaction on OrderTransaction {
id
processedAt
paymentIcon {
id
url
altText
}
paymentDetails {
... on CardPaymentDetails {
last4
cardBrand
}
}
transactionAmount {
presentmentMoney {
...Price
}
}
giftCardDetails {
last4
balance {
...Price
}
}
status
kind
transactionParentId
type
typeDetails {
name
message
}
}
`;
export default orderTransactionFragment;

View File

@@ -1,4 +1,8 @@
import addressFragment from './address';
import lineItemFragment from './line-item';
import orderMetafieldsFragment from './order-metafields';
import orderTrasactionFragment from './order-transaction';
import priceFragment from './price';
const orderCard = /* GraphQL */ `
fragment OrderCard on Order {
@@ -16,69 +20,44 @@ const orderCard = /* GraphQL */ `
}
}
totalPrice {
amount
currencyCode
...Price
}
subtotal {
...Price
}
totalShipping {
...Price
}
totalTax {
...Price
}
shippingLine {
title
originalPrice {
...Price
}
}
lineItems(first: 20) {
nodes {
...LineItem
}
}
shippingAddress {
...Address
}
billingAddress {
...Address
}
transactions {
...OrderTransaction
}
...OrderMetafields
}
${lineItemFragment}
`;
export const orderMetafields = /* GraphQL */ `
fragment OrderMetafield on Order {
id
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
value
id
key
}
warrantyActivationDeadline: metafield(
namespace: "custom"
key: "warranty_activation_deadline"
) {
value
id
key
}
warrantyActivationOdometer: metafield(
namespace: "custom"
key: "warranty_activation_odometer"
) {
value
id
key
}
warrantyActivationInstallation: metafield(
namespace: "custom"
key: "warranty_activation_installation"
) {
value
id
key
}
warrantyActivationSelfInstall: metafield(
namespace: "custom"
key: "warranty_activation_self_install"
) {
value
id
key
}
warrantyActivationVIN: metafield(namespace: "custom", key: "warranty_activation_vin") {
value
id
key
}
warrantyActivationMileage: metafield(namespace: "custom", key: "warranty_activation_mileage") {
value
id
key
}
}
${addressFragment}
${priceFragment}
${orderTrasactionFragment}
${orderMetafieldsFragment}
`;
export default orderCard;

View File

@@ -0,0 +1,8 @@
const priceFragment = /* GraphQL */ `
fragment Price on MoneyV2 {
amount
currencyCode
}
`;
export default priceFragment;