[skip ci] orders export app draft
This commit is contained in:
parent
489e110e74
commit
53b67c4505
9 changed files with 44 additions and 58 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
11
apps/orders-export/graphql/queries/PaginatedOrders.graphql
Normal file
11
apps/orders-export/graphql/queries/PaginatedOrders.graphql
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
query PaginatedOrders($after: String, $channel: String!) {
|
||||||
|
orders(first: 100, after: $after, channel: $channel) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
... on Order {
|
||||||
|
...OrderBase
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
fragment OrderCancelledSubscriptionPayload on OrderCancelled {
|
|
||||||
order {
|
|
||||||
...OrderBase
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscription OrderCancelled {
|
|
||||||
event {
|
|
||||||
...OrderCancelledSubscriptionPayload
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fragment OrderCreatedSubscriptionPayload on OrderCreated {
|
|
||||||
order {
|
|
||||||
...OrderBase
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscription OrderCreated {
|
|
||||||
event {
|
|
||||||
...OrderCreatedSubscriptionPayload
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fragment OrderFullyPaidSubscriptionPayload on OrderFullyPaid {
|
|
||||||
order {
|
|
||||||
...OrderBase
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscription OrderFullyPaid {
|
|
||||||
event {
|
|
||||||
...OrderFullyPaidSubscriptionPayload
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fragment OrderRefundedSubscriptionPayload on OrderRefunded {
|
|
||||||
order {
|
|
||||||
...OrderBase
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscription OrderRefunded {
|
|
||||||
event {
|
|
||||||
...OrderRefundedSubscriptionPayload
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fragment OrderUpdatedSubscriptionPayload on OrderUpdated {
|
|
||||||
order {
|
|
||||||
...OrderBase
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscription OrderUpdated {
|
|
||||||
event {
|
|
||||||
...OrderUpdatedSubscriptionPayload
|
|
||||||
}
|
|
||||||
}
|
|
22
apps/orders-export/src/modules/order/order-row.ts
Normal file
22
apps/orders-export/src/modules/order/order-row.ts
Normal 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;
|
||||||
|
}
|
|
@ -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>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue