diff --git a/commerce.go b/commerce.go index b6edb8e69..da7de6a0c 100644 --- a/commerce.go +++ b/commerce.go @@ -6,7 +6,7 @@ package commerce */ //go:generate rm -rf docs/openapi -//go:generate go run github.com/swaggo/swag/cmd/swag@v1.7.3 init -p pascalcase --generalInfo=commerce.go --dir=./ --output=docs/openapi +//go:generate go run github.com/swaggo/swag/cmd/swag@v1.6.7 init -p pascalcase --generalInfo=commerce.go --dir=./ --output=docs/openapi // Swagger Documentation used for generator swag (https://github.com/swaggo/swag#declarative-comments-format) // @title Flamingo Commerce API Spec diff --git a/docs/openapi/docs.go b/docs/openapi/docs.go index b81656da3..620734604 100644 --- a/docs/openapi/docs.go +++ b/docs/openapi/docs.go @@ -1,13 +1,14 @@ -// Package openapi GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag + package openapi import ( "bytes" "encoding/json" "strings" - "text/template" + "github.com/alecthomas/template" "github.com/swaggo/swag" ) @@ -15,7 +16,7 @@ var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "{{escape .Description}}", + "description": "{{.Description}}", "title": "{{.Title}}", "contact": { "name": "Flamingo", @@ -1030,7 +1031,7 @@ var doc = `{ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/productResultError" + "$ref": "#/definitions/cartResultError" } } } @@ -1090,36 +1091,6 @@ var doc = `{ } }, "definitions": { - "ProductAttribute": { - "type": "object", - "properties": { - "Code": { - "description": "Code is the internal attribute identifier", - "type": "string" - }, - "CodeLabel": { - "description": "CodeLabel is the human-readable (perhaps localized) attribute name", - "type": "string" - }, - "Label": { - "description": "Label is the human-readable (perhaps localized) attribute value", - "type": "string" - }, - "RawValue": { - "description": "RawValue is the untouched original value of the attribute" - }, - "UnitCode": { - "description": "UnitCode is the internal code of the attribute values measuring unit", - "type": "string" - } - } - }, - "ProductAttributes": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ProductAttribute" - } - }, "ProductMedia": { "type": "object", "properties": { @@ -1144,9 +1115,11 @@ var doc = `{ "type": "object", "properties": { "Amount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "CreditCardInfo": { + "type": "object", "$ref": "#/definitions/placeorder.CreditCardInfo" }, "Gateway": { @@ -1246,6 +1219,7 @@ var doc = `{ "properties": { "Applied": { "description": "how much of the discount has been subtracted from cart price, IMPORTANT: always negative", + "type": "object", "$ref": "#/definitions/domain.Price" }, "CampaignCode": { @@ -1274,11 +1248,18 @@ var doc = `{ } } }, + "cart.AppliedDiscounts": { + "type": "array", + "items": { + "$ref": "#/definitions/cart.AppliedDiscount" + } + }, "cart.AppliedGiftCard": { "type": "object", "properties": { "Applied": { "description": "how much of the gift card has been subtracted from cart price", + "type": "object", "$ref": "#/definitions/domain.Price" }, "Code": { @@ -1291,6 +1272,7 @@ var doc = `{ }, "Remaining": { "description": "how much of the gift card is still available", + "type": "object", "$ref": "#/definitions/domain.Price" } } @@ -1300,6 +1282,7 @@ var doc = `{ "properties": { "AdditionalData": { "description": "AdditionalData can be used for Custom attributes", + "type": "object", "$ref": "#/definitions/cart.AdditionalData" }, "AppliedCouponCodes": { @@ -1326,6 +1309,7 @@ var doc = `{ }, "BillingAddress": { "description": "BillingAddress is the main billing address (relevant for all payments/invoices)", + "type": "object", "$ref": "#/definitions/cart.Address" }, "DefaultCurrency": { @@ -1344,18 +1328,22 @@ var doc = `{ }, "GrandTotal": { "description": "GrandTotal is the final amount that need to be paid by the customer (gross)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalNet": { "description": "GrandTotalNet is the corresponding net value to GrandTotal", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalNetWithGiftCards": { "description": "GrandTotalNetWithGiftCards is the corresponding net value to GrandTotalWithGiftCards", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalWithGiftCards": { "description": "GrandTotalWithGiftCards is the final amount with the applied gift cards subtracted.", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ID": { @@ -1364,57 +1352,72 @@ var doc = `{ }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount is the sum of discounts that are related to the item (including shipping discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount is the sum of discounts that are not related to the item (including shipping discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "PaymentSelection": { - "description": "PaymentSelection is used to store information on \"how\" the customer wants to pay" + "description": "PaymentSelection is used to store information on \"how\" the customer wants to pay", + "type": "object", + "$ref": "#/definitions/cart.PaymentSelection" }, "Purchaser": { "description": "Purchaser hold additional infos for the legal contact person in this order", + "type": "object", "$ref": "#/definitions/cart.Person" }, "ShippingGross": { "description": "ShippingGross is the sum of all shipping costs including tax", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingGrossWithDiscounts": { "description": "ShippingGrossWithDiscounts is the sum of all shipping costs with all shipping discounts including tax", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingNet": { "description": "ShippingNet is the sum of all shipping costs", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingNetWithDiscounts": { "description": "ShippingNetWithDiscounts is the sum of all shipping costs with all shipping discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGross": { "description": "SubTotalGross is the sum of all delivery subtotals (without shipping/ discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGrossWithDiscounts": { "description": "SubTotalGrossWithDiscounts is the sum of row gross prices reduced by the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNet": { "description": "SubTotalNet is the sum of all delivery net subtotals (without shipping/ discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNetWithDiscounts": { "description": "SubTotalNetWithDiscounts is the sum of row net prices reduced by the net value of the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalDiscountAmount": { "description": "TotalDiscountAmount is the sum of all discounts (incl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalGiftCardAmount": { "description": "AppliedGiftCardsAmount is the part of GrandTotal which is paid by gift cards", + "type": "object", "$ref": "#/definitions/domain.Price" }, "Totalitems": { @@ -1451,46 +1454,57 @@ var doc = `{ }, "DeliveryInfo": { "description": "DeliveryInfo contains details for this delivery e.g. how and where the delivery should be delivered to", + "type": "object", "$ref": "#/definitions/cart.DeliveryInfo" }, "GrandTotal": { "description": "GrandTotal contains the final price to pay", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount contains the sum of discounts that are related to the item, e.g. promo due to product attribute", + "type": "object", "$ref": "#/definitions/domain.Price" }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount contains the sum of discounts that are not related to the item, e.g. a general promo", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingItem": { "description": "ShippingItem\trepresent the shipping cost that may be involved in this delivery", + "type": "object", "$ref": "#/definitions/cart.ShippingItem" }, "SubTotalDiscountAmount": { "description": "TotalDiscountAmount contains the sum of all discounts (excl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGross": { "description": "SubTotalGross contains the sum of row gross prices, without shipping/discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGrossWithDiscounts": { "description": "SubTotalGrossWithDiscounts contains the sum of row gross prices reduced by the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNet": { "description": "SubTotalNet contains the sum of row net prices, without shipping/discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNetWithDiscounts": { "description": "SubTotalNetWithDiscounts contains the sum of row net prices reduced by the net value of the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalDiscountAmount": { "description": "TotalDiscountAmount contains the sum of all discounts (incl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" } } @@ -1515,6 +1529,7 @@ var doc = `{ }, "DeliveryLocation": { "description": "DeliveryLocation is the target location for the delivery", + "type": "object", "$ref": "#/definitions/cart.DeliveryLocation" }, "DesiredTime": { @@ -1536,6 +1551,7 @@ var doc = `{ "properties": { "Address": { "description": "Address contains the address of the delivery location, maybe not relevant if the type is not address", + "type": "object", "$ref": "#/definitions/cart.Address" }, "Code": { @@ -1572,10 +1588,8 @@ var doc = `{ }, "AppliedDiscounts": { "description": "AppliedDiscounts contains the details about the discounts applied to this item - they can be \"itemrelated\" or not\nitemrelated would be e.g. special price, buy 3 pay 2\nnon-itemrelated would be e.g. 10% on everything", - "type": "array", - "items": { - "$ref": "#/definitions/cart.AppliedDiscount" - } + "type": "object", + "$ref": "#/definitions/cart.AppliedDiscounts" }, "ExternalReference": { "description": "ExternalReference can be used by cart service implementations to separate the representation in an external\ncart service from the unique item ID", @@ -1587,6 +1601,7 @@ var doc = `{ }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount is the sum of all itemrelated Discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "MarketplaceCode": { @@ -1595,6 +1610,7 @@ var doc = `{ }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount is the sum of non-itemrelated Discounts where IsItemRelated = false", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ProductName": { @@ -1605,41 +1621,47 @@ var doc = `{ }, "RowPriceGross": { "description": "RowPriceGross is the price incl. taxes for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceGrossWithDiscount": { "description": "RowPriceGrossWithDiscount is the price incl. taxes with deducted discounts for the whole Qty of products\nThis is in most cases the final price for the customer to pay", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceGrossWithItemRelatedDiscount": { "description": "RowPriceGrossWithItemRelatedDiscount is the price incl. taxes with deducted item related discounts for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNet": { "description": "RowPriceNet is the price excl. taxes for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNetWithDiscount": { "description": "RowPriceNetWithDiscount is the discounted net price for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNetWithItemRelatedDiscount": { "description": "RowPriceNetWithItemRelatedDiscount is the price excl. taxes with deducted item related discounts for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowTaxes": { "description": "RowTaxes is a list of all taxes applied for the given Qty of products", - "type": "array", - "items": { - "$ref": "#/definitions/cart.Tax" - } + "type": "object", + "$ref": "#/definitions/cart.Taxes" }, "SinglePriceGross": { "description": "SinglePriceGross is the gross price (incl. taxes) for a single product", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SinglePriceNet": { "description": "SinglePriceNet is the net price (excl. taxes) for a single product", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SourceID": { @@ -1648,6 +1670,7 @@ var doc = `{ }, "TotalDiscountAmount": { "description": "TotalDiscountAmount is the sum of all applied discounts (aka the savings for the customer)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "VariantMarketPlaceCode": { @@ -1656,17 +1679,23 @@ var doc = `{ } } }, + "cart.PaymentSelection": { + "type": "object" + }, "cart.Person": { "type": "object", "properties": { "Address": { + "type": "object", "$ref": "#/definitions/cart.Address" }, "ExistingCustomerData": { "description": "ExistingCustomerData if the current purchaser is an existing customer - this contains infos about existing customer", + "type": "object", "$ref": "#/definitions/cart.ExistingCustomerData" }, "PersonalDetails": { + "type": "object", "$ref": "#/definitions/cart.PersonalDetails" } } @@ -1692,24 +1721,27 @@ var doc = `{ "type": "object", "properties": { "AppliedDiscounts": { - "type": "array", - "items": { - "$ref": "#/definitions/cart.AppliedDiscount" - } + "type": "object", + "$ref": "#/definitions/cart.AppliedDiscounts" }, "PriceGross": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceGrossWithDiscounts": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceNet": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceNetWithDiscounts": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "TaxAmount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Title": { @@ -1721,6 +1753,7 @@ var doc = `{ "type": "object", "properties": { "Amount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Rate": { @@ -1731,6 +1764,12 @@ var doc = `{ } } }, + "cart.Taxes": { + "type": "array", + "items": { + "$ref": "#/definitions/cart.Tax" + } + }, "cart.Teaser": { "type": "object", "properties": { @@ -1755,6 +1794,7 @@ var doc = `{ "type": "string" }, "Price": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Title": { @@ -1765,6 +1805,17 @@ var doc = `{ } } }, + "cartResultError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, "checkoutError": { "type": "object", "properties": { @@ -1780,9 +1831,13 @@ var doc = `{ "type": "object", "properties": { "Error": { - "$ref": "#/definitions/productResultError" + "type": "object", + "$ref": "#/definitions/controller.productResultError" + }, + "Product": { + "type": "object", + "$ref": "#/definitions/domain.BasicProduct" }, - "Product": {}, "Success": { "type": "boolean" } @@ -1792,18 +1847,23 @@ var doc = `{ "type": "object", "properties": { "CartTeaser": { + "type": "object", "$ref": "#/definitions/cart.Teaser" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" }, - "Data": {}, + "Data": { + "type": "object" + }, "DataValidationInfo": { "type": "object" }, "Error": { "description": "Contains details if success is false", - "$ref": "#/definitions/productResultError" + "type": "object", + "$ref": "#/definitions/cartResultError" }, "Success": { "type": "boolean" @@ -1814,9 +1874,11 @@ var doc = `{ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" } } @@ -1825,21 +1887,27 @@ var doc = `{ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" }, "FailedReason": { "type": "string" }, "OrderInfos": { + "type": "object", "$ref": "#/definitions/controller.placedOrderInfos" }, "State": { "type": "string" }, - "StateData": {}, + "StateData": { + "type": "object", + "$ref": "#/definitions/process.StateData" + }, "UUID": { "type": "string" } @@ -1858,6 +1926,7 @@ var doc = `{ } }, "PlacedDecoratedCart": { + "type": "object", "$ref": "#/definitions/decorator.DecoratedCart" }, "PlacedOrderInfos": { @@ -1868,6 +1937,17 @@ var doc = `{ } } }, + "controller.productResultError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, "controller.startPlaceOrderResult": { "type": "object", "properties": { @@ -1880,6 +1960,7 @@ var doc = `{ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "DecoratedDeliveries": { @@ -1894,9 +1975,13 @@ var doc = `{ "type": "object", "properties": { "Item": { + "type": "object", "$ref": "#/definitions/cart.Item" }, - "Product": {} + "Product": { + "type": "object", + "$ref": "#/definitions/domain.BasicProduct" + } } }, "decorator.DecoratedDelivery": { @@ -1909,10 +1994,20 @@ var doc = `{ } }, "Delivery": { + "type": "object", "$ref": "#/definitions/cart.Delivery" } } }, + "domain.Attribute": { + "type": "object" + }, + "domain.Attributes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/domain.Attribute" + } + }, "domain.Badge": { "type": "object", "properties": { @@ -1924,6 +2019,15 @@ var doc = `{ } } }, + "domain.Badges": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Badge" + } + }, + "domain.BasicProduct": { + "type": "object" + }, "domain.CategoryTeaser": { "type": "object", "properties": { @@ -1970,6 +2074,7 @@ var doc = `{ "type": "string" }, "WalletDetails": { + "type": "object", "$ref": "#/definitions/domain.WalletDetails" } } @@ -1982,13 +2087,16 @@ var doc = `{ "type": "string" }, "ActionData": { + "type": "object", "$ref": "#/definitions/domain.FlowActionData" }, "Data": { - "description": "Data contains additional information related to the action / flow" + "description": "Data contains additional information related to the action / flow", + "type": "object" }, "Error": { "description": "Error contains additional information in case of an error (e.g. payment failed)", + "type": "object", "$ref": "#/definitions/domain.Error" }, "Status": { @@ -2012,6 +2120,7 @@ var doc = `{ "type": "object", "properties": { "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Type": { @@ -2023,15 +2132,18 @@ var doc = `{ "type": "object", "properties": { "Context": { + "type": "object", "$ref": "#/definitions/domain.PriceContext" }, "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "DiscountText": { "type": "string" }, "Discounted": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "IsDiscounted": { @@ -2108,9 +2220,11 @@ var doc = `{ } }, "Context": { + "type": "object", "$ref": "#/definitions/domain.PriceContext" }, "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "DenyMoreDiscounts": { @@ -2120,6 +2234,7 @@ var doc = `{ "type": "string" }, "Discounted": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "IsDiscounted": { @@ -2134,10 +2249,12 @@ var doc = `{ "type": "object", "properties": { "ActivePrice": { + "type": "object", "$ref": "#/definitions/domain.PriceInfo" }, "Attributes": { - "$ref": "#/definitions/ProductAttributes" + "type": "object", + "$ref": "#/definitions/domain.Attributes" }, "AvailablePrices": { "type": "array", @@ -2146,10 +2263,8 @@ var doc = `{ } }, "Badges": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Badge" - } + "type": "object", + "$ref": "#/definitions/domain.Badges" }, "Categories": { "type": "array", @@ -2199,6 +2314,7 @@ var doc = `{ } }, "MainCategory": { + "type": "object", "$ref": "#/definitions/domain.CategoryTeaser" }, "MarketPlaceCode": { @@ -2232,6 +2348,7 @@ var doc = `{ "type": "string" }, "Teaser": { + "type": "object", "$ref": "#/definitions/domain.TeaserData" }, "Title": { @@ -2253,10 +2370,8 @@ var doc = `{ "properties": { "Badges": { "description": "Badges optional slice of badges to teaser a product", - "type": "array", - "items": { - "$ref": "#/definitions/domain.Badge" - } + "type": "object", + "$ref": "#/definitions/domain.Badges" }, "MarketPlaceCode": { "description": "The sku that should be used to link from Teasers", @@ -2287,14 +2402,17 @@ var doc = `{ }, "TeaserLoyaltyEarningInfo": { "description": "TeaserLoyaltyEarning is the teaser for the loyalty earning used in grid / list view", + "type": "object", "$ref": "#/definitions/domain.LoyaltyEarningInfo" }, "TeaserLoyaltyPriceInfo": { "description": "TeaserLoyaltyPriceInfo is the loyalty price that can be used for teaser (e.g. on listing views)", + "type": "object", "$ref": "#/definitions/domain.LoyaltyPriceInfo" }, "TeaserPrice": { "description": "TeaserPrice is the price that should be shown in teasers (listview)", + "type": "object", "$ref": "#/definitions/domain.PriceInfo" }, "TeaserPriceIsFromPrice": { @@ -2310,6 +2428,7 @@ var doc = `{ "type": "object", "properties": { "PaymentRequestAPI": { + "type": "object", "$ref": "#/definitions/domain.PaymentRequestAPI" }, "UsedPaymentMethod": { @@ -2345,16 +2464,8 @@ var doc = `{ } } }, - "productResultError": { - "type": "object", - "properties": { - "Code": { - "type": "string" - }, - "Message": { - "type": "string" - } - } + "process.StateData": { + "type": "object" }, "validation.ItemValidationError": { "type": "object", @@ -2435,13 +2546,6 @@ func (s *s) ReadDoc() string { a, _ := json.Marshal(v) return string(a) }, - "escape": func(v interface{}) string { - // escape tabs - str := strings.Replace(v.(string), "\t", "\\t", -1) - // replace " with \", and if that results in \\", replace that with \\\" - str = strings.Replace(str, "\"", "\\\"", -1) - return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) - }, }).Parse(doc) if err != nil { return doc diff --git a/docs/openapi/swagger.json b/docs/openapi/swagger.json index c7ae9d3d2..fea813d71 100644 --- a/docs/openapi/swagger.json +++ b/docs/openapi/swagger.json @@ -1014,7 +1014,7 @@ "500": { "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/productResultError" + "$ref": "#/definitions/cartResultError" } } } @@ -1074,36 +1074,6 @@ } }, "definitions": { - "ProductAttribute": { - "type": "object", - "properties": { - "Code": { - "description": "Code is the internal attribute identifier", - "type": "string" - }, - "CodeLabel": { - "description": "CodeLabel is the human-readable (perhaps localized) attribute name", - "type": "string" - }, - "Label": { - "description": "Label is the human-readable (perhaps localized) attribute value", - "type": "string" - }, - "RawValue": { - "description": "RawValue is the untouched original value of the attribute" - }, - "UnitCode": { - "description": "UnitCode is the internal code of the attribute values measuring unit", - "type": "string" - } - } - }, - "ProductAttributes": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ProductAttribute" - } - }, "ProductMedia": { "type": "object", "properties": { @@ -1128,9 +1098,11 @@ "type": "object", "properties": { "Amount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "CreditCardInfo": { + "type": "object", "$ref": "#/definitions/placeorder.CreditCardInfo" }, "Gateway": { @@ -1230,6 +1202,7 @@ "properties": { "Applied": { "description": "how much of the discount has been subtracted from cart price, IMPORTANT: always negative", + "type": "object", "$ref": "#/definitions/domain.Price" }, "CampaignCode": { @@ -1258,11 +1231,18 @@ } } }, + "cart.AppliedDiscounts": { + "type": "array", + "items": { + "$ref": "#/definitions/cart.AppliedDiscount" + } + }, "cart.AppliedGiftCard": { "type": "object", "properties": { "Applied": { "description": "how much of the gift card has been subtracted from cart price", + "type": "object", "$ref": "#/definitions/domain.Price" }, "Code": { @@ -1275,6 +1255,7 @@ }, "Remaining": { "description": "how much of the gift card is still available", + "type": "object", "$ref": "#/definitions/domain.Price" } } @@ -1284,6 +1265,7 @@ "properties": { "AdditionalData": { "description": "AdditionalData can be used for Custom attributes", + "type": "object", "$ref": "#/definitions/cart.AdditionalData" }, "AppliedCouponCodes": { @@ -1310,6 +1292,7 @@ }, "BillingAddress": { "description": "BillingAddress is the main billing address (relevant for all payments/invoices)", + "type": "object", "$ref": "#/definitions/cart.Address" }, "DefaultCurrency": { @@ -1328,18 +1311,22 @@ }, "GrandTotal": { "description": "GrandTotal is the final amount that need to be paid by the customer (gross)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalNet": { "description": "GrandTotalNet is the corresponding net value to GrandTotal", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalNetWithGiftCards": { "description": "GrandTotalNetWithGiftCards is the corresponding net value to GrandTotalWithGiftCards", + "type": "object", "$ref": "#/definitions/domain.Price" }, "GrandTotalWithGiftCards": { "description": "GrandTotalWithGiftCards is the final amount with the applied gift cards subtracted.", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ID": { @@ -1348,57 +1335,72 @@ }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount is the sum of discounts that are related to the item (including shipping discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount is the sum of discounts that are not related to the item (including shipping discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "PaymentSelection": { - "description": "PaymentSelection is used to store information on \"how\" the customer wants to pay" + "description": "PaymentSelection is used to store information on \"how\" the customer wants to pay", + "type": "object", + "$ref": "#/definitions/cart.PaymentSelection" }, "Purchaser": { "description": "Purchaser hold additional infos for the legal contact person in this order", + "type": "object", "$ref": "#/definitions/cart.Person" }, "ShippingGross": { "description": "ShippingGross is the sum of all shipping costs including tax", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingGrossWithDiscounts": { "description": "ShippingGrossWithDiscounts is the sum of all shipping costs with all shipping discounts including tax", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingNet": { "description": "ShippingNet is the sum of all shipping costs", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingNetWithDiscounts": { "description": "ShippingNetWithDiscounts is the sum of all shipping costs with all shipping discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGross": { "description": "SubTotalGross is the sum of all delivery subtotals (without shipping/ discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGrossWithDiscounts": { "description": "SubTotalGrossWithDiscounts is the sum of row gross prices reduced by the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNet": { "description": "SubTotalNet is the sum of all delivery net subtotals (without shipping/ discounts)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNetWithDiscounts": { "description": "SubTotalNetWithDiscounts is the sum of row net prices reduced by the net value of the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalDiscountAmount": { "description": "TotalDiscountAmount is the sum of all discounts (incl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalGiftCardAmount": { "description": "AppliedGiftCardsAmount is the part of GrandTotal which is paid by gift cards", + "type": "object", "$ref": "#/definitions/domain.Price" }, "Totalitems": { @@ -1435,46 +1437,57 @@ }, "DeliveryInfo": { "description": "DeliveryInfo contains details for this delivery e.g. how and where the delivery should be delivered to", + "type": "object", "$ref": "#/definitions/cart.DeliveryInfo" }, "GrandTotal": { "description": "GrandTotal contains the final price to pay", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount contains the sum of discounts that are related to the item, e.g. promo due to product attribute", + "type": "object", "$ref": "#/definitions/domain.Price" }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount contains the sum of discounts that are not related to the item, e.g. a general promo", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ShippingItem": { "description": "ShippingItem\trepresent the shipping cost that may be involved in this delivery", + "type": "object", "$ref": "#/definitions/cart.ShippingItem" }, "SubTotalDiscountAmount": { "description": "TotalDiscountAmount contains the sum of all discounts (excl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGross": { "description": "SubTotalGross contains the sum of row gross prices, without shipping/discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalGrossWithDiscounts": { "description": "SubTotalGrossWithDiscounts contains the sum of row gross prices reduced by the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNet": { "description": "SubTotalNet contains the sum of row net prices, without shipping/discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SubTotalNetWithDiscounts": { "description": "SubTotalNetWithDiscounts contains the sum of row net prices reduced by the net value of the applied discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "TotalDiscountAmount": { "description": "TotalDiscountAmount contains the sum of all discounts (incl. shipping)", + "type": "object", "$ref": "#/definitions/domain.Price" } } @@ -1499,6 +1512,7 @@ }, "DeliveryLocation": { "description": "DeliveryLocation is the target location for the delivery", + "type": "object", "$ref": "#/definitions/cart.DeliveryLocation" }, "DesiredTime": { @@ -1520,6 +1534,7 @@ "properties": { "Address": { "description": "Address contains the address of the delivery location, maybe not relevant if the type is not address", + "type": "object", "$ref": "#/definitions/cart.Address" }, "Code": { @@ -1556,10 +1571,8 @@ }, "AppliedDiscounts": { "description": "AppliedDiscounts contains the details about the discounts applied to this item - they can be \"itemrelated\" or not\nitemrelated would be e.g. special price, buy 3 pay 2\nnon-itemrelated would be e.g. 10% on everything", - "type": "array", - "items": { - "$ref": "#/definitions/cart.AppliedDiscount" - } + "type": "object", + "$ref": "#/definitions/cart.AppliedDiscounts" }, "ExternalReference": { "description": "ExternalReference can be used by cart service implementations to separate the representation in an external\ncart service from the unique item ID", @@ -1571,6 +1584,7 @@ }, "ItemRelatedDiscountAmount": { "description": "ItemRelatedDiscountAmount is the sum of all itemrelated Discounts", + "type": "object", "$ref": "#/definitions/domain.Price" }, "MarketplaceCode": { @@ -1579,6 +1593,7 @@ }, "NonItemRelatedDiscountAmount": { "description": "NonItemRelatedDiscountAmount is the sum of non-itemrelated Discounts where IsItemRelated = false", + "type": "object", "$ref": "#/definitions/domain.Price" }, "ProductName": { @@ -1589,41 +1604,47 @@ }, "RowPriceGross": { "description": "RowPriceGross is the price incl. taxes for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceGrossWithDiscount": { "description": "RowPriceGrossWithDiscount is the price incl. taxes with deducted discounts for the whole Qty of products\nThis is in most cases the final price for the customer to pay", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceGrossWithItemRelatedDiscount": { "description": "RowPriceGrossWithItemRelatedDiscount is the price incl. taxes with deducted item related discounts for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNet": { "description": "RowPriceNet is the price excl. taxes for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNetWithDiscount": { "description": "RowPriceNetWithDiscount is the discounted net price for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowPriceNetWithItemRelatedDiscount": { "description": "RowPriceNetWithItemRelatedDiscount is the price excl. taxes with deducted item related discounts for the whole Qty of products", + "type": "object", "$ref": "#/definitions/domain.Price" }, "RowTaxes": { "description": "RowTaxes is a list of all taxes applied for the given Qty of products", - "type": "array", - "items": { - "$ref": "#/definitions/cart.Tax" - } + "type": "object", + "$ref": "#/definitions/cart.Taxes" }, "SinglePriceGross": { "description": "SinglePriceGross is the gross price (incl. taxes) for a single product", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SinglePriceNet": { "description": "SinglePriceNet is the net price (excl. taxes) for a single product", + "type": "object", "$ref": "#/definitions/domain.Price" }, "SourceID": { @@ -1632,6 +1653,7 @@ }, "TotalDiscountAmount": { "description": "TotalDiscountAmount is the sum of all applied discounts (aka the savings for the customer)", + "type": "object", "$ref": "#/definitions/domain.Price" }, "VariantMarketPlaceCode": { @@ -1640,17 +1662,23 @@ } } }, + "cart.PaymentSelection": { + "type": "object" + }, "cart.Person": { "type": "object", "properties": { "Address": { + "type": "object", "$ref": "#/definitions/cart.Address" }, "ExistingCustomerData": { "description": "ExistingCustomerData if the current purchaser is an existing customer - this contains infos about existing customer", + "type": "object", "$ref": "#/definitions/cart.ExistingCustomerData" }, "PersonalDetails": { + "type": "object", "$ref": "#/definitions/cart.PersonalDetails" } } @@ -1676,24 +1704,27 @@ "type": "object", "properties": { "AppliedDiscounts": { - "type": "array", - "items": { - "$ref": "#/definitions/cart.AppliedDiscount" - } + "type": "object", + "$ref": "#/definitions/cart.AppliedDiscounts" }, "PriceGross": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceGrossWithDiscounts": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceNet": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "PriceNetWithDiscounts": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "TaxAmount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Title": { @@ -1705,6 +1736,7 @@ "type": "object", "properties": { "Amount": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Rate": { @@ -1715,6 +1747,12 @@ } } }, + "cart.Taxes": { + "type": "array", + "items": { + "$ref": "#/definitions/cart.Tax" + } + }, "cart.Teaser": { "type": "object", "properties": { @@ -1739,6 +1777,7 @@ "type": "string" }, "Price": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Title": { @@ -1749,6 +1788,17 @@ } } }, + "cartResultError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, "checkoutError": { "type": "object", "properties": { @@ -1764,9 +1814,13 @@ "type": "object", "properties": { "Error": { - "$ref": "#/definitions/productResultError" + "type": "object", + "$ref": "#/definitions/controller.productResultError" + }, + "Product": { + "type": "object", + "$ref": "#/definitions/domain.BasicProduct" }, - "Product": {}, "Success": { "type": "boolean" } @@ -1776,18 +1830,23 @@ "type": "object", "properties": { "CartTeaser": { + "type": "object", "$ref": "#/definitions/cart.Teaser" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" }, - "Data": {}, + "Data": { + "type": "object" + }, "DataValidationInfo": { "type": "object" }, "Error": { "description": "Contains details if success is false", - "$ref": "#/definitions/productResultError" + "type": "object", + "$ref": "#/definitions/cartResultError" }, "Success": { "type": "boolean" @@ -1798,9 +1857,11 @@ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" } } @@ -1809,21 +1870,27 @@ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "CartValidationResult": { + "type": "object", "$ref": "#/definitions/validation.Result" }, "FailedReason": { "type": "string" }, "OrderInfos": { + "type": "object", "$ref": "#/definitions/controller.placedOrderInfos" }, "State": { "type": "string" }, - "StateData": {}, + "StateData": { + "type": "object", + "$ref": "#/definitions/process.StateData" + }, "UUID": { "type": "string" } @@ -1842,6 +1909,7 @@ } }, "PlacedDecoratedCart": { + "type": "object", "$ref": "#/definitions/decorator.DecoratedCart" }, "PlacedOrderInfos": { @@ -1852,6 +1920,17 @@ } } }, + "controller.productResultError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, "controller.startPlaceOrderResult": { "type": "object", "properties": { @@ -1864,6 +1943,7 @@ "type": "object", "properties": { "Cart": { + "type": "object", "$ref": "#/definitions/cart.Cart" }, "DecoratedDeliveries": { @@ -1878,9 +1958,13 @@ "type": "object", "properties": { "Item": { + "type": "object", "$ref": "#/definitions/cart.Item" }, - "Product": {} + "Product": { + "type": "object", + "$ref": "#/definitions/domain.BasicProduct" + } } }, "decorator.DecoratedDelivery": { @@ -1893,10 +1977,20 @@ } }, "Delivery": { + "type": "object", "$ref": "#/definitions/cart.Delivery" } } }, + "domain.Attribute": { + "type": "object" + }, + "domain.Attributes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/domain.Attribute" + } + }, "domain.Badge": { "type": "object", "properties": { @@ -1908,6 +2002,15 @@ } } }, + "domain.Badges": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Badge" + } + }, + "domain.BasicProduct": { + "type": "object" + }, "domain.CategoryTeaser": { "type": "object", "properties": { @@ -1954,6 +2057,7 @@ "type": "string" }, "WalletDetails": { + "type": "object", "$ref": "#/definitions/domain.WalletDetails" } } @@ -1966,13 +2070,16 @@ "type": "string" }, "ActionData": { + "type": "object", "$ref": "#/definitions/domain.FlowActionData" }, "Data": { - "description": "Data contains additional information related to the action / flow" + "description": "Data contains additional information related to the action / flow", + "type": "object" }, "Error": { "description": "Error contains additional information in case of an error (e.g. payment failed)", + "type": "object", "$ref": "#/definitions/domain.Error" }, "Status": { @@ -1996,6 +2103,7 @@ "type": "object", "properties": { "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "Type": { @@ -2007,15 +2115,18 @@ "type": "object", "properties": { "Context": { + "type": "object", "$ref": "#/definitions/domain.PriceContext" }, "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "DiscountText": { "type": "string" }, "Discounted": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "IsDiscounted": { @@ -2092,9 +2203,11 @@ } }, "Context": { + "type": "object", "$ref": "#/definitions/domain.PriceContext" }, "Default": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "DenyMoreDiscounts": { @@ -2104,6 +2217,7 @@ "type": "string" }, "Discounted": { + "type": "object", "$ref": "#/definitions/domain.Price" }, "IsDiscounted": { @@ -2118,10 +2232,12 @@ "type": "object", "properties": { "ActivePrice": { + "type": "object", "$ref": "#/definitions/domain.PriceInfo" }, "Attributes": { - "$ref": "#/definitions/ProductAttributes" + "type": "object", + "$ref": "#/definitions/domain.Attributes" }, "AvailablePrices": { "type": "array", @@ -2130,10 +2246,8 @@ } }, "Badges": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Badge" - } + "type": "object", + "$ref": "#/definitions/domain.Badges" }, "Categories": { "type": "array", @@ -2183,6 +2297,7 @@ } }, "MainCategory": { + "type": "object", "$ref": "#/definitions/domain.CategoryTeaser" }, "MarketPlaceCode": { @@ -2216,6 +2331,7 @@ "type": "string" }, "Teaser": { + "type": "object", "$ref": "#/definitions/domain.TeaserData" }, "Title": { @@ -2237,10 +2353,8 @@ "properties": { "Badges": { "description": "Badges optional slice of badges to teaser a product", - "type": "array", - "items": { - "$ref": "#/definitions/domain.Badge" - } + "type": "object", + "$ref": "#/definitions/domain.Badges" }, "MarketPlaceCode": { "description": "The sku that should be used to link from Teasers", @@ -2271,14 +2385,17 @@ }, "TeaserLoyaltyEarningInfo": { "description": "TeaserLoyaltyEarning is the teaser for the loyalty earning used in grid / list view", + "type": "object", "$ref": "#/definitions/domain.LoyaltyEarningInfo" }, "TeaserLoyaltyPriceInfo": { "description": "TeaserLoyaltyPriceInfo is the loyalty price that can be used for teaser (e.g. on listing views)", + "type": "object", "$ref": "#/definitions/domain.LoyaltyPriceInfo" }, "TeaserPrice": { "description": "TeaserPrice is the price that should be shown in teasers (listview)", + "type": "object", "$ref": "#/definitions/domain.PriceInfo" }, "TeaserPriceIsFromPrice": { @@ -2294,6 +2411,7 @@ "type": "object", "properties": { "PaymentRequestAPI": { + "type": "object", "$ref": "#/definitions/domain.PaymentRequestAPI" }, "UsedPaymentMethod": { @@ -2329,16 +2447,8 @@ } } }, - "productResultError": { - "type": "object", - "properties": { - "Code": { - "type": "string" - }, - "Message": { - "type": "string" - } - } + "process.StateData": { + "type": "object" }, "validation.ItemValidationError": { "type": "object", diff --git a/docs/openapi/swagger.yaml b/docs/openapi/swagger.yaml index 0a6fca6fa..82d557678 100644 --- a/docs/openapi/swagger.yaml +++ b/docs/openapi/swagger.yaml @@ -1,27 +1,4 @@ definitions: - ProductAttribute: - properties: - Code: - description: Code is the internal attribute identifier - type: string - CodeLabel: - description: CodeLabel is the human-readable (perhaps localized) attribute - name - type: string - Label: - description: Label is the human-readable (perhaps localized) attribute value - type: string - RawValue: - description: RawValue is the untouched original value of the attribute - UnitCode: - description: UnitCode is the internal code of the attribute values measuring - unit - type: string - type: object - ProductAttributes: - additionalProperties: - $ref: '#/definitions/ProductAttribute' - type: object ProductMedia: properties: MimeType: @@ -39,8 +16,10 @@ definitions: properties: Amount: $ref: '#/definitions/domain.Price' + type: object CreditCardInfo: $ref: '#/definitions/placeorder.CreditCardInfo' + type: object Gateway: type: string Method: @@ -109,6 +88,7 @@ definitions: $ref: '#/definitions/domain.Price' description: 'how much of the discount has been subtracted from cart price, IMPORTANT: always negative' + type: object CampaignCode: description: unique code of the underlying campaign or rule e.g. "summer-campaign-2018" type: string @@ -129,11 +109,16 @@ definitions: description: to distinguish between discounts type: string type: object + cart.AppliedDiscounts: + items: + $ref: '#/definitions/cart.AppliedDiscount' + type: array cart.AppliedGiftCard: properties: Applied: $ref: '#/definitions/domain.Price' description: how much of the gift card has been subtracted from cart price + type: object Code: type: string CustomAttributes: @@ -143,12 +128,14 @@ definitions: Remaining: $ref: '#/definitions/domain.Price' description: how much of the gift card is still available + type: object type: object cart.Cart: properties: AdditionalData: $ref: '#/definitions/cart.AdditionalData' description: AdditionalData can be used for Custom attributes + type: object AppliedCouponCodes: description: AppliedCouponCodes hold the coupons or discount codes that are applied to the cart @@ -171,6 +158,7 @@ definitions: $ref: '#/definitions/cart.Address' description: BillingAddress is the main billing address (relevant for all payments/invoices) + type: object DefaultCurrency: type: string Deliveries: @@ -186,17 +174,21 @@ definitions: $ref: '#/definitions/domain.Price' description: GrandTotal is the final amount that need to be paid by the customer (gross) + type: object GrandTotalNet: $ref: '#/definitions/domain.Price' description: GrandTotalNet is the corresponding net value to GrandTotal + type: object GrandTotalNetWithGiftCards: $ref: '#/definitions/domain.Price' description: GrandTotalNetWithGiftCards is the corresponding net value to GrandTotalWithGiftCards + type: object GrandTotalWithGiftCards: $ref: '#/definitions/domain.Price' description: GrandTotalWithGiftCards is the final amount with the applied gift cards subtracted. + type: object ID: description: ID is the main identifier of the cart type: string @@ -204,54 +196,69 @@ definitions: $ref: '#/definitions/domain.Price' description: ItemRelatedDiscountAmount is the sum of discounts that are related to the item (including shipping discounts) + type: object NonItemRelatedDiscountAmount: $ref: '#/definitions/domain.Price' description: NonItemRelatedDiscountAmount is the sum of discounts that are not related to the item (including shipping discounts) + type: object PaymentSelection: + $ref: '#/definitions/cart.PaymentSelection' description: PaymentSelection is used to store information on "how" the customer wants to pay + type: object Purchaser: $ref: '#/definitions/cart.Person' description: Purchaser hold additional infos for the legal contact person in this order + type: object ShippingGross: $ref: '#/definitions/domain.Price' description: ShippingGross is the sum of all shipping costs including tax + type: object ShippingGrossWithDiscounts: $ref: '#/definitions/domain.Price' description: ShippingGrossWithDiscounts is the sum of all shipping costs with all shipping discounts including tax + type: object ShippingNet: $ref: '#/definitions/domain.Price' description: ShippingNet is the sum of all shipping costs + type: object ShippingNetWithDiscounts: $ref: '#/definitions/domain.Price' description: ShippingNetWithDiscounts is the sum of all shipping costs with all shipping discounts + type: object SubTotalGross: $ref: '#/definitions/domain.Price' description: SubTotalGross is the sum of all delivery subtotals (without shipping/ discounts) + type: object SubTotalGrossWithDiscounts: $ref: '#/definitions/domain.Price' description: SubTotalGrossWithDiscounts is the sum of row gross prices reduced by the applied discounts + type: object SubTotalNet: $ref: '#/definitions/domain.Price' description: SubTotalNet is the sum of all delivery net subtotals (without shipping/ discounts) + type: object SubTotalNetWithDiscounts: $ref: '#/definitions/domain.Price' description: SubTotalNetWithDiscounts is the sum of row net prices reduced by the net value of the applied discounts + type: object TotalDiscountAmount: $ref: '#/definitions/domain.Price' description: TotalDiscountAmount is the sum of all discounts (incl. shipping) + type: object TotalGiftCardAmount: $ref: '#/definitions/domain.Price' description: AppliedGiftCardsAmount is the part of GrandTotal which is paid by gift cards + type: object Totalitems: description: Additional non taxable totals items: @@ -279,43 +286,54 @@ definitions: $ref: '#/definitions/cart.DeliveryInfo' description: DeliveryInfo contains details for this delivery e.g. how and where the delivery should be delivered to + type: object GrandTotal: $ref: '#/definitions/domain.Price' description: GrandTotal contains the final price to pay + type: object ItemRelatedDiscountAmount: $ref: '#/definitions/domain.Price' description: ItemRelatedDiscountAmount contains the sum of discounts that are related to the item, e.g. promo due to product attribute + type: object NonItemRelatedDiscountAmount: $ref: '#/definitions/domain.Price' description: NonItemRelatedDiscountAmount contains the sum of discounts that are not related to the item, e.g. a general promo + type: object ShippingItem: $ref: '#/definitions/cart.ShippingItem' description: "ShippingItem\trepresent the shipping cost that may be involved in this delivery" + type: object SubTotalDiscountAmount: $ref: '#/definitions/domain.Price' description: TotalDiscountAmount contains the sum of all discounts (excl. shipping) + type: object SubTotalGross: $ref: '#/definitions/domain.Price' description: SubTotalGross contains the sum of row gross prices, without shipping/discounts + type: object SubTotalGrossWithDiscounts: $ref: '#/definitions/domain.Price' description: SubTotalGrossWithDiscounts contains the sum of row gross prices reduced by the applied discounts + type: object SubTotalNet: $ref: '#/definitions/domain.Price' description: SubTotalNet contains the sum of row net prices, without shipping/discounts + type: object SubTotalNetWithDiscounts: $ref: '#/definitions/domain.Price' description: SubTotalNetWithDiscounts contains the sum of row net prices reduced by the net value of the applied discounts + type: object TotalDiscountAmount: $ref: '#/definitions/domain.Price' description: TotalDiscountAmount contains the sum of all discounts (incl. shipping) + type: object type: object cart.DeliveryInfo: properties: @@ -337,6 +355,7 @@ definitions: DeliveryLocation: $ref: '#/definitions/cart.DeliveryLocation' description: DeliveryLocation is the target location for the delivery + type: object DesiredTime: description: DesiredTime is an optional desired time for the delivery type: string @@ -355,6 +374,7 @@ definitions: $ref: '#/definitions/cart.Address' description: Address contains the address of the delivery location, maybe not relevant if the type is not address + type: object Code: description: Code is an optional identifier of this location/destination type: string @@ -380,13 +400,12 @@ definitions: type: string type: object AppliedDiscounts: + $ref: '#/definitions/cart.AppliedDiscounts' description: |- AppliedDiscounts contains the details about the discounts applied to this item - they can be "itemrelated" or not itemrelated would be e.g. special price, buy 3 pay 2 non-itemrelated would be e.g. 10% on everything - items: - $ref: '#/definitions/cart.AppliedDiscount' - type: array + type: object ExternalReference: description: |- ExternalReference can be used by cart service implementations to separate the representation in an external @@ -398,6 +417,7 @@ definitions: ItemRelatedDiscountAmount: $ref: '#/definitions/domain.Price' description: ItemRelatedDiscountAmount is the sum of all itemrelated Discounts + type: object MarketplaceCode: description: MarketplaceCode is the identifier for the product type: string @@ -405,6 +425,7 @@ definitions: $ref: '#/definitions/domain.Price' description: NonItemRelatedDiscountAmount is the sum of non-itemrelated Discounts where IsItemRelated = false + type: object ProductName: type: string Qty: @@ -412,39 +433,46 @@ definitions: RowPriceGross: $ref: '#/definitions/domain.Price' description: RowPriceGross is the price incl. taxes for the whole Qty of products + type: object RowPriceGrossWithDiscount: $ref: '#/definitions/domain.Price' description: |- RowPriceGrossWithDiscount is the price incl. taxes with deducted discounts for the whole Qty of products This is in most cases the final price for the customer to pay + type: object RowPriceGrossWithItemRelatedDiscount: $ref: '#/definitions/domain.Price' description: RowPriceGrossWithItemRelatedDiscount is the price incl. taxes with deducted item related discounts for the whole Qty of products + type: object RowPriceNet: $ref: '#/definitions/domain.Price' description: RowPriceNet is the price excl. taxes for the whole Qty of products + type: object RowPriceNetWithDiscount: $ref: '#/definitions/domain.Price' description: RowPriceNetWithDiscount is the discounted net price for the whole Qty of products + type: object RowPriceNetWithItemRelatedDiscount: $ref: '#/definitions/domain.Price' description: RowPriceNetWithItemRelatedDiscount is the price excl. taxes with deducted item related discounts for the whole Qty of products + type: object RowTaxes: + $ref: '#/definitions/cart.Taxes' description: RowTaxes is a list of all taxes applied for the given Qty of products - items: - $ref: '#/definitions/cart.Tax' - type: array + type: object SinglePriceGross: $ref: '#/definitions/domain.Price' description: SinglePriceGross is the gross price (incl. taxes) for a single product + type: object SinglePriceNet: $ref: '#/definitions/domain.Price' description: SinglePriceNet is the net price (excl. taxes) for a single product + type: object SourceID: description: Source Id of where the items should be initial picked - This is set by the SourcingLogic @@ -453,20 +481,26 @@ definitions: $ref: '#/definitions/domain.Price' description: TotalDiscountAmount is the sum of all applied discounts (aka the savings for the customer) + type: object VariantMarketPlaceCode: description: VariantMarketPlaceCode is used for Configurable products type: string type: object + cart.PaymentSelection: + type: object cart.Person: properties: Address: $ref: '#/definitions/cart.Address' + type: object ExistingCustomerData: $ref: '#/definitions/cart.ExistingCustomerData' description: ExistingCustomerData if the current purchaser is an existing customer - this contains infos about existing customer + type: object PersonalDetails: $ref: '#/definitions/cart.PersonalDetails' + type: object type: object cart.PersonalDetails: properties: @@ -482,19 +516,23 @@ definitions: cart.ShippingItem: properties: AppliedDiscounts: - items: - $ref: '#/definitions/cart.AppliedDiscount' - type: array + $ref: '#/definitions/cart.AppliedDiscounts' + type: object PriceGross: $ref: '#/definitions/domain.Price' + type: object PriceGrossWithDiscounts: $ref: '#/definitions/domain.Price' + type: object PriceNet: $ref: '#/definitions/domain.Price' + type: object PriceNetWithDiscounts: $ref: '#/definitions/domain.Price' + type: object TaxAmount: $ref: '#/definitions/domain.Price' + type: object Title: type: string type: object @@ -502,11 +540,16 @@ definitions: properties: Amount: $ref: '#/definitions/domain.Price' + type: object Rate: type: string Type: type: string type: object + cart.Taxes: + items: + $ref: '#/definitions/cart.Tax' + type: array cart.Teaser: properties: DeliveryCodes: @@ -524,11 +567,19 @@ definitions: type: string Price: $ref: '#/definitions/domain.Price' + type: object Title: type: string Type: type: string type: object + cartResultError: + properties: + Code: + type: string + Message: + type: string + type: object checkoutError: properties: Code: @@ -539,8 +590,11 @@ definitions: controller.APIResult: properties: Error: - $ref: '#/definitions/productResultError' - Product: {} + $ref: '#/definitions/controller.productResultError' + type: object + Product: + $ref: '#/definitions/domain.BasicProduct' + type: object Success: type: boolean type: object @@ -548,14 +602,18 @@ definitions: properties: CartTeaser: $ref: '#/definitions/cart.Teaser' + type: object CartValidationResult: $ref: '#/definitions/validation.Result' - Data: {} + type: object + Data: + type: object DataValidationInfo: type: object Error: - $ref: '#/definitions/productResultError' + $ref: '#/definitions/cartResultError' description: Contains details if success is false + type: object Success: type: boolean type: object @@ -563,22 +621,29 @@ definitions: properties: Cart: $ref: '#/definitions/cart.Cart' + type: object CartValidationResult: $ref: '#/definitions/validation.Result' + type: object type: object controller.placeOrderContext: properties: Cart: $ref: '#/definitions/cart.Cart' + type: object CartValidationResult: $ref: '#/definitions/validation.Result' + type: object FailedReason: type: string OrderInfos: $ref: '#/definitions/controller.placedOrderInfos' + type: object State: type: string - StateData: {} + StateData: + $ref: '#/definitions/process.StateData' + type: object UUID: type: string type: object @@ -592,11 +657,19 @@ definitions: type: array PlacedDecoratedCart: $ref: '#/definitions/decorator.DecoratedCart' + type: object PlacedOrderInfos: items: $ref: '#/definitions/placeorder.PlacedOrderInfo' type: array type: object + controller.productResultError: + properties: + Code: + type: string + Message: + type: string + type: object controller.startPlaceOrderResult: properties: UUID: @@ -606,6 +679,7 @@ definitions: properties: Cart: $ref: '#/definitions/cart.Cart' + type: object DecoratedDeliveries: items: $ref: '#/definitions/decorator.DecoratedDelivery' @@ -615,7 +689,10 @@ definitions: properties: Item: $ref: '#/definitions/cart.Item' - Product: {} + type: object + Product: + $ref: '#/definitions/domain.BasicProduct' + type: object type: object decorator.DecoratedDelivery: properties: @@ -625,6 +702,13 @@ definitions: type: array Delivery: $ref: '#/definitions/cart.Delivery' + type: object + type: object + domain.Attribute: + type: object + domain.Attributes: + additionalProperties: + $ref: '#/definitions/domain.Attribute' type: object domain.Badge: properties: @@ -633,6 +717,12 @@ definitions: Label: type: string type: object + domain.Badges: + items: + $ref: '#/definitions/domain.Badge' + type: array + domain.BasicProduct: + type: object domain.CategoryTeaser: properties: Code: @@ -668,6 +758,7 @@ definitions: type: string WalletDetails: $ref: '#/definitions/domain.WalletDetails' + type: object type: object domain.FlowStatus: properties: @@ -678,13 +769,16 @@ definitions: type: string ActionData: $ref: '#/definitions/domain.FlowActionData' + type: object Data: description: Data contains additional information related to the action / flow + type: object Error: $ref: '#/definitions/domain.Error' description: Error contains additional information in case of an error (e.g. payment failed) + type: object Status: description: Status of the payment flow. E.g. "payment_completed", "payment_waiting_for_customer" or "payment_failed" @@ -701,6 +795,7 @@ definitions: properties: Default: $ref: '#/definitions/domain.Price' + type: object Type: type: string type: object @@ -708,12 +803,15 @@ definitions: properties: Context: $ref: '#/definitions/domain.PriceContext' + type: object Default: $ref: '#/definitions/domain.Price' + type: object DiscountText: type: string Discounted: $ref: '#/definitions/domain.Price' + type: object IsDiscounted: type: boolean MaxPointsToSpent: @@ -764,14 +862,17 @@ definitions: type: array Context: $ref: '#/definitions/domain.PriceContext' + type: object Default: $ref: '#/definitions/domain.Price' + type: object DenyMoreDiscounts: type: boolean DiscountText: type: string Discounted: $ref: '#/definitions/domain.Price' + type: object IsDiscounted: type: boolean TaxClass: @@ -781,16 +882,17 @@ definitions: properties: ActivePrice: $ref: '#/definitions/domain.PriceInfo' + type: object Attributes: - $ref: '#/definitions/ProductAttributes' + $ref: '#/definitions/domain.Attributes' + type: object AvailablePrices: items: $ref: '#/definitions/domain.PriceInfo' type: array Badges: - items: - $ref: '#/definitions/domain.Badge' - type: array + $ref: '#/definitions/domain.Badges' + type: object Categories: items: $ref: '#/definitions/domain.CategoryTeaser' @@ -827,6 +929,7 @@ definitions: type: array MainCategory: $ref: '#/definitions/domain.CategoryTeaser' + type: object MarketPlaceCode: type: string Media: @@ -849,6 +952,7 @@ definitions: type: string Teaser: $ref: '#/definitions/domain.TeaserData' + type: object Title: type: string UpdatedAt: @@ -861,10 +965,9 @@ definitions: domain.TeaserData: properties: Badges: + $ref: '#/definitions/domain.Badges' description: Badges optional slice of badges to teaser a product - items: - $ref: '#/definitions/domain.Badge' - type: array + type: object MarketPlaceCode: description: The sku that should be used to link from Teasers type: string @@ -891,13 +994,16 @@ definitions: $ref: '#/definitions/domain.LoyaltyEarningInfo' description: TeaserLoyaltyEarning is the teaser for the loyalty earning used in grid / list view + type: object TeaserLoyaltyPriceInfo: $ref: '#/definitions/domain.LoyaltyPriceInfo' description: TeaserLoyaltyPriceInfo is the loyalty price that can be used for teaser (e.g. on listing views) + type: object TeaserPrice: $ref: '#/definitions/domain.PriceInfo' description: TeaserPrice is the price that should be shown in teasers (listview) + type: object TeaserPriceIsFromPrice: description: TeaserPriceIsFromPrice is set to true in cases where a product might have different prices (e.g. configurable) @@ -909,6 +1015,7 @@ definitions: properties: PaymentRequestAPI: $ref: '#/definitions/domain.PaymentRequestAPI' + type: object UsedPaymentMethod: type: string type: object @@ -930,12 +1037,7 @@ definitions: OrderNumber: type: string type: object - productResultError: - properties: - Code: - type: string - Message: - type: string + process.StateData: type: object validation.ItemValidationError: properties: @@ -1631,7 +1733,7 @@ paths: "500": description: Internal Server Error schema: - $ref: '#/definitions/productResultError' + $ref: '#/definitions/cartResultError' summary: Get the payment status of current cart (or last placed cart) tags: - Payment diff --git a/product/interfaces/controller/apicontroller.go b/product/interfaces/controller/apicontroller.go index f5a00099d..cfd3674cc 100644 --- a/product/interfaces/controller/apicontroller.go +++ b/product/interfaces/controller/apicontroller.go @@ -3,10 +3,11 @@ package controller import ( "context" - "flamingo.me/flamingo-commerce/v3/product/application" - "flamingo.me/flamingo-commerce/v3/product/domain" "flamingo.me/flamingo/v3/framework/web" "github.com/pkg/errors" + + "flamingo.me/flamingo-commerce/v3/product/application" + "flamingo.me/flamingo-commerce/v3/product/domain" ) type ( @@ -19,15 +20,15 @@ type ( // APIResult view data APIResult struct { - Error *resultError + Error *productResultError Success bool Product domain.BasicProduct } - resultError struct { + productResultError struct { Message string Code string - } //@name productResultError + } ) // Inject dependencies @@ -56,13 +57,13 @@ func (c *APIController) Get(ctx context.Context, r *web.Request) web.Result { case domain.ProductNotFound: return c.responder.Data(APIResult{ Success: false, - Error: &resultError{Code: "404", Message: err.Error()}, + Error: &productResultError{Code: "404", Message: err.Error()}, }) default: return c.responder.Data(APIResult{ Success: false, - Error: &resultError{Code: "500", Message: err.Error()}, + Error: &productResultError{Code: "500", Message: err.Error()}, }) } } diff --git a/test/integrationtest/projecttest/graphql/generated.go b/test/integrationtest/projecttest/graphql/generated.go index 20dc9a72e..68e7c9065 100644 --- a/test/integrationtest/projecttest/graphql/generated.go +++ b/test/integrationtest/projecttest/graphql/generated.go @@ -5,6 +5,7 @@ package graphql import ( "bytes" "context" + "embed" "errors" "fmt" "math/big" @@ -5264,1203 +5265,26 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil } -var sources = []*ast.Source{ - {Name: "graphql/schema/schema.graphql", Input: `type Query { flamingo: String } -type Mutation { flamingo: String } -scalar Time -scalar Map -scalar Date`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_price_interfaces_graphql-Service.graphql", Input: `type Commerce_Price{ - amount: Float - currency: String! -} - -type Commerce_Price_Charge { - price: Commerce_Price! - value: Commerce_Price! - type: String! - reference: String! -} - -type Commerce_Price_ChargeQualifier { - type: String! - reference: String! -} - -input Commerce_Price_ChargeQualifierInput { - type: String! - reference: String! -} - -type Commerce_Price_Charges { - items: [Commerce_Price_Charge!] - hasType(ctype: String): Boolean - hasChargeQualifier(qualifier: Commerce_Price_ChargeQualifierInput!): Boolean - getByChargeQualifierForced(qualifier: Commerce_Price_ChargeQualifierInput!): Commerce_Price_Charge - getByTypeForced(ctype: String): Commerce_Price_Charge -}`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_search_interfaces_graphql-Service.graphql", Input: `input Commerce_Search_KeyValueFilter { - k: String! - v: [String!] -} - -input Commerce_Search_Request { - pageSize: Int - page: Int - sortBy: String - keyValueFilters: [Commerce_Search_KeyValueFilter!] - query: String -} - -#input Commerce_Search_LiveSearchRequest { -# query: String -#} - -type Commerce_Search_Meta { - query: String! - originalQuery: String! - page: Int! - numPages: Int! - numResults: Int! - sortOptions: [Commerce_Search_SortOption!] -} - -type Commerce_Search_SortOption { - label: String! - field: String! - selected: Boolean! -} - -interface Commerce_Search_Facet { - name: String! - label: String! - position: Int! - items: [Commerce_Search_FacetItem!]! - hasSelectedItem: Boolean! -} - -interface Commerce_Search_FacetItem { - label: String! - value: String! - selected: Boolean! - count: Int! -} - -type Commerce_Search_ListFacet implements Commerce_Search_Facet { - name: String! - label: String! - position: Int! - items: [Commerce_Search_ListFacetItem!]! - hasSelectedItem: Boolean! -} - -type Commerce_Search_ListFacetItem implements Commerce_Search_FacetItem { - label: String! - value: String! - selected: Boolean! - count: Int! -} - -type Commerce_Search_TreeFacet implements Commerce_Search_Facet { - name: String! - label: String! - position: Int! - items: [Commerce_Search_TreeFacetItem!]! - hasSelectedItem: Boolean! -} - -type Commerce_Search_TreeFacetItem implements Commerce_Search_FacetItem { - label: String! - value: String! - selected: Boolean! - count: Int! - active: Boolean! - items: [Commerce_Search_TreeFacetItem!] -} - -type Commerce_Search_RangeFacet implements Commerce_Search_Facet { - name: String! - label: String! - position: Int! - items: [Commerce_Search_RangeFacetItem!]! - hasSelectedItem: Boolean! -} - -type Commerce_Search_RangeFacetItem implements Commerce_Search_FacetItem { - label: String! - value: String! - selected: Boolean! - count: Int! - min: Int! - max: Int! - selectedMin: Int! - selectedMax: Int! -} - -type Commerce_Search_Suggestion { - text: String! - highlight: String! -} - -type Commerce_Search_Promotion { - title: String! - content: String! - url: String! - media: Commerce_Search_PromotionMedia -} - -type Commerce_Search_PromotionMedia { - type: String! - mimeType: String! - usage: String! - title: String! - reference: String! -} - -#type Commerce_Search_Result { -# hits: []Commerce_Search_Document / Or maybe we dont need hits and the modules need to add a edge to this object... we will see -# searchMeta: Commerce_Search_Meta! - # Facets: domain.FacetCollection -# suggestions: [Commerce_Search_Suggestion] -#} - - -#extend type Query { -# Commerce_Search(searchRequest: Commerce_Search_Request): Commerce_Search_Result -# Commerce_Search_LiveSearch(searchRequest: Commerce_Search_LiveSearchRequest): Commerce_Search_ResultCommerce_Search_LiveSearchRequest! -#} -`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_product_interfaces_graphql-Service.graphql", Input: `interface Commerce_Product { - type: String! - marketPlaceCode: String! - identifier: String! - media: Commerce_Product_Media!, - price: Commerce_Product_PriceInfo!, - availablePrices: [Commerce_Product_PriceInfo!], - title: String! - categories: Commerce_Product_Categories! - description: String! - shortDescription: String! - meta: Commerce_Product_Meta! - loyalty: Commerce_Product_Loyalty! - attributes: Commerce_Product_Attributes! - badges: Commerce_Product_Badges! -} - -""" -A simple product, that has no variable attributes and therefore no relation to other products -""" -type Commerce_Product_SimpleProduct implements Commerce_Product { - type: String! - marketPlaceCode: String! - identifier: String! - media: Commerce_Product_Media!, - price: Commerce_Product_PriceInfo!, - availablePrices: [Commerce_Product_PriceInfo!], - title: String! - categories: Commerce_Product_Categories! - description: String! - shortDescription: String! - meta: Commerce_Product_Meta! - loyalty: Commerce_Product_Loyalty! - attributes: Commerce_Product_Attributes! - badges: Commerce_Product_Badges! -} - -""" -A configurable product defines the possible variations of a product. It only contains -information about product variants but has no active variant itself. -""" -type Commerce_Product_ConfigurableProduct implements Commerce_Product { - type: String! - marketPlaceCode: String! - identifier: String! - media: Commerce_Product_Media!, - price: Commerce_Product_PriceInfo!, - availablePrices: [Commerce_Product_PriceInfo!], - title: String! - categories: Commerce_Product_Categories! - description: String! - shortDescription: String! - meta: Commerce_Product_Meta! - loyalty: Commerce_Product_Loyalty! - attributes: Commerce_Product_Attributes! - variationSelections: [Commerce_Product_VariationSelection!] - badges: Commerce_Product_Badges! -} - -""" -An active variant is one of many concrete variants that a configurable provides. All data relates to one active variant -and not the the configurable. It also contains information about it´s siblings (other variants on the same configurable) -""" -type Commerce_Product_ActiveVariantProduct implements Commerce_Product { - type: String! - "The marketPlaceCode of the 'configurable' product. See also 'variantMarketPlaceCode' for the variant marketPlaceCode" - marketPlaceCode: String! - identifier: String! - media: Commerce_Product_Media!, - price: Commerce_Product_PriceInfo!, - availablePrices: [Commerce_Product_PriceInfo!], - title: String! - categories: Commerce_Product_Categories! - description: String! - shortDescription: String! - meta: Commerce_Product_Meta! - loyalty: Commerce_Product_Loyalty! - attributes: Commerce_Product_Attributes! - "The marketPlaceCode of the actual variant" - variantMarketPlaceCode: String! - "Contains information about other available product variations" - variationSelections: [Commerce_Product_VariationSelection!] - "Convenience property to access the active variant labels easily" - activeVariationSelections: [Commerce_Product_ActiveVariationSelection!] - badges: Commerce_Product_Badges! -} - -"A group of attributes. E.g. 'size'" -type Commerce_Product_VariationSelection { - code: String! - label: String! - "All possible variations for that attribute. E.g. 'M', 'L', 'XL'" - options: [Commerce_Product_VariationSelection_Option] -} - -"Easy-to-access property to display attribute information about an active variant" -type Commerce_Product_ActiveVariationSelection { - code: String! - label: String! - value: String! - unitCode: String! -} - -"An option for a group of attributes" -type Commerce_Product_VariationSelection_Option { - label: String! - unitCode: String! - state: Commerce_Product_VariationSelection_OptionState! - """ - Contains information about a product that matches this option. - Depending on if there is an active variant or not, it tries to include the variant, - that best matches the current option. - """ - variant: Commerce_Product_VariationSelection_OptionVariant!, -} - -"Information about the underlying variant" -type Commerce_Product_VariationSelection_OptionVariant { - marketPlaceCode: String! -} - -"The state of an option related to the currently active variant" -enum Commerce_Product_VariationSelection_OptionState { - "The currently active variant has this exact attribute + all other active variant attributes" - ACTIVE - "A variant (other than the active variant) exists, that matches this exact attribute + all other active variant attributes" - MATCH - "No variant exists, that matches this exact attribute + all other active variant attributes." - NO_MATCH -} - -"Wrapper that includes main category and all categories" -type Commerce_Product_Categories { - main: Commerce_Product_CategoryTeaser! - all: [Commerce_Product_CategoryTeaser!] -} - -"Meta information about the product" -type Commerce_Product_Meta { - keywords: [String!] -} - -"Loyalty information about this product" -type Commerce_Product_Loyalty { - price: Commerce_Product_Loyalty_PriceInfo - earning: Commerce_Product_Loyalty_EarningInfo -} - -type Commerce_Product_Loyalty_PriceInfo { - type: String! - default: Commerce_Price! - isDiscounted: Boolean! - discounted: Commerce_Price! - discountText: String! - minPointsToSpent: Float! - maxPointsToSpent: Float! - context: Commerce_Product_PriceContext! -} - -"Shows the type and the points earned" -type Commerce_Product_Loyalty_EarningInfo { - "The type of the LoyaltyEarningInfo, e.g. MilesAndMore" - type: String! - "The value of the LoyaltyEarningInfo, currency can be e.g. points or miles" - default: Commerce_Price! -} - -type Commerce_Product_PriceContext { - customerGroup: String! - deliveryCode: String! - channelCode: String! - locale: String! -} - -type Commerce_Product_Media { - all: [Commerce_Product_MediaItem!] - getMedia(usage: String!): Commerce_Product_MediaItem! -} - -type Commerce_Product_MediaItem { - type: String! - mimeType: String! - usage: String! - title: String! - reference: String! -} - -type Commerce_Product_Attributes { - attributeKeys: [String!] - attributes: [Commerce_Product_Attribute!] - hasAttribute(key: String!): Boolean - getAttribute(key: String!): Commerce_Product_Attribute - getAttributesByKey(keys: [String!]): [Commerce_Product_Attribute!] -} - -type Commerce_Product_Attribute { - "Code of the attribute e.g. ` + "`" + `productWeight` + "`" + `" - code: String! - "Human-readable code e.g. ` + "`" + `The Product Weight` + "`" + `" - codeLabel: String! - "Human-readable label of a single value" - label: String! - "Value of the selected attribute" - value: String! - "Unit of the attribute e.g. ` + "`" + `kg` + "`" + `" - unitCode: String! - "Values of a multi value attribute" - values: [String!] - "Human-readable labels of a multi value attribute" - labels: [String!] -} - -type Commerce_Product_CategoryTeaser { - code: String! - path: String! - name: String! - parent: Commerce_Product_CategoryTeaser -} - -type Commerce_Product_PriceInfo { - default: Commerce_Price! - discounted: Commerce_Price! - discountText: String! - activeBase: Commerce_Price! - activeBaseAmount: Float! - activeBaseUnit: String! - isDiscounted: Boolean! - campaignRules: [String!] - denyMoreDiscounts: Boolean! - context: Commerce_Product_PriceContext! - taxClass: String! -} - - -type Commerce_Product_SearchResult { - products: [Commerce_Product!] - facets: [Commerce_Search_Facet!]! - suggestions: [Commerce_Search_Suggestion!] - searchMeta: Commerce_Search_Meta! - hasSelectedFacet: Boolean! - promotion: Commerce_Search_Promotion -} - -type Commerce_Product_Badges { - all: [Commerce_Product_Badge!] - first: Commerce_Product_Badge -} - -type Commerce_Product_Badge { - code: String! - label: String! -} - -extend type Query { - Commerce_Product(marketPlaceCode: String!, variantMarketPlaceCode: String): Commerce_Product - Commerce_Product_Search(searchRequest: Commerce_Search_Request!): Commerce_Product_SearchResult! -} -`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_customer_interfaces_graphql-Service.graphql", Input: `type Commerce_Customer_Status_Result { - isLoggedIn: Boolean! - userID: String! -} - -type Commerce_Customer_Result { - id: String! - "Customers personal data" - personalData: Commerce_Customer_PersonData! - "Get a specific address from the customer" - getAddress(id: ID!): Commerce_Customer_Address - "Addresses that the customer provided, can be used for billing / shipping" - addresses: [Commerce_Customer_Address!] - "The default shipping address of the customer, null if there is none" - defaultShippingAddress: Commerce_Customer_Address - "The default billing address of the customer, null if there is none" - defaultBillingAddress: Commerce_Customer_Address -} - -type Commerce_Customer_PersonData { - gender: String! - firstName: String! - lastName: String! - middleName: String! - mainEmail: String! - prefix: String! - birthday: Date - nationality: String! -} - -type Commerce_Customer_Address { - id: ID! - additionalAddressLines: [String!] - city: String! - company: String! - countryCode: String! - "Flag if this address should be used as the default billing address" - defaultBilling: Boolean! - "Flag if this address should be used as the default shipping address" - defaultShipping: Boolean! - firstName: String! - lastName: String! - postCode: String! - prefix: String! - regionCode: String! - street: String! - streetNumber: String! - state: String! - telephone: String! - email: String! -} - -extend type Query { - """ - Returns the logged in status for the current session - """ - Commerce_Customer_Status: Commerce_Customer_Status_Result - """ - Returns the logged in customer for the current session or an error if it is not logged in. - If you don't want to handle the error, check with Commerce_Customer_Status first. - """ - Commerce_Customer: Commerce_Customer_Result -} -`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_cart_interfaces_graphql-Service.graphql", Input: `type Commerce_Cart_DecoratedCart { - cart: Commerce_Cart_Cart! - decoratedDeliveries: [Commerce_Cart_DecoratedDelivery!] - getDecoratedDeliveryByCode(deliveryCode: String!): Commerce_Cart_DecoratedDelivery - getAllPaymentRequiredItems: Commerce_Cart_PricedItems! - cartSummary: Commerce_Cart_Summary! -} - -type Commerce_Cart_Summary { - discounts: Commerce_Cart_AppliedDiscounts! - totalDiscountAmount: Commerce_Price - totalGiftCardAmount: Commerce_Price - grandTotalWithGiftCards: Commerce_Price - sumTotalDiscountWithGiftCardsAmount: Commerce_Price - hasAppliedDiscounts: Boolean! - sumTaxes: Commerce_Cart_Taxes - sumPaymentSelectionCartSplitValueAmountByMethods(methods: [String!]): Commerce_Price -} - -type Commerce_Cart_Cart { - id: ID! - entityID: String! - billingAddress: Commerce_Cart_Address - purchaser: Commerce_Cart_Person - deliveries: [Commerce_Cart_Delivery!] - additionalData: Commerce_Cart_AdditionalData! - paymentSelection: Commerce_Cart_PaymentSelection - belongsToAuthenticatedUser: Boolean! - authenticatedUserID: String! - appliedCouponCodes: [Commerce_Cart_CouponCode!] - defaultCurrency: String! - totalitems: [Commerce_Cart_Totalitem!] - itemCount: Int! - productCount: Int! - isPaymentSelected: Boolean! - grandTotal: Commerce_Price! - sumTotalTaxAmount: Commerce_Price! - subTotalNet: Commerce_Price! - appliedGiftCards: [Commerce_Cart_AppliedGiftCard!] - getDeliveryByCode(deliveryCode: String!): Commerce_Cart_Delivery - getDeliveryCodes: [String!] - - getMainShippingEMail: String! - isEmpty: Boolean! - hasDeliveryForCode(deliveryCode: String!): Boolean! - - getDeliveryByItemID(itemID: String!): Commerce_Cart_Delivery! - getByItemID(itemID: String!): Commerce_Cart_Item! - getTotalQty(marketPlaceCode: String!, variantCode: String!): Int - getByExternalReference(ref: String!): Commerce_Cart_Item! - - getVoucherSavings: Commerce_Price! - getCartTeaser: Commerce_Cart_Teaser! - - shippingNet: Commerce_Price! - shippingNetWithDiscounts: Commerce_Price! - shippingGross: Commerce_Price! - shippingGrossWithDiscounts: Commerce_Price! - - hasShippingCosts: Boolean! - allShippingTitles: [String!] - - subTotalGross: Commerce_Price! - subTotalGrossWithDiscounts: Commerce_Price! - subTotalNetWithDiscounts: Commerce_Price! - totalDiscountAmount: Commerce_Price! - nonItemRelatedDiscountAmount: Commerce_Price! - itemRelatedDiscountAmount: Commerce_Price! - hasAppliedCouponCode: Boolean! - - getPaymentReference: String! - getTotalItemsByType(typeCode: String!): [Commerce_Cart_Totalitem!] - grandTotalCharges: Commerce_Price_Charges! - - hasAppliedGiftCards: Boolean! - hasRemainingGiftCards: Boolean! -} - -type Commerce_Cart_PricedItems { - cartItems: [Commerce_Cart_PricedCartItem!] - shippingItems: [Commerce_Cart_PricedShippingItem!] - totalItems: [Commerce_Cart_PricedTotalItem!] -} - -type Commerce_Cart_PricedCartItem { - amount: Commerce_Price! - itemID: String! -} - -type Commerce_Cart_PricedShippingItem { - amount: Commerce_Price! - deliveryInfoCode: String! -} - -type Commerce_Cart_PricedTotalItem { - amount: Commerce_Price! - code: String! -} - -type Commerce_Cart_Tax { - amount: Commerce_Price! - type: String! - rate: Float -} - -type Commerce_Cart_Taxes { - items: [Commerce_Cart_Tax]! - getByType(taxType: String): Commerce_Cart_Tax! -} - -type Commerce_Cart_Teaser { - productCount: Int - ItemCount: Int - DeliveryCodes: [String] -} - -interface Commerce_Cart_PaymentSelection { - gateway: String! - totalValue: Commerce_Price! - cartSplit: [Commerce_Cart_PaymentSelection_Split!] -} - -type Commerce_Cart_PaymentSelection_Split { - qualifier: Commerce_Cart_PaymentSelection_SplitQualifier! - charge: Commerce_Price_Charge! -} - -type Commerce_Cart_PaymentSelection_SplitQualifier { - type: String! - method: String! - reference: String! -} - -type Commerce_Cart_DefaultPaymentSelection implements Commerce_Cart_PaymentSelection { - gateway: String! - totalValue: Commerce_Price! - cartSplit: [Commerce_Cart_PaymentSelection_Split!] -} - -type Commerce_Cart_DecoratedDelivery { - delivery: Commerce_Cart_Delivery! - decoratedItems: [Commerce_Cart_DecoratedItem!] -} - -type Commerce_Cart_Delivery { - deliveryInfo: Commerce_Cart_DeliveryInfo - cartitems: [Commerce_Cart_Item!] - shippingItem: Commerce_Cart_ShippingItem - subTotalGross: Commerce_Price - grandTotal: Commerce_Price - sumTotalTaxAmount: Commerce_Price - subTotalNet: Commerce_Price - totalDiscountAmount: Commerce_Price - nonItemRelatedDiscountAmount: Commerce_Price - itemRelatedDiscountAmount: Commerce_Price - subTotalGrossWithDiscounts: Commerce_Price - subTotalNetWithDiscounts: Commerce_Price! - hasItems: Boolean! -} - -type Commerce_Cart_DeliveryInfo { - code: String! - workflow: String! - method: String! - carrier: String! - deliveryLocation: Commerce_Cart_DeliveryLocation - desiredTime: Time - additionalData: Commerce_Cart_CustomAttributes! -} - -type Commerce_Cart_DeliveryLocation { - type: String! - address: Commerce_Cart_Address - useBillingAddress: Boolean! - code: String! -} - -type Commerce_Cart_ShippingItem { - title: String! - priceNet: Commerce_Price! - taxAmount: Commerce_Price! - priceGross: Commerce_Price! - appliedDiscounts: Commerce_Cart_AppliedDiscounts! - totalWithDiscountInclTax: Commerce_Price! - tax: Commerce_Cart_Tax! -} - -type Commerce_Cart_AppliedDiscounts { - items: [Commerce_Cart_AppliedDiscount!] - byCampaignCode(campaignCode: String): Commerce_Cart_AppliedDiscounts! - byType(filterType: String): Commerce_Cart_AppliedDiscounts! -} - -type Commerce_Cart_AppliedDiscount { - campaignCode: String! - couponCode: String! - label: String! - applied: Commerce_Price! - type: String! - isItemRelated: Boolean! - sortOrder: Int! -} - -type Commerce_Cart_DecoratedItem { - item: Commerce_Cart_Item - product: Commerce_Product -} - -type Commerce_Cart_Item { - id: ID! - externalReference: String! - marketplaceCode: String! - variantMarketPlaceCode: String! - productName: String! - sourceID: String! - qty: Int! - additionalDataKeys: [String!] - additionalDataValues: [String!] - getAdditionalData(key: String!): String - hasAdditionalDataKey(key: String!): Boolean - singlePriceGross: Commerce_Price! - singlePriceNet: Commerce_Price! - rowPriceGross: Commerce_Price! - rowPriceNet: Commerce_Price! - appliedDiscounts: Commerce_Cart_AppliedDiscounts! - # rowTaxes: Commerce_Taxes! -} - -type Commerce_Cart_Address { - vat: String! - firstname: String! - lastname: String! - middleName: String! - title: String! - salutation: String! - street: String! - streetNr: String! - additionalAddressLines: [String!] - company: String! - city: String! - postCode: String! - state: String! - regionCode: String! - country: String! - countryCode: String! - telephone: String! - email: String! -} - -type Commerce_Cart_Person { - address: Commerce_Cart_Address - personalDetails: Commerce_Cart_PersonalDetails! - existingCustomerData: Commerce_Cart_ExistingCustomerData -} - -type Commerce_Cart_ExistingCustomerData { - id: ID! -} - -type Commerce_Cart_PersonalDetails { - dateOfBirth: String! - passportCountry: String! - passportNumber: String! - nationality: String! -} +//go:embed "schema/schema.graphql" "schema/flamingo.me_flamingo-commerce_v3_price_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_search_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_product_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_customer_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_cart_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_checkout_interfaces_graphql-Service.graphql" "schema/flamingo.me_flamingo-commerce_v3_category_interfaces_graphql-Service.graphql" +var sourcesFS embed.FS -type Commerce_Cart_AdditionalData { - customAttributes: Commerce_Cart_CustomAttributes! - reservedOrderID: String! -} - -type Commerce_Cart_CustomAttributes { - "Get specific attribute by key" - get(key: String!): Commerce_Cart_KeyValue -} - -type Commerce_Cart_KeyValue { - key: String! - value: String! -} - -type Commerce_Cart_Totalitem { - code: String! - title: String! - price: Commerce_Price! - type: String! -} - -type Commerce_Cart_CouponCode { - code: String! -} - -type Commerce_Cart_AppliedGiftCard { - code: String! - applied: Commerce_Price! - remaining: Commerce_Price! - hasRemaining: Boolean! -} - -type Commerce_Cart_ValidationResult { - hasCommonError: Boolean! - commonErrorMessageKey: String! - itemResults: [Commerce_Cart_ItemValidationError!] -} - -type Commerce_Cart_ItemValidationError { - itemID: String! - errorMessageKey: String! -} - - -type Commerce_Cart_QtyRestrictionResult { - isRestricted: Boolean! - maxAllowed: Int! - remainingDifference: Int! - restrictorName: String! -} - -type Commerce_Cart_PlacedOrderInfo { - orderNumber: String! - deliveryCode: String! -} - -type Commerce_Cart_BillingAddressForm { - "Billing address form data" - formData: Commerce_Cart_AddressForm - "Validation of supplied billing address, empty if address is valid" - validationInfo: Commerce_Cart_Form_ValidationInfo - "Shows if the request was successfully processed" - processed: Boolean -} - -type Commerce_Cart_SelectedPaymentResult { - validationInfo: Commerce_Cart_Form_ValidationInfo - processed: Boolean -} - -type Commerce_Cart_Form_ValidationInfo { - "Field specific validation errors" - fieldErrors: [Commerce_Cart_Form_FieldError!] - "General validation errors" - generalErrors: [Commerce_Cart_Form_Error!] -} - -type Commerce_Cart_Form_Error { - "A key of the error message. Often used for translation" - messageKey: String! - "A speaking error label. Often used to show to end user - in case no translation exists" - defaultLabel: String! -} - -type Commerce_Cart_Form_FieldError { - "A key of the error message. Often used for translation" - messageKey: String! - "A speaking error label. Often used to show to end user - in case no translation exists" - defaultLabel: String! - "Identifier for a form field" - fieldName: String! -} - -type Commerce_Cart_AddressForm { - vat: String! - firstname: String! - lastname: String! - middleName: String! - title: String! - salutation: String! - street: String! - streetNr: String! - addressLine1: String! - addressLine2: String! - company: String! - city: String! - postCode: String! - state: String! - regionCode: String! - country: String! - countryCode: String! - phoneNumber: String! - email: String! -} - -input Commerce_Cart_AddressFormInput { - vat: String - firstname: String! - lastname: String! - middleName: String - title: String - salutation: String - street: String - streetNr: String - addressLine1: String - addressLine2: String - company: String - city: String - postCode: String - state: String - regionCode: String - country: String - countryCode: String - phoneNumber: String - email: String! -} - -input Commerce_Cart_DeliveryAddressInput { - "Unique delivery code to identify the delivery" - deliveryCode: String! - "Delivery address form data" - deliveryAddress: Commerce_Cart_AddressFormInput - "Should the data of the billing address be used for this delivery" - useBillingAddress: Boolean! - "Optional Shipping Method" - method: String - "Optional Shipping Method" - carrier: String - "Optional desired delivery date / time" - desiredTime: Time -} - -type Commerce_Cart_DeliveryAddressForm { - "Unique delivery code to identify the delivery" - deliveryCode: String! - "Delivery address form data" - formData: Commerce_Cart_AddressForm - "Shows if the data of the billing address should be used for this delivery" - useBillingAddress: Boolean! - "Shipping Method" - method: String - "Shipping Carrier" - carrier: String - "Optional desired delivery date / time" - desiredTime: Time - - "Validation of supplied delivery address, empty if address is valid" - validationInfo: Commerce_Cart_Form_ValidationInfo - "Shows if the request was successfully processed" - processed: Boolean -} - -type Commerce_Cart_UpdateDeliveryShippingOptions_Result { - "Shows if the request was successfully processed" - processed: Boolean -} - -input Commerce_Cart_DeliveryShippingOptionInput { - "Unique delivery code to identify an **existing** delivery" - deliveryCode: String! - "Shipping Method" - method: String! - "Shipping Carrier" - carrier: String! -} - -input Commerce_Cart_KeyValueInput { - key: String! - value: String! -} - -input Commerce_Cart_DeliveryAdditionalDataInput { - deliveryCode: String! - additionalData: [Commerce_Cart_KeyValueInput!]! -} - -extend type Query { - Commerce_Cart_DecoratedCart: Commerce_Cart_DecoratedCart! - Commerce_Cart_Validator: Commerce_Cart_ValidationResult! - "Commerce_Cart_QtyRestriction returns if the product is restricted in terms of the allowed quantity for the current cart and the given delivery" - Commerce_Cart_QtyRestriction(marketplaceCode: String!, variantCode: String, deliveryCode: String!): Commerce_Cart_QtyRestrictionResult! -} - -extend type Mutation { - Commerce_Cart_AddToCart(marketplaceCode: ID!, qty: Int!, deliveryCode: String!): Commerce_Cart_DecoratedCart! - Commerce_Cart_DeleteCartDelivery(deliveryCode: String!): Commerce_Cart_DecoratedCart! - Commerce_Cart_DeleteItem(itemID: ID!, deliveryCode: String!): Commerce_Cart_DecoratedCart! - Commerce_Cart_UpdateItemQty(itemID: ID!, deliveryCode: String!, qty: Int!): Commerce_Cart_DecoratedCart! - "Adds/Updates the Billing Address of the current cart" - Commerce_Cart_UpdateBillingAddress(addressForm: Commerce_Cart_AddressFormInput): Commerce_Cart_BillingAddressForm! - Commerce_Cart_UpdateSelectedPayment(gateway: String!, method: String!): Commerce_Cart_SelectedPaymentResult! - Commerce_Cart_ApplyCouponCodeOrGiftCard(code: String!): Commerce_Cart_DecoratedCart - Commerce_Cart_RemoveGiftCard(giftCardCode: String!): Commerce_Cart_DecoratedCart - Commerce_Cart_RemoveCouponCode(couponCode: String!): Commerce_Cart_DecoratedCart - "Adds/Updates one/multiple Delivery Addresses" - Commerce_Cart_UpdateDeliveryAddresses(deliveryAdresses: [Commerce_Cart_DeliveryAddressInput!]): [Commerce_Cart_DeliveryAddressForm]! - "Adds/Updates one/multiple Delivery Addresses" - Commerce_Cart_UpdateDeliveryShippingOptions(shippingOptions: [Commerce_Cart_DeliveryShippingOptionInput!]): Commerce_Cart_UpdateDeliveryShippingOptions_Result! - "Cleans current cart" - Commerce_Cart_Clean: Boolean! - "Adds/Updates additional data for the cart" - Commerce_Cart_UpdateAdditionalData(additionalData: [Commerce_Cart_KeyValueInput!]!): Commerce_Cart_DecoratedCart! - "Adds/Updates additional data for the given deliveries" - Commerce_Cart_UpdateDeliveriesAdditionalData(data: [Commerce_Cart_DeliveryAdditionalDataInput!]!): Commerce_Cart_DecoratedCart! -} -`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_checkout_interfaces_graphql-Service.graphql", Input: `type Commerce_Checkout_StartPlaceOrder_Result { - uuid: String! -} -# Commerce_Checkout_PlaceOrderContext represents the result of the current (running) place order mutation -type Commerce_Checkout_PlaceOrderContext { - # The Cart that is going to be placed - cart: Commerce_Cart_DecoratedCart - # The placed order in case order is already placed - orderInfos: Commerce_Checkout_PlacedOrderInfos - # State depending on the state of payment and place order - state may contain additional infos - state: Commerce_Checkout_PlaceOrderState_State! - # A unique id for the process - uuid: String! -} - - -# Commerce_Checkout_PlacedOrderInfos - infos about the placed orders - typically shown on a suceess page -type Commerce_Checkout_PlacedOrderInfos { - paymentInfos: [Commerce_Checkout_PlaceOrderPaymentInfo!] - placedOrderInfos: [Commerce_Cart_PlacedOrderInfo!] - email: String! -} - -type Commerce_Checkout_PlaceOrderPaymentInfo { - gateway: String! - paymentProvider: String! - method: String! - amount: Commerce_Price! - title: String! -} - - -interface Commerce_Checkout_PlaceOrderState_State { - name: String! -} - -type Commerce_Checkout_PlaceOrderState_State_Wait implements Commerce_Checkout_PlaceOrderState_State { - name: String! -} - -type Commerce_Checkout_PlaceOrderState_State_WaitForCustomer implements Commerce_Checkout_PlaceOrderState_State { - name: String! -} - -type Commerce_Checkout_PlaceOrderState_State_Success implements Commerce_Checkout_PlaceOrderState_State { - name: String! -} - -type Commerce_Checkout_PlaceOrderState_State_Failed implements Commerce_Checkout_PlaceOrderState_State { - name: String! - reason: Commerce_Checkout_PlaceOrderState_State_FailedReason! -} - -type Commerce_Checkout_PlaceOrderState_State_ShowIframe implements Commerce_Checkout_PlaceOrderState_State { - name: String! - URL: String! -} - -type Commerce_Checkout_PlaceOrderState_State_ShowHTML implements Commerce_Checkout_PlaceOrderState_State { - name: String! - HTML: String! -} - -type Commerce_Checkout_PlaceOrderState_State_Redirect implements Commerce_Checkout_PlaceOrderState_State { - name: String! - URL: String! -} - -type Commerce_Checkout_PlaceOrderState_State_TriggerClientSDK implements Commerce_Checkout_PlaceOrderState_State { - name: String! - URL: String! - data: String! -} - -type Commerce_Checkout_PlaceOrderState_State_ShowWalletPayment implements Commerce_Checkout_PlaceOrderState_State { - name: String! - "Wallet payment method that was chosen previously" - paymentMethod: String! - "Information needed to create a payment using the PaymentRequest API" - paymentRequestAPI: Commerce_Checkout_PlaceOrderState_PaymentRequestAPI! -} - -type Commerce_Checkout_PlaceOrderState_PaymentRequestAPI { - "Contains the JSON encoded method data for the PaymentRequest API" - methodData: String! - "Contains the JSON encoded details for the PaymentRequest API" - details: String! - "Contains the JSON encoded options for the PaymentRequest API" - options: String! - "Optional endpoint used for obtaining a merchant session, not set if the wallet payment doesn't require a merchant validation" - merchantValidationURL: String - "Endpoint to sent completed payment to" - completeURL: String! -} - -type Commerce_Checkout_PlaceOrderState_State_PostRedirect implements Commerce_Checkout_PlaceOrderState_State { - name: String! - URL: String! - Parameters: [Commerce_Checkout_PlaceOrderState_Form_Parameter!] -} - -interface Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String -} - - -type Commerce_Checkout_PlaceOrderState_State_FailedReason_Error implements Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String -} - -type Commerce_Checkout_PlaceOrderState_State_FailedReason_PaymentError implements Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String -} - -type Commerce_Checkout_PlaceOrderState_State_FailedReason_CanceledByCustomer implements Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String -} - -type Commerce_Checkout_PlaceOrderState_State_FailedReason_PaymentCanceledByCustomer implements Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String -} - -type Commerce_Checkout_PlaceOrderState_State_FailedReason_CartValidationError implements Commerce_Checkout_PlaceOrderState_State_FailedReason { - reason: String - validationResult: Commerce_Cart_ValidationResult! -} - -type Commerce_Checkout_PlaceOrderState_Form_Parameter { - key: String! - value: [String!] -} - -extend type Query { - # Is there a active place order process - Commerce_Checkout_ActivePlaceOrder: Boolean! - Commerce_Checkout_CurrentContext: Commerce_Checkout_PlaceOrderContext! -} - -extend type Mutation { - # Starts a new process and will replace existing ones - Commerce_Checkout_StartPlaceOrder(returnUrl: String!): Commerce_Checkout_StartPlaceOrder_Result! - # Cancels to current running place order process, possible if state is not final - Commerce_Checkout_CancelPlaceOrder: Boolean! - # Clears the last stored place order process - Commerce_Checkout_ClearPlaceOrder: Boolean! - # Gets the last stored place order state and ensures that the state machine proceeds, non blocking - Commerce_Checkout_RefreshPlaceOrder: Commerce_Checkout_PlaceOrderContext! - # Gets the most recent place order state by waiting for the state machine to proceed, therefore blocking - Commerce_Checkout_RefreshPlaceOrderBlocking: Commerce_Checkout_PlaceOrderContext! -} -`, BuiltIn: false}, - {Name: "graphql/schema/flamingo.me_flamingo-commerce_v3_category_interfaces_graphql-Service.graphql", Input: `type Commerce_Category_Attributes { - get(code: String!): Commerce_Category_Attribute - has(code: String!): Boolean - all: [Commerce_Category_Attribute!] -} - -type Commerce_Category_Attribute { - code: String! - label: String! - values: [Commerce_Category_AttributeValue!] -} - -type Commerce_Category_AttributeValue { - value: String! - label: String! -} - -interface Commerce_Category { - code: String! - name: String! - path: String! - active: Boolean! - promoted: Boolean! - attributes: Commerce_Category_Attributes! -} - -type Commerce_CategoryData implements Commerce_Category { - code: String! - name: String! - path: String! - active: Boolean! - promoted: Boolean! - attributes: Commerce_Category_Attributes! -} - -interface Commerce_Tree { - code: String! - name: String! - path: String! - active: Boolean! - subTrees: [Commerce_Tree] - hasChilds: Boolean! - documentCount: Int! -} - -type Commerce_CategoryTree implements Commerce_Tree{ - code: String! - name: String! - path: String! - active: Boolean! - subTrees: [Commerce_Tree] - hasChilds: Boolean! - documentCount: Int! -} - -type Commerce_Category_SearchResult { - category: Commerce_Category! - productSearchResult: Commerce_Product_SearchResult! +func sourceData(filename string) string { + data, err := sourcesFS.ReadFile(filename) + if err != nil { + panic(fmt.Sprintf("codegen problem: %s not available", filename)) + } + return string(data) } -extend type Query { - Commerce_CategoryTree(activeCategoryCode: String!): Commerce_Tree! - Commerce_Category(categoryCode: String!, categorySearchRequest: Commerce_Search_Request): Commerce_Category_SearchResult -} -`, BuiltIn: false}, +var sources = []*ast.Source{ + {Name: "schema/schema.graphql", Input: sourceData("schema/schema.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_price_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_price_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_search_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_search_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_product_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_product_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_customer_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_customer_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_cart_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_cart_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_checkout_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_checkout_interfaces_graphql-Service.graphql"), BuiltIn: false}, + {Name: "schema/flamingo.me_flamingo-commerce_v3_category_interfaces_graphql-Service.graphql", Input: sourceData("schema/flamingo.me_flamingo-commerce_v3_category_interfaces_graphql-Service.graphql"), BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -36215,7 +35039,12 @@ func (ec *executionContext) unmarshalInputCommerce_Cart_AddressFormInput(ctx con asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"vat", "firstname", "lastname", "middleName", "title", "salutation", "street", "streetNr", "addressLine1", "addressLine2", "company", "city", "postCode", "state", "regionCode", "country", "countryCode", "phoneNumber", "email"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "vat": var err error @@ -36382,7 +35211,12 @@ func (ec *executionContext) unmarshalInputCommerce_Cart_DeliveryAdditionalDataIn asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"deliveryCode", "additionalData"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "deliveryCode": var err error @@ -36413,7 +35247,12 @@ func (ec *executionContext) unmarshalInputCommerce_Cart_DeliveryAddressInput(ctx asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"deliveryCode", "deliveryAddress", "useBillingAddress", "method", "carrier", "desiredTime"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "deliveryCode": var err error @@ -36476,7 +35315,12 @@ func (ec *executionContext) unmarshalInputCommerce_Cart_DeliveryShippingOptionIn asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"deliveryCode", "method", "carrier"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "deliveryCode": var err error @@ -36515,7 +35359,12 @@ func (ec *executionContext) unmarshalInputCommerce_Cart_KeyValueInput(ctx contex asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "key": var err error @@ -36546,7 +35395,12 @@ func (ec *executionContext) unmarshalInputCommerce_Price_ChargeQualifierInput(ct asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"type", "reference"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "type": var err error @@ -36577,7 +35431,12 @@ func (ec *executionContext) unmarshalInputCommerce_Search_KeyValueFilter(ctx con asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"k", "v"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "k": var err error @@ -36608,7 +35467,12 @@ func (ec *executionContext) unmarshalInputCommerce_Search_Request(ctx context.Co asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"pageSize", "page", "sortBy", "keyValueFilters", "query"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "pageSize": var err error