Browse Source

feat(server): Set Address country via countryCode

Michael Bromley 7 years ago
parent
commit
87b0442985

File diff suppressed because it is too large
+ 0 - 0
schema.json


+ 2 - 2
server/e2e/__snapshots__/product-category.e2e-spec.ts.snap

@@ -26,9 +26,9 @@ Object {
   "description": "",
   "facetValues": Array [
     Object {
-      "code": "Schiller_-_Welch",
+      "code": "Larkin_Group",
       "id": "T_1",
-      "name": "Schiller - Welch",
+      "name": "Larkin Group",
     },
   ],
   "featuredAsset": Object {

+ 237 - 0
server/e2e/customer.e2e-spec.ts

@@ -0,0 +1,237 @@
+import gql from 'graphql-tag';
+
+import {
+    GET_CUSTOMER,
+    GET_CUSTOMER_LIST,
+} from '../../admin-ui/src/app/data/definitions/customer-definitions';
+import { GetCustomer, GetCustomerList } from '../../shared/generated-types';
+import { omit } from '../../shared/omit';
+
+import { TEST_SETUP_TIMEOUT_MS } from './config/test-config';
+import { TestClient } from './test-client';
+import { TestServer } from './test-server';
+
+// tslint:disable:no-non-null-assertion
+
+describe('Customer resolver', () => {
+    const client = new TestClient();
+    const server = new TestServer();
+    let firstCustomerId = '';
+    let secondCustomerId = '';
+
+    beforeAll(async () => {
+        const token = await server.init({
+            productCount: 1,
+            customerCount: 5,
+        });
+        await client.init();
+    }, TEST_SETUP_TIMEOUT_MS);
+
+    afterAll(async () => {
+        await server.destroy();
+    });
+
+    it('customers list', async () => {
+        const result = await client.query<GetCustomerList.Query, GetCustomerList.Variables>(
+            GET_CUSTOMER_LIST,
+        );
+
+        expect(result.customers.items.length).toBe(5);
+        expect(result.customers.totalItems).toBe(5);
+        firstCustomerId = result.customers.items[0].id;
+        secondCustomerId = result.customers.items[1].id;
+    });
+
+    describe('addresses', () => {
+        let firstCustomerAddressIds: string[] = [];
+
+        it('createCustomerAddress throws on invalid countryCode', async () => {
+            try {
+                await client.query(CREATE_ADDRESS, {
+                    id: firstCustomerId,
+                    input: {
+                        streetLine1: 'streetLine1',
+                        countryCode: 'INVALID',
+                    },
+                });
+                fail('Should have thrown');
+            } catch (err) {
+                expect(err.message).toEqual(
+                    expect.stringContaining(`The countryCode "INVALID" was not recognized`),
+                );
+            }
+        });
+
+        it('createCustomerAddress creates a new address', async () => {
+            const result = await client.query(CREATE_ADDRESS, {
+                id: firstCustomerId,
+                input: {
+                    fullName: 'fullName',
+                    company: 'company',
+                    streetLine1: 'streetLine1',
+                    streetLine2: 'streetLine2',
+                    city: 'city',
+                    province: 'province',
+                    postalCode: 'postalCode',
+                    countryCode: 'GB',
+                    phoneNumber: 'phoneNumber',
+                    defaultShippingAddress: false,
+                    defaultBillingAddress: false,
+                },
+            });
+            expect(omit(result.createCustomerAddress, ['id'])).toEqual({
+                fullName: 'fullName',
+                company: 'company',
+                streetLine1: 'streetLine1',
+                streetLine2: 'streetLine2',
+                city: 'city',
+                province: 'province',
+                postalCode: 'postalCode',
+                countryCode: 'GB',
+                country: 'United Kingdom of Great Britain and Northern Ireland',
+                phoneNumber: 'phoneNumber',
+                defaultShippingAddress: false,
+                defaultBillingAddress: false,
+            });
+        });
+
+        it('customer query returns addresses', async () => {
+            const result = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: firstCustomerId,
+            });
+
+            expect(result.customer!.addresses!.length).toBe(2);
+            firstCustomerAddressIds = result.customer!.addresses!.map(a => a.id);
+        });
+
+        it('updateCustomerAddress allows only a single default address', async () => {
+            // set the first customer's second address to be default
+            const result1 = await client.query(UPDATE_ADDRESS, {
+                input: {
+                    id: firstCustomerAddressIds[1],
+                    defaultShippingAddress: true,
+                    defaultBillingAddress: true,
+                },
+            });
+            expect(result1.updateCustomerAddress.defaultShippingAddress).toBe(true);
+            expect(result1.updateCustomerAddress.defaultBillingAddress).toBe(true);
+
+            // assert the first customer's first address is not default
+            const result2 = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: firstCustomerId,
+            });
+            expect(result2.customer!.addresses![0].defaultShippingAddress).toBe(false);
+            expect(result2.customer!.addresses![0].defaultBillingAddress).toBe(false);
+
+            // set the first customer's first address to be default
+            const result3 = await client.query(UPDATE_ADDRESS, {
+                input: {
+                    id: firstCustomerAddressIds[0],
+                    defaultShippingAddress: true,
+                    defaultBillingAddress: true,
+                },
+            });
+            expect(result3.updateCustomerAddress.defaultShippingAddress).toBe(true);
+            expect(result3.updateCustomerAddress.defaultBillingAddress).toBe(true);
+
+            // assert the first customer's second address is not default
+            const result4 = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: firstCustomerId,
+            });
+            expect(result4.customer!.addresses![1].defaultShippingAddress).toBe(false);
+            expect(result4.customer!.addresses![1].defaultBillingAddress).toBe(false);
+
+            // get the second customer's address id
+            const result5 = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: secondCustomerId,
+            });
+            const secondCustomerAddressId = result5.customer!.addresses![0].id;
+
+            // set the second customer's address to be default
+            const result6 = await client.query(UPDATE_ADDRESS, {
+                input: {
+                    id: secondCustomerAddressId,
+                    defaultShippingAddress: true,
+                    defaultBillingAddress: true,
+                },
+            });
+            expect(result6.updateCustomerAddress.defaultShippingAddress).toBe(true);
+            expect(result6.updateCustomerAddress.defaultBillingAddress).toBe(true);
+
+            // assets the first customer's address defaults are unchanged
+            const result7 = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: firstCustomerId,
+            });
+            expect(result7.customer!.addresses![0].defaultShippingAddress).toBe(true);
+            expect(result7.customer!.addresses![0].defaultBillingAddress).toBe(true);
+            expect(result7.customer!.addresses![1].defaultShippingAddress).toBe(false);
+            expect(result7.customer!.addresses![1].defaultBillingAddress).toBe(false);
+        });
+
+        it('createCustomerAddress with true defaults unsets existing defaults', async () => {
+            const result1 = await client.query(CREATE_ADDRESS, {
+                id: firstCustomerId,
+                input: {
+                    streetLine1: 'new default streetline',
+                    countryCode: 'GB',
+                    defaultShippingAddress: true,
+                    defaultBillingAddress: true,
+                },
+            });
+            expect(omit(result1.createCustomerAddress, ['id'])).toEqual({
+                fullName: '',
+                company: '',
+                streetLine1: 'new default streetline',
+                streetLine2: '',
+                city: '',
+                province: '',
+                postalCode: '',
+                countryCode: 'GB',
+                country: 'United Kingdom of Great Britain and Northern Ireland',
+                phoneNumber: '',
+                defaultShippingAddress: true,
+                defaultBillingAddress: true,
+            });
+
+            const result2 = await client.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
+                id: firstCustomerId,
+            });
+            expect(result2.customer!.addresses![0].defaultShippingAddress).toBe(false);
+            expect(result2.customer!.addresses![0].defaultBillingAddress).toBe(false);
+            expect(result2.customer!.addresses![1].defaultShippingAddress).toBe(false);
+            expect(result2.customer!.addresses![1].defaultBillingAddress).toBe(false);
+            expect(result2.customer!.addresses![2].defaultShippingAddress).toBe(true);
+            expect(result2.customer!.addresses![2].defaultBillingAddress).toBe(true);
+        });
+    });
+});
+
+const CREATE_ADDRESS = gql`
+    mutation CreateAddress($id: ID!, $input: CreateAddressInput!) {
+        createCustomerAddress(customerId: $id, input: $input) {
+            id
+            fullName
+            company
+            streetLine1
+            streetLine2
+            city
+            province
+            postalCode
+            country
+            countryCode
+            phoneNumber
+            defaultShippingAddress
+            defaultBillingAddress
+        }
+    }
+`;
+
+const UPDATE_ADDRESS = gql`
+    mutation UpdateAddress($input: UpdateAddressInput!) {
+        updateCustomerAddress(input: $input) {
+            id
+            defaultShippingAddress
+            defaultBillingAddress
+        }
+    }
+`;

