All BlueprintsCommerce
Discount codes
A promotion for one small shop: the shop writes codes with rules, a buyer sees exactly what a code took off, and the rules refuse to combine into an order the shop is paying somebody to accept.
What you’ll build.
A shop that takes discount codes. Customers see exactly what a code takes off before they pay, and cannot stack two codes down to nothing. A code stops working the moment its last use is taken, and refunds give back what was actually paid.
What you’ll learn.
Each sprint is built around one skill. You show you have it in a pull request your team reviews, then explain it in a walkthrough.
Authentication
You can register and sign in a user, keep a request authenticated without asking for the password again, and explain where the credential lives in the browser and why there rather than somewhere else.
A cart that survives
You can add, change and remove items, keep the cart across a logout and login, and show a total that reflects prices as they are now.
Discount codes
You can apply a valid code, refuse an invalid one with a reason, and show that a single-use code cannot be used twice.
An order that moves through states
You can move an order through its states, refuse a transition that should not happen, and show the history of how it got where it is.
Going live
Somebody who has never met you can open a URL and use the product — and you can say what is different about the copy running there, where its secrets come from, and what you do when a release turns out to be wrong.
The roadmap. 8 sprints, 36 tasks.
Every sprint has a goal and a set of tasks. Open a sprint to see the tasks you will pick up.
Knowing who is shopping
A buyer can make an account and come back to it, and nobody can issue themselves a shop account.
4 tasks
- A buyer can register and land signed in
- A buyer's account is still theirs tomorrow
- Signing out on a shared laptop leaves nothing behind
- The shop's own accounts cannot be handed out by a form
A basket worth discounting
A buyer can fill a basket that is still there tomorrow, and see a total made of lines they can check.
4 tasks
- The shop has things to sell, at prices a buyer can see
- A basket survives the buyer closing the laptop
- The basket shows its working, not just a total
- A price that changed overnight does not change quietly
Codes that come off
The shop writes a code with rules on it, a buyer applies it, and a code that does not apply is refused with the reason.
5 tasks
- The shop can write a code and say what it does
- A buyer applies a code and sees exactly what it took off
- A code that does not apply is refused with the reason
- Valid until the 31st means the shop's 31st
- Only the shop can write a code, and hiding the form is not enough
Two codes, one basket
A second code either combines by a rule the shop set, or is refused with the reason, and no run of codes takes the basket to nothing.
5 tasks
- The shop decides whether a code will share a basket
- A refused second code says which code is already there
- Two codes that do combine are applied in one fixed order
- No run of codes takes the basket to nothing
- Changing the basket re-runs every code on it
The price on the order
A basket becomes an order at the price the buyer was shown, and the order can show where that price came from.
4 tasks
- A basket becomes an order at the price on the screen
- An order can show where its price came from
- A code that expired while the basket sat is caught before the money
- An order only moves forwards
When a code runs out
A code with a limit stops at the limit, including when the last two uses arrive at the same instant.
4 tasks
- A code can be given a budget, and the shop can watch it
- A use is counted when the order is placed, not when the code is typed
- Two buyers take the last use at the same instant
- One per customer means one per customer
Taking the discount out
A refund returns what was paid, in whole or in part, and the code's count goes back where the shop decided it should.
5 tasks
- Refunding a whole order returns what was paid
- Refunding one line returns that line's share of the discount
- A partial return does not claw back a discount the shop gave
- A refunded use goes back on the code, or deliberately does not
- The buyer can see what came back and why
Open for business
A stranger can reach the shop at its own address and run the whole promotion there, on a clock that agrees with the codes.
5 tasks
- The shop runs somewhere that is not a laptop
- Nothing that gets somebody in is in the repository
- The live shop agrees with the codes about what time it is
- A stranger runs the whole promotion on the live address
- A bad release can be undone, and a failure is visible
Read before you build. The best engineers do.
Senior engineers read the docs before they touch the code. Every Blueprint comes with short documents on the product and its world, the kind a team hands a new hire. Read them well and you ask sharper questions and walk into every review prepared.
What you are building
The product, who it is for, and why a discount code is a rule engine rather than a form.
How a shop's promotion actually works
Domain you will not have: margin, what a code is made of, and why shops are frightened of their own promotions.
More commerce Blueprints.
Corner shop storefront
A small shop sells online. The shelf shows what is genuinely there, a basket survives the tab it was made in, the shop never takes money for a tin it does not have, and the buyer can follow their order until they pick it up.
Food ordering with options
Ordering for one restaurant, where a dish is a set of choices rather than a price. A size replaces the base price, extras add to it, some extras only exist on some sizes, and the total the customer is charged is worked out from what they chose rather than taken from the browser.
Restock waitlist
A waiting list for what a small shop has run out of. People ask to be told when it returns, and when three come back the stock goes down the line in the order they asked: held long enough to act on, offered to nobody behind them until that window closes, and never offered to the same person twice.
Build discount codes.
Start your free week. Adaeze runs your kickoff, and Lars reviews every pull request.