Просмотр исходного кода

refactor(server): Store reference to ShippingMethod in Order

Michael Bromley 7 лет назад
Родитель
Сommit
033c96227e

+ 5 - 1
admin-ui/src/app/data/definitions/order-definitions.ts

@@ -81,7 +81,11 @@ export const ORDER_WITH_LINES_FRAGMENT = gql`
         subTotalBeforeTax
         totalBeforeTax
         shipping
-        shippingMethod
+        shippingMethod {
+            id
+            code
+            description
+        }
         shippingAddress {
             ...ShippingAddress
         }

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
schema.json


+ 6 - 3
server/src/api/resolvers/customer.resolver.ts

@@ -14,6 +14,7 @@ import { idsAreEqual } from '../../common/utils';
 import { Address } from '../../entity/address/address.entity';
 import { Customer } from '../../entity/customer/customer.entity';
 import { CustomerService } from '../../service/services/customer.service';
+import { IdCodecService } from '../common/id-codec.service';
 import { RequestContext } from '../common/request-context';
 import { Allow } from '../decorators/allow.decorator';
 import { Decode } from '../decorators/decode.decorator';
@@ -21,7 +22,7 @@ import { Ctx } from '../decorators/request-context.decorator';
 
 @Resolver('Customer')
 export class CustomerResolver {
-    constructor(private customerService: CustomerService) {}
+    constructor(private customerService: CustomerService, private idCodecService: IdCodecService) {}
 
     @Query()
     @Allow(Permission.ReadCustomer)
@@ -51,11 +52,13 @@ export class CustomerResolver {
         @Parent() customer: Customer,
     ): Promise<Address[] | undefined> {
         if (ctx.authorizedAsOwnerOnly) {
-            if (customer.user && !idsAreEqual(customer.user.id, ctx.activeUserId)) {
+            const userId = customer.user && this.idCodecService.decode(customer.user.id);
+            if (userId && !idsAreEqual(userId, ctx.activeUserId)) {
                 return;
             }
         }
-        return this.customerService.findAddressesByCustomerId(customer.id);
+        const customerId = this.idCodecService.decode(customer.id);
+        return this.customerService.findAddressesByCustomerId(customerId);
     }
 
     @Mutation()

+ 24 - 2
server/src/api/resolvers/order.resolver.ts

@@ -20,6 +20,8 @@ import { I18nError } from '../../i18n/i18n-error';
 import { OrderState } from '../../service/helpers/order-state-machine/order-state';
 import { AuthService } from '../../service/services/auth.service';
 import { OrderService } from '../../service/services/order.service';
+import { ShippingMethodService } from '../../service/services/shipping-method.service';
+import { IdCodecService } from '../common/id-codec.service';
 import { RequestContext } from '../common/request-context';
 import { Allow } from '../decorators/allow.decorator';
 import { Decode } from '../decorators/decode.decorator';
@@ -27,7 +29,12 @@ import { Ctx } from '../decorators/request-context.decorator';
 
 @Resolver('Order')
 export class OrderResolver {
-    constructor(private orderService: OrderService, private authService: AuthService) {}
+    constructor(
+        private orderService: OrderService,
+        private shippingMethodService: ShippingMethodService,
+        private authService: AuthService,
+        private idCodecService: IdCodecService,
+    ) {}
 
     @Query()
     @Allow(Permission.ReadOrder)
@@ -51,7 +58,20 @@ export class OrderResolver {
 
     @ResolveProperty()
     async payments(@Parent() order: Order) {
-        return this.orderService.getOrderPayments(order.id);
+        const orderId = this.idCodecService.decode(order.id);
+        return this.orderService.getOrderPayments(orderId);
+    }
+
+    @ResolveProperty()
+    async shippingMethod(@Parent() order: Order) {
+        if (order.shippingMethodId) {
+            // Does not need to be decoded because it is an internal property
+            // which is never exposed to the outside world.
+            const shippingMethodId = order.shippingMethodId;
+            return this.shippingMethodService.findOne(shippingMethodId);
+        } else {
+            return null;
+        }
     }
 
     @Query()
@@ -77,6 +97,8 @@ export class OrderResolver {
             const order = await this.orderService.findOneByCode(ctx, args.code);
             if (order && order.customer.user && order.customer.user.id === ctx.activeUserId) {
                 return this.orderService.findOne(ctx, order.id);
+            } else {
+                throw new I18nError(`error.forbidden`);
             }
         }
     }

+ 4 - 1
server/src/api/resolvers/product-option.resolver.ts

@@ -12,6 +12,7 @@ import { ProductOptionGroup } from '../../entity/product-option-group/product-op
 import { ProductOption } from '../../entity/product-option/product-option.entity';
 import { ProductOptionGroupService } from '../../service/services/product-option-group.service';
 import { ProductOptionService } from '../../service/services/product-option.service';
+import { IdCodecService } from '../common/id-codec.service';
 import { RequestContext } from '../common/request-context';
 import { Allow } from '../decorators/allow.decorator';
 import { Ctx } from '../decorators/request-context.decorator';
@@ -21,6 +22,7 @@ export class ProductOptionResolver {
     constructor(
         private productOptionGroupService: ProductOptionGroupService,
         private productOptionService: ProductOptionService,
+        private idCodecService: IdCodecService,
     ) {}
 
     @Query()
@@ -47,7 +49,8 @@ export class ProductOptionResolver {
         if (optionGroup.options) {
             return Promise.resolve(optionGroup.options);
         }
-        const group = await this.productOptionGroupService.findOne(optionGroup.id, optionGroup.languageCode);
+        const id = this.idCodecService.decode(optionGroup.id);
+        const group = await this.productOptionGroupService.findOne(id, optionGroup.languageCode);
         return group ? group.options : [];
     }
 

+ 1 - 1
server/src/api/types/order.api.graphql

@@ -23,7 +23,7 @@ type OrderList implements PaginatedList {
 }
 
 type ShippingMethodQuote {
-    shippingMethodId: ID!
+    id: ID!
     price: Int!
     description: String!
 }

+ 9 - 4
server/src/entity/order/order.entity.ts

@@ -1,14 +1,16 @@
 import { Adjustment, AdjustmentType, ShippingAddress } from 'shared/generated-types';
-import { DeepPartial } from 'shared/shared-types';
-import { Column, Entity, ManyToOne, OneToMany } from 'typeorm';
+import { DeepPartial, ID } from 'shared/shared-types';
+import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany } from 'typeorm';
 
 import { Calculated } from '../../common/calculated-decorator';
+import { idType } from '../../config/vendure-config';
 import { OrderState } from '../../service/helpers/order-state-machine/order-state';
 import { VendureEntity } from '../base/base.entity';
 import { Customer } from '../customer/customer.entity';
 import { OrderItem } from '../order-item/order-item.entity';
 import { OrderLine } from '../order-line/order-line.entity';
 import { Payment } from '../payment/payment.entity';
+import { ShippingMethod } from '../shipping-method/shipping-method.entity';
 
 @Entity()
 export class Order extends VendureEntity {
@@ -40,8 +42,11 @@ export class Order extends VendureEntity {
 
     @Column() subTotal: number;
 
-    @Column({ nullable: true })
-    shippingMethod: string;
+    @Column({ type: idType(), nullable: true })
+    shippingMethodId: ID | null;
+
+    @ManyToOne(type => ShippingMethod)
+    shippingMethod: ShippingMethod | null;
 
     @Column({ default: 0 })
     shipping: number;

+ 1 - 1
server/src/entity/order/order.graphql

@@ -13,7 +13,7 @@ type Order implements Node {
     subTotalBeforeTax: Int!
     subTotal: Int!
     shipping: Int!
-    shippingMethod: String
+    shippingMethod: ShippingMethod
     totalBeforeTax: Int!
     total: Int!
 }

+ 6 - 13
server/src/service/helpers/order-calculator/order-calculator.ts

@@ -23,12 +23,7 @@ export class OrderCalculator {
     /**
      * Applies taxes and promotions to an Order. Mutates the order object.
      */
-    async applyPriceAdjustments(
-        ctx: RequestContext,
-        order: Order,
-        promotions: Promotion[],
-        preferredShippingMethod?: ID,
-    ): Promise<Order> {
+    async applyPriceAdjustments(ctx: RequestContext, order: Order, promotions: Promotion[]): Promise<Order> {
         const activeZone = ctx.channel.defaultTaxZone;
         order.clearAdjustments();
         if (order.lines.length) {
@@ -39,7 +34,7 @@ export class OrderCalculator {
             // Finally, re-calculate taxes because the promotions may have
             // altered the unit prices, which in turn will alter the tax payable.
             this.applyTaxes(ctx, order, activeZone);
-            await this.applyShipping(ctx, order, preferredShippingMethod);
+            await this.applyShipping(ctx, order);
         } else {
             this.calculateOrderTotals(order);
         }
@@ -109,18 +104,16 @@ export class OrderCalculator {
         }
     }
 
-    private async applyShipping(ctx: RequestContext, order: Order, preferredShippingMethod?: ID) {
+    private async applyShipping(ctx: RequestContext, order: Order) {
         const results = await this.shippingCalculator.getEligibleShippingMethods(ctx, order);
-        if (results && results.length) {
+        const currentShippingMethod = order.shippingMethod;
+        if (results && results.length && currentShippingMethod) {
             let selected: { method: ShippingMethod; price: number } | undefined;
-            if (preferredShippingMethod) {
-                selected = results.find(r => idsAreEqual(r.method.id, preferredShippingMethod));
-            }
+            selected = results.find(r => idsAreEqual(r.method.id, currentShippingMethod.id));
             if (!selected) {
                 selected = results[0];
             }
             order.shipping = selected.price;
-            order.shippingMethod = selected.method.description;
         }
     }
 

+ 27 - 13
server/src/service/services/order.service.ts

@@ -135,6 +135,7 @@ export class OrderService {
     ): Promise<Order> {
         this.assertQuantityIsPositive(quantity);
         const order = await this.getOrderOrThrow(ctx, orderId);
+        this.assertAddingItemsState(order);
         const productVariant = await this.getProductVariantOrThrow(ctx, productVariantId);
         let orderLine = order.lines.find(line => idsAreEqual(line.productVariant.id, productVariantId));
 
@@ -155,6 +156,7 @@ export class OrderService {
     ): Promise<Order> {
         this.assertQuantityIsPositive(quantity);
         const order = await this.getOrderOrThrow(ctx, orderId);
+        this.assertAddingItemsState(order);
         const orderLine = this.getOrderLineOrThrow(order, orderLineId);
         const currentQuantity = orderLine.quantity;
         if (currentQuantity < quantity) {
@@ -182,6 +184,7 @@ export class OrderService {
 
     async removeItemFromOrder(ctx: RequestContext, orderId: ID, orderLineId: ID): Promise<Order> {
         const order = await this.getOrderOrThrow(ctx, orderId);
+        this.assertAddingItemsState(order);
         const orderLine = this.getOrderLineOrThrow(order, orderLineId);
         order.lines = order.lines.filter(line => !idsAreEqual(line.id, orderLineId));
         const updatedOrder = await this.applyPriceAdjustments(ctx, order);
@@ -203,7 +206,7 @@ export class OrderService {
         const order = await this.getOrderOrThrow(ctx, orderId);
         const eligibleMethods = await this.shippingCalculator.getEligibleShippingMethods(ctx, order);
         return eligibleMethods.map(result => ({
-            shippingMethodId: result.method.id as string,
+            id: result.method.id as string,
             price: result.price,
             description: result.method.description,
         }));
@@ -211,7 +214,15 @@ export class OrderService {
 
     async setShippingMethod(ctx: RequestContext, orderId: ID, shippingMethodId: ID): Promise<Order> {
         const order = await this.getOrderOrThrow(ctx, orderId);
-        await this.applyPriceAdjustments(ctx, order, shippingMethodId);
+        this.assertAddingItemsState(order);
+        const eligibleMethods = await this.shippingCalculator.getEligibleShippingMethods(ctx, order);
+        const selectedMethod = eligibleMethods.find(m => idsAreEqual(m.method.id, shippingMethodId));
+        if (!selectedMethod) {
+            throw new I18nError(`error.shipping-method-unavailable`);
+        }
+        order.shippingMethod = selectedMethod.method;
+        await this.connection.getRepository(Order).save(order);
+        await this.applyPriceAdjustments(ctx, order);
         return this.connection.getRepository(Order).save(order);
     }
 
@@ -224,6 +235,9 @@ export class OrderService {
 
     async addPaymentToOrder(ctx: RequestContext, orderId: ID, input: PaymentInput): Promise<Order> {
         const order = await this.getOrderOrThrow(ctx, orderId);
+        if (order.state !== 'ArrangingPayment') {
+            throw new I18nError(`error.payment-may-only-be-added-in-arrangingpayment-state`);
+        }
         const payment = await this.paymentMethodService.createPayment(order, input.method, input.metadata);
         if (order.payments) {
             order.payments.push(payment);
@@ -317,24 +331,24 @@ export class OrderService {
         }
     }
 
+    /**
+     * Throws if the Order is not in the "AddingItems" state.
+     */
+    private assertAddingItemsState(order: Order) {
+        if (order.state !== 'AddingItems') {
+            throw new I18nError(`error.order-contents-may-only-be-modified-in-addingitems-state`);
+        }
+    }
+
     /**
      * Applies promotions, taxes and shipping to the Order.
      */
-    private async applyPriceAdjustments(
-        ctx: RequestContext,
-        order: Order,
-        preferredShippingMethod?: ID,
-    ): Promise<Order> {
+    private async applyPriceAdjustments(ctx: RequestContext, order: Order): Promise<Order> {
         const promotions = await this.connection.getRepository(Promotion).find({
             where: { enabled: true },
             order: { priorityScore: 'ASC' },
         });
-        order = await this.orderCalculator.applyPriceAdjustments(
-            ctx,
-            order,
-            promotions,
-            preferredShippingMethod,
-        );
+        order = await this.orderCalculator.applyPriceAdjustments(ctx, order, promotions);
         await this.connection.getRepository(Order).save(order);
         await this.connection.getRepository(OrderItem).save(order.getOrderItems());
         await this.connection.getRepository(OrderLine).save(order.lines);

+ 88 - 85
shared/generated-types.ts

@@ -305,7 +305,7 @@ export interface Order extends Node {
     subTotalBeforeTax: number;
     subTotal: number;
     shipping: number;
-    shippingMethod?: string | null;
+    shippingMethod?: ShippingMethod | null;
     totalBeforeTax: number;
     total: number;
 }
@@ -430,13 +430,35 @@ export interface Payment extends Node {
     metadata?: Json | null;
 }
 
+export interface ShippingMethod extends Node {
+    id: string;
+    createdAt: DateTime;
+    updatedAt: DateTime;
+    code: string;
+    description: string;
+    checker: AdjustmentOperation;
+    calculator: AdjustmentOperation;
+}
+
+export interface AdjustmentOperation {
+    code: string;
+    args: ConfigArg[];
+    description: string;
+}
+
+export interface ConfigArg {
+    name: string;
+    type: string;
+    value?: string | null;
+}
+
 export interface OrderList extends PaginatedList {
     items: Order[];
     totalItems: number;
 }
 
 export interface ShippingMethodQuote {
-    shippingMethodId: string;
+    id: string;
     price: number;
     description: string;
 }
@@ -455,12 +477,6 @@ export interface PaymentMethod extends Node {
     configArgs: ConfigArg[];
 }
 
-export interface ConfigArg {
-    name: string;
-    type: string;
-    value?: string | null;
-}
-
 export interface ProductOptionGroup extends Node {
     id: string;
     createdAt: DateTime;
@@ -533,12 +549,6 @@ export interface Promotion extends Node {
     actions: AdjustmentOperation[];
 }
 
-export interface AdjustmentOperation {
-    code: string;
-    args: ConfigArg[];
-    description: string;
-}
-
 export interface PromotionList extends PaginatedList {
     items: Promotion[];
     totalItems: number;
@@ -559,16 +569,6 @@ export interface ShippingMethodList extends PaginatedList {
     totalItems: number;
 }
 
-export interface ShippingMethod extends Node {
-    id: string;
-    createdAt: DateTime;
-    updatedAt: DateTime;
-    code: string;
-    description: string;
-    checker: AdjustmentOperation;
-    calculator: AdjustmentOperation;
-}
-
 export interface TaxRateList extends PaginatedList {
     items: TaxRate[];
     totalItems: number;
@@ -2878,7 +2878,7 @@ export namespace OrderResolvers {
         subTotalBeforeTax?: SubTotalBeforeTaxResolver<number, any, Context>;
         subTotal?: SubTotalResolver<number, any, Context>;
         shipping?: ShippingResolver<number, any, Context>;
-        shippingMethod?: ShippingMethodResolver<string | null, any, Context>;
+        shippingMethod?: ShippingMethodResolver<ShippingMethod | null, any, Context>;
         totalBeforeTax?: TotalBeforeTaxResolver<number, any, Context>;
         total?: TotalResolver<number, any, Context>;
     }
@@ -2917,7 +2917,7 @@ export namespace OrderResolvers {
     >;
     export type SubTotalResolver<R = number, Parent = any, Context = any> = Resolver<R, Parent, Context>;
     export type ShippingResolver<R = number, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type ShippingMethodResolver<R = string | null, Parent = any, Context = any> = Resolver<
+    export type ShippingMethodResolver<R = ShippingMethod | null, Parent = any, Context = any> = Resolver<
         R,
         Parent,
         Context
@@ -3294,6 +3294,58 @@ export namespace PaymentResolvers {
     export type MetadataResolver<R = Json | null, Parent = any, Context = any> = Resolver<R, Parent, Context>;
 }
 
+export namespace ShippingMethodResolvers {
+    export interface Resolvers<Context = any> {
+        id?: IdResolver<string, any, Context>;
+        createdAt?: CreatedAtResolver<DateTime, any, Context>;
+        updatedAt?: UpdatedAtResolver<DateTime, any, Context>;
+        code?: CodeResolver<string, any, Context>;
+        description?: DescriptionResolver<string, any, Context>;
+        checker?: CheckerResolver<AdjustmentOperation, any, Context>;
+        calculator?: CalculatorResolver<AdjustmentOperation, any, Context>;
+    }
+
+    export type IdResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type CreatedAtResolver<R = DateTime, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type UpdatedAtResolver<R = DateTime, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type CodeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type DescriptionResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type CheckerResolver<R = AdjustmentOperation, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context
+    >;
+    export type CalculatorResolver<R = AdjustmentOperation, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context
+    >;
+}
+
+export namespace AdjustmentOperationResolvers {
+    export interface Resolvers<Context = any> {
+        code?: CodeResolver<string, any, Context>;
+        args?: ArgsResolver<ConfigArg[], any, Context>;
+        description?: DescriptionResolver<string, any, Context>;
+    }
+
+    export type CodeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type ArgsResolver<R = ConfigArg[], Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type DescriptionResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+}
+
+export namespace ConfigArgResolvers {
+    export interface Resolvers<Context = any> {
+        name?: NameResolver<string, any, Context>;
+        type?: TypeResolver<string, any, Context>;
+        value?: ValueResolver<string | null, any, Context>;
+    }
+
+    export type NameResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type TypeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+    export type ValueResolver<R = string | null, Parent = any, Context = any> = Resolver<R, Parent, Context>;
+}
+
 export namespace OrderListResolvers {
     export interface Resolvers<Context = any> {
         items?: ItemsResolver<Order[], any, Context>;
@@ -3306,16 +3358,12 @@ export namespace OrderListResolvers {
 
 export namespace ShippingMethodQuoteResolvers {
     export interface Resolvers<Context = any> {
-        shippingMethodId?: ShippingMethodIdResolver<string, any, Context>;
+        id?: IdResolver<string, any, Context>;
         price?: PriceResolver<number, any, Context>;
         description?: DescriptionResolver<string, any, Context>;
     }
 
-    export type ShippingMethodIdResolver<R = string, Parent = any, Context = any> = Resolver<
-        R,
-        Parent,
-        Context
-    >;
+    export type IdResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
     export type PriceResolver<R = number, Parent = any, Context = any> = Resolver<R, Parent, Context>;
     export type DescriptionResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
 }
@@ -3356,18 +3404,6 @@ export namespace PaymentMethodResolvers {
     >;
 }
 
-export namespace ConfigArgResolvers {
-    export interface Resolvers<Context = any> {
-        name?: NameResolver<string, any, Context>;
-        type?: TypeResolver<string, any, Context>;
-        value?: ValueResolver<string | null, any, Context>;
-    }
-
-    export type NameResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type TypeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type ValueResolver<R = string | null, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-}
-
 export namespace ProductOptionGroupResolvers {
     export interface Resolvers<Context = any> {
         id?: IdResolver<string, any, Context>;
@@ -3588,18 +3624,6 @@ export namespace PromotionResolvers {
     >;
 }
 
-export namespace AdjustmentOperationResolvers {
-    export interface Resolvers<Context = any> {
-        code?: CodeResolver<string, any, Context>;
-        args?: ArgsResolver<ConfigArg[], any, Context>;
-        description?: DescriptionResolver<string, any, Context>;
-    }
-
-    export type CodeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type ArgsResolver<R = ConfigArg[], Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type DescriptionResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-}
-
 export namespace PromotionListResolvers {
     export interface Resolvers<Context = any> {
         items?: ItemsResolver<Promotion[], any, Context>;
@@ -3652,34 +3676,6 @@ export namespace ShippingMethodListResolvers {
     export type TotalItemsResolver<R = number, Parent = any, Context = any> = Resolver<R, Parent, Context>;
 }
 
-export namespace ShippingMethodResolvers {
-    export interface Resolvers<Context = any> {
-        id?: IdResolver<string, any, Context>;
-        createdAt?: CreatedAtResolver<DateTime, any, Context>;
-        updatedAt?: UpdatedAtResolver<DateTime, any, Context>;
-        code?: CodeResolver<string, any, Context>;
-        description?: DescriptionResolver<string, any, Context>;
-        checker?: CheckerResolver<AdjustmentOperation, any, Context>;
-        calculator?: CalculatorResolver<AdjustmentOperation, any, Context>;
-    }
-
-    export type IdResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type CreatedAtResolver<R = DateTime, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type UpdatedAtResolver<R = DateTime, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type CodeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type DescriptionResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
-    export type CheckerResolver<R = AdjustmentOperation, Parent = any, Context = any> = Resolver<
-        R,
-        Parent,
-        Context
-    >;
-    export type CalculatorResolver<R = AdjustmentOperation, Parent = any, Context = any> = Resolver<
-        R,
-        Parent,
-        Context
-    >;
-}
-
 export namespace TaxRateListResolvers {
     export interface Resolvers<Context = any> {
         items?: ItemsResolver<TaxRate[], any, Context>;
@@ -5805,7 +5801,7 @@ export namespace OrderWithLines {
         subTotalBeforeTax: number;
         totalBeforeTax: number;
         shipping: number;
-        shippingMethod?: string | null;
+        shippingMethod?: ShippingMethod | null;
         shippingAddress?: ShippingAddress | null;
         payments?: Payments[] | null;
         total: number;
@@ -5853,6 +5849,13 @@ export namespace OrderWithLines {
 
     export type Adjustments = Adjustment.Fragment;
 
+    export type ShippingMethod = {
+        __typename?: 'ShippingMethod';
+        id: string;
+        code: string;
+        description: string;
+    };
+
     export type ShippingAddress = ShippingAddress.Fragment;
 
     export type Payments = {

Некоторые файлы не были показаны из-за большого количества измененных файлов