فهرست منبع

feat(server): Implement CRU on ShippingMethod entity

Relates to #35
Michael Bromley 7 سال پیش
والد
کامیت
c0c674bd70

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
schema.json


+ 2 - 0
server/src/api/api.module.ts

@@ -26,6 +26,7 @@ import { ProductOptionResolver } from './resolvers/product-option.resolver';
 import { ProductResolver } from './resolvers/product.resolver';
 import { PromotionResolver } from './resolvers/promotion.resolver';
 import { RoleResolver } from './resolvers/role.resolver';
+import { ShippingMethodResolver } from './resolvers/shipping-method.resolver';
 import { TaxCategoryResolver } from './resolvers/tax-category.resolver';
 import { TaxRateResolver } from './resolvers/tax-rate.resolver';
 import { ZoneResolver } from './resolvers/zone.resolver';
@@ -45,6 +46,7 @@ const exportedProviders = [
     ProductOptionResolver,
     ProductResolver,
     RoleResolver,
+    ShippingMethodResolver,
     TaxCategoryResolver,
     TaxRateResolver,
     ZoneResolver,

+ 1 - 0
server/src/api/resolvers/promotion.resolver.ts

@@ -36,6 +36,7 @@ export class PromotionResolver {
     @Query()
     @Allow(Permission.ReadSettings)
     adjustmentOperations(@Ctx() ctx: RequestContext) {
+        // TODO: split this into 2 queries, one for PromotionConditions and one for PromotionActions
         return this.promotionService.getAdjustmentOperations();
     }
 

+ 57 - 0
server/src/api/resolvers/shipping-method.resolver.ts

@@ -0,0 +1,57 @@
+import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
+import { ShippingMethod } from 'entity/shipping-method/shipping-method.entity';
+import {
+    AdjustmentOperation,
+    CreateShippingMethodMutationArgs,
+    Permission,
+    ShippingMethodQueryArgs,
+    ShippingMethodsQueryArgs,
+    UpdateShippingMethodMutationArgs,
+} from 'shared/generated-types';
+import { PaginatedList } from 'shared/shared-types';
+
+import { ShippingMethodService } from '../../service/services/shipping-method.service';
+import { Allow } from '../decorators/allow.decorator';
+
+@Resolver('ShippingMethod')
+export class ShippingMethodResolver {
+    constructor(private shippingMethodService: ShippingMethodService) {}
+
+    @Query()
+    @Allow(Permission.ReadSettings)
+    shippingMethods(@Args() args: ShippingMethodsQueryArgs): Promise<PaginatedList<ShippingMethod>> {
+        return this.shippingMethodService.findAll(args.options || undefined);
+    }
+
+    @Query()
+    @Allow(Permission.ReadSettings)
+    shippingMethod(@Args() args: ShippingMethodQueryArgs): Promise<ShippingMethod | undefined> {
+        return this.shippingMethodService.findOne(args.id);
+    }
+
+    @Query()
+    @Allow(Permission.ReadSettings)
+    shippingEligibilityCheckers(@Args() args: ShippingMethodQueryArgs): AdjustmentOperation[] {
+        return this.shippingMethodService.getShippingEligibilityCheckers();
+    }
+
+    @Query()
+    @Allow(Permission.ReadSettings)
+    shippingCalculators(@Args() args: ShippingMethodQueryArgs): AdjustmentOperation[] {
+        return this.shippingMethodService.getShippingCalculators();
+    }
+
+    @Mutation()
+    @Allow(Permission.CreateSettings)
+    createShippingMethod(@Args() args: CreateShippingMethodMutationArgs): Promise<ShippingMethod> {
+        const { input } = args;
+        return this.shippingMethodService.create(input);
+    }
+
+    @Mutation()
+    @Allow(Permission.UpdateSettings)
+    updateShippingMethod(@Args() args: UpdateShippingMethodMutationArgs): Promise<ShippingMethod> {
+        const { input } = args;
+        return this.shippingMethodService.update(input);
+    }
+}

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

@@ -6,7 +6,7 @@ type Query {
 type Mutation {
   "Create a new Role"
   createRole(input: CreateRoleInput!): Role!
-  "Update an existing new Role"
+  "Update an existing Role"
   updateRole(input: UpdateRoleInput!): Role!
 }
 

+ 40 - 0
server/src/api/types/shipping-method.api.graphql

@@ -0,0 +1,40 @@
+type Query {
+    shippingMethods(options: ShippingMethodListOptions): ShippingMethodList!
+    shippingMethod(id: ID!): ShippingMethod
+    shippingEligibilityCheckers: [AdjustmentOperation!]!
+    shippingCalculators: [AdjustmentOperation!]!
+}
+
+type Mutation {
+    "Create a new ShippingMethod"
+    createShippingMethod(input: CreateShippingMethodInput!): ShippingMethod!
+    "Update an existing ShippingMethod"
+    updateShippingMethod(input: UpdateShippingMethodInput!): ShippingMethod!
+}
+
+type ShippingMethodList implements PaginatedList {
+    items: [ShippingMethod!]!
+    totalItems: Int!
+}
+
+input ShippingMethodListOptions {
+    take: Int
+    skip: Int
+    sort: ShippingMethodSortParameter
+    filter: ShippingMethodFilterParameter
+}
+
+input ShippingMethodSortParameter {
+    id: SortOrder
+    createdAt: SortOrder
+    updatedAt: SortOrder
+    code: SortOrder
+    description: SortOrder
+}
+
+input ShippingMethodFilterParameter {
+    code: StringOperators
+    description: StringOperators
+    createdAt: DateOperators
+    updatedAt: DateOperators
+}

+ 1 - 0
server/src/config/config.service.mock.ts

@@ -21,6 +21,7 @@ export class MockConfigService implements MockClass<ConfigService> {
     };
     uploadMaxFileSize = 1024;
     dbConnectionOptions = {};
+    shippingOptions = {};
     promotionOptions = {
         promotionConditions: [],
         promotionActions: [],

+ 5 - 0
server/src/config/config.service.ts

@@ -15,6 +15,7 @@ import {
     OrderMergeOptions,
     OrderProcessOptions,
     PromotionOptions,
+    ShippingOptions,
     VendureConfig,
 } from './vendure-config';
 import { VendurePlugin } from './vendure-plugin/vendure-plugin';
@@ -77,6 +78,10 @@ export class ConfigService implements VendureConfig {
         return this.activeConfig.promotionOptions;
     }
 
+    get shippingOptions(): ShippingOptions {
+        return this.activeConfig.shippingOptions;
+    }
+
     get orderMergeOptions(): OrderMergeOptions {
         return this.activeConfig.orderMergeOptions;
     }

+ 6 - 0
server/src/config/default-config.ts

@@ -12,6 +12,8 @@ import { MergeOrdersStrategy } from './order-merge-strategy/merge-orders-strateg
 import { UseGuestStrategy } from './order-merge-strategy/use-guest-strategy';
 import { defaultPromotionActions } from './promotion/default-promotion-actions';
 import { defaultPromotionConditions } from './promotion/default-promotion-conditions';
+import { defaultShippingCalculator } from './shipping-method/default-shipping-calculator';
+import { defaultShippingEligibilityChecker } from './shipping-method/default-shipping-eligibility-checker';
 import { VendureConfig } from './vendure-config';
 
 /**
@@ -48,6 +50,10 @@ export const defaultConfig: ReadOnlyRequired<VendureConfig> = {
         promotionConditions: defaultPromotionConditions,
         promotionActions: defaultPromotionActions,
     },
+    shippingOptions: {
+        shippingEligibilityCheckers: [defaultShippingEligibilityChecker],
+        shippingCalculators: [defaultShippingCalculator],
+    },
     orderProcessOptions: {},
     orderMergeOptions: {
         mergeStrategy: new MergeOrdersStrategy(),

+ 12 - 0
server/src/config/shipping-method/default-shipping-calculator.ts

@@ -0,0 +1,12 @@
+import { ShippingCalculator } from './shipping-calculator';
+
+export const defaultShippingCalculator = new ShippingCalculator({
+    code: 'default-shipping-calculator',
+    description: 'Default Flat-Rate Shipping Calculator',
+    args: {
+        rate: 'money',
+    },
+    calculate: (order, args) => {
+        return args.rate;
+    },
+});

+ 8 - 0
server/src/config/shipping-method/default-shipping-eligibility-checker.ts

@@ -0,0 +1,8 @@
+import { ShippingEligibilityChecker } from './shipping-eligibility-checker';
+
+export const defaultShippingEligibilityChecker = new ShippingEligibilityChecker({
+    code: 'default-shipping-eligibility-checker',
+    description: 'Default Shipping Eligibility Checker',
+    args: {},
+    check: order => true,
+});

+ 29 - 0
server/src/config/shipping-method/shipping-calculator.ts

@@ -0,0 +1,29 @@
+import { AdjustmentArg } from 'shared/generated-types';
+
+import { Order } from '../../entity/order/order.entity';
+import { AdjustmentArgs, argsArrayToHash, ArgumentValues } from '../common/adjustments';
+
+export type ShippingCalculatorArgType = 'int' | 'money' | 'string' | 'boolean';
+export type ShippingCalculatorArgs = AdjustmentArgs<ShippingCalculatorArgType>;
+export type CalculateShippingFn<T extends ShippingCalculatorArgs> = (
+    order: Order,
+    args: ArgumentValues<T>,
+) => number;
+
+export class ShippingCalculator<T extends ShippingCalculatorArgs = {}> {
+    readonly code: string;
+    readonly description: string;
+    readonly args: ShippingCalculatorArgs;
+    private readonly calculateFn: CalculateShippingFn<T>;
+
+    constructor(config: { args: T; calculate: CalculateShippingFn<T>; code: string; description: string }) {
+        this.code = config.code;
+        this.description = config.description;
+        this.args = config.args;
+        this.calculateFn = config.calculate;
+    }
+
+    calculate(order: Order, args: AdjustmentArg[]): number {
+        return this.calculateFn(order, argsArrayToHash(args));
+    }
+}

+ 34 - 0
server/src/config/shipping-method/shipping-eligibility-checker.ts

@@ -0,0 +1,34 @@
+import { AdjustmentArg } from 'shared/generated-types';
+
+import { Order } from '../../entity/order/order.entity';
+import { AdjustmentArgs, argsArrayToHash, ArgumentValues } from '../common/adjustments';
+
+export type ShippingEligibilityCheckerArgType = 'int' | 'money' | 'string' | 'boolean';
+export type ShippingEligibilityCheckerArgs = AdjustmentArgs<ShippingEligibilityCheckerArgType>;
+export type CheckShippingEligibilityCheckerFn<T extends ShippingEligibilityCheckerArgs> = (
+    order: Order,
+    args: ArgumentValues<T>,
+) => boolean;
+
+export class ShippingEligibilityChecker<T extends ShippingEligibilityCheckerArgs = {}> {
+    readonly code: string;
+    readonly description: string;
+    readonly args: ShippingEligibilityCheckerArgs;
+    private readonly checkFn: CheckShippingEligibilityCheckerFn<T>;
+
+    constructor(config: {
+        args: T;
+        check: CheckShippingEligibilityCheckerFn<T>;
+        code: string;
+        description: string;
+    }) {
+        this.code = config.code;
+        this.description = config.description;
+        this.args = config.args;
+        this.checkFn = config.check;
+    }
+
+    check(order: Order, args: AdjustmentArg[]) {
+        return this.checkFn(order, argsArrayToHash(args));
+    }
+}

+ 2 - 2
server/src/config/vendure-config.ts

@@ -139,11 +139,11 @@ export interface ShippingOptions {
     /**
      * An array of available ShippingEligibilityCheckers for use in configuring ShippingMethods
      */
-    shippingEligibilityCheckers?: ShippingEligibilityChecker[];
+    shippingEligibilityCheckers?: Array<ShippingEligibilityChecker<any>>;
     /**
      * An array of available ShippingCalculator for use in configuring ShippingMethods
      */
-    shippingCalculators?: ShippingCalculator[];
+    shippingCalculators?: Array<ShippingCalculator<any>>;
 }
 
 export interface VendureConfig {

+ 2 - 0
server/src/entity/entities.ts

@@ -26,6 +26,7 @@ import { Role } from './role/role.entity';
 import { AnonymousSession } from './session/anonymous-session.entity';
 import { AuthenticatedSession } from './session/authenticated-session.entity';
 import { Session } from './session/session.entity';
+import { ShippingMethod } from './shipping-method/shipping-method.entity';
 import { TaxCategory } from './tax-category/tax-category.entity';
 import { TaxRate } from './tax-rate/tax-rate.entity';
 import { User } from './user/user.entity';
@@ -63,6 +64,7 @@ export const coreEntitiesMap = {
     Promotion,
     Role,
     Session,
+    ShippingMethod,
     TaxCategory,
     TaxRate,
     User,

+ 26 - 0
server/src/entity/shipping-method/shipping-method.entity.ts

@@ -0,0 +1,26 @@
+import { AdjustmentOperation } from 'shared/generated-types';
+import { DeepPartial } from 'shared/shared-types';
+import { Column, Entity, JoinTable, ManyToMany } from 'typeorm';
+
+import { ChannelAware } from '../../common/types/common-types';
+import { VendureEntity } from '../base/base.entity';
+import { Channel } from '../channel/channel.entity';
+
+@Entity()
+export class ShippingMethod extends VendureEntity implements ChannelAware {
+    constructor(input?: DeepPartial<ShippingMethod>) {
+        super(input);
+    }
+
+    @Column() code: string;
+
+    @Column() description: string;
+
+    @Column('simple-json') checker: AdjustmentOperation;
+
+    @Column('simple-json') calculator: AdjustmentOperation;
+
+    @ManyToMany(type => Channel)
+    @JoinTable()
+    channels: Channel[];
+}

+ 24 - 0
server/src/entity/shipping-method/shipping-method.graphql

@@ -0,0 +1,24 @@
+type ShippingMethod implements Node {
+    id: ID!
+    createdAt: DateTime!
+    updatedAt: DateTime!
+    code: String!
+    description: String!
+    checker: AdjustmentOperation!
+    calculator: AdjustmentOperation!
+}
+
+input CreateShippingMethodInput {
+    code: String!
+    description: String!
+    checker: AdjustmentOperationInput!
+    calculator: AdjustmentOperationInput!
+}
+
+input UpdateShippingMethodInput {
+    id: ID!
+    code: String
+    description: String
+    checker: AdjustmentOperationInput
+    calculator: AdjustmentOperationInput
+}

+ 2 - 0
server/src/service/service.module.ts

@@ -27,6 +27,7 @@ import { ProductVariantService } from './services/product-variant.service';
 import { ProductService } from './services/product.service';
 import { PromotionService } from './services/promotion.service';
 import { RoleService } from './services/role.service';
+import { ShippingMethodService } from './services/shipping-method.service';
 import { TaxCategoryService } from './services/tax-category.service';
 import { TaxRateService } from './services/tax-rate.service';
 import { ZoneService } from './services/zone.service';
@@ -48,6 +49,7 @@ const exportedProviders = [
     ProductService,
     ProductVariantService,
     RoleService,
+    ShippingMethodService,
     TaxCategoryService,
     TaxRateService,
     ZoneService,

+ 145 - 0
server/src/service/services/shipping-method.service.ts

@@ -0,0 +1,145 @@
+import { Injectable } from '@nestjs/common';
+import { InjectConnection } from '@nestjs/typeorm';
+import {
+    AdjustmentOperation,
+    AdjustmentOperationInput,
+    CreateShippingMethodInput,
+    UpdateShippingMethodInput,
+} from 'shared/generated-types';
+import { omit } from 'shared/omit';
+import { ID, PaginatedList } from 'shared/shared-types';
+import { Connection } from 'typeorm';
+
+import { ListQueryOptions } from '../../common/types/common-types';
+import { assertFound } from '../../common/utils';
+import { ConfigService } from '../../config/config.service';
+import { ShippingCalculator } from '../../config/shipping-method/shipping-calculator';
+import { ShippingEligibilityChecker } from '../../config/shipping-method/shipping-eligibility-checker';
+import { ShippingMethod } from '../../entity/shipping-method/shipping-method.entity';
+import { I18nError } from '../../i18n/i18n-error';
+import { ListQueryBuilder } from '../helpers/list-query-builder/list-query-builder';
+import { patchEntity } from '../helpers/utils/patch-entity';
+
+import { ChannelService } from './channel.service';
+
+@Injectable()
+export class ShippingMethodService {
+    shippingEligibilityCheckers: ShippingEligibilityChecker[];
+    shippingCalculators: ShippingCalculator[];
+
+    constructor(
+        @InjectConnection() private connection: Connection,
+        private configService: ConfigService,
+        private listQueryBuilder: ListQueryBuilder,
+        private channelService: ChannelService,
+    ) {
+        this.shippingEligibilityCheckers =
+            this.configService.shippingOptions.shippingEligibilityCheckers || [];
+        this.shippingCalculators = this.configService.shippingOptions.shippingCalculators || [];
+    }
+
+    findAll(options?: ListQueryOptions<ShippingMethod>): Promise<PaginatedList<ShippingMethod>> {
+        return this.listQueryBuilder
+            .build(ShippingMethod, options, ['channels'])
+            .getManyAndCount()
+            .then(([items, totalItems]) => ({
+                items,
+                totalItems,
+            }));
+    }
+
+    findOne(shippingMethodId: ID): Promise<ShippingMethod | undefined> {
+        return this.connection.manager.findOne(ShippingMethod, shippingMethodId, {
+            relations: ['channels'],
+        });
+    }
+
+    async create(input: CreateShippingMethodInput): Promise<ShippingMethod> {
+        const shippingMethod = new ShippingMethod({
+            code: input.code,
+            description: input.description,
+            checker: this.parseOperationArgs(input.checker, this.getChecker(input.checker.code)),
+            calculator: this.parseOperationArgs(input.calculator, this.getCalculator(input.calculator.code)),
+        });
+        shippingMethod.channels = [this.channelService.getDefaultChannel()];
+        return this.connection.manager.save(shippingMethod);
+    }
+
+    async update(input: UpdateShippingMethodInput): Promise<ShippingMethod> {
+        const shippingMethod = await this.findOne(input.id);
+        if (!shippingMethod) {
+            throw new I18nError(`error.entity-with-id-not-found`, {
+                entityName: 'ShippingMethod',
+                id: input.id,
+            });
+        }
+        const updatedShippingMethod = patchEntity(shippingMethod, omit(input, ['checker', 'calculator']));
+        if (input.checker) {
+            updatedShippingMethod.checker = this.parseOperationArgs(
+                input.checker,
+                this.getChecker(input.checker.code),
+            );
+        }
+        if (input.calculator) {
+            updatedShippingMethod.calculator = this.parseOperationArgs(
+                input.calculator,
+                this.getChecker(input.calculator.code),
+            );
+        }
+        await this.connection.manager.save(updatedShippingMethod);
+        return assertFound(this.findOne(shippingMethod.id));
+    }
+
+    getShippingEligibilityCheckers(): AdjustmentOperation[] {
+        return this.shippingEligibilityCheckers.map(this.toAdjustmentOperation);
+    }
+
+    getShippingCalculators(): AdjustmentOperation[] {
+        return this.shippingCalculators.map(this.toAdjustmentOperation);
+    }
+
+    private toAdjustmentOperation(source: ShippingCalculator | ShippingEligibilityChecker) {
+        return {
+            code: source.code,
+            description: source.description,
+            args: Object.entries(source.args).map(([name, type]) => ({ name, type })),
+        };
+    }
+
+    /**
+     * Converts the input values of the "create" and "update" mutations into the format expected by the ShippingMethod entity.
+     */
+    private parseOperationArgs(
+        input: AdjustmentOperationInput,
+        adjustmentSource: ShippingEligibilityChecker | ShippingCalculator,
+    ): AdjustmentOperation {
+        const output: AdjustmentOperation = {
+            code: input.code,
+            description: adjustmentSource.description,
+            args: input.arguments.map((inputArg, i) => {
+                return {
+                    name: inputArg.name,
+                    type: adjustmentSource.args[inputArg.name],
+                    value: inputArg.value,
+                };
+            }),
+        };
+        return output;
+    }
+
+    private getChecker(code: string): ShippingEligibilityChecker {
+        const match = this.shippingEligibilityCheckers.find(a => a.code === code);
+        if (!match) {
+            throw new I18nError(`error.shipping-eligibility-checker-with-code-not-found`, { code });
+        }
+        return match;
+    }
+
+    private getCalculator(code: string): ShippingCalculator {
+        const match = this.shippingCalculators.find(a => a.code === code);
+        if (!match) {
+            throw new I18nError(`error.shipping-calculator-with-code-not-found`, { code });
+        }
+        return match;
+    }
+}

+ 154 - 0
shared/generated-types.ts

@@ -70,6 +70,8 @@ export interface Query {
     adjustmentOperations: AdjustmentOperations;
     roles: RoleList;
     role?: Role | null;
+    shippingMethods: ShippingMethodList;
+    shippingMethod?: ShippingMethod | null;
     taxCategories: TaxCategory[];
     taxCategory?: TaxCategory | null;
     taxRates: TaxRateList;
@@ -487,6 +489,21 @@ export interface RoleList extends PaginatedList {
     totalItems: number;
 }
 
+export interface ShippingMethodList extends PaginatedList {
+    items: ShippingMethod[];
+    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;
@@ -546,6 +563,8 @@ export interface Mutation {
     updatePromotion: Promotion;
     createRole: Role;
     updateRole: Role;
+    createShippingMethod: ShippingMethod;
+    updateShippingMethod: ShippingMethod;
     createTaxCategory: TaxCategory;
     updateTaxCategory: TaxCategory;
     createTaxRate: TaxRate;
@@ -801,6 +820,28 @@ export interface RoleFilterParameter {
     updatedAt?: DateOperators | null;
 }
 
+export interface ShippingMethodListOptions {
+    take?: number | null;
+    skip?: number | null;
+    sort?: ShippingMethodSortParameter | null;
+    filter?: ShippingMethodFilterParameter | null;
+}
+
+export interface ShippingMethodSortParameter {
+    id?: SortOrder | null;
+    createdAt?: SortOrder | null;
+    updatedAt?: SortOrder | null;
+    code?: SortOrder | null;
+    description?: SortOrder | null;
+}
+
+export interface ShippingMethodFilterParameter {
+    code?: StringOperators | null;
+    description?: StringOperators | null;
+    createdAt?: DateOperators | null;
+    updatedAt?: DateOperators | null;
+}
+
 export interface TaxRateListOptions {
     take?: number | null;
     skip?: number | null;
@@ -1121,6 +1162,21 @@ export interface UpdateRoleInput {
     permissions?: Permission[] | null;
 }
 
+export interface CreateShippingMethodInput {
+    code: string;
+    description: string;
+    checker: AdjustmentOperationInput;
+    calculator: AdjustmentOperationInput;
+}
+
+export interface UpdateShippingMethodInput {
+    id: string;
+    code?: string | null;
+    description?: string | null;
+    checker?: AdjustmentOperationInput | null;
+    calculator?: AdjustmentOperationInput | null;
+}
+
 export interface CreateTaxCategoryInput {
     name: string;
 }
@@ -1260,6 +1316,12 @@ export interface RolesQueryArgs {
 export interface RoleQueryArgs {
     id: string;
 }
+export interface ShippingMethodsQueryArgs {
+    options?: ShippingMethodListOptions | null;
+}
+export interface ShippingMethodQueryArgs {
+    id: string;
+}
 export interface TaxCategoryQueryArgs {
     id: string;
 }
@@ -1401,6 +1463,12 @@ export interface CreateRoleMutationArgs {
 export interface UpdateRoleMutationArgs {
     input: UpdateRoleInput;
 }
+export interface CreateShippingMethodMutationArgs {
+    input: CreateShippingMethodInput;
+}
+export interface UpdateShippingMethodMutationArgs {
+    input: UpdateShippingMethodInput;
+}
 export interface CreateTaxCategoryMutationArgs {
     input: CreateTaxCategoryInput;
 }
@@ -1701,6 +1769,8 @@ export namespace QueryResolvers {
         adjustmentOperations?: AdjustmentOperationsResolver<AdjustmentOperations, any, Context>;
         roles?: RolesResolver<RoleList, any, Context>;
         role?: RoleResolver<Role | null, any, Context>;
+        shippingMethods?: ShippingMethodsResolver<ShippingMethodList, any, Context>;
+        shippingMethod?: ShippingMethodResolver<ShippingMethod | null, any, Context>;
         taxCategories?: TaxCategoriesResolver<TaxCategory[], any, Context>;
         taxCategory?: TaxCategoryResolver<TaxCategory | null, any, Context>;
         taxRates?: TaxRatesResolver<TaxRateList, any, Context>;
@@ -1974,6 +2044,26 @@ export namespace QueryResolvers {
         id: string;
     }
 
+    export type ShippingMethodsResolver<R = ShippingMethodList, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context,
+        ShippingMethodsArgs
+    >;
+    export interface ShippingMethodsArgs {
+        options?: ShippingMethodListOptions | null;
+    }
+
+    export type ShippingMethodResolver<R = ShippingMethod | null, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context,
+        ShippingMethodArgs
+    >;
+    export interface ShippingMethodArgs {
+        id: string;
+    }
+
     export type TaxCategoriesResolver<R = TaxCategory[], Parent = any, Context = any> = Resolver<
         R,
         Parent,
@@ -3169,6 +3259,48 @@ export namespace RoleListResolvers {
     export type TotalItemsResolver<R = number, Parent = any, Context = any> = Resolver<R, Parent, Context>;
 }
 
+export namespace ShippingMethodListResolvers {
+    export interface Resolvers<Context = any> {
+        items?: ItemsResolver<ShippingMethod[], any, Context>;
+        totalItems?: TotalItemsResolver<number, any, Context>;
+    }
+
+    export type ItemsResolver<R = ShippingMethod[], Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context
+    >;
+    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>;
@@ -3260,6 +3392,8 @@ export namespace MutationResolvers {
         updatePromotion?: UpdatePromotionResolver<Promotion, any, Context>;
         createRole?: CreateRoleResolver<Role, any, Context>;
         updateRole?: UpdateRoleResolver<Role, any, Context>;
+        createShippingMethod?: CreateShippingMethodResolver<ShippingMethod, any, Context>;
+        updateShippingMethod?: UpdateShippingMethodResolver<ShippingMethod, any, Context>;
         createTaxCategory?: CreateTaxCategoryResolver<TaxCategory, any, Context>;
         updateTaxCategory?: UpdateTaxCategoryResolver<TaxCategory, any, Context>;
         createTaxRate?: CreateTaxRateResolver<TaxRate, any, Context>;
@@ -3667,6 +3801,26 @@ export namespace MutationResolvers {
         input: UpdateRoleInput;
     }
 
+    export type CreateShippingMethodResolver<R = ShippingMethod, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context,
+        CreateShippingMethodArgs
+    >;
+    export interface CreateShippingMethodArgs {
+        input: CreateShippingMethodInput;
+    }
+
+    export type UpdateShippingMethodResolver<R = ShippingMethod, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context,
+        UpdateShippingMethodArgs
+    >;
+    export interface UpdateShippingMethodArgs {
+        input: UpdateShippingMethodInput;
+    }
+
     export type CreateTaxCategoryResolver<R = TaxCategory, Parent = any, Context = any> = Resolver<
         R,
         Parent,

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است