order-transaction-ddd

command module
v0.0.0-...-87f3e45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 25 Imported by: 0

README

Order Transaction in DDD (Domain-Driven Design)

The idea of this repository is to demonstrate my approach to implement DDD for Order Transaction service in Golang as well as structuring code, logging, instrumenting, unit testing, etc. This is an experimental approach inspired by https://github.com/marcusolsson/goddd and shall not be taken for granted as best practice or guidance.

transaction package is the heart of the domain model, and Order struct is the central class of the domain model. Everything start from there.

Running the Application

Application is running default on port 8080 using inmem repository. See Makefile for shortcut. Example:

make run

Run Local using mongo as repository:

make run-mongo-migrate

Run via docker-compose:

docker-compose up

Note: mongodb should have replica to enable transaction.

Unit tests and PostgreSQL repository has not been fully completed though.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package handling contains process of handling order after order is being submitted by customer assigned to admin
Package handling contains process of handling order after order is being submitted by customer assigned to admin
persistent
Package transaction contains the heart of the domain model.
Package transaction contains the heart of the domain model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL