Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python DDD example

License

NotificationsYou must be signed in to change notification settings

pgorecki/python-ddd

Repository files navigation

Build StatuscodecovLicense: MIT

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

(*)This project is is accompanied by my bloghttps://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 aListing. 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 anListing for sale (which we callpublishing in the Catalog), seller must provide aListing duration and initial price. Also it is also possible to schedule aListing 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 oneItem in theCatalog at a time.

Buying

WhenListing is selled through auctionBidding takes place. As aBuyer, 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) - seehttps://www.ebay.com/help/buying/bidding/automatic-bidding?id=4014.

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

Payments

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

Users

Each user can be aSeller or aBuyer (or both). User priveledges can be elevated to aStaff member orAdministrator.

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 andPayment bounded contexts were identified as a result of event storming. Relationship between these bounded contexts is presented in the following context map.

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

How to run this project

poetry shell

poetry install

poe compose_up - run in a separate shell to start the database

poe start

poe test

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp