انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-069-L08

عرض عملي: طلب استرداد يُوجَّه إلى موافقة بشرية

  • الدرس 8 من 8
  • Mid-level
في هذا الدرس 3 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

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

تفاصيل المخطط المبدئي

خطوة بخطوة

  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.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.