Flexible E-Commerce Framework on top of Flamingo. Used to build E-Commerce "Portals" and connect it with the help of individual Adapters to other services.

Overview

Flamingo Commerce

Go Report Card Tests Release

With "Flamingo Commerce" you get your toolkit for building fast and flexible commerce experience applications.

A demoshop using the standalone adapters is online here https://demoshop.flamingo.me - you can also try the GraphQL support

What problems does Flamingo Commerce solve?

  • Modern Architecture: Break monolithic e-commerce architeture to allow scaling and maintainability.
  • Modern Architecture: Use it to build commerce for headless commerce solutions
  • Real time commerce: Build personalized experiences - without the need to cache rendered pages

What are the main design goals of Flamingo Commerce?

  • Performance: We do not want to rely on any frontend caching. Instead it is no problem to show every customer an individual experience.
  • Clean architecture: We use "domaind driven design" and "ports and adapters" to build a maintainable and clean application.
  • Suiteable for Microservice architectures: Adapters concept and various resilience concepts makes it easy to connect to other (micro) services.
  • Decoupled and flexible frontend development: Frontend development is decoupled from the "Backend for Frontend" - so that it is possible to use "any" frontend technology.
  • Testability: By providing "Fake Adapters" that provide test data, it is possible to test your application without external dependencies.
  • Great Developer Experience: :-)
  • Open Source: Flamingo Commerce and Flamingo is Open Source and will be.

Whats does Flamingo Commerce provide?

  • Different e-commerce Flamingo Modules for typical e-commerce domains: Each providing a separated bounded context with its „domain“, „application“ and „interface“ logic.

  • Using „ports and adapters“ to separate domain from technical details, all these modules can be used with your own „Adapters“ to interact with any API or microservice you want.

  • Some of the major Flamingo Commerce modules (bounded contexts) are:

    • product: Offering domain models for different product types. Supporting multiple prices (including loyalty prices) etc..
    • cart: Powerful cart domain model. Supporting multi delivery, multiple payment transactions, and a lot more.
    • search: Generic search service and features
    • checkout: Offering logic and interfaces for an example (default) checkout.
  • Each of the modules provide graphql support that you can use.

Flamingo Commerce is build on top of the Flamingo Framework so it makes sense that you read through the Flamingo docs also

Read more under docs.flamingo.me

Commerce Modules:

  • price:

    • Offers value objects for prices and charges - supporting calculations, rounding and splitting
    • GoDoc
    • Readme
  • product:

    • Offers domain models and interface logic for handling different product types
    • GoDoc
    • Readme
  • category:

    • Offers domain models and interface logic for category tree and category views
    • GoDoc
    • Readme
  • cart:

    • The cart module is one of the main modules in Flamingo Commerce. It offers domain models and logic for multi delivery, multi payment carts.
    • GoDoc
    • Readme
  • payment:

    • Offers a generic payment value objects as well as a generic web payment interface and comes with the "offlinepayment" gateway.
    • GoDoc
    • Readme
  • search:

    • Offers domain models and interface logic for generic search and search filters.
    • GoDoc
    • Readme
  • checkout:

    • Offers a default checkout implementation that can be used.
    • GoDoc
    • Readme
  • customer:

    • Offers domain models for customer
    • GoDoc
    • Readme
  • order:

    • Offers domain models for orders. For example to use it on a "My Orders" page.
    • GoDoc
    • Readme
  • w3cdatalayer:

    • Offers interface logic to render a Datalayer that can be used for e-commerce tracking
    • Readme

Flamingo Commerce Release Status

Flamingo Commerce API is Beta because we will still change the API (models and methods). You are encourages to use it but if you update you might need to adjust your code to the latest changes.

Setup

We recommend to use go modules, so you just need to add Flamingo Commerce to your main go file as import:

e.g. to use the product module add

import (
  "flamingo.me/flamingo-commerce/v3/product"
)

And then load the Module in your application bootstrap:

// main is our entry point
func main() {

	flamingo.App([]dingo.Module{
	    ...
		//flamingo-commerce modules
		new(product.Module),
		
	}, nil)
}

To update the dependency in go.mod run

go get flamingo.me/flamingo-commerce/v3

Demo

There is a demo: https://demoshop.flamingo.me

And the code is also published: https://github.com/i-love-flamingo/commerce-demo-carotene

