diff --git a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls index dae7e020a..58d3d05ed 100644 --- a/design-documents/graph-ql/coverage/customer/Wishlist.graphqls +++ b/design-documents/graph-ql/coverage/customer/Wishlist.graphqls @@ -1,29 +1,52 @@ 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 - addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput - removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput - updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput + 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(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") + 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 { 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 - 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") + uid: ID + 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 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 +56,9 @@ type WishlistItems { } input WishlistItemUpdateInput { - wishlist_item_id: ID + wishlist_item_uid: ID! quantity: Float + description: String selected_options: [ID!] entered_options: [EnteredOptionInput!] } @@ -44,6 +68,7 @@ type AddProductsToWishlistOutput { } type RemoveProductsFromWishlistOutput { + status: Boolean! wishlist: Wishlist! } @@ -51,9 +76,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!] @@ -61,7 +102,7 @@ input WishlistItemInput { } interface WishlistItemInterface { - id: ID + uid: ID quantity: Float description: String added_at: String @@ -90,10 +131,62 @@ 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_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_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.") +} + +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.") +} 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")