From cb8624aa7b8f02e8b3f34e793bd8ad748c147cdc Mon Sep 17 00:00:00 2001 From: rakesh Date: Tue, 20 Oct 2020 18:27:57 +0530 Subject: [PATCH 1/3] update customer files with UID changes --- .../coverage/customer/Wishlist.graphqls | 8 +++--- .../coverage/customer/customer.graphqls | 8 +++--- .../coverage/customer/gift-registry.graphqls | 26 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls index ccd81d0d2..893995bc8 100644 --- a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls +++ b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls @@ -1,6 +1,6 @@ type Mutation { createWishlist(name: String!): ID # Multiple wishlists Commerce functionality - removeWishlist(id: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist + removeWishlist(uid: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput @@ -8,12 +8,12 @@ type Mutation { type Customer { wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2") - wishlist_v2(id: ID!): Wishlist # This query will be added in the ce + wishlist_v2(uid: ID!): Wishlist # This query will be added in the ce wishlists: [Wishlist!]! @doc(description: "Customer wishlists are limited to a max of 1 wishlist in Magento Open Source") # This query will be added in the ce } type Wishlist { - id: ID + uid: ID items: [WishlistItem] @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") items_count: Int @@ -51,7 +51,7 @@ input WishlistItemInput { } interface WishlistItemInterface { - id: ID + uid: ID quantity: Float description: String added_at: String diff --git a/design-documents/graph-ql/coverage/customer/customer.graphqls b/design-documents/graph-ql/coverage/customer/customer.graphqls index 42075d0f8..4512fab79 100644 --- a/design-documents/graph-ql/coverage/customer/customer.graphqls +++ b/design-documents/graph-ql/coverage/customer/customer.graphqls @@ -21,8 +21,8 @@ type Mutation { updateCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update the customer's personal information") revokeCustomerToken: RevokeCustomerTokenOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke the customer token") createCustomerAddress(input: CustomerAddressInput!): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomerAddress") @doc(description: "Create customer address") - updateCustomerAddress(id: Int!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address") - deleteCustomerAddress(id: Int!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address") + updateCustomerAddress(uid: ID!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address") + deleteCustomerAddress(uid: ID!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address") requestPasswordResetEmail(email: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RequestPasswordResetEmail") @doc(description: "Request an email with a reset password token for the registered customer identified by the specified email.") resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ResetPassword") @doc(description: "Reset a customer's password using the reset password token that the customer received in an email after requesting it using requestPasswordResetEmail.") } @@ -100,14 +100,14 @@ type Customer @doc(description: "Customer defines the customer name and address dob: String @doc(description: "The customer's date of birth") @deprecated(reason: "Use `date_of_birth` instead") date_of_birth: String @doc(description: "The customer's date of birth") taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") - id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") + uid: ID @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") } type CustomerAddress @doc(description: "CustomerAddress contains detailed information about a customer's billing and shipping addresses"){ - id: Int @doc(description: "The ID assigned to the address object") + uid: ID @doc(description: "The ID assigned to the address object") customer_id: Int @doc(description: "The customer ID") @deprecated(reason: "customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses.") region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID") region_id: Int @doc(description: "The unique ID for a pre-defined region") @deprecated(reason: "Use `region` instead.") diff --git a/design-documents/graph-ql/coverage/customer/gift-registry.graphqls b/design-documents/graph-ql/coverage/customer/gift-registry.graphqls index 9efa70f2d..47734e9da 100644 --- a/design-documents/graph-ql/coverage/customer/gift-registry.graphqls +++ b/design-documents/graph-ql/coverage/customer/gift-registry.graphqls @@ -1,6 +1,6 @@ type Customer { gift_registry_list: [GiftRegistry] - gift_registry(id: ID!): GiftRegistry + gift_registry(uid: ID!): GiftRegistry } type Query { @@ -11,15 +11,15 @@ type Query { giftRegistryTypeId: ID, searchableDynamicAttributes: [GiftRegistryDynamicAttributeInput] @doc(description: "For select attributes ID should be provided expected. For range search, '_from' and '_to' suffixes can be added to the attribute code. For text attributes provide value for exact matching.") ): [GiftRegistry] @doc(description: "Gift registry search by registrant name and additional searchable attributes.") - giftRegistry(id: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe") + giftRegistry(uid: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe") } type Mutation { # All mutations below should only be accessible to the registry owner. Guest users should be getting authorization error createGiftRegistry(giftRegistry: CreateGiftRegistryInput!): CreateGiftRegistryOutput - updateGiftRegistry(id: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput - removeGiftRegistry(id: ID!): RemoveGiftRegistryOutput + updateGiftRegistry(uid: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput + removeGiftRegistry(uid: ID!): RemoveGiftRegistryOutput addGiftRegistryItems(giftRegistryId: ID!, items: [AddGiftRegistryItemInput!]!): AddGiftRegistryItemsOutput removeGiftRegistryItems(giftRegistryId: ID!, itemIds: [ID!]!): RemoveGiftRegistryItemsOutput @@ -29,7 +29,7 @@ type Mutation { updateGiftRegistryRegistrants(giftRegistryId: ID!, registrants: [UpdateGiftRegistryRegistrantInput!]!): UpdateGiftRegistryRegistrantsOutput removeGiftRegistryRegistrants(giftRegistryId: ID!, registrantIds: [ID!]!): RemoveGiftRegistryRegistrantsOutput - shareGiftRegistry(id: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput + shareGiftRegistry(uid: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput } input ShareGiftRegistryInviteeInput @@ -58,12 +58,12 @@ input AddGiftRegistryItemInput { # Should be defined in scope of https://github.com/magento/architecture/blob/master/design-documents/graph-ql/coverage/add-items-to-cart-single-mutation.md input EnteredOptionInput { - id: String! + uid: String! value: String! } input UpdateGiftRegistryItemInput { - id: ID! + uid: ID! quantity: Float! note: String } @@ -79,7 +79,7 @@ input UpdateGiftRegistryInput { } input CreateGiftRegistryInput { - id: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.") + uid: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.") event_name: String! type_id: String! message: String! @@ -95,7 +95,7 @@ input GiftRegistryShippingAddressInput @doc(description: "Either address data or } input UpdateGiftRegistryRegistrantInput { - id: ID! + uid: ID! first_name: String last_name: String email: String @@ -155,7 +155,7 @@ type ShareGiftRegistryOutput { } type GiftRegistryType { - id: ID! + uid: ID! label: String! dynamic_attributes_metadata: [GiftRegistryDynamicAttributeMetadataInterface] } @@ -224,7 +224,7 @@ type GiftRegistrySelectAttributeOptionMetadata { } type GiftRegistry { - id: ID! + uid: ID! event_name: String! type: GiftRegistryType message: String! @@ -239,7 +239,7 @@ type GiftRegistry { } interface GiftRegistryItemInterface { - id: String! + uid: String! quantity: Float! quantity_fulfilled: Float! note: String @@ -301,7 +301,7 @@ enum GiftRegistryDynamicAttributeGroup { } type GiftRegistryRegistrant { - id: ID! + uid: ID! first_name: String! last_name: String! email: String! @doc(description: "Accessible to the registry owner only") From 5d60865eb02b1784d37fdb040bafdb4937981f65 Mon Sep 17 00:00:00 2001 From: rakesh Date: Thu, 12 Nov 2020 13:06:08 +0530 Subject: [PATCH 2/3] resolved conflict with PR --- .../coverage/customer/Wishlist.graphqls | 114 ++++++++++++++++-- 1 file changed, 105 insertions(+), 9 deletions(-) diff --git a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls index 518455e2e..a0de2fd7b 100644 --- a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls +++ b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls @@ -1,9 +1,16 @@ type Mutation { - createWishlist(name: String!): ID # Multiple wishlists Commerce functionality - removeWishlist(uid: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist - addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput + createWishlist(input: CreateWishlistInput!): CreateWishlistOutput # Multiple wishlists Commerce functionality + deleteWishlist(wishlistUid: ID!): DeleteWishlistOutput # Commerce fucntionality - in Opens Source we assume customer always has one wishlist + addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput + copyProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemCopyInput!]!): CopyProductsBetweenWishlistsOutput @doc(description: "Copy a product to the wish list") + moveProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemMoveInput!]!): MoveProductsBetweenWishlistsOutput @doc(description: "Move products from one wish list to another") + updateWishlist( wishlistUid: ID!, input: UpdateWishlistInput!): UpdateWishlistOutput @doc(description: "Change the name and visibility of the specified wish list") + addWishlistItemsToCart( + wishlistUid: ID!, @doc(description: "unique Id of wishlist") + wishlistItemUids: [ID!] @doc(description: "Optional param. selected wish list items that are to be added") + ): AddWishlistItemsToCartOutput @doc(description: "Add Requisition List Items To Customer Cart") } type Customer { @@ -13,6 +20,7 @@ type Customer { } type Wishlist { +<<<<<<< customer-files-uid-update uid: ID items: [WishlistItem] @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") @@ -24,6 +32,23 @@ type Wishlist { sharing_code: String updated_at: String name: String @doc(description: "Avaialble in Commerce edition only") + visibility: WishlistVisibilityEnum! +} + +type WishlistItems { + items: [WishlistItemInterface]! @doc(description: "Wishlist items list") + page_info: SearchResultPageInfo + total_pages: Int! @doc(description: "total count of wishlist items") +} + +input CreateWishlistInput { + name: String! + visibility: WishlistVisibilityEnum! +} + +input UpdateWishlistInput { + name: String + visibility: WishlistVisibilityEnum } type WishlistItems { @@ -33,8 +58,9 @@ type WishlistItems { } input WishlistItemUpdateInput { - wishlist_item_id: ID + wishlist_item_id: ID! quantity: Float + description: String selected_options: [ID!] entered_options: [EnteredOptionInput!] } @@ -44,6 +70,7 @@ type AddProductsToWishlistOutput { } type RemoveProductsFromWishlistOutput { + status: Boolean! wishlist: Wishlist! } @@ -51,9 +78,25 @@ type UpdateProductsInWishlistOutput { wishlist: Wishlist! } +type AddWishlistItemsToCartOutput { + status: Boolean! + add_wishlist_items_to_cart_user_errors: [AddWishlistItemUserError]! +} + +type AddWishlistItemUserError { + message: String! + type: AddWishlistItemUserErrorType! +} + +enum AddWishlistItemUserErrorType { + OUT_OF_STOCK + MAX_QTY_FOR_USER + NOT_AVAILABLE +} + input WishlistItemInput { - sku: String - quantity: Float + sku: String! + quantity: Float! parent_sku: String, parent_quantity: Float, selected_options: [ID!] @@ -90,10 +133,63 @@ type BundleWishlistItem implements WishlistItemInterface { } type GiftCardWishlistItem implements WishlistItemInterface { - sender_name: String! - sender_email: String! + gift_card_options: GiftCardOptions! +} + +type GiftCardOptions { + sender_name: String + sender_email: String recipient_name: String recipient_email: String - amount: SelectedGiftCardAmount + amount: Money + custom_giftcard_amount: Money message: String } + +type GroupedProductWishlistItem implements WishlistItemInterface { + grouped_products: [GroupedProductItem!]! +} + +enum WishlistVisibilityEnum @doc(description: "This enumeration defines the wish list visibility types") { + PUBLIC + PRIVATE +} + +type CreateWishlistOutput { + wishlist: Wishlist! +} + +type DeleteWishlistOutput { + status: Boolean! + wishlists: [Wishlist!]! +} + +input WishlistItemCopyInput { + wishlist_item_id: ID! @doc(description: "The ID of the item to be copied") + quantity: Float @doc(description: "The quantity of this item to copy to the destination wish list. This value can't be greater than the quantity in the source wish list.") +} + +input WishlistItemMoveInput { + wishlist_item_id: ID! @doc(description: "The ID of the item to be moved") + quantity: Float @doc(description: "The quantity of this item to move to the destination wish list. This value can't be greater than the quantity in the source wish list.") +} + +type UpdateWishlistOutput { + wishlist: Wishlist +} + +type CopyProductsBetweenWishlistsOutput { + source_wishlist: Wishlist! + destination_wishlist: Wishlist! +} + +type MoveProductsBetweenWishlistsOutput { + source_wishlist: Wishlist! + destination_wishlist: Wishlist! +} + +type StoreConfig { + maximum_number_of_wishlists: Int @doc(description: "If multiple wish lists are enabled, the maximum number of wish lists the customer can have") + enable_multiple_wishlists: Boolean @doc(description: "Indicates whether customers can have multiple wish lists.") +} + From 47ee3d4e094d02dfff47ff8658c2981f33c33e26 Mon Sep 17 00:00:00 2001 From: rakesh Date: Thu, 12 Nov 2020 14:22:29 +0530 Subject: [PATCH 3/3] resolved conflict --- .../coverage/customer/Wishlist.graphqls | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls index a0de2fd7b..58d3d05ed 100644 --- a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls +++ b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls @@ -1,9 +1,9 @@ type Mutation { createWishlist(input: CreateWishlistInput!): CreateWishlistOutput # Multiple wishlists Commerce functionality deleteWishlist(wishlistUid: ID!): DeleteWishlistOutput # Commerce fucntionality - in Opens Source we assume customer always has one wishlist - addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput - removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput - updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput + addProductsToWishlist(wishlistUid: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput + removeProductsFromWishlist(wishlistUid: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput + updateProductsInWishlist(wishlistUid: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput copyProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemCopyInput!]!): CopyProductsBetweenWishlistsOutput @doc(description: "Copy a product to the wish list") moveProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemMoveInput!]!): MoveProductsBetweenWishlistsOutput @doc(description: "Move products from one wish list to another") updateWishlist( wishlistUid: ID!, input: UpdateWishlistInput!): UpdateWishlistOutput @doc(description: "Change the name and visibility of the specified wish list") @@ -20,14 +20,12 @@ type Customer { } type Wishlist { -<<<<<<< customer-files-uid-update uid: ID - items: [WishlistItem] @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") - items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") - items_v3( - currentPage: Int = 1 @doc(description: "current page of the customer wishlist items. default is 1") - pageSize: Int = 20 @doc(description: "page size for the customer wishlist items. default is 20") - ): WishlistItems! @doc(description: "An array of items in the customer's wishlist") + items: [WishlistItem] @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") + items_v2( + currentPage: Int = 1, + pageSize: Int = 20 + ): WishlistItems @doc(description: "An array of items in the customer's wishlist") items_count: Int sharing_code: String updated_at: String @@ -58,7 +56,7 @@ type WishlistItems { } input WishlistItemUpdateInput { - wishlist_item_id: ID! + wishlist_item_uid: ID! quantity: Float description: String selected_options: [ID!] @@ -165,12 +163,12 @@ type DeleteWishlistOutput { } input WishlistItemCopyInput { - wishlist_item_id: ID! @doc(description: "The ID of the item to be copied") + wishlist_item_uid: ID! @doc(description: "The ID of the item to be copied") quantity: Float @doc(description: "The quantity of this item to copy to the destination wish list. This value can't be greater than the quantity in the source wish list.") } input WishlistItemMoveInput { - wishlist_item_id: ID! @doc(description: "The ID of the item to be moved") + wishlist_item_uid: ID! @doc(description: "The ID of the item to be moved") quantity: Float @doc(description: "The quantity of this item to move to the destination wish list. This value can't be greater than the quantity in the source wish list.") } @@ -192,4 +190,3 @@ type StoreConfig { maximum_number_of_wishlists: Int @doc(description: "If multiple wish lists are enabled, the maximum number of wish lists the customer can have") enable_multiple_wishlists: Boolean @doc(description: "Indicates whether customers can have multiple wish lists.") } -