Comments
  • checkout: Allow fully discounted carts to be placed.

    checkout: Allow fully discounted carts to be placed.

    Before, payment was always required even if the grand total of a cart was zero. Now, when no payment is required the order is being placed without payment processing. In the checkoutform, no payment selection is set in this case.

    • [x] Add changelog
    • [x] Fix float comparison issues (currently tests are failing)
    • [x] Move some code in tests to helper functions
    • [x] Move coupon logic from inmemory cart to integration test layer
    • [x] Check new standard place order
    opened by C4rter 8
  • Different formatting of attribute values returned by Value() and Values() of Attribute of BasicProductData

    Different formatting of attribute values returned by Value() and Values() of Attribute of BasicProductData

    Hi. While investigating a bug which was caused by the fact that Value() returns the raw value of the attribute but with whitespaces trimmed on both ends, I noticed that the Values() method returns a list of attribute values but the values do not have the whitespaces removed.

    https://github.com/i-love-flamingo/flamingo-commerce/blob/bf76717aebb7d4ea1e81bdd8acbe70a307b2f520/product/domain/productBasics.go#L225-L227

    and

    https://github.com/i-love-flamingo/flamingo-commerce/blob/bf76717aebb7d4ea1e81bdd8acbe70a307b2f520/product/domain/productBasics.go#L264-L273

    opened by richard-ra 5
  • checkout: optional cart validation before place order

    checkout: optional cart validation before place order

    When using the place order state machine, one of the first steps during the process is already validating the cart. Afterwards the cart is closed and stored inside the context store. When then later placing the order the OrderService performs the cart validation again.

    At this time the cart is already closed and if a validator tries to fetch the cart from the session, an empty cart returns which can lead to invalid validation results.

    opened by tessig 4
  • Add integrationtest

    Add integrationtest

    Adding Integrationtest that start a flamingo app with required modules and calls the expected urls.

    This will test:

    • flamingo-commerce modules boots up
    • all fake adapters exists
    • and we can add blackbox test based on them (PDP, add to cart etc)
    opened by danielpoe 4
  • cart: Fix Cart Merging

    cart: Fix Cart Merging

    1. It is hard to test cartService because of Authentication and the problem to mock it => add Interfaces

    2. Cart Merge currently has problems:

    • No BillingAddress is merged
    • AdditionalInfos are missing in Delivery
    • its not handled as a "detached transaction" and a canceled context might kick in
    opened by danielpoe 4
  • cart: always reserve an order id if requested

    cart: always reserve an order id if requested

    The CartService must always reserve a (new) orderID fetched from the PlaceOrderService if requested.

    The reciever ReserveOrderIDAndSave must not check if an order ID is already set on the cart.

    opened by masmrlar 4
  • Add cart restrictors

    Add cart restrictors

    The Restriction Service provides a port for implementing product restrictions. By using Dingo multibinding to cart.MaxQuantityRestrictor, you can add your own restriction to the service. The Restrict function returns the remaining allowed quantity or math.MaxInt32 for infinity.

    The Service itself consolidates all bound restrictors and returns the most restricting rule (this is the smallest quantity allowed by any restrictor). If all restrictors return infinity or there is no restrictor bound at all, an error of type *ErrNoRestriction is returned.

    enhancement 
    opened by carstendietrich 4
  • go.mod: update runc to v1.0.0-rc92

    go.mod: update runc to v1.0.0-rc92

    Resolves #305

    Nancy output:

    go list -json -m all | docker run --rm -i sonatypecommunity/nancy:latest sleuth
    Checking for updates...
    Already up-to-date.
    pkg:golang/github.com/coreos/[email protected]
    3 known vulnerabilities affecting installed version
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ [CVE-2020-15114] In etcd before versions 3.3.23 and 3.4.10, the etcd gateway is a simple TCP prox...                                                                                                                           ┃
    ┣━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Description        ┃ In etcd before versions 3.3.23 and 3.4.10, the etcd gateway is a simple TCP                                                                                                                               ┃
    ┃                    ┃ proxy to allow for basic service discovery and access. However, it is                                                                                                                                     ┃
    ┃                    ┃ possible to include the gateway address as an endpoint. This results in a                                                                                                                                 ┃
    ┃                    ┃ denial of service, since the endpoint can become stuck in a loop of                                                                                                                                       ┃
    ┃                    ┃ requesting itself until there are no more available file descriptors to                                                                                                                                   ┃
    ┃                    ┃ accept connections on the gateway.                                                                                                                                                                        ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ OSS Index ID       ┃ bba60acb-c7b5-4621-af69-f4085a8301d0                                                                                                                                                                      ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Score         ┃ 7.7/10 (High)                                                                                                                                                                                             ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Vector        ┃ CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H                                                                                                                                                              ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Link for more info ┃ https://ossindex.sonatype.org/vuln/bba60acb-c7b5-4621-af69-f4085a8301d0?component-type=golang&component-name=github.com%2Fcoreos%2Fetcd&utm_source=nancy-client&utm_medium=integration&utm_content=1.0.15 ┃
    ┗━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ [CVE-2020-15136] In ectd before versions 3.4.10 and 3.3.23, gateway TLS authentication is only ap...                                                                                                                           ┃
    ┣━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Description        ┃ In ectd before versions 3.4.10 and 3.3.23, gateway TLS authentication is                                                                                                                                  ┃
    ┃                    ┃ only applied to endpoints detected in DNS SRV records. When starting a                                                                                                                                    ┃
    ┃                    ┃ gateway, TLS authentication will only be attempted on endpoints identified                                                                                                                                ┃
    ┃                    ┃ in DNS SRV records for a given domain, which occurs in the                                                                                                                                                ┃
    ┃                    ┃ discoverEndpoints function. No authentication is performed against                                                                                                                                        ┃
    ┃                    ┃ endpoints provided in the --endpoints flag. This has been fixed in versions                                                                                                                               ┃
    ┃                    ┃ 3.4.10 and 3.3.23 with improved documentation and deprecation of the                                                                                                                                      ┃
    ┃                    ┃ functionality.                                                                                                                                                                                            ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ OSS Index ID       ┃ d373dc3f-aa88-483b-b501-20fe5382cc80                                                                                                                                                                      ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Score         ┃ 6.5/10 (Medium)                                                                                                                                                                                           ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Vector        ┃ CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N                                                                                                                                                              ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Link for more info ┃ https://ossindex.sonatype.org/vuln/d373dc3f-aa88-483b-b501-20fe5382cc80?component-type=golang&component-name=github.com%2Fcoreos%2Fetcd&utm_source=nancy-client&utm_medium=integration&utm_content=1.0.15 ┃
    ┗━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ [CVE-2020-15115] etcd before versions 3.3.23 and 3.4.10 does not perform any password length vali...                                                                                                                           ┃
    ┣━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Description        ┃ etcd before versions 3.3.23 and 3.4.10 does not perform any password length                                                                                                                               ┃
    ┃                    ┃ validation, which allows for very short passwords, such as those with a                                                                                                                                   ┃
    ┃                    ┃ length of one. This may allow an attacker to guess or brute-force users'                                                                                                                                  ┃
    ┃                    ┃ passwords with little computational effort.                                                                                                                                                               ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ OSS Index ID       ┃ 5def94e5-b89c-4a94-b9c6-ae0e120784c2                                                                                                                                                                      ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Score         ┃ 5.8/10 (Medium)                                                                                                                                                                                           ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ CVSS Vector        ┃ CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N                                                                                                                                                              ┃
    ┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    ┃ Link for more info ┃ https://ossindex.sonatype.org/vuln/5def94e5-b89c-4a94-b9c6-ae0e120784c2?component-type=golang&component-name=github.com%2Fcoreos%2Fetcd&utm_source=nancy-client&utm_medium=integration&utm_content=1.0.15 ┃
    ┗━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
    
    1 Vulnerable Packages
    
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ Summary                       ┃
    ┣━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┫
    ┃ Audited Dependencies    ┃ 291 ┃
    ┣━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫
    ┃ Vulnerable Dependencies ┃ 1   ┃
    ┗━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛
    

    This is related to https://github.com/i-love-flamingo/flamingo/issues/182 I assume

    A workflow for Nancy on PR's is also provided.

    opened by jeinfeldt 3
  • product: New GraphQL Commerce_Product schema

    product: New GraphQL Commerce_Product schema

    The goal of this PR is to have a unified GraphQL schema for Commerce_Product that makes it easier for consumers to display data for product variants and their related "configurable products".

    This is the proposed schema we are trying to achieve:

    type Product {
        __typename: String!, # __typename
        marketPlaceCode: String! #variants.[sku].baseData.marketPlaceCode
        media: Media, # teaserData.media
        price: ProductPrice, # teaserData.teaserPrice
        loyalty: {
            price: ProductLoyaltyPrice, # teaserData.teaserLoyaltyPriceInfo
            earning: ProductLoyaltyEarning # teaserData.teaserLoyaltyEarningInfo
        },
        title: String!, # variants.[sku].baseData.title
        categories: {
            main: # variants.[sku].baseData.MainCategory with fallback to Categories[0]
            all: # variants.[sku].baseData.Categories
        }
        retailer: {
            id: String, # variants.[sku].retailer.id ?
            title: String, # variants.[sku].retailer.title ?
        }
        brand: {
            id: String, # variants.[sku].brand.id ?
            title: String, # variants.[sku].brand.title ?
        }
        description: String ! #variants.[sku].baseData.description
        meta: {
            description: String !, #variants.[sku].baseData.attributes.getAttribute(key: "metaDescription").label
            title: String !, #variants.[sku].baseData.attributes.getAttribute(key: "metaTitle").label
            keywords: [String !], #variants.[sku].baseData.keywords
        }
        urlSlug: String!, #variants.[sku].baseData.attributes.getAttribute(key: "urlSlug").label
        deliveryOptions: [String!], #variants.[sku].baseData.attributes.getAttribute(key: "deliveryOptions").values
        channel: String!: #getIdentifier.split('-')[2] -> could potentially derived from SP request
        locale: String!: #getIdentifier.split('-')[1] -> could potentially derived from SP request
        limitations: Om3_ProductLimitations_Result! #variants.[sku].productLimitations
        attributes: Attributes #variants.[sku].baseData.attributes
    
        ... on Commerce_ConfigurableProductWithActiveVariant {
            variantMarketPlaceCode: String!
            activeVariationSelection: [ActiveVariationSelection!]
            variationSelections: [VariationSelection]
            baseConfigurableProduct: Commerce_ConfigurableProduct!
        }
    
        ... on Commerce_ConfigurableProduct {
            # NO_MATCH for all options
            # use first-best combination for all attributes to determine variantMarketPlaceCode
            variationSelections: [VariationSelection]
        }
    };
    
    type VariationSelection {
        code: String!
        label: String!
        options: [VariationSelectionOption]
    }
    
    type ActiveVariationSelection {
        attributeLabel: String!
        optionLabel: String!
    }
    
    type VariationSelectionOption {
        code: String!
        label: String!
        state: VariationSelectionOptionState!
        variantMarketPlaceCode: String!,
    }
    
    enum VariationSelectionOptionState {
        ACTIVE
        MATCH
        NO_MATCH
    }
    
    opened by tomraithel 3
  • Potential collision and risk from indirect dependence

    Potential collision and risk from indirect dependence "github.com/gotestyourself/gotestyourself"

    Background

    Repo i-love-flamingo/flamingo-commerce used the old path to import gotestyourself indirectly. This caused that github.com/gotestyourself/gotestyourself and gotest.tools coexist in this repo: https://github.com/i-love-flamingo/flamingo-commerce/blob/master/go.mod (Line 35 & 58)

    github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
    gotest.tools v2.2.0+incompatible
    

    That’s because the gotestyourself has already renamed it’s import path from "github.com/gotestyourself/gotestyourself" to "gotest.tools". When you use the old path "github.com/gotestyourself/gotestyourself" to import the gotestyourself, will reintroduces gotestyourself through the import statements "import gotest.tools" in the go source file of gotestyourself.

    https://github.com/gotestyourself/gotest.tools/blob/v2.2.0/fs/example_test.go#L8

    package fs_test
    import (
    	…
    	"gotest.tools/assert"
    	"gotest.tools/assert/cmp"
    	"gotest.tools/fs"
    	"gotest.tools/golden"
    )
    

    "github.com/gotestyourself/gotestyourself" and "gotest.tools" are the same repos. This will work in isolation, bring about potential risks and problems.

    Solution

    Add replace statement in the go.mod file:

    replace github.com/gotestyourself/gotestyourself => gotest.tools v2.2.0
    

    Then clean the go.mod.

    opened by KateGo520 3
  • Cart cleanup adapters

    Cart cleanup adapters

    Current problems:

    • there is no working emailadapter - name is misleading
    • the cart adpater has an inmemory storage - but the adapter itself is not "inmemory"

    Therefore this PR cleans this up and prepares at the same time that an additional module can provide a email adpater

    opened by danielpoe 3
  • chore(deps): update module github.com/swaggo/swag to v1.8.9

    chore(deps): update module github.com/swaggo/swag to v1.8.9

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/swaggo/swag | require | patch | v1.8.8 -> v1.8.9 |


    Release Notes

    swaggo/swag

    v1.8.9

    Compare Source

    Changelog

    a10fb9a Just optimize code about parsing extensions (#​1399) 4ccbeaf chore: increment version (#​1423) 8139731 chore: parse escaped double colon (\:) example struct tag (#​1402) 2c530ea chore: release candidate (#​1403) e3151c1 chore: release candidate (#​1404) e50db3e enhancement for enums (#​1400) 7c20f30 feat: parse only specific extension tag (#​1219) 80d5221 feat: support json tags in embedded structs (#​1396) 4519064 feat: use enums in request (#​1417) 9a4fa5d fix issue 1414 (#​1419) 30684a2 fix parsing bug affected by fmt (#​1398) 7867c24 fix: don't error on empty comment line (#​1415) dfce6c8 parse self-nested generic struct (#​1420) ba5df82 record token.FileSet for every file so that the position of parsing error can be acquired (#​1393) 3fe9ca2 revert docker login-action (#​1405)


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update module github.com/go-test/deep to v1.1.0

    chore(deps): update module github.com/go-test/deep to v1.1.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/go-test/deep | require | minor | v1.0.8 -> v1.1.0 |


    Release Notes

    go-test/deep

    v1.1.0

    Compare Source


    v1.0.9

    Compare Source

    • Fixed issue #​45: Panic when comparing errors in unexported fields (PR #​54) (@​seveas)
    • Fixed issue #​46: Functions are handled differently from reflect.DeepEqual (PR #​55) (@​countcb)
    • Updated matrix to go1.17, go1.18, and go1.19 and moved testing to GitHub Actions

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update module flamingo.me/graphql to v1.9.0

    chore(deps): update module flamingo.me/graphql to v1.9.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | flamingo.me/graphql | require | minor | v1.8.0 -> v1.9.0 |


    Release Notes

    i-love-flamingo/graphql

    v1.9.0

    Compare Source

    Features
    Fixes
    Ops and CI/CD
    Chores and tidying
    • deps: update module github.com/99designs/gqlgen to v0.17.21 (#​50) (8104cfd)
    • deps: update module flamingo.me/dingo to v0.2.10 (#​48) (a6b9ed5)
    • deps: update module flamingo.me/flamingo/v3 to v3.4.0 (#​47) (a169a56)
    • deps: update module github.com/spf13/cobra to v1.6.1 (#​46) (97c0f19)
    • deps: update module github.com/99designs/gqlgen to v0.17.20 (#​42) (c08c353)
    • bump to go 1.19 (5483683)
    • deps: update module github.com/99designs/gqlgen to v0.17.15 (#​40) (2b6063a)
    • deps: update module github.com/vektah/gqlparser/v2 to v2.4.8 (#​39) (5056b96)
    • deps: update module github.com/vektah/gqlparser/v2 to v2.4.7 (#​38) (4586516)
    • deps: update module github.com/99designs/gqlgen to v0.17.13 (#​36) (982ec0c)
    • deps: update module github.com/spf13/cobra to v1.5.0 (bf1bf6e)
    • deps: update module github.com/99designs/gqlgen to v0.17.12 (61f0127)
    • deps: update module github.com/vektah/gqlparser/v2 to v2.4.6 (200c5c6)
    • deps: update module github.com/99designs/gqlgen to v0.17.10 (#​30) (984798f)
    • deps: update module github.com/vektah/gqlparser/v2 to v2.4.5 (#​31) (604c232)
    • deps: update module github.com/99designs/gqlgen to v0.17.6 (#​28) (3826079)
    • deps: update module github.com/vektah/gqlparser/v2 to v2.4.3 (#​29) (c69f8af)
    • deps: update actions/checkout action to v3 (#​24) (de0e0a4)
    • deps: update actions/setup-go action to v3 (#​25) (64f0d69)
    Other

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update module golang.org/x/text to v0.6.0

    chore(deps): update module golang.org/x/text to v0.6.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/text | require | minor | v0.4.0 -> v0.6.0 |


    Release Notes

    golang/text

    v0.6.0

    Compare Source

    v0.5.0

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update module github.com/99designs/gqlgen to v0.17.22

    chore(deps): update module github.com/99designs/gqlgen to v0.17.22

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/99designs/gqlgen | require | patch | v0.17.20 -> v0.17.22 |


    Release Notes

    99designs/gqlgen

    v0.17.22

    Compare Source

    a44685b2 Ability to return multiple errors from resolvers raise than add it to stack. (#​2454)
    • Remove DO NOT EDIT

    Sometimes vscode warn about this while editing resolvers code. Finally the resolver's code is editable and generated at the same time.

    • Ability to return multiple errors from resolver.

    • Multiple errors return example

    • Fix missing import

    • reformat

    • gofmt

    • go generate ./...

    • go generate ./...

    • Regenerate

    • remove trailing period

    db1e3b81 Implicit external check (#​2449)
    • Prevent entity resolver generation for stub types. In Federation 2 key fields are implicitly external

    • Add more comments to "isResolvable"

    • Check that no resolvers are set for stub "Hello"

    • Run generate with go 1.16

    • Simplify implicit external check

    • Add stricter federation version check. Update comment on expected behavior of the resolvable argument. Add comment to documentation about external directive.

    • Preallocate keyFields slice

    • Add non stub type to federation v2 test

    • Do not append to preallocated slice

    • Add test coverage for multiple fields in key

    • Fix typo in comment

    • 5065163 Re-generate and update release checklist to regenerate for new version

    • 5cfc22d Add v0.17.21 Release notes

    • 5d39046 v0.17.21 postrelease bump

    v0.17.21

    Compare Source

    5c083c79 use goField directive for getters generation (#​2447)
    • consider goField directive for getters generation

    • Re-generate to pass linting

    463d2134 fix: safe http error response (#​2438)
    • safe http error when parsing body

    • fix tests

    • fix linting

    • fix linting

    • Dispatch decoding errors so hook can present them

    • Revert test expectation to original

    86c144fc Bump decode-uri-component from 0.2.0 to 0.2.2 in /integration (#​2445)

    Bumps decode-uri-component from 0.2.0 to 0.2.2.


    updated-dependencies:

    • dependency-name: decode-uri-component dependency-type: indirect ...
    f28ffccd Bump minimatch from 3.0.4 to 3.1.2 in /integration (#​2435)

    Bumps minimatch from 3.0.4 to 3.1.2.


    updated-dependencies:

    • dependency-name: minimatch dependency-type: indirect ...
    efb31b54 Check if go.mod exists while init (#​2432)
    • Add check go.mod first to prevent cascade errors in "init" directive

    • Fix formatting

    • Fix formatting with gofmt

    This reverts commit c23d183.

    • Adjust go.mod file to look in parent directories as well
    89e91da1 Add resolver commit (#​2434)
    • Add resolver commit

    • Add version to comment and re-generate

    906c0dee optional return pointers in unmarshalInput (#​2397)
    • optional return pointers in unmarshalInput

    • add docs for return_pointers_in_unmarshalinput

    a9d06036 Add json.Number support to UnmarshalString (#​2396)
    • Add json.Number support to UnmarshalString

    • Add UnmarshalString tests

    • Remove trailing zeros when calling UnmarshalString with float64

    daa44079 Update README.md (#​2391)

    fix: execute gqlgen generate command error. eg: systems failed: unable to build object definition: unable to find type: github.com/99designs/gqlgen/graphql/introspection.InputValue. need import github.com/99designs/gqlgen/graphql/introspection .

    419dd96c Bump got and [@​graphql](https://togithub.com/graphql)-codegen/cli in /integration (#​2389)

    Removes got


    updated-dependencies:

    • dependency-name: got dependency-type: indirect dependency-type: direct:development ...
    265888c6 Bump jsdom and jest in /integration (#​2388)

    Bumps jsdom and jest. These dependencies needed to be updated together.

    Removes jsdom

    Updates jest from 24.9.0 to 29.0.3


    updated-dependencies:

    • dependency-name: jsdom dependency-type: indirect
    • dependency-name: jest dependency-type: direct:development ...
    56f6db04 Update module mitchellh/mapstructure to 1.5.0 (#​2111)
    • Update mitchellh/mapstructure

    • Avoid double pointer

    • ea9590a update changelog for v0.17.20

    • 4c06e6c v0.17.20 postrelease bump


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v3.5.0)
  • v3.5.0(Nov 8, 2021)

    general

    • Switch to MIT License

    cart

    • Add convenience function to clone carts
    • DefaultCartBehaviour now returns real cart clones to prevent data races on cart fields
    • API
      • Breaking: Update DELETE /api/v1/cart to actually clean the whole cart not only removing the cart items (introduces new route for the previous behaviour, see below)
      • Add new endpoint DELETE /api/v1/cart/deliveries/items to be able to remove all cart items from all deliveries but keeping delivery info and other cart data untouched
    • Add new method SumShippingGrossWithDiscounts to the cart domain which returns gross shipping costs for the cart
    • When using the ItemSplitter to split items in items with single qty (SplitInSingleQtyItems) the split discounts are reversed to make splitting the row total stable.
    • Breaking: SumTotalTaxAmount now takes taxes on shipping costs into account
    • Breaking: Delivery discount sum calculations SumTotalDiscountAmount, SumNonItemRelatedDiscountAmount, SumItemRelatedDiscountAmount now take discount on shipping costs into account
      • Old calculation is now in SumSubTotalDiscountAmount.
    • CartService
      • Add UpdateAdditionalData to be able to set additional data to cart
      • Add UpdateDeliveryAdditionalData to be able to set additional data to the delivery info
      • Introduce new interface to be able to easier mock the whole CartService
      • Add auto generated mockery mock for the CartService
      • Add new field PriceGross of shippingItem to directly get the shipping cost incl tax (must be filled by cart adapter)
    • GraphQL:
      • Add new method sumShippingGrossWithDiscounts to the Commerce_DecoratedCart type
      • Add new field sumShippingGross to the Commerce_DecoratedCart type
      • Add new field priceGross to the Commerce_Cart_ShippingItem type
      • Add new mutation Commerce_Cart_UpdateAdditionalData
      • Add new mutation Commerce_Cart_UpdateDeliveriesAdditionalData
      • Add new field customAttributes to the Commerce_CartAdditionalData type
      • Add new field additionalData to the Commerce_CartDeliveryInfo type
      • Add new type Commerce_Cart_CustomAttributes with method for getting key/value pairs
      • Breaking: Make naming convention consistent in graphql schema Commerce_Cart_*
      • Breaking: Remove the fields getAdditionalData, additionalDataKeys, additionalDeliveryInfoKeys from the Commerce_CartDeliveryInfo type
      • Breaking: Commerce_Cart_UpdateDeliveryShippingOptions mutation responded with slice of Commerce_Cart_DeliveryAddressForm which was incorrect as we don't process any form data within the mutation. It responds now rightly only with processed state.
    • Breaking: Upgrade github.com/go-playground/form to v4, all types are fully compatible, but import paths have to be changed

    checkout

    • Introducing Flamingo events on final states of the place order process
    • Introduce a max ttl for the checkout state machine to avoid polluting the redis with stale checkout processes, defaults to 2h
    • Checkout controller: force new order id reservation if an early place happened and there was a payment issue
    • API
      • In case of an invalid cart during place order process we now expose the cart validation result, affected endpoints:
        GET /api/v1/checkout/placeorder
        POST /api/v1/checkout/placeorder/refresh
        POST /api/v1/checkout/placeorder/refresh-blocking
        
    • Add new Flow Action PaymentFlowActionTriggerClientSDK to the checkout
    • Breaking: Upgrade github.com/go-playground/form to v4, all types are fully compatible, but import paths have to be changed

    customer

    • Add mockery mocks for both Customer / CustomerIdentityService for easier testing
    • Add State field to customer address to be closer to cart address type, expose via GraphQL

    price

    • When marshalling domain.Price to JSON the amount is rounded.
    • Fix various rounding issues with negative prices, add all rounding modes and examples to moduel readme.

    product

    • Enhance the PriceContext to allow potential delivery specific pricing
    • GraphQL:
      • Breaking: Change activeBase of Commerce_Product_PriceInfo from Float to Commerce_Price
      • Add availablePrices to the Commerce_Product interface to display potential pricing options in the frontend
      • Add context to the Commerce_Product_PriceInfo model to be able to differ between prices
    Source code(tar.gz)
    Source code(zip)
  • v3.4.0(Feb 11, 2021)

    cart

    • Added desired time to DeliveryForm

    • InMemoryCartStorage: initialize lock and storage already in Inject() to avoid potential race conditions

    • API

      • Add endpoints for deleting / updating a item in the cart (DELETE/PUT: /api/v1/cart/delivery/{deliveryCode}/item)
      • Breaking: Affects v1 prefixed routes, switched to a more RESTful naming and use of the correct HTTP verbs to mark idempotent operations
        • | old HTTP verb | old route | new HTTP verb | new route | |--------------:|----------------------------------------------------|---------------|--------------------------------------------| | POST | /api/v1/cart/delivery/{deliveryCode}/additem | POST | /api/v1/cart/delivery/{deliveryCode}/item | | POST/PUT | /api/v1/cart/applyvoucher | POST | /api/v1/cart/voucher | | POST/DELETE | /api/v1/cart/removevoucher | DELETE | /api/v1/cart/voucher | | POST/PUT | /api/v1/cart/applygiftcard | POST | /api/v1/cart/gift-card | | POST | /api/v1/cart/applycombinedvouchergift | POST | /api/v1/cart/voucher-gift-card | | POST | /api/v1/cart/removegiftcard | DELETE | /api/v1/cart/gift-card | | POST | /api/v1/cart/billing | PUT | /api/v1/cart/billing | | POST | /api/v1/cart/delivery/{deliveryCode}/deliveryinfo | PUT | /api/v1/cart/delivery/{deliveryCode} | | PUT | /api/v1/cart/updatepaymentselection | PUT | /api/v1/cart/payment-selection |
    • GraphQL

      • Update schema and resolver regarding desired time

    category

    • Added cue config to module
    • Update fake service documentation
    • FakeService
      • The category fake service was added which can return a project specific category tree and categories
      • Added configuration options are fakeService.enabled and fakeService.testDataFolder to enable the fake category service and to use json files as fake categories and tree. You can find examples in the documentation of the module

    checkout

    • Checkout Controller, update handling of aborted/canceled payments:
      • Cancel the order / restore the cart before generating the new idempotency key of the payment selection
    • Resolve goroutine leak in redis locker
    • Breaking Change StartPlaceOrder behaviour to always start a new one.
    • Breaking Change ClearPlaceOrderProcess behaviour to be always possible (no matter on which state)
    • API
      • Breaking: Affects v1 prefixed routes, switched to a more RESTful naming and use of the correct HTTP verbs to mark idempotent operations
        • | old HTTP verb | old route | new HTTP verb | new route | |--------------:|-----------------------------------------------|---------------|-----------------------------------------------| | POST | /api/v1/checkout/placeorder/refreshblocking | POST | /api/v1/checkout/placeorder/refresh-blocking |

    customer

    • GraphQL
      • Extend Commerce_Customer_Address with some useful fields
      • Extend Commerce_Customer_Result with a field for querying a specific address
      • Breaking:
        • Commerce_Customer_Address: rename field StreetNr to StreetNumber, lastname to lastName and firstname to firstName
        • Commerce_Customer_Result: defaultShippingAddress and defaultBillingAddress now can return null if there is no default address
        • Commerce_Customer_PersonData: field birthday is now nullable and of type Date.

    payment

    • Introduced wallet payment method

    product

    • Add support for product badges
    • GraphQL
      • Breaking New schema for products:
        • Commerce_Product has been restructured and now has three subtypes: Commerce_Product_SimpleProduct, Commerce_Product_ConfigurableProduct, Commerce_Product_ActiveVariantProduct
        • Product variant data, that has previously been buried in Commerce_ConfigurableProduct.variants, has been mapped to the toplevel of each product and can be accessed directly.
        • Both ActiveVariantProduct and ConfigurableProduct provide a new property named variationSelections which exposes a list of possible attribute combinations for the configurable.
    • FakeService
      • The product fake search service is now able to return products with an active variant via fake_configurable_with_active_variant. Variation attributes have been changed to only include color and size.
      • Added configuration option jsonTestDataFolder to use json files as fake products. You can find an example product under: test/integrationtest/projecttest/tests/graphql/testdata/products/json_simple.json
      • Added fakservice documentation to the product module.
      • The product fake search service is now able to return a specific product if the given query matches the marketplace code / name of the json file of the product
      • The product fake search service returns no products if it is queried with no-results
    • Expose VariantVariationAttributesSorting on domain.ConfigurableProductWithActiveVariant
    • Breaking: Update stock handling: Remove magic alwaysInStock product attribute. Just Rely BasicProductData.StockLevel field instead.

    sourcing

    • Breaking
      • Optional pointer DeliveryInfo added as parameter to StockProvider.GetStock

    docs

    • Embed swagger.json via go-bindata, so it can be used from the outside
    Source code(tar.gz)
    Source code(zip)
  • v3.3.0(Aug 12, 2020)

    This release mainly focuses on improving existing GraphQL queries/mutations, general maintenance, and the switch from the deprecated oauth module to the new auth implementation.

    product

    • Switch module config to CUE
    • Extended product model with loyalty earnings
    • Added Rest API route to get products
    • GraphQL
      • Added values field of Attribute to the schema
      • exposed loyalty earnings
      • Added facets to fake search service
    • Expose unit of product variant attributes
    • fake: add loyalty pricing for fake_simple product, introduced fake_fixed_simple_without_discounts product

    cart

    • Breaking: Moved to new flamingo auth module, breaks several interfaces which previously relied on the OAuth module
    • Breaking
      • Cart item validation now requires the decorated cart to be passed to assure that validators don't rely on a cart from any other source (e.g. session)
      • Session added as a parameter to interface method MaxQuantityRestrictor.Restrict
      • Session added as a parameter to RestrictionService.RestrictQty
      • Changed no cache entry found error for cartCache Invalidate, Delete and DeleteAll to ErrNoCacheEntry
    • Switch module config to CUE
    • GraphQL
      • Add new mutation to set / update one or multiple delivery addresses Commerce_Cart_UpdateDeliveryAddresses
      • Add new mutation to update the shipping options (carrier / method) of an existing delivery Commerce_Cart_UpdateDeliveryShippingOptions
      • Add new mutation to clean current users cart Commerce_Cart_Clean
      • Add new query to check if a product is restricted in terms of the allowed quantity Commerce_Cart_QtyRestriction
      • Add new field sumPaymentSelectionCartSplitValueAmountByMethods to the Commerce_Cart_Summary which sums up cart split amounts of the payment selection by the provided methods.
      • Expose PaymentSelection.CartSplit() via GraphQL, add new types Commerce_Cart_PaymentSelection_Split and Commerce_Cart_PaymentSelection_SplitQualifier
      • Breaking: renamed the following GraphQL types
        • type Commerce_Cart_BillingAddressFormData is now Commerce_Cart_AddressForm
        • input Commerce_BillingAddressFormInput is now Commerce_Cart_AddressFormInput
        • type Commerce_Charge is now Commerce_Price_Charge
        • type Commerce_ChargeQualifier is now Commerce_Price_ChargeQualifier
        • input Commerce_ChargeQualifierInput is now Commerce_Price_ChargeQualifierInput
    • Adjusted log level for cache entry not found error when trying to delete the cached cart

    customer

    • Breaking: renamed GetId to GetID in domain.Customer interface
    • introduced new CustomerIdentityService to retrieve authenticated customers by auth.Identity
    • Breaking: removed CustomerService please use CustomerIdentityService
    • GraphQL: Add new customer queries:
      • Commerce_Customer_Status returns the customer's login status
      • Commerce_Customer returns the logged-in customer

    checkout

    • Deprecate Sourcing service port in checkout (activate if required with setting commerce.checkout.activateDeprecatedSourcing)
    • Make cart validation before place order optional with configuration
    • State Machine
      • Add additional metrics to monitor place order flow
        • flamingo_commerce_checkout_placeorder_starts
        • flamingo_commerce_checkout_placeorder_state_run_count
        • flamingo_commerce_checkout_placeorder_state_failed_count
      • Add a step to validate the payment selection if needed. The step provides a port to be implemented if needed.
    • Expose place order endpoints also via rest
    • Checkout controller, update to the error handling:
      • In case of a payment error, the checkout controller will now redirect to the checkout/review action instead of just rendering the matching template on the current route.
      • Same applies in case of an error during place order, the checkout controller will now redirect to the checkout step.
      • In both cases the error will be stored as a flash message in the session before redirecting, the target action will then receive it and pass it to the template view data.

    search

    • Switch module config to CUE
    • Update pagination module configuration. Use commerce.pagination namespace for configuration now.
    • GraphQL
      • Breaking simplified Commerce_Search_SortOption type
      • Breaking use GraphQL specific search result type
      • Added facets resolver

    category

    • GraphQL
      • Breaking moved GraphQL dto package to categorydto

    docs

    • Add Swagger/OpenAPI 2.0 specification to project, using swaggo/swag sourcing
    • Add a new "sourcing" module that can be used standalone. See sourcing/Readme.md for more details

    w3cdatalayer

    • Breaking: Switch from flamingo oauth module to the new auth module, to keep w3cdatalayer working please configure the new auth module accordingly

    order

    • Breaking: removed interface CustomerOrderService please use CustomerIdentityOrderService
    • Update config path: order.useFakeAdapters to commerce.order.useFakeAdapter
    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Apr 9, 2020)

    w3cdatalayer

    • Fixed a bug that causes the datalayer to panic if it failed to build an absolute url
    • Introduced a configuration option to choose between base64url and hex encoding for the hashed values
    • Move config to commerce namespace, from w3cDatalayer to commerce.w3cDatalayer
    • Add legacy config mapping so old mappings can still be used
    • Add cue based config to have config validation in place

    checkout

    • Controller
      • Allow checkout for fully discounted carts without payment processing. Previously all checkouts needed a valid payment to continue. In case there is nothing to pay this can be skipped.
        • Order ID will be reserved as soon as the user hits the checkout previously it was done before starting the payment
    • GraphQL
      • Update place order process to also allow zero carts which don't need payment, this leads to a state flow that lacks the payment steps. See module readme for further details.
    • Update source service to support external location codes.
      • Adds ExternalLocationCode to the Source struct.
      • Update SetSourcesForCartItems() to use the new SourcingServiceDetail functionality if the bound service implements the interface
    • Update OrderService to expose more metrics regarding the place order process:
      flamingo-commerce/checkout/orders/cart_validation_failed
      flamingo-commerce/checkout/orders/no_payment_selection
      flamingo-commerce/checkout/orders/payment_gateway_not_found
      flamingo-commerce/checkout/orders/payment_flow_status_error
      flamingo-commerce/checkout/orders/order_payment_from_flow_error
      flamingo-commerce/checkout/orders/payment_flow_status_failed_canceled
      flamingo-commerce/checkout/orders/payment_flow_status_aborted
      flamingo-commerce/checkout/orders/place_order_failed
      flamingo-commerce/checkout/orders/place_order_successful
      

    cart

    • inMemoryBehaviour: Allow custom logic for GiftCard / Voucher handling
      • We introduced two new interfaces GiftCardHandler + VoucherHandler
      • This enables users of the in-memory cart to add project specific gift card and voucher handling
    • Fix CreateInitialDeliveryIfNotPresent so that cache gets updated now when an initial delivery is created
    • GraphQL: Add new cart validation query Commerce_Cart_Validator to check if cart contains valid items

    price

    • IsZero() now uses LikelyEqual() instead of Equal() to avoid issues occurring due to floating-point arithmetic

    product

    • product attributes:
      • Added AttributesByKey domain method to filter attributes by key and exposed this method as getAttributesByKey in GraphQL
      • GraphQL: Exposing codeLabel property in the Commerce_ProductAttribute type

    payment

    • Introduced error message for already used idempotency key
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Feb 26, 2020)

    The release mainly improves the checkout experience when using the GraphQL interfaces, by introducing a new place order process which is backed by a state machine. This encapsulates all critical parts of the checkout into separate states which are easier to test and allow us to rollback each process part seperatly.

    dependencies

    • Update flamingo core to v3.2.0
    • Update dingo to v0.2.9

    tests

    • Added GraphQL integration tests for new Place Order Process, run manually with make integrationtest
    • To run the GraphQL Demo project use make run-integrationtest-demo-project
    • To regenerate the GraphQL files used by the integration tests / demo project use make generate-integrationtest-graphql

    cart

    • Add additionalData to the AddRequest used during add to cart

      • Breaking: Update helper/builder function BuildAddRequest
    • Breaking: Change to EventPublisher interface, PublishChangedQtyInCartEvent and PublishAddToCartEvent now include a cart as a parameter

    • Breaking: Change to behaviour of AddToCartEvent and ChangedQtyInCartEvent, they are now thrown after the cart has been adjusted and written back to cache

    • Events deferred from ModifyBehaviour are dispatched before AddToCartEvent and ChangedQtyInCartEvent

    • The AddToCartEvent includes the current cart (with added product)

    • The ChangedQtyInCartEvent includes the current cart (with updated quantities)

    • Mark CartReceiverService.RestoreCart() as deprecated, use CartService.RestoreCart() instead, the cart adapter therefore needs to implement the CompleteBehaviour interface.

    • Add CartReceiverService.ModifyBehaviour() to easily receive the current behaviour (guest/customer)

    • Add CompleteBehaviour interface which ensures that the cart adapter offers Complete / Restore functionality

    • Add CartService.CompleteCurrentCart() and CartService.RestoreCart() which rely on the new CompleteBehaviour interface

    • Breaking: Update CartService.CancelOrder() to use CartService.RestoreCart() instead of CartReceiverService.RestoreCart(), if your cart supports completing/restoring please implement CompleteBehaviour interface

    • Add CartService.CancelOrderWithoutRestore() to allow order cancellation without restoring the cart

    • Mark GuestCartService.RestoreCart as deprecated, will be replaced by CompleteBehaviour

    • Mark CustomerCartService.RestoreCart as deprecated, will be replaced by CompleteBehaviour

    • Add mocks for all behaviours, you can use a specific one e.g. &mocks.CompleteBehaviour{} or the all in one &mocks.AllBehaviour{}

    • Update InMemoryBehaviour to fulfill the CompleteBehaviour interface (adds Complete()/Restore())

    • Update InMemoryCartStorage, add Mutex to be thread safe

    • Update SimplePaymentFormService to allow gift cards in the PaymentSelection, please use the config commerce.cart.simplePaymentForm.giftCardPaymentMethodto specify the default payment method for gift cards

    • Add missing product module dependency to cart module

    checkout

    • Move config to commerce namespace, from checkout to commerce.checkout

    • Add legacy config mapping so old mappings can still be used

    • Add cue based config to have config validation in place

    • Add OrderService.CancelOrderWithoutRestore() which uses the new CartService function

    • Add OrderService.CartPlaceOrder() to place a provided cart instead of fetching it from the CartService

    • Add new GraphQL Place Order process which relies on a new state machine please referer to the module readme for more details

      • Transition all actions of the checkout controller to separate states
      • Add new ContextStore port to provide a storage for the place order process
        • Provide InMemory and Redis Adapter
      • Add new TryLocker port to provide an easy way to sync multiple order processes across different nodes
        • Provide InMemory and Redis Adapter
      • Breaking: Add new GraphQL mutations / queries to start / stop / refresh the place order process

    payment

    • Add PaymentService to easily work with bound PaymentGateway's

      • PaymentService.AvailablePaymentGateways() returns all bound gateways
      • PaymentService.PaymentGateway() gets the payment gateway by gateway code
      • PaymentService.PaymentGatewayByCart() gets the payment gateway of the cart payment selection
    • Extend the FlowStatus struct with more standardized FlowActionData

    • Add standardized Flow Actions PaymentFlowActionShowIframe, PaymentFlowActionShowHTML, PaymentFlowActionRedirect, PaymentFlowActionPostRedirect please use these in your payment adapter since the standard place order relies on them.

    search

    • Extend Suggestion struct with Type and AdditionalAttributes to be able to distinguish between product/category suggestions
    Source code(tar.gz)
    Source code(zip)
Owner
Flamingo
Flamingo is a frontend framework made in go. It is especially useful for building web based sites and portals in a microservice oriented architecture.
Flamingo
GoAdmin Instruction - A golang framework help gopher quickly build a data visualization platform

GoAdmin Instruction - A golang framework help gopher quickly build a data visualization platform

palutova 0 Jan 21, 2022
The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

null 8 Jul 14, 2022
Rocinante is a gin inspired web framework built on top of net/http.

Rocinante Rocinante is a gin inspired web framework built on top of net/http. ⚙️ Installation $ go get -u github.com/fskanokano/rocinante-go ⚡️ Quicks

null 3 Jul 27, 2021
Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.

Ponzu Watch the video introduction Ponzu is a powerful and efficient open-source HTTP server framework and CMS. It provides automatic, free, and secur

Ponzu 5.5k Dec 28, 2022
QOR is a set of libraries written in Go that abstracts common features needed for business applications, CMSs, and E-commerce systems.

QOR English Chat Room: 中文聊天室: For security issues, please send us an email to security@getqor.com and give us time to respond BEFORE posting as an iss

QOR 5.1k Jan 2, 2023
Ozair Farahi 11 Nov 15, 2022
A secure, flexible, rapid Go web framework

A secure, flexible, rapid Go web framework Visit aah's official website https://aahframework.org to learn more News v0.12.3 released and tagged on Feb

aah framework 673 Dec 24, 2022
A secure, flexible, rapid Go web framework

A secure, flexible, rapid Go web framework Visit aah's official website https://aahframework.org to learn more News v0.12.3 released and tagged on Feb

null 0 Oct 26, 2021
Vektor - Build production-grade web services quickly

Vektor enables development of modern web services in Go. Vektor is designed to simplify the development of web APIs by eliminating boilerplate, using secure defaults, providing plug-in points, and offering common pieces needed for web apps. Vektor is fairly opinionated, but aims to provide flexibility in the right places.

Suborbital 84 Dec 15, 2022
A REST framework for quickly writing resource based services in Golang.

What is Resoursea? A high productivity web framework for quickly writing resource based services fully implementing the REST architectural style. This

Resoursea 33 Sep 27, 2022
A Go framework for building JSON web services inspired by Dropwizard

Tiger Tonic A Go framework for building JSON web services inspired by Dropwizard. If HTML is your game, this will hurt a little. Like the Go language

Richard Crowley 999 Dec 9, 2022
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).

WebGo v4.1.3 WebGo is a minimalistic framework for Go to build web applications (server side) with zero 3rd party dependencies. Unlike full-fledged fr

Kamaleshwar 266 Jan 1, 2023
based on go lang build WEB development framework for go lang beginners .

based on go lang build WEB development framework for go lang beginners .

zhenfan.yu 1 Oct 31, 2021
lightweight, idiomatic and composable router for building Go HTTP services

chi is a lightweight, idiomatic and composable router for building Go HTTP services. It's especially good at helping you write large REST API services

go-chi 13k Jan 6, 2023
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

golanger 298 Nov 14, 2022
laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

桥边红药 17 Feb 24, 2022
package for building REST-style Web Services using Go

go-restful package for building REST-style Web Services using Google Go Code examples using v3 REST asks developers to use HTTP methods explicitly and

Ernest Micklei 4.7k Jan 1, 2023
Implementing back-end services for blog application

Go Blog API Real-world examples implementing back-end services for blog application using Go programming language to build RESTful API, all routes and

Achmad Chun-Chun Winata Adi 50 Jan 5, 2023