Build a Course Shop for a Small Studio
A three-person training studio sells seven spreadsheet courses from a shop that told 19 learners who had already passed that they had failed, after the owner raised a pass mark. You will build the replacement, from a published course version and a video that must be ready, through payment, refunds, watching rights, quizzes and certificates. You will prove it with a newsletter day in which payments arrive late, video reports repeat, phones upload hours late and the pass mark changes halfway.
The brief
The client
I run a three-person studio that teaches financial modelling in spreadsheets to accountants and analysts. We sell seven courses, about 350 people enrol each month, and every lesson is a video on a hosting service we pay for.
When I raised the pass mark on our pivot tables course from 60 to 75 percent, the site marked everyone again. 19 people who had already passed got an email saying they had failed, and their certificates stopped verifying. A lesson I published showed "processing" for two days, and I could not tell whether the host's encode had failed or its message was late.
The same month a payment confirmation reached us three hours after the buyer paid, so the buyer paid a second time. A learner I had refunded kept watching for weeks, because I had unticked a box on the course and not on their account. I need to answer "why can this person watch, and have they finished?" with something better than "the page says so", and I need a pass mark change to leave past results alone.
The problem
The shop keeps one answer per learner and course for access and another for completion. The checkout script sets access, a refund script clears it, the owner sets it by hand in the admin page, and the video page reads it. Nobody can tell which change came last or why. Completion is a percentage recalculated from the course as it stands today, so adding a lesson lowers every enrolled learner's progress. A quiz is judged against the current pass mark, so a changed pass mark rewrites results that were already recorded.
Two outside parties add timing the shop does not control. The payment provider confirms a payment when it chooses, sometimes late and sometimes twice, and a buyer who sees no access pays again. The video host reports that a video is ready or failed through a message that can arrive late, twice, or for a video nobody uploaded, so a lesson flips between "ready" and "processing" and nobody can say whether the encode failed or the notification was late. A learner who skips to the end of every video reaches 100 percent, and a phone that reports progress hours late can overwrite what the laptop already saved.
The cost was 19 wrongly failed learners and an apology email, one duplicate charge refunded by hand, a refunded learner who watched for weeks, and an owner who spent two evenings finding out why.
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
- Let the studio draft a course of video lessons with a final quiz and publish it as a version that never changes afterwards.
- Accept a lesson video, show a plain reason when the host cannot use it, and publish a version only when every video in it is ready.
- Let a learner buy a course at the version's price through the provider's hosted payment page, and open the course within seconds of the confirmation, even when the confirmation arrives late or twice.
- Refund a purchase within 14 days of payment under the refund rule that was in force when the learner paid, exactly once. The window is the studio's own guarantee: the legal EU right of withdrawal lapses once a buyer asks for immediate access.
- Decide at the moment of a playback request whether the learner may watch, stop a refunded learner from starting a new playback, and say why for any learner at any past moment.
- Email the learner once when a course is ready and once when an order is refunded.
- Record what a learner watched from a laptop and a phone, late and sometimes twice, and count a lesson as complete only when 90 percent of its length has been watched.
- Run quizzes with an attempt limit, a passing score and a time limit judged on the shop's clock, and change a passing score without changing any recorded result.
- Issue a certificate with a public verification code when, and only when, the learner has completed the course. Show it as revoked after a refund.
- Erase a learner's name and email on request, keeping orders, access, progress, attempts and certificate records identified by ID.
- Check with one command that every paid order has access or a refund, that no certificate exists without a completion, and that the access and completion the shop reports equal what the rules conclude when worked out independently.
Deliverables
- Your repository starts the shop, the two stand-ins, the devices script, the newsletter-day simulator and a mailbox that catches every email the shop sends, each with one documented command, plus seven courses ready to sell.
- A README that takes a reviewer from a fresh clone to a bought, refunded and certified course and the shop check report in 20 minutes, and lists the command for each test.
- A sheet of the studio's rules with every example worked by hand, written before the shop.
- A test suite for every Checkpoint. A test that needs two requests at the same moment must be able to fail against a build that handles them one after the other.
- A way to run the studio's day faster than real time: a clock you can move for the shop and each stand-in, and a way to make the video host and the payment provider report late, twice, out of order and for something nobody ordered, and to make a refund fail once.
- The order-independence result and the report of the final newsletter day, both committed to your repository.
- A short operations note covering what the studio can do and see: why a video is not usable, which host reports and provider messages the shop could not match, why a learner could watch at a past moment, which paid orders have no access and how to fix them, and which refunds are waiting to be sent.
Out of scope
- Cohorts, seat limits and seat holds. The studio sells self-paced courses only.
- Instructor payouts, revenue share and a ledger. The owner pays the co-instructor by hand from a sales report, and a statement that traces every cent is a different brief's subject.
- Disputes and chargebacks. They need evidence deadlines, a second money flow and a block on refunds.
- Taking a lesson down after a rights notice. It cascades into refunds, access and payouts, and the studio has not decided what should happen to each.
- VAT by customer country, the withdrawal waiver and tax reports. Their rules need legal input and a tax table the studio has not given. Prices are tax-inclusive and the shop records one amount in euro cents.
- Coupons, bundles and subscriptions. Each adds a price rule the studio does not use.
- Moving a learner to a newer course version. A learner stays on the version they bought, and a test in the fifth Phase proves nothing moves them by accident.
- Quiz question types beyond single-choice, and text or download lessons. The pass mark, attempt limit and time limit are the point, not the question bank.
- SCORM, xAPI and LTI. They solve packaging and launching courses inside other systems, which is not this client's problem.
- Real video transcoding, copy protection, watermarking and a player front end. You build a video host stand-in and a script that plays the browser. A viewing address that expires is as far as protection goes.
- Learners under 16. Their consent rules need legal input, so sign-up asks for an adult confirmation and stops there.
- Collecting card data. The payment provider stand-in offers a hosted payment page.
- Learner and studio sign-in. The studio proves itself with one secret key and a learner is named by their learner ID, so do not put this shop on the internet.
- Deploying anywhere but the reviewer's machine, including containers and cloud hosting.
- Deleting orders and access records on a schedule. The studio is Dutch and has to keep its business records for 7 years, or 10 years for sales reported under the EU One Stop Shop VAT scheme, so the shop deletes nothing by age. Erasure happens on request only.
Architectural constraints
- Prices and refunds are exact to the cent in euros, video lengths are whole seconds and scores are whole percent, rounded down. Times in answers are UTC with milliseconds and are shown to people in Europe/Amsterdam.
- No card number is ever stored or logged. The learner pays on the provider's page.
- A published course version, and the refund rule in force on a given day, never change. A change creates a new one, and each purchase, attempt and refund is judged under the one in force when it happened.
- For any learner and any past moment, the shop says why the learner could or could not watch and whether they had finished. A script or a person changing one thing by hand cannot silently decide either answer, and the same history gives the same answer in whatever order the messages arrived.
- Things are judged on when they happened, not on when a message arrived. The quiz deadline and the refund window are judged on the shop's clock, never on a device's.
- Receiving the same provider or host message twice changes nothing the second time. Anything interrupted by a crash is finished once after the restart, never lost and never done twice.
- Money is never refunded twice, a version number is never given twice, and a quiz never allows an attempt beyond its limit, even when two requests arrive at the same moment.
- After an erasure request the learner's name and email appear nowhere the shop stores data, holds mail or other work waiting to go out, or writes logs. Mail already sent stays in the mailbox. Orders, payments, access, progress, attempts and certificates stay, identified by ID.
Prerequisites
You have built one application with a database, in any language and framework. You do not need distributed systems experience, and you do not need to know how a course studio sells its courses; the first Phase explains the business and the words the brief uses, then works the rules out by hand. Two parts are harder than the rest: counting watched seconds when reports overlap, and tests that move a clock. The first Phase works the cases out by hand before you write the shop.
Free to start. An account is what keeps track of the checkpoints you finish.
Work out the rules and control the clock
Produces a worked sheet of the studio's rules with the answer to every example the shop will be judged on, and a shop that starts with one command and runs on a clock you can move. Leaves every business behaviour for later: nothing can be drafted, bought or watched yet.
Acceptance criteria
You replay the month the old shop failed 19 learners as a timeline in your repository, in the order the failures happened. For each step the timeline shows what the old shop did, what the studio's rules say should have happened, and the working behind that answer.
The timeline starts with the steps one course takes from the studio's draft to a stranger verifying a certificate, in order: draft, video upload, host report, publish, payment, confirmation, access, playback, watch report from a phone, lesson complete, quiz attempt, course complete, certificate, refund, certificate revoked, erasure. For each step it shows what the learner, the studio or the stranger can see afterwards, in plain words.
The replay then covers these cases, and the timeline shows the working and each answer as what should have happened:
- A buyer who pays order A at 10:00 and order B for the same course at 10:20, where A's confirmation reaches the shop at 13:00 and B's at 10:20: which order is the duplicate, and whether the learner may watch, and through which order, as the shop knew it at 12:00 and at 13:01.
- A payment at 2 Mar 2026, 10:00 UTC under the 14-day refund rule: the last instant a refund is accepted and the first instant it is refused.
- A payment at 12 Mar 2026, 10:00 UTC under the 30-day rule that starts on 10 Mar 2026, 00:00 UTC: the last instant a refund is accepted, given that Amsterdam clocks change on 29 Mar 2026 and a day is 24 hours. The same payment when the confirmation reached the shop three hours late.
- A viewing address issued at 10:00:00.000 that lasts 30 minutes for a learner refunded at 10:10:00.000: whether it plays at 10:25 and whether a new one is issued at 10:10:00.001.
- The seconds a learner must watch to finish a 480 second lesson and a 473 second lesson at 90 percent, and whether 431 and 425 seconds are enough. A learner who jumps to second 460 and watches to 480.
- The seconds watched for five pairs of watched ranges, each a start up to but not including an end: apart (0 to 100 and 200 to 300), touching (0 to 100 and 100 to 200), overlapping (0 to 150 and 100 to 200), one inside the other (0 to 200 and 50 to 100) and the same range twice (0 to 100 twice).
- The score for 3 right answers of 5 and for 4 of 7, rounded down, and whether each passes a mark of 60. The best score and attempts used for three attempts that scored 40, were never submitted and scored 80. A submission received at 10:20:00.001 for an attempt started at 10:00:00.000 with a 20 minute limit, when the learner's laptop claims 10:05.
- A learner who scored 65 on a course version with a pass mark of 60 and one who scored 65 on a version with a pass mark of 75.
The timeline ends with at least one case the studio's rules do not settle, written as a question to the studio. A reviewer can check every number on the timeline from the brief alone.
Architectural guidance
Boundary cases such as 431 seconds against 432, or 10:00:00 against 10:00:01, decide who is refunded and who has finished, and they are cheap to settle by hand and expensive to discover in a failing test. These answers are also the only part of the checking that the shop's own code did not produce, so the later Phases come back to them.
Acceptance criteria
One command named in the README starts the shop from a fresh clone, together with a mailbox that catches every email the shop sends. The README says how long a reviewer needs from clone to a running shop and lists the command for each test the project will have. The test suite runs with one command and passes, even though it only checks the clock so far.
The studio acts with a secret key that the README says how to set. A studio request without the key is refused and changes nothing. The shop reports its current time as a UTC instant with milliseconds and as Europe/Amsterdam time. The studio can set the shop's time to any ISO 8601 instant and move it forward, and the shop reports the new time afterwards. A request to set the time without the key, or with a value that is not an instant, is refused and leaves the time unchanged. The README names the way to start the shop so that it refuses to set its time at all, and a test starts it that way and sees the refusal.
With the time set to 2 Mar 2026, 10:00 UTC the shop reports 11:00 in Amsterdam. With the time set to 29 Mar 2026, 00:30 UTC it reports 01:30, and one hour later, 29 Mar 2026, 01:30 UTC, it reports 03:30, because Amsterdam clocks change at 01:00 UTC that day. Moving the time forward by 1 hour moves it by exactly 1 hour, and the shop keeps answering while it is moved.
Architectural guidance
If some parts of the shop read the machine's time while others read the time you set, one part decides a refund window is still open while another decides it has closed, and the studio refunds a learner it should not have. A clock that anyone can set on a live shop lets a buyer extend their own refund window, so the setting only exists where the README says it does.
Architectural walkthrough
How a course studio sells its courses
The studio records each lesson as a video and groups the lessons into a course with a quiz at the end. Each video goes to a video host: a company that stores it, converts it so it plays on any screen, and reports back when it is ready or when the conversion failed. The conversion takes a while, so a new lesson waits for that report before anyone can watch it.
A learner buys a course on a payment page run by a payment provider. The provider takes the card payment and later sends the shop a message saying the payment went through. The learner then watches the lessons on a laptop or a phone and takes the quiz. A learner who has watched the lessons and passed the quiz gets a certificate, and anyone they show it to, an employer for example, can check that it is real.
In a normal month about 350 people enrol across the studio's seven courses, with a rush in the hour after a newsletter goes out. The owner now and then publishes a new or changed lesson, answers refund requests, and changes a lesson or a pass mark when a course needs it.
The words this brief uses:
Course version: the course as it was published at a given moment. A change creates a new version, and a learner stays on the version they bought.
Pass mark: the lowest quiz score that passes, in percent.
Refund window: how long after paying a learner may ask for their money back. Here it is the studio's own promise, not a legal right.
Payment confirmation: the provider's message that a payment went through. It can arrive late or twice.
Host report: the video host's message that a video is ready or has failed.
Viewing address: the link that plays one lesson, valid for a short time.
Verification code: the code a stranger uses to check a certificate.
Erasure: removing a learner's name and email when they ask, which the GDPR gives them the right to do.
Why the rules come first
The studio's trouble began with rules that lived only inside the old shop. Nobody could say what a recorded quiz score should mean once the pass mark changed, so the shop decided for itself and told 19 learners who had passed that they had failed. This Phase makes you write the rules down with numbers before any of them is code.
The boundaries are the expensive part. A refund request at 10:00:00 on the last day is accepted and one second later is refused. A lesson of 473 seconds is finished at 426 seconds watched and not at 425. A learner who skips to the last minute of every video has watched one minute. A member who first meets these as a failing test ends up arguing with the test instead of with the rule, and a test written by the same person who wrote the shop agrees with the shop even when both are wrong. Answers worked out by hand, before the shop exists, give you something to check it against.
The clock is the other problem. The refund window is 14 days, the quiz allows 20 minutes, a viewing address lasts 30 minutes, and a payment confirmation can arrive three hours late. A test that waits for any of those takes days or never runs, and a test that reads the machine's time passes on some days and fails on others. Nothing in the later Phases can be checked until the shop's time is something you set.
Publish a course version that never changes
Produces drafting, a video host stand-in that you build, a rule that a video must be usable before it is published, and published course versions that stay exactly as published. Leaves selling, access and learning for later: nothing can be bought or watched yet.
Acceptance criteria
Every studio action needs the studio's secret key. A request without it is refused and creates nothing. The studio registers a video with a file name and a size in bytes above 0 and gets back an ID. The studio sees that video as not usable and "still processing", because no host has reported on it. A size of 0 or a missing file name is refused.
The studio creates a course with a title and a price in euro cents, and saves a draft for it. The draft holds lessons in a saved order, each with a title, a registered video and a mark saying whether it is required. It holds a final quiz of at least one single-choice question, each with 2 to 6 options and exactly one correct option. It holds the completion rules: which lessons are required, a pass mark from 1 to 100 percent, an attempt limit from 1 to 10, a time limit from 1 to 180 minutes, and the percentage of a lesson that counts as watched, from 1 to 100. The sample draft uses a price of 7,900 cents, a pass mark of 60, 3 attempts, 20 minutes and 90 percent.
Reading the draft back returns exactly what was saved, with the lessons in the saved order. Saving again replaces the draft. A draft with no lessons saves and is refused later, when the studio tries to publish it.
Each of these is refused and leaves the stored draft unchanged: a lesson whose video the studio never registered, a required lesson that is not in the draft, a pass mark of 0 or 101, a question with two correct options, a question with one option, and a price of 0 or below.
Architectural guidance
The draft is the only part of the shop the studio may edit, so it accepts anything that makes sense and rejects what could never be published sensibly. A pass mark of 0 passes every learner. A required lesson that is not in the course can never be finished, so a learner would pay for a course they cannot complete. Both are cheaper to refuse here, while the studio can still fix them, than to explain to a buyer later.
Acceptance criteria
The video host stand-in is a small program you write that behaves like an outside party, faults included. It starts with one command in the README and runs apart from the shop. The shop sends it each registered video, and later it reports back to the shop. A report says which video it is about, when it happened, and either ready with a length in whole seconds (480 by default) or failed with a reason such as unsupported codec. It carries a report ID and a secret that the shop and the host share, so the shop can tell it came from the host. The host waits up to 5 seconds for the shop's answer and sends a report again until it gets a success answer.
No test waits in real time: the stand-in runs on a clock a test can move, and a test can make it send every report that is due. For any video a test can choose the outcome, ready or failed with a reason, the delay in seconds, and one fault at a time. Late: the report comes after a delay longer than the studio's first publish attempt. Twice: the same report arrives two times. Out of order: a failure that happened earlier than a ready report for the same video arrives after it. Unknown: a report about a video nobody uploaded.
The stand-in shows each fault it caused. The twice run shows one report ID sent two times. The out-of-order run shows the ready report sent before a failure with an earlier time. The unknown run shows a video the shop never sent. Until the next Checkpoint, the shop may answer every report with success and do nothing.
Sending a registered video to the host a second time makes no second upload: the stand-in shows one. If the stand-in is not running, the request fails, the video stays "still processing" and the studio sees that no upload happened. Sending it again once the stand-in is back produces one upload.
Architectural guidance
The host retries until it gets an answer, so duplicates are normal traffic. A shop written for one report per video fails in production first, on the day the studio announces a new course.
Acceptance criteria
A report from the host with the right secret is answered with success within 1 second. A report with a missing or wrong secret is refused and changes nothing. The same report sent twice answers success both times and leaves the video where the first one left it. Two copies of one report sent at the same moment end the same way. A test sends them so that the race could show, and fails against a build that handles them one after the other.
A test stops the shop right after it has acknowledged a report and before the video's result has changed, using a way the README names, then starts it again. The video then shows the result of that report, and shows it once.
A video is usable when the latest report about it, by the time it happened, is ready. It is not usable when the latest is a failure or when nothing has arrived. If two reports happened at the same time, not usable wins. A failure that happened at 10:00 and arrives after a ready report from 10:05 leaves the video usable. A ready report from 10:00 that arrives after a failure from 10:05 leaves it not usable.
The studio sees, for a video, whether it is usable. For a usable video it sees the length in whole seconds from the latest ready report. For a video that is not usable it sees a plain reason: "The video format is not supported" for an unsupported codec, "Still processing" when nothing has arrived, and a general sentence for any other reason. No host field name or reason code appears in anything the studio sees.
A report about a video nobody uploaded is acknowledged with success so the host stops retrying. It does not make any video usable. The studio can list the reports the shop could not match to a video.
Architectural guidance
Arrival order depends on the host's retry timing and says nothing about what happened to the video. The host gives the shop 5 seconds to answer, and a slow answer makes it send the same report again. Refusing a report the shop cannot match makes the host send it forever.
Acceptance criteria
A publish request for a draft publishes it as course version 1 when every lesson's video is usable. If any is not, the request is refused, nothing is created, and the answer lists each blocking lesson with the plain reason from the previous Checkpoint. A draft with no lessons, or with no quiz, is refused with its reasons.
Reading a published version returns the title, the price in cents, the lessons in order with title, video, whether it is required, and length in whole seconds as the host reported it at the moment of publishing, the quiz with its answer key, and the completion rules including the pass mark. The studio can read the course's current version, which is the highest version number.
Publishing a draft identical to the current version creates nothing and returns that version, marked as not newly created. Publishing a draft that differs from the current version creates the next number.
Two publish requests for the same changed draft, sent at the same moment, create exactly one new version. Both answer successfully and one is marked as created. A test sends them so that the race could show, and fails against a build that handles them one after the other.
Architectural guidance
A learner who pays for a lesson that cannot play has been sold something broken, so a course with a video that failed or is still processing is not published. Two publishes at the same moment that both claim version 2 would give two groups of buyers different pass marks under the same number. The length of each lesson is read at publishing because the threshold for finishing is a share of that length, and a re-encode that changes the length later must not change who has finished.
Acceptance criteria
The studio publishes a course as version 1 with a pass mark of 60 and saves a copy of what reading version 1 returns. It then retitles a lesson, replaces a video and raises the pass mark to 75 in the draft. Reading version 1 again returns exactly the same as the copy. A host report that later marks one of its videos failed, or reports a different length, changes nothing in version 1.
The studio has no way to edit or delete a published version, and every attempt to do so is refused and leaves it unchanged.
Publishing the changed draft creates version 2 with a pass mark of 75, and version 1 still says 60. The current version is 2. A second change to the draft that leaves the pass mark at 75 creates version 3 that also says 75.
Architectural guidance
A learner who buys version 1 has bought its lessons, its price and its pass mark of 60. An edit that reaches back into version 1 changes what they bought. A change the studio did not mean to make is invisible unless someone compares what a buyer was shown before with what they are shown now.
Architectural walkthrough
Two things go wrong here. The first is the video host. It tells the shop that a video is ready or has failed by calling back, and it keeps calling until the shop answers. It also calls late, calls out of order, and sometimes calls about a video nobody uploaded. The client's lesson that showed "processing" for two days is what a shop looks like when it treats the latest call to arrive as the truth about the video. The studio could not tell whether the encode had failed or the message was late, and learners clicked a lesson that never played.
The second is a published course that changes under the people who bought it. When the owner raised a pass mark from 60 to 75, the shop applied it to learners who had already finished, and 19 of them were told they had failed. A published version has to stay exactly as it was published, and a change has to become a new version that only new buyers get.
You build the video host stand-in yourself, because a real host will not send a duplicate or reversed message when you ask. A failure you can cause on demand can be fixed and tested again. A failure you wait for cannot.
Sell and refund a course
Produces a payment provider stand-in that you build, purchases at the price the learner was shown, orders that settle correctly whatever order the provider's messages arrive in, and refunds judged under the rule in force when the learner paid. Leaves access and learning for later: a paid order opens nothing yet.
Acceptance criteria
The payment provider stand-in is a small program you write that behaves like an outside party, faults included. It starts with one command in the README and runs apart from the shop. The shop asks it for a payment for an amount in euro cents and a reference for the order, and gets back the address of a payment page. Any other currency is refused. The page shows the amount and a Pay button and asks for no card number, so the shop never receives card data. A test can press Pay for a payment.
Paying makes the provider send the shop a message with a message ID, a payment reference, the order reference, the amount in cents, the currency and when it happened. The request carries a signature header in this shape, where t is Unix seconds and v1 is the hex HMAC-SHA256 of t, a dot and the raw body, keyed with a secret that the shop and the provider share:
Provider-Signature: t=1772445600,v1=5b3c...e91
A command in the README takes a message the provider delivered and reports whether its signature matches.
The provider signs a message at the moment it sends it, so a message sent again carries a new t. It waits up to 5 seconds for the shop's answer and sends again until it gets a success answer. It runs on a clock a test can move, and a test can make it send every message that is due.
A test can cause four faults for a payment or an order. Late: the message is held for up to 10,800 seconds. Twice: the same message ID is sent two times, with two different t values. Out of order: a refund message that follows a payment message in time is sent before it. Failed refund: the next refund request is answered with a server error once.
The provider refunds a payment when the shop asks. The request carries a key. The same key sent again returns the same refund and refunds nothing more, and a different key for a payment already refunded is refused. A test can also refund a payment as if from the provider's own dashboard, which sends the shop a refund message it never asked for.
The stand-in shows a payment confirmed with a 10,800 second delay: nothing is sent while its clock is behind the delay, and the message is sent once the clock passes it.
Architectural guidance
A real provider's test mode will not confirm a payment three hours late, or announce a refund before the payment it follows, when you ask. Your shop will meet both on a newsletter day. Signing at send time is how real providers behave, and it is the reason a 5 minute tolerance in the next Checkpoints does not clash with a 3 hour delay. Card entry on the provider's page means the shop cannot leak a card number it never held.
Acceptance criteria
A learner starts a purchase by sending their learner ID and a course. The shop creates one order for the course's current published version at that version's price, 7,900 cents for the sample course, and answers with the order and the address of the provider's payment page. The order shows its learner, course, version, price and status in plain words, and no name or email.
A request that carries an amount is refused and creates nothing. A course with no published version is refused, creates no order and makes no call to the provider.
The order exists before the provider is called. If the provider stand-in is not running, the request fails, and the order is visible as "waiting for payment" with no payment page. Starting a purchase twice for the same learner and course creates two orders, both waiting for payment.
An order started when the current version is 1 at 7,900 cents stays at version 1 and 7,900 after version 2 is published at 9,900, and the payment page it asked for was for 7,900.
Architectural guidance
The learner agreed to a price, so the order takes its price from the published version at that moment. A request that can name its own amount sells a 79 euro course for 1 cent. If the provider is down and the order was never written, a charge can exist with no record of why, and the studio finds out when the buyer writes.
Acceptance criteria
The shop accepts a message from the provider only when its signature matches the raw body it received. Each of these is refused, changes nothing and leaves nothing that shows the claimed payment: a missing signature, a wrong signature, a body changed by one byte after signing, and a signature time more than 5 minutes before or after the shop's time. A test makes the last case by setting the stand-in's clock 6 minutes behind. A signature time 4 minutes 59 seconds off is accepted.
A genuine message that is 3 hours late but was signed when it was sent is accepted. With the shop's clock moved forward 1 hour and the stand-in's clock left behind, the next message is refused for its time. Moving both clocks together accepts it.
A genuine message is answered with success within 1 second.
Architectural guidance
With no limit on a message's age, a captured message works for ever. A genuine message that is hours late must still pass, which is why the provider signs when it sends and not when the payment happened.
Acceptance criteria
The studio and the learner see an order as one of four things in plain words. It is waiting for payment when no payment message has been counted for it. It is paid when one has and no refund has. It is refunded when both have. It is a duplicate when the same learner holds another order for the same course whose payment happened earlier, with the order number breaking a tie, and that other order is not refunded.
The same message ID sent twice answers success both times and counts once. Two copies sent at the same moment end the same way, and a test sends them so that the race could show. A message for an order reference no order owns is acknowledged with success, changes nothing, and appears in a list the studio can read. A payment message whose amount differs from the order's price does not make the order paid, and the studio can see it marked as a wrong amount.
Three sequences end in the same state however the messages arrive. In the first, order A for a learner and course is paid at 10:00 but its message arrives at 13:00, while order B for the same learner and course is paid at 10:20 and arrives at 10:20. In either arrival order A ends paid and B ends a duplicate. In the second, a refund message for order C arrives before C's payment message: C stays waiting for payment until the payment message arrives and then ends refunded. In the third, every message is delivered twice. A test replays each sequence in every possible arrival order and compares the final status of every order.
Architectural guidance
Arrival order depends on the provider's retries and says nothing about which payment came first. In the client's story the first payment was confirmed three hours late. A rule that keeps whichever message arrived first would keep the later order and refund the one the learner expected to open. Two copies of one message that arrive together can each look new, and the learner is then counted as having paid twice.
Acceptance criteria
Two refund rules exist. The first allows 14 days from the payment. The second allows 30 days and applies to payments made from 10 Mar 2026, 00:00 UTC. A day is 24 hours of elapsed time. A purchase is judged under the rule in force when it was paid, and that choice is not redone later.
The buying learner can ask for a refund of a paid order inside its window. The shop accepts the request without waiting for the provider, asks the provider, and when the provider confirms, the order shows as refunded. The window is judged on the shop's clock and runs from when the payment happened.
An order paid at 2 Mar 2026, 10:00 UTC is under the 14-day rule, so a request at 16 Mar 2026, 10:00 UTC is accepted and one second later is refused and creates no refund. It is still refused at 20 Mar 2026, after the 30-day rule began. An order paid at 12 Mar 2026, 10:00 UTC is under the 30-day rule, so a request at 11 Apr 2026, 10:00 UTC is accepted although Amsterdam clocks changed on 29 Mar 2026. If that payment's message reached the shop three hours late, a request at 11 Apr 2026, 10:30 UTC is still refused.
Requests for an order that is waiting for payment, refunded or a duplicate are refused. A request with another learner's ID is refused as if the order did not exist. A second request for an order that already has a refund is refused. Two requests for one order sent at the same moment end with one acceptance and one refusal, and a test sends them so that the race could show.
If the stand-in fails the first refund call, the shop tries again, up to 5 times in all. The stand-in shows one refund, the order ends refunded once, and the learner is refunded once. After 5 failures the order stays paid, the studio can see the refund is still waiting to be sent, and the studio can send it again once the provider is back.
A test stops the shop right after it accepts a refund request and before the provider is asked, using a way the README names. After the shop starts again, the provider has refunded the purchase once and the order shows as refunded.
An order that turns out to be a duplicate is refunded automatically, with no window check and no request from the learner, and ends refunded while the earlier order stays paid. A refund message from the provider's dashboard for an order already refunded here adds no second refund. A dashboard refund for a paid order ends it refunded.
Architectural guidance
The window runs from when the payment happened because the message may be hours late, and 24-hour days keep a clock change from moving its end.
Architectural walkthrough
The provider decides when it tells the shop about a payment. In the client's story a confirmation reached the shop three hours after the buyer paid. The buyer saw nothing, paid a second time, and the studio refunded 79 euros by hand. A shop that sets an order to paid when a message arrives cannot tell which of two payments came first, and it keeps the wrong one.
Messages from the provider can also be forged. Anyone who can reach the shop's address can post "payment succeeded" for a course, and anyone who captured a genuine message can send it again next week. The provider signs each message, so a shop that does not check the signature sells courses for nothing.
Refunds add three more failures. The studio promised a learner 14 days, and a window that follows whatever rule applies today breaks that promise the day the studio changes the rule. Two refund requests at the same moment, or a retry after the provider failed once, can send the learner 79 euros twice. A process that dies after accepting a refund request and before telling the provider leaves a learner who was promised money and a studio that does not know it owes it.
Decide who may watch
Produces learners, access that opens on payment and ends on refund, a plain answer to why a learner may or may not watch, and short-lived viewing addresses. Leaves watching progress, quizzes and certificates for later: nothing is measured or assessed yet.
Acceptance criteria
A registration with a name, an email and an adult confirmation creates a learner and returns a learner ID. A registration without the confirmation, or with it set to false, is refused and creates nothing, because the studio does not sell to learners under 16. A purchase started with a learner ID that no learner owns is refused, and the number of orders is the same before and after.
When an order is first counted paid, the learner may watch the course, on the course version they bought, and the shop says which order gave them access. With a provider stand-in, enough payments to measure a 95th percentile open within 5 seconds or less of the shop accepting the provider's message, and the test prints the figure.
The learner receives one email, addressed to their email, saying the course is ready, and the mailbox holds one message for that order.
The version is fixed when access first opens. A learner who bought version 1 is still on version 1 after the studio publishes version 2, and a second order for the same course that is for version 2 leaves them on version 1.
The same payment message delivered twice, a restart in between, or two copies arriving at the same moment leave access that opened once and one email. A test sends the last case so that the race could show. An order that turns out to be a duplicate gives no access of its own and sends no email.
Architectural guidance
A buyer who pays and sees nothing pays again, which is how the studio refunded a duplicate by hand. A publish of version 2 must never change what a learner who bought version 1 receives. A second email for the same order tells the learner something is wrong when nothing is.
Acceptance criteria
A request for whether a learner may watch a course answers yes or no, with a reason in one plain sentence and the course version the learner is on. A learner ID that no learner owns is refused as unknown. A registered learner who never bought the course gets no, with the reason that access was never granted.
A learner may watch while at least one of their orders for the course has been counted paid and has not been refunded. The sentence names the order and the time it was paid in Europe/Amsterdam, for example "Access from order 1042, paid on 2026-03-02 11:00". Times in answers stay UTC with milliseconds. When every order has been refunded the reason is that access was ended by a refund.
A learner paid at 10:00:00.000Z and refunded at 10:10:00.000Z may not watch afterwards, whichever of the two messages reached the shop first, and the reason is that access was ended by a refund.
A buyer who paid twice keeps the access of the payment that happened first. Order B is paid at 10:20 and opens the course, then order A, paid at 10:00, is confirmed at 13:00. B becomes a duplicate and is refunded. The learner may watch, the sentence names order A, and B's refund ended only the access B had given.
The same request with an "as known at" instant answers from what the shop had been told by that instant. In the case above, as known at 12:00 the answer is yes through order B, and as known at 13:01 it is yes through order A. This is how the studio answers why a learner could watch at a past moment.
Each refunded order sends one email to the mailbox: a refund email when the learner asked for the refund and a duplicate-refund email when it was for a duplicate payment, and never both for one order. A repeated message sends nothing more.
Architectural guidance
One answer to "may this learner watch" that anything can overwrite is the old shop's bug: the last change wins and nobody can say which change that was. A support question such as "why could she watch on Tuesday?" needs what the shop knew on Tuesday, which differs from what was true when a message arrives three hours late.
Acceptance criteria
A playback request with a course, a lesson and a learner ID gets a viewing address only if the learner may watch right then. The address expires exactly 30 minutes after the shop's time: a request at 1 Apr 2026, 10:00 UTC gets an address that expires at 10:30:00.000Z. The studio can list every address the shop issued, with learner, video, issue time and expiry.
A learner who may not watch is refused with the reason from the previous Checkpoint, and no address is issued, which the studio's list shows. A lesson that is not in the learner's version is refused the same way.
The address reveals no name, email or learner ID to whoever holds it. The video host stand-in plays an address until its expiry on its own clock and refuses it afterwards: at 10:29:59.999 it plays and at 10:30:00.000 it is refused. An address altered in any way, including one character changed, the expiry moved by a minute or a different video named, is refused at any time. Tests move the shop's clock and the stand-in's clock together.
A learner is refunded at 10:10:00.000Z and holds an address issued at 10:00:00.000Z. The stand-in still plays that address at 10:25:00.000Z. A playback request at 10:10:00.001Z is refused with the reason that access was ended by a refund and adds nothing to the studio's list. The README states that 30 minutes is the longest a learner whose access was ended can keep playing.
Architectural guidance
The answer to "may this learner watch" can change at any moment, and a refunded learner who can still start new videos costs the studio the course twice. A video already playing cannot be recalled, so the lifetime of the address is the honest bound on how long a refunded learner keeps watching. A shorter lifetime narrows it and costs more requests, and the studio should know the number.
Acceptance criteria
A test stops the shop right after it has counted a payment and before the learner's access has opened, using a way the README names. The learner, who has paid, cannot watch at that moment. After the shop starts again, with nobody running a repair, the learner may watch within 5 seconds, once, with one email in the mailbox, even when the provider's message is delivered again after the restart.
The same test stops the shop right after it has counted a refund and before access has ended. After the restart, access has ended once and the mailbox holds one refund email.
The operations note says how the studio finds, for any time window, every paid order whose learner cannot watch and every refunded order whose learner still can, and how it fixes them without the learner doing anything. Running the fix twice changes nothing the second time. A test shows both lists are empty after the restart above.
Architectural guidance
A process can die after a payment is saved and before the learner is told. The buyer has paid 79 euros, sees nothing, and the studio finds out when the buyer writes. The reverse is quieter: a refunded learner keeps watching and no one notices. Both failures leave no error behind, which is why the test stops the shop at the worst moment and then asks what is missing.
Acceptance criteria
One test drives the whole path through the stand-ins and the clock. A learner pays at 1 Apr 2026, 10:00 UTC, may watch, asks for playback, and holds an address that expires at 10:30:00.000Z. The studio refunds at 10:10:00.000Z. A playback request at 10:10:00.001Z is refused with the reason that access was ended by a refund, the studio's list of issued addresses gains nothing, the address from 10:00 still plays on the stand-in until 10:30:00.000Z, and the mailbox holds one refund email for the order.
You keep a second calculation of the answer in your repository, written from the rules in this brief and from the sheet in the first Phase, sharing no code with the shop. It takes a list of orders, payments and refunds with the times they happened and returns whether the learner may watch, the reason and the version. The same provider messages are sent to a fresh shop in the order they happened, in many shuffled orders from fixed seeds, with every message delivered twice, and with every refund message before its payment message. In every run the shop's answer equals the second calculation's. The scenarios are a plain refund and the buyer who paid twice. The result, with the number of runs and the seeds, is committed to your repository as the order-independence result.
A deliberately broken shop shows what the test can see. Change the shop so that the last message to arrive decides the answer instead of the times the payments and refunds happened (the README says how you did it). The order-independence test fails on at least one shuffled order of the plain refund. Undoing the change makes it pass.
Architectural guidance
A refund that does not end access is only caught when the next request is judged at that moment, so the test looks at what was issued and not at what the shop says. A test that reuses the shop's own calculation compares the shop with itself. A test that only runs the order its author thought of passes against a shop where the last message decides, which is the old shop's failure.
Architectural walkthrough
In the old shop a learner who was refunded kept watching for weeks. The checkout set an answer, the refund routine cleared it, the owner edited it by hand and the video page read it, so nobody could say which change came last or why. When the owner asked why a learner could watch, the shop had no answer. The cost was weeks of free access and two evenings spent finding out why.
The failure to survive is that access disagrees with the money. Access must open once when a payment is counted, whatever order the provider's messages arrived in, and must end when a refund is counted. A buyer who paid twice must keep the access of the payment that happened first. A learner must be able to start watching only while their access is live, and the studio must be able to say what it knew about a learner at a past moment, because a confirmation that arrives three hours late makes what was true and what the shop knew differ.
A viewing address that has already been issued keeps playing until it expires, and a process can die after a payment is saved and before the learner is told.
Track and assess
Produces watched time from several devices, lesson completion from time actually watched, and quiz attempts judged on the shop's clock. Leaves certificates, erasure and the whole-shop proof for later: finishing a course issues nothing yet.
Acceptance criteria
A devices script plays a laptop and a phone for one learner and one lesson. It is seeded, so a run repeats exactly. The laptop reports every 15 seconds of video as it plays. The phone watches offline and reports up to 6 hours later, and sends some reports twice.
A progress report sent with the learner's ID carries a report ID the device generated, a device ID, a lesson, the time the device made it, and a list of ranges, each a start and an end in whole seconds of the video. The shop accepts it. The shop judges a report under the course version the learner bought, whatever the report claims.
These are refused and store nothing: a range whose start is not below its end, a range ending beyond the lesson's length in the learner's version (a 480 second lesson refuses a range ending at 481), a lesson that is not in the learner's version, and a report made more than 5 minutes after the shop's time. A learner who bought nothing for the course is refused. A learner whose access was refunded still has their reports stored, because what they watched happened whatever became of the order.
The same report ID sent twice is accepted both times and leaves one report. Two identical reports sent at the same moment end as one report, and a test sends them so that the race could show.
A request for a lesson's resume position returns the end of the last range in the report made latest, the larger end when two reports were made at the same instant, or 0 for a lesson never watched. A laptop report made at 12:00:00 ending at second 135 sets it to 135. A phone report received at 12:05 that was made at 09:00 and ends at second 45 leaves it at 135.
The seeded run ends with one stored report per distinct report ID, every repeat accepted with nothing added, and a resume position equal to the end of the report made latest, whichever device sent it.
Architectural guidance
A phone that retries a post cannot know whether the first one arrived, so repeats are normal. The resume position follows the time a report was made, so a six-hour-old phone report cannot move the learner back from where the laptop got to, which is the overwrite the client described. A phone or a script that names a lesson from a version the learner did not buy would otherwise get credit for it.
Acceptance criteria
A request for a learner's progress on a course returns, for each lesson of the learner's version, the seconds watched, the lesson's length in seconds, whether the lesson is complete, and when it became complete.
Seconds watched count each second of the lesson once, however many of the learner's reports include it. A range runs from its start up to but not including its end. A lesson is complete when the seconds watched times 100 reach the completion percentage times the lesson's length, in whole numbers. At 90 percent a lesson of 480 seconds needs 432: a learner with 431 watched seconds is incomplete and one with 432 is complete. A lesson of 473 seconds needs 426, and 425 is incomplete. A learner who jumps to second 460 and watches to 480 has 20 watched seconds and the lesson is incomplete, however far along the video they got.
The five range pairs from the first Phase's sheet return the totals the sheet gives, each tested on its own, with the ranges sent in either order.
The time a lesson became complete is the earliest moment at which the reports made by then reach the threshold, so it does not depend on when they arrived. A 480 second lesson receives the ranges 0 to 300 made at 10:04:00, 300 to 440 made at 10:10:00 and 440 to 480 made at 10:11:00. In all six arrival orders the lesson ends complete, it became complete at 10:10:00.000Z, the seconds watched are 480 and the resume position is 480. A repeated report, or a late report for a lesson that is already complete, changes none of these.
Repeating every report, and shuffling the reports of a seeded run many times, change neither the seconds watched nor the completion time.
Architectural guidance
Completion is a count of seconds, and a count has to ignore seconds already counted. The threshold is compared in whole numbers because 90 percent of 473 seconds is the kind of boundary that decides, wrongly, whether a learner has finished. The completion time follows when the learner watched and not when the report arrived, so a phone's late report moves the answer to where it belongs and does not appear to complete the lesson hours after the learner stopped.
Acceptance criteria
A learner whose access is live starts a quiz attempt for a course. A learner whose access has ended is refused and nothing is stored. The attempt records its start from the shop's clock and the pass mark and limits of the learner's version. Under the sample rules that is 3 attempts, 20 minutes and a pass mark of 60. The response holds the attempt, its deadline and the questions with their options, and no answer key anywhere.
A fourth attempt is refused and stores nothing. With two attempts used, two start requests sent at the same moment end with one accepted start, one refusal and three attempts in all, and a test sends them so that the race could show. An attempt that is never submitted still counts as used.
A submission carries the answers. The shop judges the time by its own clock when the submission is received: one at or before the deadline is graded, and one after is refused as late and recorded with no score. A time sent by the learner's device is ignored. For an attempt started at 1 Apr 2026, 10:00 UTC, a submission received at 10:20:00.000Z is graded and one received at 10:20:00.001Z is refused, even when the device claims 10:05. A second submission for the same attempt is refused and leaves the score as it was. An answer naming an option that does not belong to the question, or a question that is not in the quiz, is refused and the attempt stays open.
The score is the whole percent of questions answered correctly, rounded down, with an unanswered question counted wrong: 3 of 5 is 60 and 4 of 7 is 57. Whether an attempt passed is its score compared with the pass mark of the learner's version, so 57 does not pass and 60 does. Three attempts scoring 40, never submitted and 80 give a best score of 80 with 3 of 3 attempts used and the quiz passed.
The learner's progress also reports the best score, the attempts used, the attempts allowed, whether the quiz is passed and whether the course is complete. A course is complete when every required lesson is complete and the best score reaches the pass mark. It became complete at the latest of the lessons' completion times and the submission time of the first passing attempt, so a late phone report that completes the last lesson completes the course as of when that lesson was finished.
Architectural guidance
A device controls everything it sends, including the time and how many times it tries, so the deadline and the limit are judged where the learner cannot reach them. An attempt that is never submitted still counts, or a learner could open attempts to read the questions at no cost.
Acceptance criteria
A test sets up 19 learners on version 1 of a course, each with every required lesson complete and a graded attempt scoring between 60 and 74 under the pass mark of 60, so each has passed. It keeps a full copy of every learner's attempts, reports and progress answers. The studio then raises the pass mark to 75, adds a ninth lesson, and publishes version 2.
Afterwards every copy is identical. For each of the 19 learners the progress answer gives the same scores, the quiz still passed, the course still complete and the same lessons, 8 of 8. Each learner is still on version 1. A request to move a learner to version 2 is refused.
A new learner buys after the publish and is on version 2. Their attempt scoring 65 does not pass, while an attempt scoring 65 by a learner on version 1 passes. Both exist at once, and neither answer changes when the other learner's attempt is graded.
An attempt started under version 1 at 10:00:00.000Z, with version 2 published at 10:05:00.000Z and the submission received at 10:10:00.000Z scoring 70, is graded against the pass mark of 60 and passes.
A reference calculation for completion, written from the brief's rules and sharing no code with the shop, takes a seeded set of reports and attempts. The same set is loaded into a fresh shop in the order they happened, in many shuffled orders, with every report sent twice. In every run the shop's progress equals the reference calculation's. The result is added to the order-independence result.
Architectural guidance
A recorded result is a fact about what happened under a rule. A rule read from the course as it stands today rewrites that result whenever the rule changes. A learner stays on the version they bought because moving one is a separate feature with its own question about what should happen to their results, which this brief leaves out. The test shows that nothing moves a learner by accident.
Architectural walkthrough
The pass mark on a course went from 60 to 75 percent, the old shop judged every recorded quiz against the new number, and 19 learners who had passed were told they had failed. A result is a fact about what happened under the rule the learner was on, and it has to stay what it was when the rule changes. The same goes for lessons: adding a ninth lesson to a course must not lower the progress of someone who finished eight.
Progress arrives from devices the studio does not control. A laptop reports every 15 seconds. A phone watches offline and reports hours later, sometimes twice. A phone report that arrives late must not overwrite where the laptop already got to, and a learner who skips to the end of every video must not count as having watched it.
Two learners can also ask for the last quiz attempt at the same moment, and a learner's laptop clock can say it is 10:05 when the shop says 10:20. A shop that trusts the learner's device lets a fourth attempt through and lets a late answer count. Every test in this Phase sets the shop's clock instead of waiting.
Certify and prove
Produces certificates with a public verification code, revocation on refund, learner erasure, and a newsletter-day run that checks the whole shop. Leaves taking a lesson down, payouts and disputes out of the brief.
Acceptance criteria
A learner who completes a course, with every required lesson complete and a best score that reaches the pass mark of their version, is issued a certificate with a code. A learner with every lesson complete and a failing score gets none, and so does a learner with a passing score and a required lesson missing.
The code is 12 characters from an alphabet of 32 that leaves out look-alikes such as 0 and O, unpredictable, and encodes nothing about the learner, the course or the time. The public page for a code shows the course title, the date of completion in Europe/Amsterdam, the certificate marked as valid, and the learner's name. It never shows the email. Random wrong codes each get a not-found answer with an identical body.
Two learners take the same course: one is on version 1 with a best score of 65 and a pass mark of 60, and one is on version 2 with a best score of 65 and a pass mark of 75. The first receives a certificate and the second does not.
The report that finishes the last required lesson sent twice, or two such reports sent at the same moment, end with one certificate for the learner and course version. A test sends the last case so that the race could show.
A test stops the shop right after a learner's course is concluded complete and before the certificate exists, using a way the README names. After the shop starts again, with nobody running a repair, the learner has exactly one certificate within 5 seconds.
Architectural guidance
A certificate is a claim to strangers, so it is issued only when the learner's own rules say the course is complete. A duplicate gives one completion two codes. The code is random so that holding one certificate tells a stranger nothing about any other.
Acceptance criteria
When a refund ends a learner's last live access to a course, every certificate they hold for it shows as revoked on its public page. The page shows the course title and the date of the revocation, which is the time the refund happened. It is neither a not-found answer nor marked valid.
The same refund message delivered twice, or two such messages at the same moment, end with the certificate revoked once. A test sends the last case so that the race could show.
Take the buyer who paid twice in the fourth Phase. Order B is refunded as a duplicate while order A still gives the learner access. The certificate stays valid, because the learner may still watch.
The completion can arrive after the refund. A phone report received after the refund, but made before it, finishes the last required lesson, and the course is concluded complete as of when the learner finished. The certificate is issued and then shown as revoked. Whichever the shop handles first, the completion or the refund, the final state is one certificate shown as revoked. A test forces both orders.
Architectural guidance
A certificate that is edited or removed after a refund loses the fact that it was ever valid, and a stranger who checks the code needs to be told it was withdrawn. A duplicate-payment refund ends one order and leaves the access from the other, so it must not revoke. A shop that refuses to issue a certificate once a refund exists, or revokes only what already exists, ends in a different place depending on which message it handled first.
Acceptance criteria
An erasure request for a learner is accepted from that learner or from the studio, and refused when a learner names a different learner. Afterwards the learner's name and email are gone, and the shop reports that the learner is erased and when. A second request is accepted and leaves the erasure time as the first request set it.
The counts of orders, payments, refunds, access records, progress reports, quiz attempts, certificates and revocations are unchanged. The may-watch answer, the progress answer and each order's status are the same as before.
A test searches for the learner's former name and email in everything the shop stores, writes to its logs, holds waiting to go out or has sent anywhere except the mailbox. It finds 0 matches. The mailbox keeps messages already sent, and the README says so plainly.
The public page for an erased learner's certificate shows the course title, the date of completion and whether it is valid or revoked, and no name.
An email waiting to be sent at the moment of erasure sends nothing, raises no error and leaves nothing for the studio to clear. A learner who registers again with the same email gets a new learner ID with no link to the erased one.
The operations note says the studio has a legal duty to keep its business records for 7 years (Dutch tax administration rule, 10 years for sales reported under the One Stop Shop VAT scheme), which is why orders, payments and refunds stay identified by ID when a learner is erased, and that the shop deletes nothing on a schedule and erases on request only.
Architectural guidance
A learner's name and email get copied into receipts, logs, waiting mail and certificate pages without anyone deciding to. A learner who asks to be erased and later finds their name on a public certificate page has been told something untrue. The Dutch record-keeping duty of 7 years, 10 for One Stop Shop sales, is why erasure takes the personal details and leaves the records, so the brief builds erasure on request only.
Architectural walkthrough
A certificate is a claim a stranger can check. A stranger types a code into a public page and learns whether the studio vouches for the person. A certificate issued for a course that was never completed is a false claim, and a false claim cannot be recalled quietly. A certificate that vanishes after a refund tells the stranger nothing, where "revoked" tells them the studio withdrew it. The page cannot be wrong in either direction.
Completion and refund can reach the shop in either order. A phone report that finishes the last lesson may arrive after the learner was refunded, and the shop must end in the same place whichever it handles first. A process that dies between completing a course and issuing the certificate leaves a learner who passed with nothing to show, and nobody notices until they write.
The page also shows a name, and a name is personal data. The learner can ask for it to be erased, and the orders, payments, progress and certificates that the studio has to keep must still make sense afterwards. The last Checkpoint puts all of it together on a newsletter day, when payments arrive late, host reports repeat, phones upload hours late and the pass mark changes halfway.
Architectural walkthrough
One answer that nobody can explain
The old shop kept a single answer for whether a learner could watch, and every part of the business wrote to it. The checkout set it, the refund routine cleared it, the owner edited it by hand, and the video page read it. When the studio asked why a refunded learner kept watching for weeks, the shop had no answer, because an answer that gets overwritten says nothing about who wrote it last or why. Each failure in the client's story traces back to that. The check on your own build is whether you can say, for any learner, why they can watch now and why they could at 12:00 last Tuesday.
Rules that change must not rewrite the past
The owner raised a pass mark from 60 to 75 and the shop judged every recorded quiz again. 19 learners who had passed were told they had failed and their certificates stopped verifying. A learner who bought under a 14-day refund rule was promised 14 days, and a window that follows whatever rule applies today breaks that promise the day the studio changes it. Adding a lesson to a course must not lower the progress of a learner who finished the old one. In your build, raise the pass mark, add a lesson and change the refund rule, and check that no learner who bought earlier sees a different result.
Outside parties are late, repeat themselves and arrive out of order
A payment confirmation reached the studio three hours after the buyer paid. The buyer saw nothing, paid a second time, and the studio refunded 79 euros by hand. The video host calls back until it gets an answer, so the same report arrives twice, and sometimes a failure that happened earlier arrives after a ready report. One lesson showed "processing" for two days because the shop took whichever message came last as the truth. A message can also be forged, or a genuine one can be sent again later. In your build, send every message twice, late, reversed and altered, and check that the learner, the studio and the money all end up in the same place.
Two people at the same moment
Two refund requests for one purchase, two publishes of one draft, and two requests for a learner's last quiz attempt can all arrive in the same instant. Each request looks fine on its own, and both succeed. The studio would refund 79 euros twice, two groups of buyers would hold different pass marks under one version number, and a learner would get a fourth attempt. A test that sends the two requests one after the other passes against all of these, so your tests have to be able to fail.
The process dies in the middle
A process can die after a payment is saved and before the learner is told. The buyer has paid, sees no access, and nobody finds out until they write. The reverse is quieter: a refund is saved, access is not ended, and the learner keeps watching. A learner can finish a course and never receive the certificate. None of these leaves an error behind. In your build, stop the shop at each of those moments, start it again, and check that nothing is lost and nothing is done twice.
What a refund really costs
A viewing address that was issued before a refund keeps playing until it expires. The studio cannot take it back, so the length of the address is the longest a refunded learner can keep watching, and the studio has to be told the number.
Where it shows if you cut a corner
Four symptoms show a cut corner. A refunded learner keeps watching, and the studio cannot say who wrote the answer last. A raised pass mark tells learners who passed at 60 that they failed at 75. A buyer pays twice because a confirmation came three hours late, and the studio refunds 79 euros by hand. Two refund requests for one purchase return 79 euros twice.
Related Links
- Belastingdienst, keeping your business recordsbacks the 7 years the studio must keep its business records, and the 10 years for sales reported under the EU One Stop Shop VAT scheme, so the shop deletes nothing by age.
- GDPR Article 17, right to erasurebacks erasing a learner's name and email on request while orders, access and certificate records stay.
- GDPR in the Netherlands, age of digital consentbacks the 16-year line that keeps learners under 16 out of scope.
- Stripe: webhooksthe provider behaviour the stand-in imitates, with confirmations that arrive late or more than once.
- Mux: listen for webhooksbacks the video host that calls back until it gets an answer, so the same report can arrive twice.