+ 30 - 2
server/e2e/order.e2e-spec.ts

@@ -342,6 +342,24 @@ describe('Orders', () => {
         describe('shipping', () => {
             let shippingMethods: any;
 
+            it('setOrderShippingAddress throws with invalid countryCode', async () => {
+                const address: CreateAddressInput = {
+                    streetLine1: '12 the street',
+                    countryCode: 'INVALID',
+                };
+
+                try {
+                    await client.query(SET_SHIPPING_ADDRESS, {
+                        input: address,
+                    });
+                    fail('Should have thrown');
+                } catch (err) {
+                    expect(err.message).toEqual(
+                        expect.stringContaining(`The countryCode "INVALID" was not recognized`),
+                    );
+                }
+            });
+
             it('setOrderShippingAddress sets shipping address', async () => {
                 const address: CreateAddressInput = {
                     fullName: 'name',
@@ -351,14 +369,24 @@ describe('Orders', () => {
                     city: 'foo',
                     province: 'bar',
                     postalCode: '123456',
-                    country: 'baz',
+                    countryCode: 'US',
                     phoneNumber: '4444444',
                 };
                 const result = await client.query(SET_SHIPPING_ADDRESS, {
                     input: address,
                 });
 
-                expect(result.setOrderShippingAddress.shippingAddress).toEqual(address);
+                expect(result.setOrderShippingAddress.shippingAddress).toEqual({
+                    fullName: 'name',
+                    company: 'company',
+                    streetLine1: '12 the street',
+                    streetLine2: 'line 2',
+                    city: 'foo',
+                    province: 'bar',
+                    postalCode: '123456',
+                    country: 'United States of America',
+                    phoneNumber: '4444444',
+                });
             });
 
             it('eligibleShippingMethods lists shipping methods', async () => {

+ 1 - 1
server/mock-data/mock-data.service.ts

@@ -309,7 +309,7 @@ export class MockDataService {
                         city: faker.address.city(),
                         province: faker.address.county(),
                         postalCode: faker.address.zipCode(),
-                        country: faker.address.country(),
+                        countryCode: 'GB',
                     } as CreateAddressInput,
                     customerId: customer.id,
                 };

+ 5 - 2
server/src/api/resolvers/customer.resolver.ts

@@ -78,9 +78,12 @@ export class CustomerResolver {
     @Mutation()
     @Allow(Permission.CreateCustomer)
     @Decode('customerId')
-    async createCustomerAddress(@Args() args: CreateCustomerAddressMutationArgs): Promise<Address> {
+    async createCustomerAddress(
+        @Ctx() ctx: RequestContext,
+        @Args() args: CreateCustomerAddressMutationArgs,
+    ): Promise<Address> {
         const { customerId, input } = args;
-        return this.customerService.createAddress(customerId, input);
+        return this.customerService.createAddress(ctx, customerId, input);
     }
 
     @Mutation()

+ 5 - 3
server/src/entity/address/address.entity.ts

@@ -14,7 +14,7 @@ export class Address extends VendureEntity implements HasCustomFields {
     @ManyToOne(type => Customer, customer => customer.addresses)
     customer: Customer;
 
-    @Column() fullName: string;
+    @Column({ default: '' }) fullName: string;
 
     @Column({ default: '' })
     company: string;
@@ -24,15 +24,17 @@ export class Address extends VendureEntity implements HasCustomFields {
     @Column({ default: '' })
     streetLine2: string;
 
-    @Column() city: string;
+    @Column({ default: '' }) city: string;
 
     @Column({ default: '' })
     province: string;
 
-    @Column() postalCode: string;
+    @Column({ default: '' }) postalCode: string;
 
     @Column() country: string;
 
+    @Column() countryCode: string;
+
     @Column({ default: '' })
     phoneNumber: string;
 

+ 6 - 5
server/src/entity/address/address.graphql

@@ -4,12 +4,13 @@ type Address implements Node {
     updatedAt: DateTime!
     fullName: String
     company: String
-    streetLine1: String
+    streetLine1: String!
     streetLine2: String
     city: String
     province: String
     postalCode: String
-    country: String
+    country: String!
+    countryCode: String!
     phoneNumber: String
     defaultShippingAddress: Boolean
     defaultBillingAddress: Boolean
@@ -18,12 +19,12 @@ type Address implements Node {
 input CreateAddressInput {
     fullName: String
     company: String
-    streetLine1: String
+    streetLine1: String!
     streetLine2: String
     city: String
     province: String
     postalCode: String
-    country: String
+    countryCode: String!
     phoneNumber: String
     defaultShippingAddress: Boolean
     defaultBillingAddress: Boolean
@@ -38,7 +39,7 @@ input UpdateAddressInput {
     city: String
     province: String
     postalCode: String
-    country: String
+    countryCode: String
     phoneNumber: String
     defaultShippingAddress: Boolean
     defaultBillingAddress: Boolean

+ 2 - 0
server/src/entity/order/order.graphql

@@ -29,6 +29,7 @@ type ShippingAddress {
     province: String
     postalCode: String
     country: String
+    countryCode: String
     phoneNumber: String
 }
 
@@ -41,5 +42,6 @@ type BillingAddress {
     province: String
     postalCode: String
     country: String
+    countryCode: String
     phoneNumber: String
 }

+ 1 - 0
server/src/i18n/messages/en.json

@@ -6,6 +6,7 @@
     "cannot-transition-to-shipping-when-order-is-empty": "Cannot transition Order to the \"ArrangingShipping\" state when it is empty",
     "cannot-transition-to-payment-without-customer": "Cannot transition Order to the \"ArrangingShipping\" state without Customer details",
     "channel-not-found":  "No channel with the token \"{ token }\" exists",
+    "country-code-not-valid":  "The countryCode \"{ countryCode }\" was not recognized",
     "email-address-not-verified": "Please verify this email address before logging in",
     "entity-has-no-translation-in-language": "Translatable entity '{ entityName }' has not been translated into the requested language ({ languageCode })",
     "entity-with-id-not-found": "No { entityName } with the id '{ id }' could be found",

+ 13 - 0
server/src/service/services/country.service.ts

@@ -5,6 +5,7 @@ import { Connection } from 'typeorm';
 import { CreateCountryInput, UpdateCountryInput } from '../../../../shared/generated-types';
 import { ID, PaginatedList } from '../../../../shared/shared-types';
 import { RequestContext } from '../../api/common/request-context';
+import { UserInputError } from '../../common/error/errors';
 import { ListQueryOptions } from '../../common/types/common-types';
 import { Translated } from '../../common/types/locale-types';
 import { assertFound } from '../../common/utils';
@@ -45,6 +46,18 @@ export class CountryService {
             .then(country => country && translateDeep(country, ctx.languageCode));
     }
 
+    async findOneByCode(ctx: RequestContext, countryCode: string): Promise<Translated<Country>> {
+        const country = await this.connection.getRepository(Country).findOne({
+            where: {
+                code: countryCode,
+            },
+        });
+        if (!country) {
+            throw new UserInputError('error.country-code-not-valid', { countryCode });
+        }
+        return translateDeep(country, ctx.languageCode);
+    }
+
     async create(ctx: RequestContext, input: CreateCountryInput): Promise<Translated<Country>> {
         const country = await this.translatableSaver.create({
             input,

+ 39 - 4
server/src/service/services/customer.service.ts

@@ -13,7 +13,7 @@ import { ID, PaginatedList } from '../../../../shared/shared-types';
 import { RequestContext } from '../../api/common/request-context';
 import { EntityNotFoundError, InternalServerError } from '../../common/error/errors';
 import { ListQueryOptions } from '../../common/types/common-types';
-import { assertFound, normalizeEmailAddress } from '../../common/utils';
+import { assertFound, idsAreEqual, normalizeEmailAddress } from '../../common/utils';
 import { Address } from '../../entity/address/address.entity';
 import { Customer } from '../../entity/customer/customer.entity';
 import { EventBus } from '../../event-bus/event-bus';
@@ -22,6 +22,7 @@ import { ListQueryBuilder } from '../helpers/list-query-builder/list-query-build
 import { getEntityOrThrow } from '../helpers/utils/get-entity-or-throw';
 import { patchEntity } from '../helpers/utils/patch-entity';
 
+import { CountryService } from './country.service';
 import { UserService } from './user.service';
 
 @Injectable()
@@ -29,6 +30,7 @@ export class CustomerService {
     constructor(
         @InjectConnection() private connection: Connection,
         private userService: UserService,
+        private countryService: CountryService,
         private listQueryBuilder: ListQueryBuilder,
         private eventBus: EventBus,
     ) {}
@@ -153,7 +155,11 @@ export class CustomerService {
         return this.connection.getRepository(Customer).save(customer);
     }
 
-    async createAddress(customerId: string, input: CreateAddressInput): Promise<Address> {
+    async createAddress(
+        ctx: RequestContext,
+        customerId: string,
+        input: CreateAddressInput,
+    ): Promise<Address> {
         const customer = await this.connection.manager.findOne(Customer, customerId, {
             relations: ['addresses'],
         });
@@ -161,11 +167,15 @@ export class CustomerService {
         if (!customer) {
             throw new EntityNotFoundError('Customer', customerId);
         }
-
-        const address = new Address(input);
+        const country = await this.countryService.findOneByCode(ctx, input.countryCode);
+        const address = new Address({
+            ...input,
+            country: country.name,
+        });
         const createdAddress = await this.connection.manager.getRepository(Address).save(address);
         customer.addresses.push(createdAddress);
         await this.connection.manager.save(customer);
+        await this.enforceSingleDefaultAddress(createdAddress.id, input);
         return createdAddress;
     }
 
@@ -173,6 +183,31 @@ export class CustomerService {
         const address = await getEntityOrThrow(this.connection, Address, input.id);
         const updatedAddress = patchEntity(address, input);
         await this.connection.getRepository(Address).save(updatedAddress);
+        await this.enforceSingleDefaultAddress(input.id, input);
         return updatedAddress;
     }
+
+    private async enforceSingleDefaultAddress(addressId: ID, input: CreateAddressInput | UpdateAddressInput) {
+        const result = await this.connection
+            .getRepository(Address)
+            .findOne(addressId, { relations: ['customer', 'customer.addresses'] });
+        if (result) {
+            const customerAddressIds = result.customer.addresses
+                .map(a => a.id)
+                .filter(id => !idsAreEqual(id, addressId)) as string[];
+
+            if (customerAddressIds.length) {
+                if (input.defaultBillingAddress === true) {
+                    await this.connection.getRepository(Address).update(customerAddressIds, {
+                        defaultBillingAddress: false,
+                    });
+                }
+                if (input.defaultShippingAddress === true) {
+                    await this.connection.getRepository(Address).update(customerAddressIds, {
+                        defaultShippingAddress: false,
+                    });
+                }
+            }
+        }
+    }
 }

+ 4 - 1
server/src/service/services/order.service.ts

@@ -24,6 +24,7 @@ import { OrderStateMachine } from '../helpers/order-state-machine/order-state-ma
 import { ShippingCalculator } from '../helpers/shipping-calculator/shipping-calculator';
 import { translateDeep } from '../helpers/utils/translate-entity';
 
+import { CountryService } from './country.service';
 import { CustomerService } from './customer.service';
 import { PaymentMethodService } from './payment-method.service';
 import { ProductVariantService } from './product-variant.service';
@@ -33,6 +34,7 @@ export class OrderService {
         @InjectConnection() private connection: Connection,
         private productVariantService: ProductVariantService,
         private customerService: CustomerService,
+        private countryService: CountryService,
         private orderCalculator: OrderCalculator,
         private shippingCalculator: ShippingCalculator,
         private orderStateMachine: OrderStateMachine,
@@ -201,7 +203,8 @@ export class OrderService {
 
     async setShippingAddress(ctx: RequestContext, orderId: ID, input: CreateAddressInput): Promise<Order> {
         const order = await this.getOrderOrThrow(ctx, orderId);
-        order.shippingAddress = input;
+        const country = await this.countryService.findOneByCode(ctx, input.countryCode);
+        order.shippingAddress = { ...input, countryCode: input.countryCode, country: country.name };
         return this.connection.getRepository(Order).save(order);
     }
 

+ 27 - 12
shared/generated-types.ts

@@ -232,12 +232,13 @@ export interface Address extends Node {
     updatedAt: DateTime;
     fullName?: string | null;
     company?: string | null;
-    streetLine1?: string | null;
+    streetLine1: string;
     streetLine2?: string | null;
     city?: string | null;
     province?: string | null;
     postalCode?: string | null;
     country?: string | null;
+    countryCode: string;
     phoneNumber?: string | null;
     defaultShippingAddress?: boolean | null;
     defaultBillingAddress?: boolean | null;
@@ -337,6 +338,7 @@ export interface ShippingAddress {
     province?: string | null;
     postalCode?: string | null;
     country?: string | null;
+    countryCode?: string | null;
     phoneNumber?: string | null;
 }
 
@@ -349,6 +351,7 @@ export interface BillingAddress {
     province?: string | null;
     postalCode?: string | null;
     country?: string | null;
+    countryCode?: string | null;
     phoneNumber?: string | null;
 }
 
@@ -1167,12 +1170,12 @@ export interface UpdateCustomerInput {
 export interface CreateAddressInput {
     fullName?: string | null;
     company?: string | null;
-    streetLine1?: string | null;
+    streetLine1: string;
     streetLine2?: string | null;
     city?: string | null;
     province?: string | null;
     postalCode?: string | null;
-    country?: string | null;
+    countryCode: string;
     phoneNumber?: string | null;
     defaultShippingAddress?: boolean | null;
     defaultBillingAddress?: boolean | null;
@@ -1188,7 +1191,7 @@ export interface UpdateAddressInput {
     city?: string | null;
     province?: string | null;
     postalCode?: string | null;
-    country?: string | null;
+    countryCode?: string | null;
     phoneNumber?: string | null;
     defaultShippingAddress?: boolean | null;
     defaultBillingAddress?: boolean | null;
@@ -3029,12 +3032,13 @@ export namespace AddressResolvers {
         updatedAt?: UpdatedAtResolver<DateTime, any, Context>;
         fullName?: FullNameResolver<string | null, any, Context>;
         company?: CompanyResolver<string | null, any, Context>;
-        streetLine1?: StreetLine1Resolver<string | null, any, Context>;
+        streetLine1?: StreetLine1Resolver<string, any, Context>;
         streetLine2?: StreetLine2Resolver<string | null, any, Context>;
         city?: CityResolver<string | null, any, Context>;
         province?: ProvinceResolver<string | null, any, Context>;
         postalCode?: PostalCodeResolver<string | null, any, Context>;
         country?: CountryResolver<string | null, any, Context>;
+        countryCode?: CountryCodeResolver<string, any, Context>;
         phoneNumber?: PhoneNumberResolver<string | null, any, Context>;
         defaultShippingAddress?: DefaultShippingAddressResolver<boolean | null, any, Context>;
         defaultBillingAddress?: DefaultBillingAddressResolver<boolean | null, any, Context>;
@@ -3054,11 +3058,7 @@ export namespace AddressResolvers {
         Parent,
         Context
     >;
-    export type StreetLine1Resolver<R = string | null, Parent = any, Context = any> = Resolver<
-        R,
-        Parent,
-        Context
-    >;
+    export type StreetLine1Resolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
     export type StreetLine2Resolver<R = string | null, Parent = any, Context = any> = Resolver<
         R,
         Parent,
@@ -3080,6 +3080,7 @@ export namespace AddressResolvers {
         Parent,
         Context
     >;
+    export type CountryCodeResolver<R = string, Parent = any, Context = any> = Resolver<R, Parent, Context>;
     export type PhoneNumberResolver<R = string | null, Parent = any, Context = any> = Resolver<
         R,
         Parent,
@@ -3368,6 +3369,7 @@ export namespace ShippingAddressResolvers {
         province?: ProvinceResolver<string | null, any, Context>;
         postalCode?: PostalCodeResolver<string | null, any, Context>;
         country?: CountryResolver<string | null, any, Context>;
+        countryCode?: CountryCodeResolver<string | null, any, Context>;
         phoneNumber?: PhoneNumberResolver<string | null, any, Context>;
     }
 
@@ -3407,6 +3409,11 @@ export namespace ShippingAddressResolvers {
         Parent,
         Context
     >;
+    export type CountryCodeResolver<R = string | null, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context
+    >;
     export type PhoneNumberResolver<R = string | null, Parent = any, Context = any> = Resolver<
         R,
         Parent,
@@ -3424,6 +3431,7 @@ export namespace BillingAddressResolvers {
         province?: ProvinceResolver<string | null, any, Context>;
         postalCode?: PostalCodeResolver<string | null, any, Context>;
         country?: CountryResolver<string | null, any, Context>;
+        countryCode?: CountryCodeResolver<string | null, any, Context>;
         phoneNumber?: PhoneNumberResolver<string | null, any, Context>;
     }
 
@@ -3463,6 +3471,11 @@ export namespace BillingAddressResolvers {
         Parent,
         Context
     >;
+    export type CountryCodeResolver<R = string | null, Parent = any, Context = any> = Resolver<
+        R,
+        Parent,
+        Context
+    >;
     export type PhoneNumberResolver<R = string | null, Parent = any, Context = any> = Resolver<
         R,
         Parent,
@@ -5380,7 +5393,7 @@ export namespace GetUiState {
 
 export namespace GetCustomerList {
     export type Variables = {
-        options: CustomerListOptions;
+        options?: CustomerListOptions | null;
     };
 
     export type Query = {
@@ -6569,12 +6582,14 @@ export namespace Address {
         __typename?: 'Address';
         id: string;
         fullName?: string | null;
-        streetLine1?: string | null;
+        company?: string | null;
+        streetLine1: string;
         streetLine2?: string | null;
         city?: string | null;
         province?: string | null;
         postalCode?: string | null;
         country?: string | null;
+        countryCode: string;
         phoneNumber?: string | null;
         defaultShippingAddress?: boolean | null;
         defaultBillingAddress?: boolean | null;

Some files were not shown because too many files changed in this diff