Build a Session Pack Tracker
A solo career coach sells prepaid packs of five sessions and counts them in a paper notebook. She loses income whenever she cannot say whether a cancelled session was cancelled early enough to give back. You will build a small tool that counts the sessions left on each pack, books and cancels sessions by her cancellation rule, and shows every client her own time.
The brief
The client
I am a career coach and I work alone. I have about twelve clients at a time, and I sell each of them a pack of five one-hour sessions. I keep the count in a paper notebook: a client's name, a row of five boxes, and a tick for every session.
A client once told me her sixth session was included. I had written "cancelled" next to one tick and could not remember whether she cancelled the evening before or an hour before. I gave her the session and lost a morning's income.
Some of my clients live abroad, so I also never know which hour a booking shows on their clock. I need something that counts for me, applies my cancellation rule the same way every time, and shows each client her own time.
The problem
A pack is money the coach has already been paid, and each session in it is an hour she can sell once. The notebook cannot tell her whether a pack still has a session left, whether it has expired, or whether a cancelled session was cancelled early enough to give the session back.
When she guesses wrong she either gives away a free hour or argues with a client who paid for it. Both cost more than the tool takes to build.
The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.
The spec
Requirements
- Add a client with a name, an email and a time zone.
- Record that a client bought a pack of a given number of sessions at a given price, and give the pack an expiry date 90 days after purchase.
- Show, for any client, each of their packs with the sessions included, the sessions left and the expiry date.
- Book a session for a client at a chosen start time. The session uses one session from one of the client's packs, and when the client has several open packs it uses the one that expires first.
- Refuse a booking, with a reason the coach can read, when no pack has a session left, when the session would start after the pack expires, or when the start time has already passed.
- Cancel a session. A client who cancels 24 hours or more before the start gets the session back. A client who cancels later forfeits it. When the coach cancels, the session is always given back.
- Refuse to cancel a session that is already cancelled, and change nothing when it does.
- Show a client's history: every session with its start time in the client's own time zone and its state.
- Accept the current time as an input, so every rule that depends on the clock can be checked without waiting.
Deliverables
- A working tool in the language and interface of your choice: a web page, an API that other programs call by sending requests, or a command-line program.
- A README that takes a reviewer from a fresh copy of the project to the replay of the coach's notebook, with the final numbers shown, in 10 minutes, and lists the command for each test.
- The coach's notes from the first Checkpoint: what she tracks, her rules in her own words and the worked examples.
- A set of rule cases that runs in one action and reports pass or fail for each case.
Out of scope
- Taking payment. The coach collects money by bank transfer, so the tool records that a pack was bought and nothing else.
- Clients logging in and booking themselves. The coach is the only user. A client booking her own hour is the next step up, Build a Booking System for a Coaching Studio.
- Refusing two sessions at the same hour. The coach looks at her own calendar, and this tool does not know about it.
- Subscriptions, monthly credits and emergency passes. A renewing plan adds states the notebook never had.
- Video calls, messages, session notes and email reminders. Each is its own area of a larger product.
- More than one coach, payouts and commission.
- Moving a session to another time. The coach cancels the old one and books a new one.
- Selling a single session without a pack. The coach sells only packs.
- A login, users and roles. One coach on her own machine does not need them. Do not put this tool on the internet: anyone who can open it could read every client's email and change every pack.
Architectural constraints
- Amounts are exact to the cent. A price of 450.00 is always shown back as 450.00, however many packs are added up.
- A session shows the same moment to everyone and the right hour on each client's own clock, including either side of a clock change in her country.
- The tool can be told what the current time is. It uses the real clock only when nobody supplies one.
- The sessions left on a pack always equal the sessions included minus the sessions that still count as used in the client's history. Nobody types the number in.
- A refused booking or a refused cancellation changes nothing.
Prerequisites
You can write a small program in a language of your choice and have saved data to a database or a file once. You do not need to know how a coach sells sessions, how time zones work, or any framework. You do not need to know how a solo coach sells packs of sessions; the first Phase explains the business and the words the brief uses. Having written one automated test helps.
Free to start. An account is what keeps track of the checkpoints you finish.
Record clients and packs
Produces the coach's notes, clients with a time zone, packs with an expiry date, and a view of each client's packs with the sessions left. Leaves booking and cancelling for later, so every pack still has all its sessions.
Acceptance criteria
A document in your repository that the coach could read without seeing any code. It states each of her pack rules as one plain sentence. It first names the three things she tracks: clients, packs and sessions, and the four states a session can be in: booked, cancelled in time, cancelled late and cancelled by the coach.
The rules are these. Booking takes one session from the pack. Cancelling 24 hours or more before the start gives the session back, and exactly 24 hours counts as in time. Cancelling later forfeits it. A cancel by the coach always gives it back. A cancelled session cannot be cancelled again. A pack expires 90 days after purchase, and a session may start up to the end of the expiry day.
It holds at least six worked examples, each ending in a number of sessions left. One example: a pack of 5, two sessions booked, one of them cancelled 3 days before the start, so 4 are left. The examples include a cancel at exactly 24 hours, a cancel 23 hours before, a cancel by the coach, a booking on the expiry day and on the day after it, and a client with two open packs.
Each example states its starting point and the number the coach expects, so anyone can check it by hand.
Architectural guidance
A rule the coach cannot work out by hand is a rule that is still unclear. It gets built one way, and the coach finds out it was the wrong way when a client argues. Without worked examples, her real disputes (cancelled the evening before, or an hour before) are settled by whatever the first version happens to do.
Acceptance criteria
A person or a request can add a client with a name, an email and a time zone, and then see that client in a list of all clients. The time zone is given as a place name such as Europe/Lisbon or America/New_York. The client is still there after the tool is stopped and started again.
An empty name is refused. An email with no "@" is refused. A time zone that does not exist, such as Mars/Olympus, is refused, and so is an empty one. Each refusal comes with a reason the coach can read, and the list of clients is the same as before the attempt.
After adding Ines Duarte with the zone Europe/Lisbon, the list shows her name, her email and Europe/Lisbon exactly as entered.
Architectural guidance
A client whose place is recorded as a fixed difference from the coach's hour sees her sessions an hour off for part of every year, when her country changes its clocks. Nobody notices until she turns up early or late. A misspelled or invented place is accepted without complaint at entry, and the failure appears weeks later, when her history cannot be shown and the coach cannot tell why.
Acceptance criteria
A person or a request can record that a client bought a pack with a number of sessions, a price in euro and a purchase date. The tool then shows the pack with its price, its sessions included, its purchase date and an expiry date 90 days after the purchase.
A pack bought on 2 Nov 2026 shows the expiry 31 Jan 2027. A pack bought on 9 Nov 2026 shows 7 Feb 2027. A pack bought on 14 Dec 2026 shows 14 Mar 2027.
A price entered as 450.00 is shown back as exactly 450.00. A price entered as 450.5 is shown as 450.50. A price of 19999.99 is shown back as exactly 19999.99. A price with three decimals, such as 450.005, is refused. A price of 0 or less is refused.
A pack of 0 sessions, a pack with a negative number of sessions, a pack for a client that does not exist and a purchase date that is not a real date are each refused with a reason the coach can read, and nothing is saved.
Architectural guidance
A bill that is one cent off is an argument with a client, and prices added up over many packs that drift by fractions of a cent give the coach totals her bank does not match. An expiry date that has to be retyped goes wrong the first time a purchase date is corrected, and the pack then expires on a day nobody can explain. A pack that expires one day early or late turns a booking the coach promised into a refusal, or the reverse.
Acceptance criteria
A person or a request can ask for a client by name or identifier and see each of that client's packs, each with sessions included, sessions left and expiry date. A new pack of 5 sessions with no sessions booked shows 5 left. A new pack of 3 shows 3 left.
A client with two packs sees both on separate lines, the one that expires first at the top. A client with no packs sees a readable message that says so and not an error. A client that does not exist is refused with a reason.
Nothing in the tool, whether a screen, a command or a request, lets anyone enter or change the sessions left on a pack. The number is only ever shown.
Architectural guidance
The coach reads this number to decide whether to say yes to a client, so a wrong one costs her a free hour or an argument. A number that is typed in, or kept apart from the sessions behind it, disagrees with them the first time she corrects a mistake, and from then on neither can be trusted. No sessions exist yet, so every answer today is the pack size. The check is that nothing lets the number be set, so the next Phase cannot make it wrong.
Architectural walkthrough
How a solo coach sells packs of sessions
A career coach works alone with about twelve clients at a time. She sells each client a pack: a set number of one-hour sessions, five in her case, paid for up front. A client then books sessions one at a time, each at a start time, and each one uses up a session from the pack.
Packs do not last forever. A pack expires 90 days after it is bought. A client can cancel a booked session, and her rule decides whether the session goes back to the pack or is lost. Some clients live abroad, so the same start time shows as a different hour on their clock.
The words this brief uses:
Pack: a set number of sessions a client has bought at one price.
Session: one hour of coaching, booked at a start time.
Sessions left: the sessions in a pack that are not used or forfeited.
Expiry date: the day a pack stops being usable, 90 days after purchase.
Forfeit: lose a session because the client cancelled too late.
Time zone: the region whose clock a time is read on. A start time is the same moment everywhere and a different hour on each clock.
Why the numbers come first
Three numbers have to be right before a single session exists: how many sessions a pack has left, what a pack cost, and which hour a client sees on her own clock. Each one fails in a way the coach cannot see until a client argues with her.
The first Checkpoint is research for that reason. The coach's rules and examples are worked by hand before anything is built, so the numbers the finished tool must reach are known in advance.
Book and cancel sessions
Produces booking and cancelling that apply the pack rules, including every refusal. Proves booking and cancelling at the edges of the clock in one run. Leaves the history view and the replay of the coach's notebook for the next Phase.
Acceptance criteria
A person or a request can book a session for a client at a start date and hour. The coach gives the start in her own time, Europe/Amsterdam. The tool shows the new session with its start, its state "booked" and the pack it uses.
For a client with one pack of 5 and no sessions, booking one session for 10 Nov 2026 at 10:00 shows the pack with 4 left, and the session as booked. Reading the session back shows 10 Nov 2026 at 10:00 Amsterdam time. After five bookings the pack shows 0 left.
When a client has two packs that both have a session left and are good on the start day, the session uses the pack that expires first. A client with a pack expiring on 31 Jan 2027 and another expiring on 14 Mar 2027 books a session for 12 Jan 2027 and sees the first pack drop by one and the second stay as it was.
The booked session is still there, and the count is still right, after the tool is stopped and started again.
Architectural guidance
A start time saved as the clock reading the coach typed shows the wrong hour to a client in another zone, and nobody can tell which sessions are affected. When two packs could cover a session and the choice depends on which was saved first, the same booking spends a different pack on different days. The pack that should have been used first then expires with sessions unused, and the client paid for those.
Acceptance criteria
A person or a request can supply the current time along with any action. The tool uses that time as "now". When nobody supplies one, it uses the real clock. This input exists for testing: with it you can check a rule that depends on the time of day without waiting for that time.
A booking is refused, with a reason the coach can read, in each of these cases. The client's packs all have 0 sessions left: the reason says there are no sessions left. The start falls after the end of the pack's expiry day in Amsterdam time: the reason says the pack expires before the start. The start is at or before "now": the reason says the start has passed. The client does not exist: the reason says so.
For a pack expiring on 7 Feb 2027, a session starting 7 Feb 2027 at 23:30 is accepted, and one starting 8 Feb 2027 at 00:00 is refused. A client with two packs, one empty and one with 2 left, can still book, and the session uses the pack with 2 left. A client whose only pack has 2 left but expires before the start is refused with the expiry reason and not the empty reason.
After every refusal the list of sessions and the sessions left on every pack are exactly what they were before the attempt.
Architectural guidance
A booking that is refused halfway can leave a session in the coach's diary and a pack that is one lower, for an hour nobody can attend. She sees an empty pack and no failed booking to explain it. A rule that can only be seen firing at the right time of day reaches clients before anyone has watched it work, so the refusal for a start that has passed and the edge of the expiry day need a time you can choose.
Acceptance criteria
A person or a request can cancel a booked session and say who cancels: the client or the coach. The current time can be supplied, as in the last Checkpoint. The session then shows its new state, and the pack shows its new sessions left.
Take a pack of 5 with one booked session starting on 20 Nov 2026 at 10:00, so 4 are left. Each case below starts from that state. Cancelling by the client at 19 Nov 2026 at 09:00, which is 25 hours before, shows "cancelled in time" and 5 left. Cancelling at 19 Nov 2026 at 11:00, which is 23 hours before, shows "cancelled late" and still 4 left. Cancelling at exactly 19 Nov 2026 at 10:00, 24 hours before, shows "cancelled in time" and 5 left. A cancel by the client after the start time shows "cancelled late" and the count does not move.
A cancel by the coach at 20 Nov 2026 at 09:00, 1 hour before, shows "cancelled by the coach" and 5 left. A cancel by the coach after the start also gives the session back.
Cancelling a session that is already cancelled is refused with a reason the coach can read. The session keeps its first state, so a session cancelled late is still cancelled late, and the sessions left do not change. Cancelling a session that does not exist is refused the same way.
After the late cancel, four more bookings on that pack succeed and a fifth is refused as empty, because a late cancel keeps its session used.
Architectural guidance
A cancel that can be applied twice turns a late cancel into an in-time one, and the coach gives away an hour she was entitled to keep. A tie at exactly 24 hours decided differently on different screens gives the same client two answers, and the coach ends up quoting the kinder one. A gap measured by comparing two clock readings as text goes wrong whenever the two sit in different zones or on either side of a clock change.
Acceptance criteria
A person runs one command from the README and gets each case below reported by name as passed or failed, with the current time supplied by the case. A pack of 5 with one session booked for 20 Nov 2026 at 10:00 shows 4 left. A client cancel at 19 Nov 2026, 09:00 (25 hours before) shows "cancelled in time" and 5 left, at exactly 10:00 (24 hours before) shows "cancelled in time" and 5 left, and at 11:00 (23 hours before) shows "cancelled late" and 4 left. Cancelling the late-cancelled session again is refused and the session stays "cancelled late". For a pack expiring on 7 Feb 2027, a session starting 7 Feb 2027 at 23:30 is accepted and one starting 8 Feb 2027 at 00:00 is refused. After each refusal the sessions and the sessions left on every pack read exactly as before. Running the cases again with the computer's date changed gives the same results. Changing one expected answer makes the run report that case as failed.
Architectural guidance
The 24 hour tie and the last day of a pack are where two screens give the same client two answers, and the coach ends up quoting the kinder one. A rule that can only be seen on the right day has not been tried by anyone when it reaches a client.
Architectural walkthrough
This Phase must survive a coach who makes ordinary mistakes: cancelling a session twice, booking an hour that has gone, booking a client whose pack ran out last week. Each mistake costs her money or trust if the tool accepts it.
The cancellation rule depends on what time it is. If the only way to see it fire is to wait a day, it is a guess until a client argues.
Show the history and prove the rules
Produces the client's session history in her own time zone, a set of rule cases that run in one action, and a replay of the coach's notebook from an empty tool. Adds no new rule.
Acceptance criteria
A person or a request can ask for a client and see every session of that client, in order of start time, each with its date, its hour in that client's own time zone, its state and the pack it used. Cancelled sessions are included.
The coach books a session for 12 Nov 2026 at 11:00 Amsterdam time. A client in Europe/Amsterdam sees 11:00. A client in Europe/Lisbon sees 10:00 on the same date. The coach books 7 Feb 2027 at 16:00 Amsterdam time for a client in America/New_York, and she sees 10:00 on that date. Two clients with the same session in different zones see different hours, and the stored moment is unchanged.
A client who has cancelled a session sees it in the list with its state: "cancelled in time", "cancelled late" or "cancelled by the coach". A client with no sessions sees a readable message that says so. A client that does not exist is refused with a reason.
Use dates away from the days when clocks change, in March and October in Europe and in March and November in the United States, so that the expected hour is unambiguous.
Architectural guidance
A history converted to the coach's clock when it was saved can only ever show the coach's clock. Hours near the days when clocks change are easy to get wrong by hand, which is why the examples here avoid them.
Acceptance criteria
One action, such as a single command or a single button, runs every rule case and prints one line per case with the case name, the expected sessions left, the actual sessions left and "pass" or "fail". The worked examples from the first Checkpoint are among the cases. At the end it prints the number of passes and the number of failures.
Each case starts from a known state of its own, so the cases can run in any order and one failure does not stop the others. No case reads the real clock: each one sets "now" itself, so two runs on different days print the same lines.
These boundary cases exist by name and pass: a cancel 25 hours, 24 hours and 23 hours before the start; a cancel 24 hours plus one minute and 24 hours minus one minute before; a cancel by the coach 1 hour before; a second cancel on a cancelled session; a booking that starts at 23:59 on the expiry day and one that starts at 00:00 on the day after; a booking on a pack with exactly 1 session left and then one more on the same pack; a booking whose start is exactly "now".
Prove that the cases can fail. Make the tool apply a 23 hour cutoff instead of 24, run again, and the 23 hours case and the 24 hours minus one minute case report "fail" by name. Restore 24 hours and every case passes.
Architectural guidance
The mistakes sit at the edges of a rule, so exactly 24 hours and the last minute of the expiry day need named checks of their own. A check that depends on today's date passes today and fails tomorrow, and a set of checks that cannot fail proves nothing, which is why you break the rule on purpose at the end.
Acceptance criteria
One action, documented in your README, empties the tool, plays the scenario below in order with the stated clock for each step, and prints the result. Starting times and clock times are in Amsterdam time, and every session is one hour. Running it twice in a row prints the same result.
Clients: Joris Bakker in Europe/Amsterdam, Ines Duarte in Europe/Lisbon, Dana Okafor in America/New_York. Packs: A is Joris, 5 sessions, 45000 cents, bought 2 Nov 2026. B is Ines, 5 sessions, 45000 cents, bought 2 Nov 2026. C is Dana, 3 sessions, 27000 cents, bought 9 Nov 2026. D is Joris, 5 sessions, 45000 cents, bought 14 Dec 2026, recorded at step 11. Record the clients and packs A, B and C before step 1.
- Clock 5 Nov 2026, 09:00. Book Joris on 10 Nov 2026, 17 Nov 2026, 24 Nov 2026, 1 Dec 2026 and 8 Dec 2026, each at 10:00. All use pack A.
- Clock 6 Nov 2026, 09:00. Book Ines on 12 Nov 2026, 19 Nov 2026 and 26 Nov 2026, each at 11:00.
- Clock 11 Nov 2026, 11:00. Ines cancels the 12 Nov 2026 session: exactly 24 hours before, cancelled in time.
- Clock 15 Nov 2026, 10:00. Joris cancels the 17 Nov 2026 session: cancelled in time.
- Clock 18 Nov 2026, 12:00. Ines cancels the 19 Nov 2026 session: 23 hours before, cancelled late.
- Clock 20 Nov 2026, 09:00. Book Ines on 3 Dec 2026, 10 Dec 2026 and 17 Dec 2026, each at 11:00. Then try 22 Dec 2026 at 11:00: refused, no sessions left.
- Clock 24 Nov 2026, 09:00. The coach cancels Joris's 24 Nov 2026 session: cancelled by the coach.
- Clock 30 Nov 2026, 12:00. Joris cancels the 1 Dec 2026 session: 22 hours before, cancelled late.
- Clock 1 Dec 2026, 09:00. Joris cancels the 8 Dec 2026 session: cancelled in time.
- Clock 1 Dec 2026, 09:30. Try to book Dana on 8 Feb 2027 at 16:00: refused, the pack expires before the start.
- Clock 14 Dec 2026, 09:00. Record pack D for Joris.
- Clock 20 Dec 2026, 09:00. Book Joris on 12 Jan 2027 at 10:00, which uses pack A because it expires first, and on 2 Feb 2027 at 10:00, which uses pack D because pack A has expired by then.
- Clock 20 Jan 2027, 09:00. Book Dana on 7 Feb 2027 at 16:00, the last day of her pack.
The printed result matches these numbers. Sessions left: pack A 2, pack B 0, pack C 2, pack D 4. Expiry dates: pack A 31 Jan 2027, pack B 31 Jan 2027, pack C 7 Feb 2027, pack D 14 Mar 2027. In total 14 sessions were booked. Of those, 3 were cancelled in time, 2 cancelled late and 1 cancelled by the coach, and 2 booking attempts were refused with readable reasons.
Joris's history shows seven sessions: 10 Nov 2026 booked, 17 Nov 2026 cancelled in time, 24 Nov 2026 cancelled by the coach, 1 Dec 2026 cancelled late, 8 Dec 2026 cancelled in time, 12 Jan 2027 booked and 2 Feb 2027 booked. Ines's 12 Nov 2026 session shows 10:00, and Dana's 7 Feb 2027 session shows 10:00.
Architectural guidance
A pack that goes through six bookings and four kinds of cancel ends on a wrong number if any one of them is counted wrongly, and the coach finds out when she tells a client how many sessions she has. When your result differs, work the pack out by hand from its sessions and their states. The expected numbers do not move to match your tool, because the tool is what is being checked.
Architectural walkthrough
This Phase is about trust, in two places. A client in New York who is shown the coach's clock arrives six hours off for a session the coach thinks is settled. Every client has to see her own hour for the same session, and the session itself must be the same one for all of them.
The second place is the rules. A rule the coach only tried by hand is a rule she guessed at. If a change moves the cutoff by one minute, the first person to find out is a client with a disputed cancellation. A set of cases that covers the cutoff and the expiry boundary by name turns that into a failing case on the day it happens.
The replay at the end covers what single rules miss. Booking, cancelling, expiry and the choice between two packs affect each other, and a count that is wrong in one corner shows up only when they all run together. The replay starts from nothing and ends at numbers fixed in advance.
Architectural walkthrough
A count that disagrees with the list
A tracker that keeps a number on each pack called sessions left works until the coach makes one mistake. She cancels the wrong session, or the program stops halfway through a booking, and the number and the list of sessions now disagree. Neither one can tell her which is right, and she is back to arguing from memory.
The count has to follow from the sessions it describes. Fixing a wrong cancellation then fixes the number, because there is no second figure to repair.
A rule that depends on the clock
Whether a cancellation gives the session back depends on how long before the start it was made, so the answer depends on what time it is. If the only way to see the rule fire is to wait a day, the rule stays a guess until a client argues about it. At exactly 24 hours, a minute under and a minute over, a wrong answer costs the coach an hour of income or a client's goodwill.
A booking that half happens
A booking has two good outcomes: the session exists and the pack is one lower, or nothing happened. The outcome in between is a pack that lost a session to a booking that does not exist. The coach sees an empty pack and a diary with nothing in it.
Where it shows if you cut a corner
A sessions-left figure typed in or kept apart shows at the end of the replay, as a number that does not match the sessions behind it. A rule that cannot be run at a chosen time shows as boundary cases nobody can run. Clock text kept without its place shows as a client in New York seeing her session six hours off. Prices that pick up fractions of a cent show on a long run of packs, not on a single price of 450.00.
The next step up is Build a Booking System for a Coaching Studio. It takes the same packs and the same cancellation rule into a setting where clients book their own hours, so two of them can want the same slot at the same moment.