Codstak
    • Home
    • DSA
    • JavaScript
    • TypeScript
    • Node.js
    • React
    • More↓
      BlogReact PrepPricingDiscordNewsletterLeaderboard
    React challenge/medium

    Model a Refund Workflow

    Challenge workspace

    100-120 min
    Real-world mini-appsPath 26/30
    ReducersState & eventsForms

    Suggested first

    Recoverable Equipment Checkout

    Your workspace must pass its server-side browser checks to complete this challenge.

    Day 9 — Model a refund workflow with a reducer

    Use explicit states and actions so impossible transitions are difficult to represent.

    The provided submission boundary rejects a reason containing duplicate and accepts other non-empty reasons, so both failure recovery and completion can be tested locally.

    Requirements

    • Model reason, review, submitting, failed, and complete states.
    • Reject a review transition without a reason.
    • Preserve the reason through an error and offer a recovery path.
    • Do not encode mutually exclusive workflow states with scattered booleans.

    Interview review

    • What would justify a state-machine library here?
    • Which transition rules belong on the server too?