├── .editorconfig ├── .github ├── CODEOWNERS └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG-1.0.md ├── CHANGELOG-1.1.md ├── CHANGELOG-1.2.md ├── CHANGELOG-1.3.md ├── CHANGELOG-1.4.md ├── CHANGELOG-1.5.md ├── CHANGELOG-1.6.md ├── README.md ├── UPGRADE.md ├── bin └── .gitkeep ├── composer.json ├── doc ├── Cookbook.md ├── Workflow.png └── swagger.yml ├── ecs.php ├── etc └── .gitkeep ├── phpspec.yml.dist ├── phpstan.neon ├── phpunit.xml.dist ├── spec ├── Checker │ ├── ChannelExistenceCheckerSpec.php │ ├── ProductInCartChannelCheckerSpec.php │ └── PromotionCouponEligibilityCheckerSpec.php ├── Command │ ├── AddressBook │ │ └── SetDefaultAddressSpec.php │ ├── Cart │ │ ├── AddCouponSpec.php │ │ ├── AddressOrderSpec.php │ │ ├── AssignCustomerToCartSpec.php │ │ ├── ChangeItemQuantitySpec.php │ │ ├── ChoosePaymentMethodSpec.php │ │ ├── ChooseShippingMethodSpec.php │ │ ├── CompleteOrderSpec.php │ │ ├── DropCartSpec.php │ │ ├── PickupCartSpec.php │ │ ├── PutOptionBasedConfigurableItemToCartSpec.php │ │ ├── PutSimpleItemToCartSpec.php │ │ └── PutVariantBasedConfigurableItemToCartSpec.php │ ├── Customer │ │ ├── EnableCustomerSpec.php │ │ ├── GenerateResetPasswordTokenSpec.php │ │ ├── GenerateVerificationTokenSpec.php │ │ ├── SendOrderConfirmationSpec.php │ │ ├── SendResetPasswordTokenSpec.php │ │ ├── SendVerificationTokenSpec.php │ │ ├── UpdateCustomerSpec.php │ │ └── VerifyAccountSpec.php │ ├── Order │ │ └── UpdatePaymentMethodSpec.php │ └── Product │ │ ├── AddProductReviewByCodeSpec.php │ │ └── AddProductReviewBySlugSpec.php ├── CommandProvider │ ├── ChannelBasedCommandProviderSpec.php │ ├── DefaultCommandProviderSpec.php │ ├── PutItemToCartCommandProviderSpec.php │ └── ShopUserBasedCommandProviderSpec.php ├── Event │ ├── CartPickedUpSpec.php │ └── OrderCompletedSpec.php ├── EventListener │ ├── CartBlamerListenerSpec.php │ ├── Messenger │ │ ├── CartPickedUpListenerSpec.php │ │ └── OrderCompletedListenerSpec.php │ └── UserRegistrationListenerSpec.php ├── Factory │ ├── AddressBook │ │ └── AddressViewFactorySpec.php │ ├── Cart │ │ ├── AdjustmentViewFactorySpec.php │ │ ├── CartItemViewFactorySpec.php │ │ ├── CartViewFactorySpec.php │ │ └── TotalViewFactorySpec.php │ ├── Checkout │ │ ├── PaymentMethodViewFactorySpec.php │ │ ├── PaymentViewFactorySpec.php │ │ ├── ShipmentViewFactorySpec.php │ │ └── ShippingMethodViewFactorySpec.php │ ├── Customer │ │ └── CustomerViewFactorySpec.php │ ├── ImageViewFactorySpec.php │ ├── Order │ │ └── PlacedOrderViewFactorySpec.php │ ├── PriceViewFactorySpec.php │ ├── Product │ │ ├── DetailedProductViewFactorySpec.php │ │ ├── LimitedProductAttributeValuesViewFactorySpec.php │ │ ├── ListProductViewFactorySpec.php │ │ ├── ProductAttributeValueViewFactorySpec.php │ │ ├── ProductAttributeValueViewResolver │ │ │ ├── DefaultProductAttributeValueViewResolverSpec.php │ │ │ └── SelectProductAttributeValueViewResolverSpec.php │ │ ├── ProductReviewViewFactorySpec.php │ │ ├── ProductVariantViewFactorySpec.php │ │ └── ProductViewFactorySpec.php │ └── Taxon │ │ ├── TaxonDetailsViewFactorySpec.php │ │ └── TaxonViewFactorySpec.php ├── Generator │ └── ProductBreadcrumbGeneratorSpec.php ├── Handler │ ├── AddressBook │ │ └── SetDefaultAddressHandlerSpec.php │ ├── Cart │ │ ├── AddCouponHandlerSpec.php │ │ ├── AddressOrderHandlerSpec.php │ │ ├── AssignCustomerToCartHandlerSpec.php │ │ ├── ChangeItemQuantityHandlerSpec.php │ │ ├── ChoosePaymentMethodHandlerSpec.php │ │ ├── ChooseShippingMethodHandlerSpec.php │ │ ├── CompleteOrderHandlerSpec.php │ │ ├── DropCartHandlerSpec.php │ │ ├── PickupCartHandlerSpec.php │ │ ├── PutOptionBasedConfigurableItemToCartHandlerSpec.php │ │ ├── PutSimpleItemToCartHandlerSpec.php │ │ └── PutVariantBasedConfigurableItemToCartHandlerSpec.php │ ├── Customer │ │ ├── EnableCustomerHandlerSpec.php │ │ ├── GenerateResetPasswordTokenHandlerSpec.php │ │ ├── GenerateVerificationTokenHandlerSpec.php │ │ ├── SendOrderConfirmationHandlerSpec.php │ │ ├── SendResetPasswordTokenHandlerSpec.php │ │ ├── SendVerificationTokenHandlerSpec.php │ │ ├── UpdateCustomerHandlerSpec.php │ │ └── VerifyAccountHandlerSpec.php │ ├── Order │ │ └── UpdatePaymentMethodHandlerSpec.php │ └── Product │ │ ├── AddProductReviewByCodeHandlerSpec.php │ │ └── AddProductReviewBySlugHandlerSpec.php ├── Http │ ├── RequestBasedLocaleContextSpec.php │ ├── RequestBasedLocaleProviderSpec.php │ └── RequestChannelEnsurerSpec.php ├── Mapper │ └── AddressMapperSpec.php ├── Model │ └── AddressSpec.php ├── Modifier │ └── OrderModifierSpec.php ├── Normalizer │ └── RequestCartTokenNormalizerSpec.php ├── Provider │ ├── LoggedInShopUserProviderSpec.php │ ├── ProductReviewerProviderSpec.php │ ├── ShopUserAwareCustomerProviderSpec.php │ └── SupportedLocaleProviderSpec.php ├── Shipping │ └── ShippingCostEstimatorSpec.php ├── Validator │ ├── Address │ │ ├── AddressExistsValidatorSpec.php │ │ └── CountryExistsValidatorSpec.php │ ├── Cart │ │ ├── CartEligibilityValidatorSpec.php │ │ ├── CartExistsValidatorSpec.php │ │ ├── CartItemEligibilityValidatorSpec.php │ │ ├── CartItemExistsValidatorSpec.php │ │ ├── CartNotEmptyValidatorSpec.php │ │ ├── CartReadyForCheckoutValidatorSpec.php │ │ ├── PaymentMethodAvailableValidatorSpec.php │ │ ├── PaymentMethodExistsValidatorSpec.php │ │ ├── TokenIsNotUsedValidatorSpec.php │ │ └── ValidPromotionCouponCodeValidatorSpec.php │ ├── ChannelExistsValidatorSpec.php │ ├── Customer │ │ ├── ShopUserDoesNotExistValidatorSpec.php │ │ ├── ShopUserExistsValidatorSpec.php │ │ └── VerificationTokenExistsValidatorSpec.php │ ├── Order │ │ └── OrderExistsValidatorSpec.php │ └── Product │ │ ├── ConfigurableProductValidatorSpec.php │ │ ├── ProductEligibilityValidatorSpec.php │ │ ├── ProductExistsValidatorSpec.php │ │ ├── ProductInCartChannelValidatorSpec.php │ │ ├── ProductOptionEligibilityValidatorSpec.php │ │ ├── ProductOptionExistsValidatorSpec.php │ │ ├── ProductVariantEligibilityValidatorSpec.php │ │ ├── ProductVariantExistsValidatorSpec.php │ │ └── SimpleProductValidatorSpec.php └── ViewRepository │ ├── Cart │ └── CartViewRepositorySpec.php │ ├── Order │ └── PlacedOrderViewRepositorySpec.php │ └── Product │ └── ProductDetailsViewRepositorySpec.php ├── src ├── Checker │ ├── ChannelExistenceChecker.php │ ├── ChannelExistenceCheckerInterface.php │ ├── ProductInCartChannelChecker.php │ ├── ProductInCartChannelCheckerInterface.php │ └── PromotionCouponEligibilityChecker.php ├── Command │ ├── AddressBook │ │ └── SetDefaultAddress.php │ ├── Cart │ │ ├── AddCoupon.php │ │ ├── AddressOrder.php │ │ ├── AssignCustomerToCart.php │ │ ├── ChangeItemQuantity.php │ │ ├── ChoosePaymentMethod.php │ │ ├── ChooseShippingMethod.php │ │ ├── CompleteOrder.php │ │ ├── DropCart.php │ │ ├── PickupCart.php │ │ ├── PutOptionBasedConfigurableItemToCart.php │ │ ├── PutSimpleItemToCart.php │ │ ├── PutVariantBasedConfigurableItemToCart.php │ │ ├── RemoveCoupon.php │ │ └── RemoveItemFromCart.php │ ├── CommandInterface.php │ ├── Customer │ │ ├── EnableCustomer.php │ │ ├── GenerateResetPasswordToken.php │ │ ├── GenerateVerificationToken.php │ │ ├── RegisterCustomer.php │ │ ├── SendOrderConfirmation.php │ │ ├── SendResetPasswordToken.php │ │ ├── SendVerificationToken.php │ │ ├── UpdateCustomer.php │ │ └── VerifyAccount.php │ ├── LocaleAwareCommandInterface.php │ ├── Order │ │ └── UpdatePaymentMethod.php │ └── Product │ │ ├── AddProductReviewByCode.php │ │ └── AddProductReviewBySlug.php ├── CommandProvider │ ├── ChannelBasedCommandProvider.php │ ├── ChannelBasedCommandProviderInterface.php │ ├── CommandProviderInterface.php │ ├── DefaultCommandProvider.php │ ├── PutItemToCartCommandProvider.php │ ├── ShopUserBasedCommandProvider.php │ └── ShopUserBasedCommandProviderInterface.php ├── CompilerPass │ └── RemoveUserCartRecalculationListenerPass.php ├── Controller │ ├── AddressBook │ │ └── SetDefaultAddressAction.php │ ├── Cart │ │ ├── AddCouponAction.php │ │ ├── ChangeItemQuantityAction.php │ │ ├── DropCartAction.php │ │ ├── EstimateShippingCostAction.php │ │ ├── PickupCartAction.php │ │ ├── PutItemToCartAction.php │ │ ├── PutItemsToCartAction.php │ │ ├── RemoveCouponAction.php │ │ ├── RemoveItemFromCartAction.php │ │ └── SummarizeAction.php │ ├── Checkout │ │ ├── AddressAction.php │ │ ├── ChoosePaymentMethodAction.php │ │ ├── ChooseShippingMethodAction.php │ │ ├── CompleteOrderAction.php │ │ ├── ShowAvailablePaymentMethodsAction.php │ │ └── ShowAvailableShippingMethodsAction.php │ ├── Customer │ │ ├── CustomerController.php │ │ ├── LoggedInCustomerDetailsAction.php │ │ ├── RegisterCustomerAction.php │ │ ├── RequestPasswordResettingAction.php │ │ ├── ResendVerificationTokenAction.php │ │ ├── UpdateCustomerAction.php │ │ └── VerifyAccountAction.php │ ├── Order │ │ ├── ShowOrderDetailsAction.php │ │ ├── ShowOrdersListAction.php │ │ └── UpdatePaymentMethodAction.php │ ├── Product │ │ ├── AddReviewByCodeAction.php │ │ ├── AddReviewBySlugAction.php │ │ ├── ShowLatestProductAction.php │ │ ├── ShowProductCatalogByTaxonCodeAction.php │ │ ├── ShowProductCatalogByTaxonSlugAction.php │ │ ├── ShowProductDetailsByCodeAction.php │ │ ├── ShowProductDetailsBySlugAction.php │ │ ├── ShowProductReviewsByCodeAction.php │ │ └── ShowProductReviewsBySlugAction.php │ └── Taxon │ │ ├── ShowTaxonDetailsAction.php │ │ └── ShowTaxonTreeAction.php ├── DependencyInjection │ ├── Configuration.php │ └── SyliusShopApiExtension.php ├── Event │ ├── CartPickedUp.php │ ├── CustomerRegistered.php │ └── OrderCompleted.php ├── EventListener │ ├── CartBlamerListener.php │ ├── Messenger │ │ ├── CartPickedUpListener.php │ │ └── OrderCompletedListener.php │ ├── UserCartRecalculationListener.php │ └── UserRegistrationListener.php ├── Exception │ ├── ChannelNotFoundException.php │ ├── UserNotFoundException.php │ ├── ViewCreationException.php │ └── WrongUserException.php ├── Factory │ ├── AddressBook │ │ ├── AddressViewFactory.php │ │ └── AddressViewFactoryInterface.php │ ├── Cart │ │ ├── AdjustmentViewFactory.php │ │ ├── AdjustmentViewFactoryInterface.php │ │ ├── CartItemViewFactory.php │ │ ├── CartItemViewFactoryInterface.php │ │ ├── CartViewFactory.php │ │ ├── CartViewFactoryInterface.php │ │ ├── EstimatedShippingCostViewFactory.php │ │ ├── EstimatedShippingCostViewFactoryInterface.php │ │ ├── TotalViewFactory.php │ │ └── TotalViewFactoryInterface.php │ ├── Checkout │ │ ├── PaymentMethodViewFactory.php │ │ ├── PaymentMethodViewFactoryInterface.php │ │ ├── PaymentViewFactory.php │ │ ├── PaymentViewFactoryInterface.php │ │ ├── ShipmentViewFactory.php │ │ ├── ShipmentViewFactoryInterface.php │ │ ├── ShippingMethodViewFactory.php │ │ └── ShippingMethodViewFactoryInterface.php │ ├── Customer │ │ ├── CustomerViewFactory.php │ │ └── CustomerViewFactoryInterface.php │ ├── ImageViewFactory.php │ ├── ImageViewFactoryInterface.php │ ├── Order │ │ ├── PlacedOrderViewFactory.php │ │ └── PlacedOrderViewFactoryInterface.php │ ├── PriceViewFactory.php │ ├── PriceViewFactoryInterface.php │ ├── Product │ │ ├── DetailedProductViewFactory.php │ │ ├── LimitedProductAttributeValuesViewFactory.php │ │ ├── ListProductViewFactory.php │ │ ├── PageViewFactory.php │ │ ├── PageViewFactoryInterface.php │ │ ├── ProductAttributeValueViewFactory.php │ │ ├── ProductAttributeValueViewFactoryInterface.php │ │ ├── ProductAttributeValueViewResolver │ │ │ ├── DefaultProductAttributeValueViewResolver.php │ │ │ ├── ProductAttributeValueViewResolverInterface.php │ │ │ └── SelectProductAttributeValueViewResolver.php │ │ ├── ProductAttributeValuesViewFactoryInterface.php │ │ ├── ProductReviewViewFactory.php │ │ ├── ProductReviewViewFactoryInterface.php │ │ ├── ProductVariantViewFactory.php │ │ ├── ProductVariantViewFactoryInterface.php │ │ ├── ProductViewFactory.php │ │ └── ProductViewFactoryInterface.php │ ├── Taxon │ │ ├── TaxonDetailsViewFactory.php │ │ ├── TaxonDetailsViewFactoryInterface.php │ │ ├── TaxonViewFactory.php │ │ └── TaxonViewFactoryInterface.php │ ├── ValidationErrorViewFactory.php │ └── ValidationErrorViewFactoryInterface.php ├── Generator │ ├── ProductBreadcrumbGenerator.php │ └── ProductBreadcrumbGeneratorInterface.php ├── Handler │ ├── AddressBook │ │ └── SetDefaultAddressHandler.php │ ├── Cart │ │ ├── AddCouponHandler.php │ │ ├── AddressOrderHandler.php │ │ ├── AssignCustomerToCartHandler.php │ │ ├── ChangeItemQuantityHandler.php │ │ ├── ChoosePaymentMethodHandler.php │ │ ├── ChooseShippingMethodHandler.php │ │ ├── CompleteOrderHandler.php │ │ ├── DropCartHandler.php │ │ ├── PickupCartHandler.php │ │ ├── PutOptionBasedConfigurableItemToCartHandler.php │ │ ├── PutSimpleItemToCartHandler.php │ │ ├── PutVariantBasedConfigurableItemToCartHandler.php │ │ ├── RemoveCouponHandler.php │ │ └── RemoveItemFromCartHandler.php │ ├── Customer │ │ ├── EnableCustomerHandler.php │ │ ├── GenerateResetPasswordTokenHandler.php │ │ ├── GenerateVerificationTokenHandler.php │ │ ├── RegisterCustomerHandler.php │ │ ├── SendOrderConfirmationHandler.php │ │ ├── SendResetPasswordTokenHandler.php │ │ ├── SendVerificationTokenHandler.php │ │ ├── UpdateCustomerHandler.php │ │ └── VerifyAccountHandler.php │ ├── Order │ │ └── UpdatePaymentMethodHandler.php │ └── Product │ │ ├── AddProductReviewByCodeHandler.php │ │ └── AddProductReviewBySlugHandler.php ├── Http │ ├── RequestBasedLocaleContext.php │ ├── RequestBasedLocaleProvider.php │ ├── RequestBasedLocaleProviderInterface.php │ └── RequestChannelEnsurer.php ├── Mailer │ └── Emails.php ├── Mapper │ ├── AddressMapper.php │ └── AddressMapperInterface.php ├── Model │ ├── Address.php │ └── PaginatorDetails.php ├── Modifier │ ├── OrderModifier.php │ └── OrderModifierInterface.php ├── Normalizer │ ├── RequestCartTokenNormalizer.php │ └── RequestCartTokenNormalizerInterface.php ├── Provider │ ├── CustomerProviderInterface.php │ ├── LoggedInShopUserProvider.php │ ├── LoggedInShopUserProviderInterface.php │ ├── ProductReviewerProvider.php │ ├── ProductReviewerProviderInterface.php │ ├── ShopUserAwareCustomerProvider.php │ ├── SupportedLocaleProvider.php │ └── SupportedLocaleProviderInterface.php ├── Request │ ├── AddressBook │ │ └── SetDefaultAddressRequest.php │ ├── Cart │ │ ├── AddCouponRequest.php │ │ ├── AssignCustomerToCartRequest.php │ │ ├── ChangeItemQuantityRequest.php │ │ ├── DropCartRequest.php │ │ ├── EstimateShippingCostRequest.php │ │ ├── PickupCartRequest.php │ │ ├── PutOptionBasedConfigurableItemToCartRequest.php │ │ ├── PutSimpleItemToCartRequest.php │ │ ├── PutVariantBasedConfigurableItemToCartRequest.php │ │ ├── RemoveCouponRequest.php │ │ └── RemoveItemFromCartRequest.php │ ├── ChannelBasedRequestInterface.php │ ├── Checkout │ │ ├── AddressOrderRequest.php │ │ ├── ChoosePaymentMethodRequest.php │ │ ├── ChooseShippingMethodRequest.php │ │ └── CompleteOrderRequest.php │ ├── Customer │ │ ├── GenerateResetPasswordTokenRequest.php │ │ ├── RegisterCustomerRequest.php │ │ ├── ResendVerificationTokenRequest.php │ │ ├── SendResetPasswordTokenRequest.php │ │ ├── UpdateCustomerRequest.php │ │ └── VerifyAccountRequest.php │ ├── Order │ │ └── UpdatePaymentMethodRequest.php │ ├── Product │ │ ├── AddProductReviewByCodeRequest.php │ │ └── AddProductReviewBySlugRequest.php │ ├── RequestInterface.php │ └── ShopUserBasedRequestInterface.php ├── Resources │ ├── config │ │ ├── app │ │ │ ├── config.yml │ │ │ └── sylius_mailer.yml │ │ ├── routing.yml │ │ ├── routing │ │ │ ├── address_book.yml │ │ │ ├── cart.yml │ │ │ ├── checkout.yml │ │ │ ├── customer.yml │ │ │ ├── order.yml │ │ │ ├── productByCode.yml │ │ │ ├── productBySlug.yml │ │ │ ├── productList.yml │ │ │ ├── register.yml │ │ │ └── taxon.yml │ │ ├── serializer │ │ │ ├── Address │ │ │ │ ├── Model.Address.yml │ │ │ │ └── Model.Country.yml │ │ │ ├── ImageView.yml │ │ │ ├── Order │ │ │ │ └── PlacedOrderView.yml │ │ │ └── Product │ │ │ │ ├── PageView.yml │ │ │ │ ├── ProductVariantView.yml │ │ │ │ └── ProductView.yml │ │ ├── services.xml │ │ ├── services │ │ │ ├── actions │ │ │ │ ├── address_book.xml │ │ │ │ ├── cart.xml │ │ │ │ ├── checkout.xml │ │ │ │ ├── customer.xml │ │ │ │ ├── order.xml │ │ │ │ ├── product.xml │ │ │ │ └── taxon.xml │ │ │ ├── checker.xml │ │ │ ├── checker │ │ │ │ └── channel.xml │ │ │ ├── command_providers.xml │ │ │ ├── command_providers │ │ │ │ ├── address_book.xml │ │ │ │ ├── cart.xml │ │ │ │ ├── checkout.xml │ │ │ │ ├── customer.xml │ │ │ │ └── product.xml │ │ │ ├── controllers.xml │ │ │ ├── factories.xml │ │ │ ├── factories │ │ │ │ ├── address_book.xml │ │ │ │ ├── cart.xml │ │ │ │ ├── checkout.xml │ │ │ │ ├── customer.xml │ │ │ │ ├── order.xml │ │ │ │ ├── product.xml │ │ │ │ └── taxon.xml │ │ │ ├── handler │ │ │ │ ├── address_book.xml │ │ │ │ ├── cart.xml │ │ │ │ ├── customer.xml │ │ │ │ ├── order.xml │ │ │ │ └── product.xml │ │ │ ├── handlers.xml │ │ │ ├── http.xml │ │ │ ├── listeners.xml │ │ │ ├── mapper.xml │ │ │ ├── providers.xml │ │ │ ├── queries.xml │ │ │ ├── repositories │ │ │ │ ├── cart.xml │ │ │ │ ├── order.xml │ │ │ │ └── product.xml │ │ │ ├── shipping.xml │ │ │ ├── validators.xml │ │ │ └── validators │ │ │ │ ├── address.xml │ │ │ │ ├── cart.xml │ │ │ │ ├── customer.xml │ │ │ │ ├── order.xml │ │ │ │ └── product.xml │ │ └── validation │ │ │ ├── address_book │ │ │ ├── AddressModelRequest.xml │ │ │ └── SetDefaultAddressRequest.xml │ │ │ ├── cart │ │ │ ├── AddCouponRequest.xml │ │ │ ├── ChangeItemQuantityRequest.xml │ │ │ ├── DropCartRequest.xml │ │ │ ├── EstimateShippingCostRequest.xml │ │ │ ├── PickupCartRequest.xml │ │ │ ├── PutOptionBasedConfigurableItemToCartRequest.xml │ │ │ ├── PutSimpleItemToCartRequest.xml │ │ │ ├── PutVariantBasedConfigurableItemToCartRequest.xml │ │ │ ├── RemoveCouponRequest.xml │ │ │ └── RemoveItemFromCartRequest.xml │ │ │ ├── checkout │ │ │ ├── AddressOrderRequest.xml │ │ │ ├── ChoosePaymentMethodRequest.xml │ │ │ └── CompleteOrderRequest.xml │ │ │ ├── customer │ │ │ ├── GenerateResetPasswordTokenRequest.xml │ │ │ ├── RegisterCustomerRequest.xml │ │ │ ├── ResendVerificationTokenRequest.xml │ │ │ ├── UpdateCustomerRequest.xml │ │ │ └── VerifyAccountRequest.xml │ │ │ ├── order │ │ │ └── UpdatePaymentMethodRequest.xml │ │ │ └── product │ │ │ ├── AddProductReviewByCodeRequest.xml │ │ │ └── AddProductReviewBySlugRequest.xml │ ├── translations │ │ ├── validators.de.yml │ │ └── validators.en.yml │ └── views │ │ └── Email │ │ ├── orderConfirmation.html.twig │ │ ├── passwordReset.html.twig │ │ └── verification.html.twig ├── Shipping │ ├── ShippingCost.php │ ├── ShippingCostEstimator.php │ └── ShippingCostEstimatorInterface.php ├── SyliusShopApiPlugin.php ├── Validator │ ├── Address │ │ ├── AddressExistsValidator.php │ │ └── CountryExistsValidator.php │ ├── Cart │ │ ├── CartEligibilityValidator.php │ │ ├── CartExistsValidator.php │ │ ├── CartItemEligibilityValidator.php │ │ ├── CartItemExistsValidator.php │ │ ├── CartNotEmptyValidator.php │ │ ├── CartReadyForCheckoutValidator.php │ │ ├── PaymentMethodAvailableValidator.php │ │ ├── PaymentMethodExistsValidator.php │ │ ├── TokenIsNotUsedValidator.php │ │ └── ValidPromotionCouponCodeValidator.php │ ├── ChannelExistsValidator.php │ ├── Constraints │ │ ├── AddressExists.php │ │ ├── CartEligibility.php │ │ ├── CartExists.php │ │ ├── CartItemEligibility.php │ │ ├── CartItemExists.php │ │ ├── CartNotEmpty.php │ │ ├── CartReadyForCheckout.php │ │ ├── ChannelExists.php │ │ ├── ConfigurableProduct.php │ │ ├── CountryExists.php │ │ ├── OrderExists.php │ │ ├── PaymentMethodAvailable.php │ │ ├── PaymentMethodExists.php │ │ ├── PaymentNotPaid.php │ │ ├── ProductEligibility.php │ │ ├── ProductExists.php │ │ ├── ProductInCartChannel.php │ │ ├── ProductOptionEligibility.php │ │ ├── ProductOptionExists.php │ │ ├── ProductVariantEligibility.php │ │ ├── ProductVariantExists.php │ │ ├── ShopUserDoesNotExist.php │ │ ├── ShopUserExists.php │ │ ├── SimpleProduct.php │ │ ├── TokenIsNotUsed.php │ │ ├── ValidPromotionCouponCode.php │ │ └── VerificationTokenExists.php │ ├── Customer │ │ ├── ShopUserDoesNotExistValidator.php │ │ ├── ShopUserExistsValidator.php │ │ └── VerificationTokenExistsValidator.php │ ├── Order │ │ ├── OrderExistsValidator.php │ │ └── PaymentNotPaidValidator.php │ └── Product │ │ ├── ConfigurableProductValidator.php │ │ ├── ProductEligibilityValidator.php │ │ ├── ProductExistsValidator.php │ │ ├── ProductInCartChannelValidator.php │ │ ├── ProductOptionEligibilityValidator.php │ │ ├── ProductOptionExistsValidator.php │ │ ├── ProductVariantEligibilityValidator.php │ │ ├── ProductVariantExistsValidator.php │ │ └── SimpleProductValidator.php ├── View │ ├── AddressBook │ │ └── AddressView.php │ ├── Cart │ │ ├── AdjustmentView.php │ │ ├── CartSummaryView.php │ │ ├── EstimatedShippingCostView.php │ │ ├── PaymentMethodView.php │ │ ├── PaymentView.php │ │ ├── ShippingMethodView.php │ │ └── TotalsView.php │ ├── Checkout │ │ └── ShipmentView.php │ ├── Customer │ │ └── CustomerView.php │ ├── ImageView.php │ ├── ItemView.php │ ├── Order │ │ └── PlacedOrderView.php │ ├── PriceView.php │ ├── Product │ │ ├── PageLinksView.php │ │ ├── PageView.php │ │ ├── ProductAttributeValueView.php │ │ ├── ProductListView.php │ │ ├── ProductReviewView.php │ │ ├── ProductTaxonView.php │ │ ├── ProductVariantView.php │ │ ├── ProductView.php │ │ ├── VariantOptionValueView.php │ │ └── VariantOptionView.php │ ├── Taxon │ │ ├── TaxonDetailsView.php │ │ └── TaxonView.php │ └── ValidationErrorView.php └── ViewRepository │ ├── Cart │ ├── CartViewRepository.php │ └── CartViewRepositoryInterface.php │ ├── Order │ ├── PlacedOrderViewRepository.php │ └── PlacedOrderViewRepositoryInterface.php │ └── Product │ ├── ProductCatalogViewRepository.php │ ├── ProductCatalogViewRepositoryInterface.php │ ├── ProductDetailsViewRepository.php │ ├── ProductDetailsViewRepositoryInterface.php │ ├── ProductLatestViewRepository.php │ ├── ProductLatestViewRepositoryInterface.php │ ├── ProductReviewsViewRepository.php │ └── ProductReviewsViewRepositoryInterface.php └── tests ├── Application ├── .env.dist ├── .env.prod.dist ├── .env.test.dist ├── .gitignore ├── Kernel.php ├── bin │ └── console ├── composer.json ├── config │ ├── bundles.php │ ├── jwt │ │ ├── private-test.pem │ │ └── public-test.pem │ ├── packages │ │ ├── _sylius.yaml │ │ ├── dev │ │ │ ├── framework.yaml │ │ │ ├── jms_serializer.yaml │ │ │ ├── monolog.yaml │ │ │ ├── routing.yaml │ │ │ ├── swiftmailer.php │ │ │ └── web_profiler.yaml │ │ ├── doctrine.yaml │ │ ├── doctrine_migrations.yaml │ │ ├── fos_rest.yaml │ │ ├── framework.yaml │ │ ├── jms_serializer.yaml │ │ ├── lexik_jwt_authentication.yaml │ │ ├── liip_imagine.yaml │ │ ├── mailer.php │ │ ├── prod │ │ │ ├── doctrine.yaml │ │ │ ├── jms_serializer.yaml │ │ │ └── monolog.yaml │ │ ├── routing.yaml │ │ ├── security.yaml │ │ ├── stof_doctrine_extensions.yaml │ │ ├── swiftmailer.php │ │ ├── sylius_shop_api.yaml │ │ ├── test │ │ │ ├── framework.yaml │ │ │ ├── mailer.php │ │ │ ├── monolog.yaml │ │ │ ├── swiftmailer.php │ │ │ ├── sylius_theme.yaml │ │ │ └── web_profiler.yaml │ │ ├── test_cached │ │ │ ├── doctrine.yaml │ │ │ ├── fos_rest.yaml │ │ │ ├── framework.yaml │ │ │ ├── mailer.php │ │ │ ├── monolog.yaml │ │ │ ├── swiftmailer.php │ │ │ ├── sylius_channel.yaml │ │ │ ├── sylius_theme.yaml │ │ │ └── twig.yaml │ │ ├── translation.yaml │ │ ├── twig.yaml │ │ ├── twig_extensions.yaml │ │ ├── validator.yaml │ │ └── webpack_encore.php │ ├── routes.yaml │ ├── routes │ │ ├── dev │ │ │ ├── twig.yaml │ │ │ └── web_profiler.yaml │ │ ├── liip_imagine.yaml │ │ └── sylius_admin.yaml │ └── services.yaml ├── public │ ├── .htaccess │ ├── favicon.ico │ ├── index.php │ ├── media │ │ └── image │ │ │ └── pants.jpeg │ └── robots.txt ├── templates │ └── .gitignore └── translations │ └── .gitignore ├── Controller ├── .gitkeep ├── AddressBook │ ├── CreateAddressApiTest.php │ ├── RemoveAddressApiTest.php │ ├── SetDefaultAddressApiTest.php │ ├── ShowApiTest.php │ └── UpdateAddressApiTest.php ├── Cart │ ├── AddCouponShopApiTest.php │ ├── ChangeItemQuantityApiTest.php │ ├── DropCartApiTest.php │ ├── EstimateShippingTest.php │ ├── PickupApiTest.php │ ├── PutItemToCartApiTest.php │ ├── PutItemsToCartApiTest.php │ ├── RemoveCouponShopApiTest.php │ ├── RemoveItemFromCartApiTest.php │ └── SummarizeApiTest.php ├── Checkout │ ├── AddressApiTest.php │ ├── ChoosePaymentMethodApiTest.php │ ├── ChooseShippingMethodApiTest.php │ ├── CompleteOrderApiTest.php │ ├── CountriesApiTest.php │ ├── ShowAvailablePaymentMethodsShopApiTest.php │ ├── ShowAvailableShippingMethodsShopApiTest.php │ └── SummarizeApiTest.php ├── Customer │ ├── ChangePasswordApiTest.php │ ├── LoggedInCustomerDetailsActionTest.php │ ├── LoginApiTest.php │ ├── RegisterApiTest.php │ ├── RequestPasswordResettingApiTest.php │ ├── ResendVerificationTokenApiTest.php │ ├── ResetPasswordApiTest.php │ ├── UpdateCustomerApiTest.php │ └── VerifyApiTest.php ├── JsonApiTestCase.php ├── Order │ ├── ListApiTest.php │ ├── OrderUpdatePaymentMethodApiTest.php │ └── ShowApiTest.php ├── Product │ ├── AddReviewByCodeApiTest.php │ ├── AddReviewBySlugApiTest.php │ ├── ShowCatalogByCodeApiTest.php │ ├── ShowCatalogBySlugApiTest.php │ ├── ShowDetailsByCodeApiTest.php │ ├── ShowDetailsBySlugApiTest.php │ ├── ShowLatestApiTest.php │ ├── ShowReviewsByCodeApiTest.php │ └── ShowReviewsBySlugApiTest.php ├── Taxon │ ├── ShowDetailsApiTest.php │ └── ShowTreeApiTest.php └── Utils │ ├── MailerAssertionsTrait.php │ ├── OrderPlacerTrait.php │ ├── PurgeMessagesTrait.php │ └── ShopUserLoginTrait.php ├── DataFixtures ├── .gitkeep └── ORM │ ├── address.yml │ ├── channel.yml │ ├── country.yml │ ├── coupon_based_promotion.yml │ ├── customer.yml │ ├── mug_review.yml │ ├── payment.yml │ ├── product_with_attributes.yml │ ├── promotion.yml │ ├── shipping.yml │ └── shop.yml ├── DependencyInjection ├── ConfigurationTest.php └── ShopApiExtensionTest.php ├── Mocks ├── TestChannelBasedCommand.php ├── TestChannelBasedRequest.php ├── TestCommand.php ├── TestRequest.php ├── TestShopUserBasedCommand.php └── TestShopUserBasedRequest.php ├── Request ├── AddCouponRequestTest.php ├── AddProductReviewByCodeRequestTest.php ├── AddProductReviewBySlugRequestTest.php ├── ChangeItemQuantityRequestTest.php ├── DropCartRequestTest.php ├── PickupCartRequestTest.php ├── PutOptionBasedConfigurableItemToCartRequestTest.php ├── PutSimpleItemToCartRequestTest.php ├── PutVariantBasedConfigurableItemToCartRequestTest.php ├── ResendVerificationTokenRequestTest.php ├── UpdateCustomerRequestTest.php └── VerifyAccountRequestTest.php └── Responses └── Expected ├── .gitkeep ├── address_book ├── SF5 │ ├── validation_create_address_book_with_wrong_country_response.json │ └── validation_create_address_book_with_wrong_province_response.json ├── SF6 │ ├── validation_create_address_book_with_wrong_country_response.json │ └── validation_create_address_book_with_wrong_province_response.json ├── add_address_response.json ├── show_address_book_response.json ├── validation_create_address_book_response.json └── validation_create_address_book_with_wrong_province_response.json ├── cart ├── add_multiple_products_to_cart_response.json ├── add_multiple_products_to_cart_validation_error_response.json ├── add_multiple_products_to_new_cart_response.json ├── add_product_variant_based_on_options_multiple_times_to_cart_response.json ├── add_product_variant_based_on_options_to_cart_response.json ├── add_product_variant_multiple_times_to_cart_response.json ├── add_product_variant_to_cart_response.json ├── add_simple_product_multiple_times_to_cart_response.json ├── add_simple_product_to_cart_response.json ├── add_simple_product_to_new_cart_response.json ├── cart_after_deleting_an_item.json ├── cart_and_country_does_not_exist_response.json ├── cart_has_not_been_found_response.json ├── cart_item_has_not_been_found_response.json ├── cart_with_coupon_based_promotion_applied_response.json ├── deprecated_empty_response.json ├── empty_response.json ├── empty_response_de_DE.json ├── estimated_shipping_cost_bases_on_country_and_province_response.json ├── estimated_shipping_cost_bases_on_country_response.json ├── filled_cart_with_product_variant_summary_response.json ├── filled_cart_with_simple_product_summary_response.json ├── german_filled_cart_with_product_variant_summary_response.json ├── german_filled_cart_with_simple_product_summary_response.json ├── product_not_in_cart_channel.json ├── product_option_exists_response.json ├── recalculated_cart_after_log_in.json ├── reprocessed_cart_after_deleting_an_item.json ├── validation_cart_and_cart_item_not_exist_response.json ├── validation_cart_empty_response.json ├── validation_cart_item_not_eligible_response.json ├── validation_cart_item_not_exists_response.json ├── validation_cart_item_variant_not_eligible_response.json ├── validation_cart_not_exists_in_german_response.json ├── validation_cart_not_exists_response.json ├── validation_channel_not_exists_response.json ├── validation_channel_not_found_response.json ├── validation_coupon_not_found_response.json ├── validation_coupon_not_valid_response.json ├── validation_product_non_eligible_response.json ├── validation_product_not_configurable_response.json ├── validation_product_not_defined_response.json ├── validation_product_not_exists_response.json ├── validation_product_not_simple_response.json ├── validation_product_variant_non_eligible_response.json ├── validation_product_variant_not_exists_response.json ├── validation_quantity_lower_than_one_response.json └── validation_token_already_used_response.json ├── cart_with_given_token_does_not_exist.json ├── channel_has_not_been_found_response.json ├── checkout ├── all_countries_response.json ├── cart_addressed_response.json ├── cart_addressed_with_different_shipping_and_billing_address_response.json ├── cart_addressed_with_province_codes_response.json ├── cart_does_not_exist.json ├── cart_empty_response.json ├── cart_failed_checkout_product_not_eligible_response.json ├── cart_failed_checkout_product_variant_not_eligible_response.json ├── cart_not_ready_for_checkout.json ├── cart_with_chosen_payment_response.json ├── cart_with_chosen_shipment_response.json ├── cart_with_chosen_shipment_with_per_item_rate_response.json ├── get_available_payment_methods.json ├── get_available_payment_methods_failed.json ├── get_available_shipping_methods.json ├── get_available_shipping_methods_failed.json ├── modified_cart_with_chosen_shipment_with_per_item_rate_response.json ├── non_existing_payment_method.json ├── one_of_countries_response.json └── payment_method_not_available.json ├── customer ├── bad_credentials_response.json ├── customer_log_in_response.json ├── logged_in_customer_details_response.json ├── request_reset_password_empty_email.json ├── request_reset_password_failed_email.json ├── update_customer.json ├── validation_email_not_defined_response.json ├── validation_email_not_found_response.json ├── validation_email_not_valid_response.json ├── validation_empty_data.json ├── validation_gender_not_valid_response.json ├── validation_registration_data_response.json ├── validation_registration_email_taken_response.json ├── verify_account_required_data.json └── verify_account_token_not_exists.json ├── order ├── order_details_response.json ├── order_details_response_guest.json ├── order_not_found_response.json ├── order_not_found_response_guest.json ├── order_placed_by_registered_customer.json └── orders_list_response.json ├── product ├── channel_has_not_been_found_response.json ├── german_product_list_page_by_code_response.json ├── german_product_list_page_by_slug_response.json ├── german_product_with_attributes_details_page.json ├── german_product_with_options_details_page.json ├── german_simple_product_details_page.json ├── limited_product_list_page_by_code_response.json ├── limited_product_list_page_by_slug_response.json ├── product_has_not_been_found_for_given_code_response.json ├── product_has_not_been_found_for_given_slug_response.json ├── product_list_latest_2_response.json ├── product_list_latest_4_response.json ├── product_list_latest_without_disabled_simple_product_response.json ├── product_list_latest_without_disabled_variant_response.json ├── product_list_page_by_code_response.json ├── product_list_page_by_code_without_disabled_product_variant_response.json ├── product_list_page_by_code_without_disabled_products_response.json ├── product_list_page_by_slug_response.json ├── product_list_page_by_slug_without_disabled_product_response.json ├── product_list_page_by_slug_without_disabled_product_variants_response.json ├── product_review_list_page_by_code_response.json ├── product_review_list_page_by_slug_response.json ├── product_t_shirt_list_page_by_code_response.json ├── product_t_shirt_list_page_by_slug_response.json ├── product_with_attributes_details_page.json ├── product_with_options_details_page.json ├── product_with_variant_details_page.json ├── product_with_variant_details_without_disabled_product_variant_page.json ├── product_without_taxons_details_page.json └── simple_product_details_page.json ├── reviews ├── add_review_failed_email.json └── add_review_failed_rating.json └── taxon ├── all_taxons_response.json ├── german_all_taxons_response.json ├── german_one_of_taxons_response.json ├── one_of_taxons_response.json └── strange_taxon_code_response.json /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Sylius/core-team 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /composer.lock 3 | /vendor/ 4 | /bin/* 5 | !/bin/.gitkeep 6 | 7 | .phpunit.result.cache 8 | /phpunit.xml 9 | -------------------------------------------------------------------------------- /bin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/bin/.gitkeep -------------------------------------------------------------------------------- /doc/Workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/doc/Workflow.png -------------------------------------------------------------------------------- /etc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/etc/.gitkeep -------------------------------------------------------------------------------- /phpspec.yml.dist: -------------------------------------------------------------------------------- 1 | suites: 2 | default: 3 | namespace: Sylius\ShopApiPlugin 4 | psr4_prefix: Sylius\ShopApiPlugin 5 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/phpstan/phpstan-webmozart-assert/extension.neon 3 | 4 | parameters: 5 | level: 6 6 | checkGenericClassInNonGenericObjectType: false 7 | checkMissingIterableValueType: false 8 | 9 | excludePaths: 10 | - src/DependencyInjection/Configuration.php 11 | 12 | ignoreErrors: 13 | - /^Access to an undefined property Symfony\\Component\\Validator\\Constraint::\$message\.$/ 14 | - '/Sylius\\Component\\Core\\Model\\(\w+), Sylius\\Component\\\w+\\Model\\\1 given\./' 15 | - '/Property Sylius\\ShopApiPlugin\\Request\\Customer\\UpdateCustomerRequest::\$birthday \(DateTimeImmutable\|null\) does not accept bool\|float\|int\|string\|null\./' 16 | - '/^Property Sylius\\ShopApiPlugin\\Request\\Cart\\(\w+)\:\:\$productCode \(string\) on left side of \?\? is not nullable\./' 17 | - '/^Expression on left side of \?\? is not nullable\./' 18 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ./tests/Application 6 | ./tests/DataFixtures 7 | ./tests/Responses 8 | 9 | 10 | 11 | 12 | ./tests 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /spec/Command/AddressBook/SetDefaultAddressSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ADDRESS_ID', 'user@email.com'); 21 | } 22 | 23 | function it_has_id(): void 24 | { 25 | $this->id()->shouldReturn('ADDRESS_ID'); 26 | } 27 | 28 | function it_has_user_email(): void 29 | { 30 | $this->userEmail()->shouldReturn('user@email.com'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spec/Command/Cart/AddCouponSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN', 'COUPON_CODE'); 21 | } 22 | 23 | public function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | 28 | public function it_has_coupon_code(): void 29 | { 30 | $this->couponCode()->shouldReturn('COUPON_CODE'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spec/Command/Cart/AssignCustomerToCartSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN', 'example@customer.com'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | 28 | function it_has_email(): void 29 | { 30 | $this->email()->shouldReturn('example@customer.com'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spec/Command/Cart/ChooseShippingMethodSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN', 1, 'DHL_SHIPPING_METHOD'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | 28 | function it_has_identifier_of_shipping(): void 29 | { 30 | $this->shipmentIdentifier()->shouldReturn(1); 31 | } 32 | 33 | function it_has_shipping_method_defined(): void 34 | { 35 | $this->shippingMethod()->shouldReturn('DHL_SHIPPING_METHOD'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spec/Command/Cart/CompleteOrderSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | 28 | function it_can_have_a_note(): void 29 | { 30 | $this->beConstructedWith('ORDERTOKEN', 'Some order notes'); 31 | 32 | $this->notes()->shouldReturn('Some order notes'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spec/Command/Cart/DropCartSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spec/Command/Cart/PickupCartSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN', 'CHANNEL_CODE'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | 28 | function it_has_channel_code(): void 29 | { 30 | $this->channelCode()->shouldReturn('CHANNEL_CODE'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spec/Command/Customer/EnableCustomerSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('example@customer.com'); 21 | } 22 | 23 | function it_has_email(): void 24 | { 25 | $this->email()->shouldReturn('example@customer.com'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spec/Command/Customer/GenerateResetPasswordTokenSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('example@customer.com'); 22 | } 23 | 24 | function it_is_initializable(): void 25 | { 26 | $this->shouldHaveType(GenerateResetPasswordToken::class); 27 | } 28 | 29 | function it_has_email(): void 30 | { 31 | $this->email()->shouldReturn('example@customer.com'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spec/Command/Customer/GenerateVerificationTokenSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('example@customer.com'); 22 | } 23 | 24 | function it_is_initializable(): void 25 | { 26 | $this->shouldHaveType(GenerateVerificationToken::class); 27 | } 28 | 29 | function it_has_email(): void 30 | { 31 | $this->email()->shouldReturn('example@customer.com'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spec/Command/Customer/SendOrderConfirmationSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN'); 21 | } 22 | 23 | function it_has_an_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spec/Command/Customer/VerifyAccountSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('RANDOMSTRINGAFNAKJFNAKNF'); 22 | } 23 | 24 | function it_is_initializable(): void 25 | { 26 | $this->shouldHaveType(VerifyAccount::class); 27 | } 28 | 29 | function it_has_email(): void 30 | { 31 | $this->token()->shouldReturn('RANDOMSTRINGAFNAKJFNAKNF'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spec/Event/CartPickedUpSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spec/Event/OrderCompletedSpec.php: -------------------------------------------------------------------------------- 1 | beConstructedWith('ORDERTOKEN'); 21 | } 22 | 23 | function it_has_order_token(): void 24 | { 25 | $this->orderToken()->shouldReturn('ORDERTOKEN'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Checker/ChannelExistenceCheckerInterface.php: -------------------------------------------------------------------------------- 1 | getChannel(), $product->getChannels()->toArray(), true); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Checker/ProductInCartChannelCheckerInterface.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 27 | $this->couponCode = $couponCode; 28 | } 29 | 30 | public function orderToken(): string 31 | { 32 | return $this->orderToken; 33 | } 34 | 35 | public function couponCode(): string 36 | { 37 | return $this->couponCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Command/Cart/AssignCustomerToCart.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 27 | $this->email = $email; 28 | } 29 | 30 | public function orderToken(): string 31 | { 32 | return $this->orderToken; 33 | } 34 | 35 | public function email(): string 36 | { 37 | return $this->email; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Command/Cart/CompleteOrder.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 27 | $this->notes = $notes; 28 | } 29 | 30 | public function orderToken(): string 31 | { 32 | return $this->orderToken; 33 | } 34 | 35 | public function notes(): ?string 36 | { 37 | return $this->notes; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Command/Cart/DropCart.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 24 | } 25 | 26 | public function orderToken(): string 27 | { 28 | return $this->orderToken; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Command/Cart/RemoveCoupon.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 24 | } 25 | 26 | public function orderToken(): string 27 | { 28 | return $this->orderToken; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Command/CommandInterface.php: -------------------------------------------------------------------------------- 1 | email = $email; 22 | } 23 | 24 | public function email(): string 25 | { 26 | return $this->email; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Command/Customer/GenerateResetPasswordToken.php: -------------------------------------------------------------------------------- 1 | email = $email; 24 | } 25 | 26 | public function email(): string 27 | { 28 | return $this->email; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Command/Customer/GenerateVerificationToken.php: -------------------------------------------------------------------------------- 1 | email = $email; 22 | } 23 | 24 | public function email(): string 25 | { 26 | return $this->email; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Command/Customer/SendOrderConfirmation.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 24 | } 25 | 26 | public function orderToken(): string 27 | { 28 | return $this->orderToken; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Command/Customer/SendResetPasswordToken.php: -------------------------------------------------------------------------------- 1 | email = $email; 27 | $this->channelCode = $channelCode; 28 | } 29 | 30 | public function email(): string 31 | { 32 | return $this->email; 33 | } 34 | 35 | public function channelCode(): string 36 | { 37 | return $this->channelCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Command/Customer/SendVerificationToken.php: -------------------------------------------------------------------------------- 1 | email = $email; 27 | $this->channelCode = $channelCode; 28 | } 29 | 30 | public function email(): string 31 | { 32 | return $this->email; 33 | } 34 | 35 | public function channelCode(): string 36 | { 37 | return $this->channelCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Command/Customer/VerifyAccount.php: -------------------------------------------------------------------------------- 1 | token = $token; 24 | } 25 | 26 | public function token(): string 27 | { 28 | return $this->token; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Command/LocaleAwareCommandInterface.php: -------------------------------------------------------------------------------- 1 | removeDefinition('sylius.listener.user_cart_recalculation'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Event/CartPickedUp.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 22 | } 23 | 24 | public function orderToken(): string 25 | { 26 | return $this->orderToken; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Event/OrderCompleted.php: -------------------------------------------------------------------------------- 1 | orderToken = $orderToken; 22 | } 23 | 24 | public function orderToken(): string 25 | { 26 | return $this->orderToken; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/EventListener/Messenger/OrderCompletedListener.php: -------------------------------------------------------------------------------- 1 | bus = $bus; 26 | } 27 | 28 | public function __invoke(OrderCompleted $orderCompleted): void 29 | { 30 | $this->bus->dispatch(new SendOrderConfirmation($orderCompleted->orderToken())); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Exception/ChannelNotFoundException.php: -------------------------------------------------------------------------------- 1 | priceViewClass = $priceViewClass; 24 | } 25 | 26 | /** @inheritdoc */ 27 | public function create(int $price, string $currency): PriceView 28 | { 29 | /** @var PriceView $priceView */ 30 | $priceView = new $this->priceViewClass(); 31 | $priceView->current = $price; 32 | $priceView->currency = $currency; 33 | 34 | return $priceView; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Factory/PriceViewFactoryInterface.php: -------------------------------------------------------------------------------- 1 | getValue(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Factory/Product/ProductAttributeValueViewResolver/ProductAttributeValueViewResolverInterface.php: -------------------------------------------------------------------------------- 1 | getTranslation($locale)->getSlug(); 21 | 22 | $taxon = $product->getMainTaxon(); 23 | 24 | return $taxon ? sprintf('%s/%s', $taxon->getTranslation($locale)->getSlug(), $breadcrumb) : $breadcrumb; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Generator/ProductBreadcrumbGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | customerProvider = $customerProvider; 24 | } 25 | 26 | public function provide(string $email): ProductReviewerInterface 27 | { 28 | return $this->customerProvider->provide($email); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Provider/ProductReviewerProviderInterface.php: -------------------------------------------------------------------------------- 1 | 17 | available: 18 | expose: true 19 | type: bool 20 | price: 21 | expose: true 22 | type: Sylius\ShopApiPlugin\View\PriceView 23 | originalPrice: 24 | expose: true 25 | type: Sylius\ShopApiPlugin\View\PriceView 26 | images: 27 | expose: true 28 | type: array 29 | -------------------------------------------------------------------------------- /src/Resources/config/services/checker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Resources/config/services/checker/channel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Resources/config/services/command_providers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Resources/config/services/command_providers/address_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | %sylius.shop_api.request.set_default_address.class% 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Resources/config/services/command_providers/product.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | %sylius.shop_api.request.add_product_review_by_code.class% 12 | 13 | 14 | 15 | 19 | %sylius.shop_api.request.add_product_review_by_slug.class% 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Resources/config/services/controllers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Resources/config/services/factories/address_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 11 | %sylius.shop_api.view.address.class% 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Resources/config/services/factories/customer.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 9 | %sylius.shop_api.view.customer.class% 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Resources/config/services/handler/address_book.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Resources/config/services/handler/order.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Resources/config/services/handlers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Resources/config/services/mapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Resources/config/services/queries.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Resources/config/services/repositories/cart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Resources/config/services/repositories/order.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Resources/config/services/shipping.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Resources/config/services/validators.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Resources/config/services/validators/order.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Resources/config/validation/address_book/SetDefaultAddressRequest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Resources/config/validation/cart/DropCartRequest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Resources/config/validation/cart/RemoveCouponRequest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Resources/config/validation/customer/GenerateResetPasswordTokenRequest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Resources/config/validation/customer/VerifyAccountRequest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Resources/translations/validators.de.yml: -------------------------------------------------------------------------------- 1 | sylius: 2 | shop_api: 3 | cart: 4 | not_exists: Warenkorb existiert nicht. 5 | -------------------------------------------------------------------------------- /src/Resources/views/Email/orderConfirmation.html.twig: -------------------------------------------------------------------------------- 1 | {% block subject %} 2 | Order confirmation 3 | {% endblock %} 4 | 5 | {% block body %} 6 | {% autoescape %} 7 | Your order no. {{ order.number }} has been successfully placed. 8 |

9 | Thank you for shopping at our store! 10 | {% endautoescape %} 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /src/Resources/views/Email/passwordReset.html.twig: -------------------------------------------------------------------------------- 1 | {% block subject %} 2 | Password reset 3 | {% endblock %} 4 | 5 | {% block body %} 6 | {% set url = url('sylius_shop_api_password_reset', {'channelCode': channelCode, 'token': user.passwordResetToken}) %} 7 | {% autoescape %} 8 |

Hello {{ user.username }}

9 | 10 | To reset your password - please visit {{ url|raw }} 11 |

12 | Regards, the Team. 13 | {% endautoescape %} 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /src/Resources/views/Email/verification.html.twig: -------------------------------------------------------------------------------- 1 | {% block subject %} 2 | Email address verification 3 | {% endblock %} 4 | 5 | {% block body %} 6 | {% set url = url('sylius_shop_api_user_verification', {'channelCode': channelCode, 'token': user.emailVerificationToken}) %} 7 | {% autoescape %} 8 | To verify your email address - please visit {{ url|raw }} 9 | {% endautoescape %} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /src/Shipping/ShippingCost.php: -------------------------------------------------------------------------------- 1 | price = $price; 25 | $this->currency = $currency; 26 | } 27 | 28 | public function price(): int 29 | { 30 | return $this->price; 31 | } 32 | 33 | public function currency(): string 34 | { 35 | return $this->currency; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Shipping/ShippingCostEstimatorInterface.php: -------------------------------------------------------------------------------- 1 | addCompilerPass(new RemoveUserCartRecalculationListenerPass()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Validator/Constraints/AddressExists.php: -------------------------------------------------------------------------------- 1 | amount = new PriceView(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/View/Cart/EstimatedShippingCostView.php: -------------------------------------------------------------------------------- 1 | method = new PaymentMethodView(); 30 | $this->price = new PriceView(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/View/Cart/ShippingMethodView.php: -------------------------------------------------------------------------------- 1 | price = new PriceView(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/View/Cart/TotalsView.php: -------------------------------------------------------------------------------- 1 | method = new ShippingMethodView(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/View/Customer/CustomerView.php: -------------------------------------------------------------------------------- 1 | product = new ProductView(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/View/PriceView.php: -------------------------------------------------------------------------------- 1 | links = new PageLinksView(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/View/Product/ProductAttributeValueView.php: -------------------------------------------------------------------------------- 1 | value = new VariantOptionValueView(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/View/Taxon/TaxonDetailsView.php: -------------------------------------------------------------------------------- 1 | = 11200) { 16 | return; 17 | } 18 | 19 | return static function (ContainerConfigurator $containerConfigurator) { 20 | $containerConfigurator->extension('swiftmailer', [ 21 | 'disable_delivery' => true, 22 | ]); 23 | }; 24 | -------------------------------------------------------------------------------- /tests/Application/config/packages/dev/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | web_profiler: 2 | toolbar: true 3 | intercept_redirects: false 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/doctrine.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # Adds a fallback DATABASE_URL if the env var is not set. 3 | # This allows you to run cache:warmup even if your 4 | # environment variables are not available yet. 5 | # You should not need to change this value. 6 | env(DATABASE_URL): '' 7 | 8 | doctrine: 9 | dbal: 10 | driver: 'pdo_mysql' 11 | server_version: '5.7' 12 | charset: UTF8 13 | 14 | url: '%env(resolve:DATABASE_URL)%' 15 | -------------------------------------------------------------------------------- /tests/Application/config/packages/doctrine_migrations.yaml: -------------------------------------------------------------------------------- 1 | doctrine_migrations: 2 | storage: 3 | table_storage: 4 | table_name: sylius_migrations 5 | migrations_paths: 6 | 'App\Migrations': '%kernel.project_dir%/src/Migrations/' 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/fos_rest.yaml: -------------------------------------------------------------------------------- 1 | fos_rest: 2 | exception: true 3 | view: 4 | formats: 5 | json: true 6 | xml: true 7 | empty_content: 204 8 | format_listener: 9 | rules: 10 | - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } 11 | - { path: '^/shop-api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } 12 | - { path: '^/', stop: true } 13 | -------------------------------------------------------------------------------- /tests/Application/config/packages/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | secret: '%env(APP_SECRET)%' 3 | form: true 4 | csrf_protection: true 5 | session: 6 | handler_id: ~ 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/jms_serializer.yaml: -------------------------------------------------------------------------------- 1 | jms_serializer: 2 | visitors: 3 | xml_serialization: 4 | format_output: '%kernel.debug%' 5 | -------------------------------------------------------------------------------- /tests/Application/config/packages/lexik_jwt_authentication.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | jwt_private_key_path: '%kernel.project_dir%/config/jwt/private-test.pem' 3 | jwt_public_key_path: '%kernel.project_dir%/config/jwt/public-test.pem' 4 | jwt_key_pass_phrase: 'heron' 5 | jwt_token_ttl: 3600 6 | 7 | lexik_jwt_authentication: 8 | private_key_path: '%jwt_private_key_path%' 9 | public_key_path: '%jwt_public_key_path%' 10 | pass_phrase: '%jwt_key_pass_phrase%' 11 | token_ttl: '%jwt_token_ttl%' 12 | -------------------------------------------------------------------------------- /tests/Application/config/packages/liip_imagine.yaml: -------------------------------------------------------------------------------- 1 | liip_imagine: 2 | resolvers: 3 | default: 4 | web_path: 5 | web_root: "%kernel.project_dir%/public" 6 | cache_prefix: "media/cache" 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/mailer.php: -------------------------------------------------------------------------------- 1 | extension('framework', [ 21 | 'mailer' => [ 22 | 'dsn' => '%env(MAILER_DSN)%', 23 | ], 24 | ]); 25 | }; 26 | -------------------------------------------------------------------------------- /tests/Application/config/packages/prod/jms_serializer.yaml: -------------------------------------------------------------------------------- 1 | jms_serializer: 2 | visitors: 3 | json_serialization: 4 | options: 5 | - JSON_UNESCAPED_SLASHES 6 | - JSON_PRESERVE_ZERO_FRACTION 7 | json_deserialization: 8 | options: 9 | - JSON_UNESCAPED_SLASHES 10 | - JSON_PRESERVE_ZERO_FRACTION 11 | -------------------------------------------------------------------------------- /tests/Application/config/packages/prod/monolog.yaml: -------------------------------------------------------------------------------- 1 | monolog: 2 | handlers: 3 | main: 4 | type: fingers_crossed 5 | action_level: error 6 | handler: nested 7 | nested: 8 | type: stream 9 | path: "%kernel.logs_dir%/%kernel.environment%.log" 10 | level: debug 11 | -------------------------------------------------------------------------------- /tests/Application/config/packages/routing.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | router: 3 | strict_requirements: ~ 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/stof_doctrine_extensions.yaml: -------------------------------------------------------------------------------- 1 | # Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html 2 | # See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/ 3 | stof_doctrine_extensions: 4 | default_locale: '%locale%' 5 | -------------------------------------------------------------------------------- /tests/Application/config/packages/swiftmailer.php: -------------------------------------------------------------------------------- 1 | = 11200) { 16 | return; 17 | } 18 | 19 | return static function (ContainerConfigurator $containerConfigurator) { 20 | $containerConfigurator->extension('swiftmailer', [ 21 | 'url' => '%env(MAILER_URL)%', 22 | ]); 23 | }; 24 | -------------------------------------------------------------------------------- /tests/Application/config/packages/sylius_shop_api.yaml: -------------------------------------------------------------------------------- 1 | sylius_shop_api: 2 | included_attributes: 3 | - "MUG_MATERIAL_CODE" 4 | - "JACKET_COLLECTION_CODE" 5 | - "JACKET_PFC_CODE" 6 | - "JACKET_MATERIAL_CODE" 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | test: ~ 3 | session: 4 | storage_factory_id: session.storage.factory.mock_file 5 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/mailer.php: -------------------------------------------------------------------------------- 1 | extension('framework', [ 21 | 'cache' => [ 22 | 'pools' => [ 23 | 'test.mailer_pool' => [ 24 | 'adapter' => 'cache.adapter.filesystem', 25 | ], 26 | ], 27 | ], 28 | ]); 29 | }; 30 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/monolog.yaml: -------------------------------------------------------------------------------- 1 | monolog: 2 | handlers: 3 | main: 4 | type: stream 5 | path: "%kernel.logs_dir%/%kernel.environment%.log" 6 | level: error 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/swiftmailer.php: -------------------------------------------------------------------------------- 1 | = 11200) { 16 | return; 17 | } 18 | 19 | return static function (ContainerConfigurator $containerConfigurator) { 20 | $containerConfigurator->extension('swiftmailer', [ 21 | 'disable_delivery' => true, 22 | 'logging' => true, 23 | 'spool' => [ 24 | 'type' => 'file', 25 | 'path' => '%kernel.cache_dir%/spool', 26 | ], 27 | ]); 28 | }; 29 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/sylius_theme.yaml: -------------------------------------------------------------------------------- 1 | sylius_theme: 2 | sources: 3 | test: ~ 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | web_profiler: 2 | toolbar: false 3 | intercept_redirects: false 4 | 5 | framework: 6 | profiler: { collect: false } 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/fos_rest.yaml: -------------------------------------------------------------------------------- 1 | fos_rest: 2 | exception: 3 | debug: true 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | test: ~ 3 | session: 4 | storage_factory_id: session.storage.factory.mock_file 5 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/mailer.php: -------------------------------------------------------------------------------- 1 | import(__DIR__ . '/../test/mailer.php'); 21 | }; 22 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/monolog.yaml: -------------------------------------------------------------------------------- 1 | monolog: 2 | handlers: 3 | main: 4 | type: stream 5 | path: "%kernel.logs_dir%/%kernel.environment%.log" 6 | level: error 7 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/swiftmailer.php: -------------------------------------------------------------------------------- 1 | = 11200) { 16 | return; 17 | } 18 | 19 | return static function (ContainerConfigurator $containerConfigurator) { 20 | $containerConfigurator->import(__DIR__ . '/../test/swiftmailer.php'); 21 | }; 22 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/sylius_channel.yaml: -------------------------------------------------------------------------------- 1 | sylius_channel: 2 | debug: true 3 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/sylius_theme.yaml: -------------------------------------------------------------------------------- 1 | sylius_theme: 2 | sources: 3 | test: ~ 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/test_cached/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | strict_variables: true 3 | -------------------------------------------------------------------------------- /tests/Application/config/packages/translation.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | default_locale: '%locale%' 3 | translator: 4 | paths: 5 | - '%kernel.project_dir%/translations' 6 | fallbacks: 7 | - '%locale%' 8 | - 'en' 9 | -------------------------------------------------------------------------------- /tests/Application/config/packages/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | paths: ['%kernel.project_dir%/templates'] 3 | debug: '%kernel.debug%' 4 | strict_variables: '%kernel.debug%' 5 | -------------------------------------------------------------------------------- /tests/Application/config/packages/twig_extensions.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | _defaults: 3 | public: false 4 | autowire: true 5 | autoconfigure: true 6 | 7 | # Uncomment any lines below to activate that Twig extension 8 | #Twig\Extensions\ArrayExtension: ~ 9 | #Twig\Extensions\DateExtension: ~ 10 | #Twig\Extensions\IntlExtension: ~ 11 | #Twig\Extensions\TextExtension: ~ 12 | -------------------------------------------------------------------------------- /tests/Application/config/packages/validator.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | validation: 3 | enable_annotations: true 4 | -------------------------------------------------------------------------------- /tests/Application/config/packages/webpack_encore.php: -------------------------------------------------------------------------------- 1 | extension('webpack_encore', [ 16 | 'output_path' => '%kernel.project_dir%/public/build', 17 | 'builds' => [ 18 | 'admin' => '%kernel.project_dir%/public/build/admin', 19 | 'shop' => '%kernel.project_dir%/public/build/shop', 20 | 'app.admin' => '%kernel.project_dir%/public/build/app/admin', 21 | 'app.shop' => '%kernel.project_dir%/public/build/app/shop', 22 | ], 23 | ]); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/Application/config/routes.yaml: -------------------------------------------------------------------------------- 1 | # Put your own routes here 2 | 3 | sylius_shop_api: 4 | resource: "@SyliusShopApiPlugin/Resources/config/routing.yml" 5 | 6 | sylius_shop_api_login_check: 7 | methods: [POST] 8 | path: /shop-api/login_check 9 | -------------------------------------------------------------------------------- /tests/Application/config/routes/dev/twig.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Application/config/routes/dev/twig.yaml -------------------------------------------------------------------------------- /tests/Application/config/routes/dev/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | -------------------------------------------------------------------------------- /tests/Application/config/routes/liip_imagine.yaml: -------------------------------------------------------------------------------- 1 | _liip_imagine: 2 | resource: "@LiipImagineBundle/Resources/config/routing.yaml" 3 | -------------------------------------------------------------------------------- /tests/Application/config/routes/sylius_admin.yaml: -------------------------------------------------------------------------------- 1 | sylius_admin: 2 | resource: "@SyliusAdminBundle/Resources/config/routing.yml" 3 | prefix: /admin 4 | -------------------------------------------------------------------------------- /tests/Application/config/services.yaml: -------------------------------------------------------------------------------- 1 | # Put parameters here that don't need to change on each machine where the app is deployed 2 | # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration 3 | parameters: 4 | locale: en_GB 5 | -------------------------------------------------------------------------------- /tests/Application/public/.htaccess: -------------------------------------------------------------------------------- 1 | DirectoryIndex app.php 2 | 3 | 4 | RewriteEngine On 5 | 6 | RewriteCond %{HTTP:Authorization} ^(.*) 7 | RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] 8 | 9 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 10 | RewriteRule ^(.*) - [E=BASE:%1] 11 | 12 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 13 | RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 14 | 15 | RewriteCond %{REQUEST_FILENAME} -f 16 | RewriteRule .? - [L] 17 | 18 | RewriteRule .? %{ENV:BASE}/index.php [L] 19 | 20 | 21 | 22 | 23 | RedirectMatch 302 ^/$ /index.php/ 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/Application/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Application/public/favicon.ico -------------------------------------------------------------------------------- /tests/Application/public/media/image/pants.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Application/public/media/image/pants.jpeg -------------------------------------------------------------------------------- /tests/Application/public/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | -------------------------------------------------------------------------------- /tests/Application/templates/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Application/templates/.gitignore -------------------------------------------------------------------------------- /tests/Application/translations/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Application/translations/.gitignore -------------------------------------------------------------------------------- /tests/Controller/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Controller/.gitkeep -------------------------------------------------------------------------------- /tests/DataFixtures/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/DataFixtures/.gitkeep -------------------------------------------------------------------------------- /tests/DataFixtures/ORM/country.yml: -------------------------------------------------------------------------------- 1 | Sylius\Component\Addressing\Model\Country: 2 | country_gb: 3 | code: GB 4 | 5 | Sylius\Component\Addressing\Model\Province: 6 | province_gb_scotland: 7 | name: Scotland 8 | code: GB-SCT 9 | country: '@country_gb' 10 | province_gb_wales: 11 | name: Wales 12 | code: GB-WLS 13 | country: '@country_gb' 14 | province_gb_northen_ireland: 15 | name: Northern Ireland 16 | code: GB-NIR 17 | country: '@country_gb' 18 | province_gb_england: 19 | name: England 20 | code: GB-ENG 21 | country: '@country_gb' 22 | -------------------------------------------------------------------------------- /tests/DataFixtures/ORM/mug_review.yml: -------------------------------------------------------------------------------- 1 | Sylius\Component\Core\Model\ProductReview: 2 | reviews_{1..20}: 3 | title: "Nice mug" 4 | rating: "" 5 | author: "@customer_oliver" 6 | status: "accepted" 7 | comment: "" 8 | reviewSubject: "@mug" 9 | bad_reviews_{1..5}: 10 | title: "Nice mug" 11 | rating: "" 12 | author: "@hater" 13 | status: "accepted" 14 | comment: "" 15 | reviewSubject: "@mug" 16 | -------------------------------------------------------------------------------- /tests/Mocks/TestChannelBasedCommand.php: -------------------------------------------------------------------------------- 1 | token = $token; 27 | $this->channelCode = $channelCode; 28 | } 29 | 30 | public function token(): string 31 | { 32 | return $this->token; 33 | } 34 | 35 | public function channelCode(): string 36 | { 37 | return $this->channelCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/Mocks/TestCommand.php: -------------------------------------------------------------------------------- 1 | token = $token; 24 | } 25 | 26 | public function token(): string 27 | { 28 | return $this->token; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Mocks/TestShopUserBasedCommand.php: -------------------------------------------------------------------------------- 1 | token = $token; 27 | $this->email = $email; 28 | } 29 | 30 | public function token(): string 31 | { 32 | return $this->token; 33 | } 34 | 35 | public function email(): string 36 | { 37 | return $this->email; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/Request/AddCouponRequestTest.php: -------------------------------------------------------------------------------- 1 | 'SUMMER_SALE'], ['token' => 'ORDERTOKEN'])); 27 | 28 | $this->assertEquals($pickupCartRequest->getCommand(), new AddCoupon('ORDERTOKEN', 'SUMMER_SALE')); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Request/DropCartRequestTest.php: -------------------------------------------------------------------------------- 1 | 'ORDERTOKEN'])); 27 | 28 | $this->assertEquals($request->getCommand(), new DropCart('ORDERTOKEN')); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Request/VerifyAccountRequestTest.php: -------------------------------------------------------------------------------- 1 | 'RANDOMSTRINGAFAFAKASNFJAFAJ'], [], [])); 27 | 28 | $this->assertEquals($request->getCommand(), new VerifyAccount('RANDOMSTRINGAFAFAKASNFJAFAJ')); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Responses/Expected/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sylius/ShopApiPlugin/e4c89e822046d26a04b13be22c1d176da2886c8a/tests/Responses/Expected/.gitkeep -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/SF5/validation_create_address_book_with_wrong_country_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "children": { 6 | "firstName": {}, 7 | "lastName": {}, 8 | "phoneNumber": {}, 9 | "company": {}, 10 | "countryCode": { 11 | "errors": [ 12 | "This value is not valid." 13 | ] 14 | }, 15 | "street": {}, 16 | "city": {}, 17 | "postcode": {} 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/SF5/validation_create_address_book_with_wrong_province_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "errors": [ 6 | "Please select proper province." 7 | ], 8 | "children": { 9 | "firstName": {}, 10 | "lastName": {}, 11 | "phoneNumber": {}, 12 | "company": {}, 13 | "countryCode": {}, 14 | "street": {}, 15 | "city": {}, 16 | "postcode": {}, 17 | "provinceCode": { 18 | "errors": [ 19 | "This value is not valid." 20 | ] 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/SF6/validation_create_address_book_with_wrong_country_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "children": { 6 | "firstName": [], 7 | "lastName": [], 8 | "phoneNumber": [], 9 | "company": [], 10 | "countryCode": { 11 | "errors": [ 12 | "The selected choice is invalid." 13 | ] 14 | }, 15 | "street": [], 16 | "city": [], 17 | "postcode": [] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/SF6/validation_create_address_book_with_wrong_province_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "errors": [ 6 | "Please select proper province." 7 | ], 8 | "children": { 9 | "firstName": [], 10 | "lastName": [], 11 | "phoneNumber": [], 12 | "company": [], 13 | "countryCode": [], 14 | "street": [], 15 | "city": [], 16 | "postcode": [], 17 | "provinceCode": { 18 | "errors": [ 19 | "The selected choice is invalid." 20 | ] 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/validation_create_address_book_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "children": { 6 | "firstName": { 7 | "errors": [ 8 | "Please enter first name." 9 | ] 10 | }, 11 | "lastName": { 12 | "errors": [ 13 | "Please enter last name." 14 | ] 15 | }, 16 | "phoneNumber": {}, 17 | "company": {}, 18 | "countryCode": { 19 | "errors": [ 20 | "Please select country." 21 | ] 22 | }, 23 | "street": { 24 | "errors": [ 25 | "Please enter street." 26 | ] 27 | }, 28 | "city": { 29 | "errors": [ 30 | "Please enter city." 31 | ] 32 | }, 33 | "postcode": { 34 | "errors": [ 35 | "Please enter postcode." 36 | ] 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/Responses/Expected/address_book/validation_create_address_book_with_wrong_province_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation Failed", 4 | "errors": { 5 | "errors": [ 6 | "Please select proper province." 7 | ], 8 | "children": { 9 | "firstName": {}, 10 | "lastName": {}, 11 | "phoneNumber": {}, 12 | "company": {}, 13 | "countryCode": {}, 14 | "street": {}, 15 | "city": {}, 16 | "postcode": {}, 17 | "provinceCode": { 18 | "errors": [ 19 | "This value is not valid." 20 | ] 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/add_multiple_products_to_cart_validation_error_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": [ 5 | { 6 | }, 7 | { 8 | "quantity": [ 9 | "sylius.shop_api.quantity.not_null" 10 | ] 11 | }, 12 | { 13 | "quantity": [ 14 | "sylius.shop_api.quantity.not_null" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/cart_after_deleting_an_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "tokenValue": "SDAOSLEFNWU35H3QLI5325", 3 | "channel": "WEB_GB", 4 | "currency": "GBP", 5 | "locale": "en_GB", 6 | "checkoutState": "cart", 7 | "items": [], 8 | "totals": { 9 | "total": 0, 10 | "items": 0, 11 | "taxes": 0, 12 | "shipping": 0, 13 | "promotion": 0 14 | }, 15 | "payments": [], 16 | "shipments": [], 17 | "cartDiscounts": [] 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/cart_and_country_does_not_exist_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "cartToken": [ 6 | "Cart does not exist." 7 | ], 8 | "countryCode": [ 9 | "The country does not exist." 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/cart_has_not_been_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Cart with given id does not exists" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/cart_item_has_not_been_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "id": [ 6 | "Cart item does not exist." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/deprecated_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "tokenValue": "SDAOSLEFNWU35H3QLI5325", 3 | "channel": "WEB_GB", 4 | "currency": "GBP", 5 | "locale": "en_GB", 6 | "checkoutState": "cart", 7 | "items": [], 8 | "totals": { 9 | "total": 0, 10 | "items": 0, 11 | "taxes": 0, 12 | "shipping": 0, 13 | "promotion": 0 14 | }, 15 | "payments": [], 16 | "shipments": [], 17 | "cartDiscounts": [] 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "tokenValue": "@string@", 3 | "channel": "WEB_GB", 4 | "currency": "GBP", 5 | "locale": "en_GB", 6 | "checkoutState": "cart", 7 | "items": [], 8 | "totals": { 9 | "total": 0, 10 | "items": 0, 11 | "taxes": 0, 12 | "shipping": 0, 13 | "promotion": 0 14 | }, 15 | "payments": [], 16 | "shipments": [], 17 | "cartDiscounts": [] 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/empty_response_de_DE.json: -------------------------------------------------------------------------------- 1 | { 2 | "tokenValue": "@string@", 3 | "channel": "WEB_GB", 4 | "currency": "GBP", 5 | "locale": "de_DE", 6 | "checkoutState": "cart", 7 | "items": [], 8 | "totals": { 9 | "total": 0, 10 | "items": 0, 11 | "taxes": 0, 12 | "shipping": 0, 13 | "promotion": 0 14 | }, 15 | "payments": [], 16 | "shipments": [], 17 | "cartDiscounts": [] 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/estimated_shipping_cost_bases_on_country_and_province_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "price": { 3 | "current": 500, 4 | "currency": "GBP" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/estimated_shipping_cost_bases_on_country_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "price": { 3 | "current": 1500, 4 | "currency": "GBP" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/product_not_in_cart_channel.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "sylius.shop_api.product.not_in_cart_channel" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/product_option_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "sylius.shop_api.product_option.exists" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_and_cart_item_not_exist_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Cart does not exist." 7 | ], 8 | "id": [ 9 | "Cart item does not exist." 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "cartToken": [ 6 | "sylius.shop_api.checkout.cart.empty" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_item_not_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "id": [ 6 | "sylius.shop_api.cart_item.product.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_item_not_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "sylius.shop_api.checkout.cart.empty" 7 | ], 8 | "id": [ 9 | "Cart item does not exist." 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_item_variant_not_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "id": [ 6 | "sylius.shop_api.cart_item.product_variant.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_not_exists_in_german_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Warenkorb existiert nicht." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_cart_not_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Cart does not exist." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_channel_not_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "channel": [ 6 | "sylius.shop_api.channel.not_exists" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_channel_not_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "channel": [ 6 | "sylius.shop_api.channel.not_null", 7 | "sylius.shop_api.channel.not_exists" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_coupon_not_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "coupon": [ 6 | "sylius.shop_api.coupon.not_valid", 7 | "sylius.shop_api.coupon.not_null" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_coupon_not_valid_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "coupon": [ 6 | "sylius.shop_api.coupon.not_valid" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_non_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "sylius.shop_api.product.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_not_configurable_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "The product is not configurable." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_not_defined_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "sylius.shop_api.product.not_null", 7 | "sylius.shop_api.product.not_exists" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_not_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "sylius.shop_api.product.not_exists" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_not_simple_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "productCode": [ 6 | "The product is not a simple product." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_variant_non_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "variantCode": [ 6 | "sylius.shop_api.product_variant.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_product_variant_not_exists_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "variantCode": [ 6 | "sylius.shop_api.product_variant.exists" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_quantity_lower_than_one_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "quantity": [ 6 | "sylius.shop_api.quantity.greater_than_0" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart/validation_token_already_used_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "There is already a cart with this token." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/cart_with_given_token_does_not_exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Cart with given token does not exist!" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/channel_has_not_been_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Channel with code SPACE_KLINGON has not been found." 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/all_countries_response.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": @integer@, 4 | "code": "GB", 5 | "name": "United Kingdom" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/cart_does_not_exist.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Cart does not exist." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/cart_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "sylius.shop_api.checkout.cart.empty" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/cart_failed_checkout_product_not_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code":400, 3 | "message":"Validation failed", 4 | "errors":{ 5 | "items[0].product.code":[ 6 | "sylius.shop_api.checkout.cart_item.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/cart_failed_checkout_product_variant_not_eligible_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code":400, 3 | "message":"Validation failed", 4 | "errors":{ 5 | "items[0].product.variants[0].code":[ 6 | "sylius.shop_api.checkout.cart_item_variant.non_eligible" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/cart_not_ready_for_checkout.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Please provide the cart with a shipping and billing address" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/get_available_payment_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "payments": [ 3 | { 4 | "methods": { 5 | "COD": { 6 | "code": "COD", 7 | "name": "Cash on delivery", 8 | "description": "@string@", 9 | "instructions": "@string@" 10 | }, 11 | "PBC": { 12 | "code": "PBC", 13 | "name": "Pay by check", 14 | "description": "@string@", 15 | "instructions": "@string@" 16 | } 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/get_available_payment_methods_failed.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "The payment methods cannot be resolved in the current state of cart!" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/get_available_shipping_methods_failed.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "The shipment methods cannot be resolved in the current state of cart!" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/non_existing_payment_method.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "method": [ 6 | "The selected payment method is not available for this cart.", 7 | "The selected payment method does not exist." 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/one_of_countries_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": @integer@, 3 | "name": "United Kingdom", 4 | "code": "GB", 5 | "provinces": [ 6 | { 7 | "id": @integer@, 8 | "code": "GB-ENG", 9 | "name": "England" 10 | }, 11 | { 12 | "id": @integer@, 13 | "code": "GB-NIR", 14 | "name": "Northern Ireland" 15 | }, 16 | { 17 | "id": @integer@, 18 | "code": "GB-SCT", 19 | "name": "Scotland" 20 | }, 21 | { 22 | "id": @integer@, 23 | "code": "GB-WLS", 24 | "name": "Wales" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /tests/Responses/Expected/checkout/payment_method_not_available.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "method": [ 6 | "The selected payment method is not available for this cart." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/bad_credentials_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 401, 3 | "message": "Invalid credentials." 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/customer_log_in_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "@string@" 3 | } 4 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/logged_in_customer_details_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "@integer@", 3 | "firstName": "Oliver", 4 | "lastName": "Queen", 5 | "email": "oliver@queen.com", 6 | "gender": "m", 7 | "birthday": "@string@.isDateTime()", 8 | "phoneNumber": "0212115512", 9 | "subscribedToNewsletter": false 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/request_reset_password_empty_email.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "Please enter your email." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/request_reset_password_failed_email.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "This email is invalid." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/update_customer.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "@integer@", 3 | "firstName": "New name", 4 | "lastName": "New lastName", 5 | "email": "oliver@queen.com", 6 | "birthday": "@string@.isDateTime()", 7 | "gender": "m", 8 | "phoneNumber": "0918972132", 9 | "subscribedToNewsletter": true 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_email_not_defined_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "sylius.shop_api.email.not_null", 7 | "There is no user with this email address" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_email_not_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "There is no user with this email address" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_email_not_valid_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "sylius.shop_api.email.not_valid", 7 | "There is no user with this email address" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_empty_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "firstName": [ 6 | "Please enter your first name.", 7 | "First name must be at least 2 characters long." 8 | ], 9 | "lastName": [ 10 | "Please enter your last name.", 11 | "Last name must be at least 2 characters long." 12 | ], 13 | "gender": [ 14 | "Please choose your gender.", 15 | "Please enter a valid gender" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_gender_not_valid_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "gender": [ 6 | "Please enter a valid gender" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_registration_data_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "Please enter your email." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/validation_registration_email_taken_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "This email is already used." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/verify_account_required_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "Please provide a token." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/customer/verify_account_token_not_exists.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "token": [ 6 | "The token does not exist." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/order/order_not_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "There is no placed order with with token NOT_EXISTING_TOKEN for customer with email oliver@queen.com" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/order/order_not_found_response_guest.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "There is no placed order with with token NOT_EXISTING_TOKEN" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/order/order_placed_by_registered_customer.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Order with token ORDER_PLACED_BY_REGISTERED_USER placed by a registered user" 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/product/channel_has_not_been_found_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Channel has not been found." 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/product/product_has_not_been_found_for_given_code_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Product with code WRONG_PRODUCT_CODE has not been found." 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/product/product_has_not_been_found_for_given_slug_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 404, 3 | "message": "Product with slug some-weird-stuff has not been found in en_GB locale." 4 | } 5 | -------------------------------------------------------------------------------- /tests/Responses/Expected/product/product_without_taxons_details_page.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "LOGAN_SHOES_CODE", 3 | "name": "Logan Shoes", 4 | "slug": "logan-shoes", 5 | "channelCode": "WEB_GB", 6 | "breadcrumb": "logan-shoes", 7 | "description": "Some description Lorem ipsum dolor sit amet.", 8 | "averageRating": 0, 9 | "taxons": { 10 | "others": [] 11 | }, 12 | "variants": [], 13 | "attributes": [], 14 | "associations": [], 15 | "images": [], 16 | "_links": { 17 | "self": { 18 | "href": "\/shop-api\/products\/by-slug\/logan-shoes" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Responses/Expected/reviews/add_review_failed_email.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "email": [ 6 | "This value is not a valid email address." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/reviews/add_review_failed_rating.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 400, 3 | "message": "Validation failed", 4 | "errors": { 5 | "rating": [ 6 | "This value should be between 0 and 5." 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/Responses/Expected/taxon/strange_taxon_code_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "self": { 3 | "code": "de?lol=xd#boom", 4 | "name": "Yet another taxon", 5 | "slug": "yet_another_taxons", 6 | "description": "Some description Lorem ipsum dolor sit amet.", 7 | "position": 2, 8 | "children": [], 9 | "images": [] 10 | }, 11 | "parentTree": { 12 | "code": "de?lol=xd#boom", 13 | "name": "Yet another taxon", 14 | "slug": "yet_another_taxons", 15 | "description": "Some description Lorem ipsum dolor sit amet.", 16 | "position": 2, 17 | "children": [], 18 | "images": [] 19 | } 20 | } 21 | --------------------------------------------------------------------------------