Skip to content
Ameen Abozaid
Planned lessonMID-069-L08

Demo: a refund request routed to human approval

  • Lesson 8 of 8
  • Mid-level
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

add a side-effect tool that only creates a pending request. Prepares MID-069-LAB1.

Draft outline details

Step by step

  1. Define request_refund(orderId, reason); it inserts a PENDING refund request.
  2. Add an idempotency key (order id plus reason hash); a repeat returns the existing request.
  3. Build the approval endpoint used by a support agent; only that role can execute the refund.
  4. Add loop limits (steps, time, cost) and show the loop stopping.
  5. Planned mistake: let the tool call the payment API directly "to save a step"; the test "no side effect without approval" fails. Fix by moving execution behind approval.
  6. Show the audit record: requester, approver, arguments.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.