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/gavv/httpexpect/v2 to v2.6.1

    chore(deps): update module github.com/gavv/httpexpect/v2 to v2.6.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/gavv/httpexpect/v2 | require | minor | v2.4.1 -> v2.6.1 |


    Release Notes

    gavv/httpexpect

    v2.6.1

    Compare Source

    v2.6.0

    Compare Source

    v2.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/testcontainers/testcontainers-go to v0.16.0

    chore(deps): update module github.com/testcontainers/testcontainers-go to v0.16.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/testcontainers/testcontainers-go | require | minor | v0.15.0 -> v0.16.0 |


    Release Notes

    testcontainers/testcontainers-go

    v0.16.0

    Compare Source

    What's Changed

    ⚠️ Breaking Changes

    • feat: support native docker compose api (#​476) @​baez90

      Docker Compose v2 is implemented in Go, and for that reason we have decided to provide native Go support to Compose, deprecating the shell-escape based LocalDockerCompose, which was invoking the local binary of compose. Given the version includes the Compose dependency, and the Docker folks added a replace directive until the upcoming Docker 22.06 release is out, we were forced to add it too, causing consumers of Testcontainers for Go to add the following replace directive too.

    replace (
    	github.com/docker/cli => github.com/docker/cli v20.10.3-0.20221013132413-1d6c6e2367e2+incompatible // 22.06 master branch
    	github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch
    	github.com/moby/buildkit => github.com/moby/buildkit v0.10.1-0.20220816171719-55ba9d14360a // same as buildx
    
    	github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.2 // Can be removed on next bump of containerd to > 1.6.4
    
    	// For k8s dependencies, we use a replace directive, to prevent them being
    	// upgraded to the version specified in containerd, which is not relevant to the
    	// version needed.
    	// See https://github.com/docker/buildx/pull/948 for details.
    	// https://github.com/docker/buildx/blob/v0.8.1/go.mod#L62-L64
    	k8s.io/api => k8s.io/api v0.22.4
    	k8s.io/apimachinery => k8s.io/apimachinery v0.22.4
    	k8s.io/client-go => k8s.io/client-go v0.22.4
    )
    
    • fix: do not prepend garbage in the container.Exec response (#​624) @​mdelapenya

      The signature of the Exec function on a container created by the library has been changed in what we thought it was a non-breaking change manner, using variadic arguments. But we confirmed that it could be a breaking change in the rare case where the Exec function is assigned to a variable.

    // The original Exec function works here because its type is func(context.Context, []string),
    // but the new Exec function’s type is func(context.Context, []string, ...ProcessOption),
    // so the assignment fails at compile time. For that reason we are moving it to this section.
    var execFn func(ctx context.Context, cmd []string) = myContainer.Exec
    

    🚀 Features

    • feat: implement new MultiStrategy design (#​580) @​hhsnopek

      This PR enhances how the wait.ForAll strategy behaves: it will control the startup timeout and the deadline for all inner wait strategies, using two methods: WithStartupTimeoutDefault, which sets the default timeout for all inner wait strategies; and WithDeadline, which sets a time.Duration which limits all wait strategies. As a consequence, the already existing function WithStartupTimeout has been deprecated from the multi-strategy struct.

    • feat: Auth config for build images (#​602) @​paulozenida

    • feat: log docker info from compose (#​591) @​mdelapenya

    🐛 Bug Fixes

    📖 Documentation

    🧹 Housekeeping

    📦 Dependency updates


    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] 1
  • how to use product module? in hello world

    how to use product module? in hello world

    my code error here

    2022-06-09T17:37:22.319+0900    INFO    runtime/module.go:32    maxprocs: Leaving GOMAXPROCS=10: CPU quota undefined    {"area": "root", "module": "core.runtime", "category": "module"}
    2022-06-09T17:37:22.320+0900    INFO    [email protected]/app.go:365    Starting HTTP Server at :3322 .....     {"area": "root"}
    panic: "web.routesProvider": injecting into flamingo.me/flamingo-commerce/v3/product.<*product.routes Value>:
    injecting into flamingo.me/flamingo-commerce/v3/product/interfaces/controller.<controller.View Value>:
    can not instantiate interface flamingo.me/flamingo-commerce/v3/product/domain.ProductService
    
    goroutine 1 [running]:
    flamingo.me/dingo.(*Injector).createProvider.func1.1({0x0?, 0x0?, 0x17a7780?}, {0x1a370a0, 0xc000482940})
            /Users/flexmekim/go/pkg/mod/flamingo.me/[email protected]/dingo.go:417 +0x22e
    flamingo.me/dingo.(*Injector).createProvider.func1({0x0?, 0x0?, 0x0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/[email protected]/dingo.go:427 +0x43b
    flamingo.me/flamingo/v3/framework/web.(*Router).Handler(0xc0002468c0)
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/framework/web/router.go:118 +0xf0
    flamingo.me/flamingo/v3.serveProvider.func1(0xc000535680?, {0x18d7e95?, 0x0?, 0x0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:366 +0xff
    github.com/spf13/cobra.(*Command).execute(0xc000535680, {0xc000032050, 0x0, 0x0})
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x663
    github.com/spf13/cobra.(*Command).ExecuteC(0xc00042e000)
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
    github.com/spf13/cobra.(*Command).Execute(...)
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
    flamingo.me/flamingo/v3.(*Application).Run(0xc00049a200)
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:234 +0x1e9
    flamingo.me/flamingo/v3.App({0xc00030a180?, 0x1004c51?, 0x10014e0?}, {0x0?, 0x0?, 0x17ae5e0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:208 +0x65
    main.main()
            /Users/flexmekim/go/src/github.com/flexmekim/flamingo-example/hello/main.go:12 +0x8c
    exit status 2
    

    and my project here

    package main
    
    import (
    	"hello/helloworld"
    
    	"flamingo.me/dingo"
    	"flamingo.me/flamingo-commerce/v3/product"
    	"flamingo.me/flamingo/v3"
    )
    
    func main() {
    	flamingo.App([]dingo.Module{
    		new(helloworld.Module),
    		new(product.Module),
    	})
    }
    
    

    and product module here

    package product
    
    import (
    	"flamingo.me/dingo"
    	"flamingo.me/flamingo-commerce/v3/price"
    	"flamingo.me/flamingo-commerce/v3/product/domain"
    	"flamingo.me/flamingo-commerce/v3/product/infrastructure/fake"
    	"flamingo.me/flamingo-commerce/v3/product/interfaces/controller"
    	productgraphql "flamingo.me/flamingo-commerce/v3/product/interfaces/graphql"
    	"flamingo.me/flamingo-commerce/v3/product/interfaces/templatefunctions"
    	"flamingo.me/flamingo-commerce/v3/search"
    	"flamingo.me/flamingo/v3/framework/flamingo"
    	"flamingo.me/flamingo/v3/framework/web"
    	"flamingo.me/graphql"
    )
    
    type Module struct {
    	fakeService bool
    	api         bool
    }
    
    // Inject module configuration
    func (m *Module) Inject(
    	cfg *struct {
    		FakeService bool `inject:"config:commerce.product.fakeservice.enabled,optional"`
    		API         bool `inject:"config:commerce.product.api.enabled,optional"`
    	},
    ) *Module {
    	if cfg != nil {
    		m.api = cfg.API
    		m.fakeService = cfg.FakeService
    	}
    
    	return m
    }
    
    // Configure the product module
    func (m *Module) Configure(injector *dingo.Injector) {
    	flamingo.BindTemplateFunc(injector, "getProduct", new(templatefunctions.GetProduct))
    	flamingo.BindTemplateFunc(injector, "getProductUrl", new(templatefunctions.GetProductURL))
    	flamingo.BindTemplateFunc(injector, "findProducts", new(templatefunctions.FindProducts))
    
    	web.BindRoutes(injector, new(routes))
    	if m.api {
    		web.BindRoutes(injector, new(apiRoutes))
    	}
    
    	injector.BindMulti(new(graphql.Service)).To(new(productgraphql.Service))
    	if m.fakeService {
    		injector.Override((*domain.ProductService)(nil), "").To(fake.ProductService{}).In(dingo.ChildSingleton)
    		injector.Override((*domain.SearchService)(nil), "").To(fake.SearchService{}).In(dingo.ChildSingleton)
    	}
    
    }
    
    // Depends adds our dependencies
    func (*Module) Depends() []dingo.Module {
    	return []dingo.Module{
    		new(price.Module),
    		new(search.Module),
    	}
    }
    
    // CueConfig defines the product module configuration
    func (*Module) CueConfig() string {
    	// language=cue
    	return `
    commerce: {
    	product: {
    		view:  {
    			template: *"product/product" | !=""
    		}
    		priceIsGross: bool | *true
    		generateSlug: bool | *true
    		slugAttributeCode: string | *"urlSlug"
    		fakeservice: {
    			enabled: bool | *false
    			currency: *"€" | !=""
    			defaultProducts: bool | *true
    			if enabled {
    			  jsonTestDataFolder?: string & !=""
    			  jsonTestDataLiveSearch?: string & !=""
    			}
    		}
    		api: {
    			enabled: bool | *true
    		}
    		pagination: defaultPageSize: number | *commerce.pagination.defaultPageSize
    	}
    }`
    }
    
    type routes struct {
    	controller *controller.View
    }
    
    func (r *routes) Inject(controller *controller.View) {
    	r.controller = controller
    }
    
    func (r *routes) Routes(registry *web.RouterRegistry) {
    	registry.HandleGet("product.view", r.controller.Get)
    	h := registry.MustRoute("/product/:marketplacecode/:name.html", `product.view(marketplacecode, name, backurl?="")`)
    	h.Normalize("name")
    	h = registry.MustRoute("/product/:marketplacecode/:variantcode/:name.html", `product.view(marketplacecode, variantcode, name, backurl?="")`)
    	h.Normalize("name")
    }
    
    type apiRoutes struct {
    	apiController *controller.APIController
    }
    
    func (r *apiRoutes) Inject(apiController *controller.APIController) {
    	r.apiController = apiController
    }
    
    func (r *apiRoutes) Routes(registry *web.RouterRegistry) {
    	registry.MustRoute("/api/v1/products/:marketplacecode", "products.api.get")
    	registry.HandleGet("products.api.get", r.apiController.Get)
    }
    
    

    I don't know what else to do.

    opened by flexmeKim 0
  • how to use product module?

    how to use product module?

    my code error here

    2022-06-09T17:37:22.319+0900    INFO    runtime/module.go:32    maxprocs: Leaving GOMAXPROCS=10: CPU quota undefined    {"area": "root", "module": "core.runtime", "category": "module"}
    2022-06-09T17:37:22.320+0900    INFO    [email protected]/app.go:365    Starting HTTP Server at :3322 .....     {"area": "root"}
    panic: "web.routesProvider": injecting into flamingo.me/flamingo-commerce/v3/product.<*product.routes Value>:
    injecting into flamingo.me/flamingo-commerce/v3/product/interfaces/controller.<controller.View Value>:
    can not instantiate interface flamingo.me/flamingo-commerce/v3/product/domain.ProductService
    
    goroutine 1 [running]:
    flamingo.me/dingo.(*Injector).createProvider.func1.1({0x0?, 0x0?, 0x17a7780?}, {0x1a370a0, 0xc000482940})
            /Users/flexmekim/go/pkg/mod/flamingo.me/[email protected]/dingo.go:417 +0x22e
    flamingo.me/dingo.(*Injector).createProvider.func1({0x0?, 0x0?, 0x0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/[email protected]/dingo.go:427 +0x43b
    flamingo.me/flamingo/v3/framework/web.(*Router).Handler(0xc0002468c0)
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/framework/web/router.go:118 +0xf0
    flamingo.me/flamingo/v3.serveProvider.func1(0xc000535680?, {0x18d7e95?, 0x0?, 0x0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:366 +0xff
    github.com/spf13/cobra.(*Command).execute(0xc000535680, {0xc000032050, 0x0, 0x0})
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]1.4.0/command.go:860 +0x663
    github.com/spf13/cobra.(*Command).ExecuteC(0xc00042e000)
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
    github.com/spf13/cobra.(*Command).Execute(...)
            /Users/flexmekim/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
    flamingo.me/flamingo/v3.(*Application).Run(0xc00049a200)
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:234 +0x1e9
    flamingo.me/flamingo/v3.App({0xc00030a180?, 0x1004c51?, 0x10014e0?}, {0x0?, 0x0?, 0x17ae5e0?})
            /Users/flexmekim/go/pkg/mod/flamingo.me/flamingo/[email protected]/app.go:208 +0x65
    main.main()
            /Users/flexmekim/go/src/github.com/flexmekim/flamingo-example/hello/main.go:12 +0x8c
    exit status 2
    

    and my project here

    package main
    
    import (
    	"hello/helloworld"
    
    	"flamingo.me/dingo"
    	"flamingo.me/flamingo-commerce/v3/product"
    	"flamingo.me/flamingo/v3"
    )
    
    func main() {
    	flamingo.App([]dingo.Module{
    		new(helloworld.Module),
    		new(product.Module),
    	})
    }
    
    

    and product module here

    opened by flexmeKim 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Ignored or Blocked

    These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

    Detected dependencies

    github-actions
    .github/workflows/main.yml
    • actions/checkout v3
    • actions/setup-go v3
    • actions/checkout v3
    • actions/setup-go v3
    • actions/checkout v3
    • actions/setup-go v3
    gomod
    go.mod
    • go 1.17
    • flamingo.me/dingo v0.2.10
    • flamingo.me/flamingo/v3 v3.4.0
    • flamingo.me/form v1.1.1
    • flamingo.me/graphql v1.8.0
    • flamingo.me/pugtemplate v1.2.2
    • github.com/99designs/gqlgen v0.17.20
    • github.com/alecthomas/template [email protected]
    • github.com/gavv/httpexpect/v2 v2.4.1
    • github.com/go-playground/form/v4 v4.2.0
    • github.com/go-redsync/redsync/v4 v4.6.0
    • github.com/go-test/deep v1.0.8
    • github.com/gomodule/redigo v2.0.0+incompatible
    • github.com/google/go-cmp v0.5.9
    • github.com/google/uuid v1.3.0
    • github.com/leekchan/accounting v1.0.0
    • github.com/pkg/errors v0.9.1
    • github.com/spf13/cobra v1.6.1
    • github.com/stretchr/testify v1.8.1
    • github.com/stvp/tempredis [email protected]
    • github.com/swaggo/swag v1.8.8
    • github.com/testcontainers/testcontainers-go v0.15.0
    • github.com/vektah/gqlparser/v2 v2.5.1
    • go.opencensus.io v0.24.0
    • go.uber.org/goleak v1.2.0
    • golang.org/x/mod v0.7.0
    • golang.org/x/text v0.4.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    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
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 [email protected] and give us time to respond BEFORE posting as an iss

QOR 5.1k Dec 2, 2022
Ozair Farahi 11 Nov 15, 2022
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 6, 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 1, 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 86 Sep 14, 2022
henrylee2cn 1.6k Nov 18, 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 1000 Nov 12, 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 262 Dec 1, 2022
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 12.7k Dec 4, 2022
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 Dec 2, 2022
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 49 Oct 28, 2022