Coder Social home page Coder Social logo

python-ddd's Introduction

Python Domain Driven Design (DDD) example project

Build Status codecov License: MIT

Disclaimer: this is a work in progress project, stay tuned for updates (*).

(*) This project is is accompanied by my blog https://dddinpython.com/ where I introduce some of the concepts and patterns implemented this repository.

The goal of this project

AUCTION APPLICATION

The goal is to implement an automatic bidding system using DDD tactical patterns, described here: https://www.ebay.co.uk/pages/help/buy/bidding-overview.html

Domain

Online Auctions domain was selected for the purpose of this project, which is loosely based on Ebay bidding system.

The main reason for selecting this domain is general familiarity and limited complexity - many people understand how internet bidding work and the whole concept is not difficult to understand (or at least it's much simpler that healthcare or banking domains). On the other hand it's not simply a CRUD system - there are some business rules that must be implemented in the system.

Domain description

This is a summary of the information we got from a domain expert about how the auction system should work.

Selling

When you want to sell an item, the first step in getting your item in front of buyers is creating a Listing. For now we only focus on selling through auctions (https://www.ebay.com/help/selling/listings/auction-format?id=4110), but in the future we may consider selling with "Buy It Now" (https://www.ebay.com/help/selling/listings/selling-buy-now?id=4109) or in some other ways. When presenting an Listing for sale (which we call publishing in the Catalog), seller must provide a Listing duration and initial price. Also it is also possible to schedule a Listing publication (https://www.ebay.com/help/selling/listings/selecting-listing-duration?id=4652).

You can cancel your listing when bidding takes place, but only under certain circumstances: if time left in listing < 12 hrs you can cancel your listing only if no bids were places (but we might change it in the future).

If you are a new seller (you never sold an item before), you can list only one Item in the Catalog at a time.

Buying

When Listing is selled through auction Bidding takes place. As a Buyer, you can place a bid, which must be greated than the current price + 1 USD and which sets the the highest price you are willing to pay for an item. System will let you know if someone outbids you and you can decide if you want to increase your maximum limit. Sometimes you can can be automatically outbidded (if some other buyer sets his maximum limit higher that yours) - see https://www.ebay.com/help/buying/bidding/automatic-bidding?id=4014.

After a fixed time since the bidding was started a bidding ends and the Winner is announced.

Payments

At this point, payments are out of scope for this project.

Users

Each user can be a Seller or a Buyer (or both). User priveledges can be elevated to a Staff member or Administrator.

Event storming

Event storming technique was used to discover the business domain and the most important business processes.

Listing draft management

Publishing Listing to Catalog

Bidding process

Context Map

Lising, Bidding and Payment bounded contexts were identified as a result of event storming. Relationship between these bounded contexts is presented in the following context map.

Since Payment context will be provided by a 3rd party payments provider (via REST API), the downstream context (Bidding) must conform to whatever the upstream provides.

python-ddd's People

Contributors

pgorecki avatar ksopyla 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.