diff --git a/schema.graphql b/schema.graphql index c049f530e..025370c5c 100644 --- a/schema.graphql +++ b/schema.graphql @@ -4548,7 +4548,6 @@ type ProductVariant implements Node & ObjectWithMetadata { channelListings: [ProductVariantChannelListing!] pricing(address: AddressInput): VariantPricingInfo attributes(variantSelection: VariantAttributeScope): [SelectedAttribute!]! - costPrice: Money margin: Int quantityOrdered: Int revenue(period: ReportingPeriod): TaxedMoney @@ -5915,23 +5914,12 @@ type Warehouse implements Node & ObjectWithMetadata { id: ID! name: String! slug: String! - companyName: String! shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection! address: Address! email: String! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! -} - -input WarehouseAddressInput { - streetAddress1: String! - streetAddress2: String - city: String! - cityArea: String - postalCode: String - country: CountryCode! - countryArea: String - phone: String + companyName: String! @deprecated(reason: "Use address.CompanyName. This field will be removed in Saleor 4.0.") } type WarehouseCountableConnection { @@ -5953,10 +5941,9 @@ type WarehouseCreate { input WarehouseCreateInput { slug: String - companyName: String email: String name: String! - address: WarehouseAddressInput! + address: AddressInput! shippingZones: [ID] } @@ -6015,10 +6002,9 @@ type WarehouseUpdate { input WarehouseUpdateInput { slug: String - companyName: String email: String name: String - address: WarehouseAddressInput + address: AddressInput } type Webhook implements Node { @@ -6176,4 +6162,4 @@ union _Entity = Address | User | Group | App | ProductVariant | Product | Produc type _Service { sdl: String -} +} \ No newline at end of file diff --git a/src/shipping/views/ShippingZoneDetails/index.tsx b/src/shipping/views/ShippingZoneDetails/index.tsx index 9dc2c09fc..3d8317aa3 100644 --- a/src/shipping/views/ShippingZoneDetails/index.tsx +++ b/src/shipping/views/ShippingZoneDetails/index.tsx @@ -327,6 +327,7 @@ const ShippingZoneDetails: React.FC = ({ variables: { input: { address: { + companyName: data.companyName, city: data.city, cityArea: data.cityArea, country: findValueInEnum(data.country, CountryCode), @@ -336,7 +337,6 @@ const ShippingZoneDetails: React.FC = ({ streetAddress1: data.streetAddress1, streetAddress2: data.streetAddress2 }, - companyName: data.companyName, name: data.name } } diff --git a/src/types/globalTypes.ts b/src/types/globalTypes.ts index ef3d175d9..10579b2d3 100644 --- a/src/types/globalTypes.ts +++ b/src/types/globalTypes.ts @@ -1984,23 +1984,11 @@ export interface VoucherSortingInput { field: VoucherSortField; } -export interface WarehouseAddressInput { - streetAddress1: string; - streetAddress2?: string | null; - city: string; - cityArea?: string | null; - postalCode?: string | null; - country: CountryCode; - countryArea?: string | null; - phone?: string | null; -} - export interface WarehouseCreateInput { slug?: string | null; - companyName?: string | null; email?: string | null; name: string; - address: WarehouseAddressInput; + address: AddressInput; shippingZones?: (string | null)[] | null; } @@ -2016,10 +2004,9 @@ export interface WarehouseSortingInput { export interface WarehouseUpdateInput { slug?: string | null; - companyName?: string | null; email?: string | null; name?: string | null; - address?: WarehouseAddressInput | null; + address?: AddressInput | null; } export interface WebhookCreateInput { diff --git a/src/warehouses/views/WarehouseCreate/WarehouseCreate.tsx b/src/warehouses/views/WarehouseCreate/WarehouseCreate.tsx index 90528ba6d..faa7430ff 100644 --- a/src/warehouses/views/WarehouseCreate/WarehouseCreate.tsx +++ b/src/warehouses/views/WarehouseCreate/WarehouseCreate.tsx @@ -48,6 +48,7 @@ const WarehouseCreate: React.FC = () => { variables: { input: { address: { + companyName: data.companyName, city: data.city, cityArea: data.cityArea, country: findValueInEnum(data.country, CountryCode), @@ -57,7 +58,6 @@ const WarehouseCreate: React.FC = () => { streetAddress1: data.streetAddress1, streetAddress2: data.streetAddress2 }, - companyName: data.companyName, name: data.name } } diff --git a/src/warehouses/views/WarehouseDetails/WarehouseDetails.tsx b/src/warehouses/views/WarehouseDetails/WarehouseDetails.tsx index bebb1e2f4..76c255af4 100644 --- a/src/warehouses/views/WarehouseDetails/WarehouseDetails.tsx +++ b/src/warehouses/views/WarehouseDetails/WarehouseDetails.tsx @@ -84,6 +84,7 @@ const WarehouseDetails: React.FC = ({ id, params }) => { id, input: { address: { + companyName: data.companyName, city: data.city, cityArea: data.cityArea, country: findValueInEnum(data.country, CountryCode),