Git Product home page Git Product logo

cqrs-es-sample-with-res's Introduction

cqrs-es-sample-with-res

CQRS with Event Sourcing sample app using Rails Event Store. See it live.

Build Status Maintainability Test Coverage

Deploy

Order management app

This application simulates a process of managing orders.

We start with a list of exiting products and customers (populated with seeds).

UI flow

  • Add/remove some of the existing products to the order
  • Choose the customer
  • Submit the order
    • after this you can't update the order items or customer
    • it generates the order number like "2021/03/20" (the last part is random(100))
  • Look at the order
  • Look at the history of events (in the Rails Event Store Browser)

Domains

Domains exist in directories at the root level of the Rails app.

Ordering

The Ordering::Order aggregate manages the state machine of an order:

  • draft
  • submitted
  • paid
  • expired

After each successful change an appropriate event is published in the Order stream. This object is fully event sourced.

Payments

The Payments::Payment aggregate manages the following states:

  • authorized
  • captured
  • released This object is fully event sourced.

Read models

There's only one read model - which helps us listing all the orders and individual order details.

It consists of 2 ActiveRecord classes: Order and OrderItem.

Process Managers

There's a process manager responsible for dealing with the process of expiring orders.

It takes the following events as the input:

  • Ordering::OrderSubmitted
  • Ordering::OrderExpired
  • Ordering::OrderPaid
  • Payments::PaymentAuthorized
  • Payments::PaymentReleased

When certain conditions are met the process manager return a ReleasePayment command.

cqrs-es-sample-with-res's People

Contributors

mostlyobvious avatar mpraglowski avatar dependabot[bot] avatar antonpaisov avatar andrzejkrzywda avatar dependabot-support avatar bbuchalter avatar kennethkalmer avatar swistak35 avatar fidel avatar wlk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.