[skip ci] orders export app draft

This commit is contained in:
Lukasz Ostrowski 2023-09-08 08:52:33 +02:00
parent 489e110e74
commit 53b67c4505
9 changed files with 44 additions and 58 deletions

View file

@ -22,10 +22,18 @@ fragment OrderBase on Order {
} }
} }
lines { lines {
id
productVariantId productVariantId
productSku productSku
variantName variantName
unitPrice {
gross {
amount
}
net {
amount
}
}
quantity
} }
number number
} }

View file

@ -0,0 +1,11 @@
query PaginatedOrders($after: String, $channel: String!) {
orders(first: 100, after: $after, channel: $channel) {
edges {
node {
... on Order {
...OrderBase
}
}
}
}
}

View file

@ -1,11 +0,0 @@
fragment OrderCancelledSubscriptionPayload on OrderCancelled {
order {
...OrderBase
}
}
subscription OrderCancelled {
event {
...OrderCancelledSubscriptionPayload
}
}

View file

@ -1,11 +0,0 @@
fragment OrderCreatedSubscriptionPayload on OrderCreated {
order {
...OrderBase
}
}
subscription OrderCreated {
event {
...OrderCreatedSubscriptionPayload
}
}

View file

@ -1,11 +0,0 @@
fragment OrderFullyPaidSubscriptionPayload on OrderFullyPaid {
order {
...OrderBase
}
}
subscription OrderFullyPaid {
event {
...OrderFullyPaidSubscriptionPayload
}
}

View file

@ -1,11 +0,0 @@
fragment OrderRefundedSubscriptionPayload on OrderRefunded {
order {
...OrderBase
}
}
subscription OrderRefunded {
event {
...OrderRefundedSubscriptionPayload
}
}

View file

@ -1,11 +0,0 @@
fragment OrderUpdatedSubscriptionPayload on OrderUpdated {
order {
...OrderBase
}
}
subscription OrderUpdated {
event {
...OrderUpdatedSubscriptionPayload
}
}

View file

@ -0,0 +1,22 @@
export interface OrderRowLine {
productVariantId: string;
productSku: string;
variantName: string;
quantity: number;
unitPriceGrossAmount: number;
unitPriceNetAmount: number;
}
// todo add more fields
export interface OrderRowFull extends OrderRowLine {
id: string;
number: string;
userId: string;
userEmail: string;
channelId: string;
channelSlug: string;
shippingMethodName: string;
totalGrossAmount: string;
totalNetAmount: string;
orderCurrency: string;
}

View file

@ -8,7 +8,7 @@ const ConfigurationPage: NextPage = () => {
const { appBridgeState } = useAppBridge(); const { appBridgeState } = useAppBridge();
if (!appBridgeState) { if (!appBridgeState) {
return null; throw new Error("AppBridge is not available.");
} }
if (appBridgeState.user?.permissions.includes("MANAGE_APPS") === false) { if (appBridgeState.user?.permissions.includes("MANAGE_APPS") === false) {
@ -19,7 +19,7 @@ const ConfigurationPage: NextPage = () => {
<Box> <Box>
<AppHeader /> <AppHeader />
<Layout.AppSection marginBottom={14} heading="todo"> <Layout.AppSection marginBottom={14} heading="todo">
todo TODO
</Layout.AppSection> </Layout.AppSection>
</Box> </Box>
); );