Skip to content

Commit

Permalink
fix(core): Fix splitting of shippingLines on multivendor orders
Browse files Browse the repository at this point in the history
Relates to #2859
  • Loading branch information
michaelbromley committed Jun 3, 2024
1 parent 84ec0aa commit 9112dd8
Show file tree
Hide file tree
Showing 6 changed files with 500 additions and 25 deletions.
42 changes: 42 additions & 0 deletions packages/core/e2e/graphql/admin-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,45 @@ export const SEARCH_PRODUCTS_ADMIN = gql`
}
}
`;

export const GET_ORDER_WITH_SELLER_ORDERS = gql`
query GetOrderWithSellerOrders($id: ID!) {
order(id: $id) {
id
code
state
sellerOrders {
id
aggregateOrderId
lines {
id
productVariant {
id
name
}
}
shippingLines {
id
shippingMethod {
id
code
}
}
}
lines {
id
productVariant {
id
name
}
}
shippingLines {
id
shippingMethod {
id
code
}
}
}
}
`;
192 changes: 192 additions & 0 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7997,6 +7997,26 @@ export type SearchProductsAdminQuery = {
};
};

export type GetOrderWithSellerOrdersQueryVariables = Exact<{
id: Scalars['ID']['input'];
}>;

export type GetOrderWithSellerOrdersQuery = {
order?: {
id: string;
code: string;
state: string;
sellerOrders?: Array<{
id: string;
aggregateOrderId?: string | null;
lines: Array<{ id: string; productVariant: { id: string; name: string } }>;
shippingLines: Array<{ id: string; shippingMethod: { id: string; code: string } }>;
}> | null;
lines: Array<{ id: string; productVariant: { id: string; name: string } }>;
shippingLines: Array<{ id: string; shippingMethod: { id: string; code: string } }>;
} | null;
};

export type AdministratorFragment = {
id: string;
firstName: string;
Expand Down Expand Up @@ -22781,6 +22801,178 @@ export const SearchProductsAdminDocument = {
},
],
} as unknown as DocumentNode<SearchProductsAdminQuery, SearchProductsAdminQueryVariables>;
export const GetOrderWithSellerOrdersDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'GetOrderWithSellerOrders' },
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: { kind: 'Variable', name: { kind: 'Name', value: 'id' } },
type: {
kind: 'NonNullType',
type: { kind: 'NamedType', name: { kind: 'Name', value: 'ID' } },
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'order' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'id' },
value: { kind: 'Variable', name: { kind: 'Name', value: 'id' } },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'code' } },
{ kind: 'Field', name: { kind: 'Name', value: 'state' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'sellerOrders' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'aggregateOrderId' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'lines' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'productVariant' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'name' },
},
],
},
},
],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'shippingLines' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'shippingMethod' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'code' },
},
],
},
},
],
},
},
],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'lines' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'productVariant' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'name' },
},
],
},
},
],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'shippingLines' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'shippingMethod' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'id' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'code' },
},
],
},
},
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<GetOrderWithSellerOrdersQuery, GetOrderWithSellerOrdersQueryVariables>;
export const CreateAdministratorDocument = {
kind: 'Document',
definitions: [
Expand Down
Loading

0 comments on commit 9112dd8

Please sign in to comment.