Coding Dojo

Edit on Gitlab

CQRS Booking

You should implement a simple booking solution in CQRS architecture.

About CQRS

CQRS for Command Query Responsibility Segregation Pattern.

A query returns data and does not alter the state of the object. A command changes the state of an object but does not return any data.

We will split our code in read and write code to really live this pattern.

Booking subject

We want to make a booking solution for one hotel.

The first 2 user stories are :

They want to use the CQRS pattern. To do that we will have :

The Booking struct contains

And the Room struct contain only

Source