Project: Before the Weekend Sale

Your sign-off on Quill’s pull #32 was practice for the question Grace asked at the start of this course. Margaret’s pull #45, built on quill/gift-cards-v2, says that later returns on orders paid partly with a gift card now send the right share back to each tender. Every test passes, and the weekend sale is close.

In this project, you’ll decide what evidence would convince you that Margaret’s change is right, gather it from the running shop, and write Grace a sign-off you can put your name on. Start with what Grace asked for.

Read the Brief

Grace’s question is on Margaret’s pull request, which comes with her branch. When you switch to it from your second-draft-books folder for the first time, Git makes a local copy of the branch:

Language: Shell
$ git switch margaret/refunds-to-gift-cards
$ npm run seed

Then open docs/pulls/45.md:

Language: Markdown Text Filename: docs/pulls/45.md
**Margaret:** Extends the tender allocation for follow-up returns. Uses the
original gift contribution as the ceiling on the later return. The outer refund
function retains the total-payment limit. Based on `quill/gift-cards-v2`.

**Grace:** All the tests pass. Can this ship before the weekend sale? Please
tell me what you checked in the records and outbox, and what remains uncertain.

Grace asks for a decision, for what you checked in data/ and outbox/, and for what you’re still unsure of. That’s the sign-off from the last lesson. You’ll write it under the Evidence section in your map.md.

Here’s what you’re working with:

  • The change: margaret/refunds-to-gift-cards, built on quill/gift-cards-v2. Compared with its base, it changes one hunk in src/refunds/destination.js and adds docs/pulls/45.md. You don’t need anything else in the codebase to start.
  • The intent: Grace’s gift card criteria under “Gift cards” in docs/REQUESTS.md. The refund paragraph is the one this change touches.
  • The order to run: Nadia Patel (customer-1) buys Small Maps for 750p and The Long Way Home for 2250p with no discount code, 3000p in all. She pays 1000p with GIFT-1000 and 2000p by card. Then she returns the two books one at a time, Small Maps first.
  • Where the evidence lives: The order’s fields, gatewayRefunds, giftCards, and stock in data/shop.json, and the emails in outbox/.

Grace’s “All the tests pass” is true, since npm test reports 24 of 24 on both branches. As Intent and Acceptance showed, that means Edsger’s examples still work. His note on pull #32 said they’re examples, not every sequence.

Plan Your Checks

The steps follow a senior colleague’s order, and each says what to write in map.md. They run across this brief and the three items after it:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.