Inspiration

In fiscal year 2025, only 1,390 of 5,050 Texas journeyman electrician exam attempts passed, a 27.52% pass rate (TDLR exam statistics). On September 1, 2026, Texas adopted the 2026 NEC (TDLR rule adoption), so instructors are re-teaching on a new edition at the same time.

I'm a commercial electrician trained at IBEW Local 453, and I build Sentinel Learning's NEC exam prep. Instructors buy class seats in bulk, and the buying, bookkeeping and refunds pull time away from teaching. I wanted an agent that handles the money work but never moves a dollar on its own.

What it does

An instructor asks in plain English: "Buy 12 seats for my fall class." The seat assistant returns a server-priced proposal. The instructor clicks Confirm, pays through PayPal Sandbox, and the seats unlock only after PayPal confirms the capture. PayPal's checkout also offers Pay in 4 and Pay Monthly, so an instructor can unlock a whole cohort's seats today and spread the cost. Each seat unlocks Sentinel's NEC exam prep, which teaches electricians to find answers in their own code book on the 2026 NEC.

The same assistant can propose a refund of the most recent paid order. A Confirm bar shows the capture ID and amount, and only that click issues the refund.

The seat ledger, a live PayPal events drawer and an AG Studio analytics report all update as it happens.

The agent proposes, a human approves, PayPal executes. Unlike autonomous spend agents that hold payment credentials, the AI is kept out of the money path. It can price and stage proposals from plain English on two AI surfaces, but only a human Confirm click reaches the server-verified PayPal Orders v2 and Payments v2 endpoints.

How I built it

Built new for this hackathon: the first commit was October 26, 2026, inside the submission period.

  • PayPal Orders v2 and Payments v2. Orders are created with POST /v2/checkout/orders and captured with POST /v2/checkout/orders/{id}/capture. Refunds call POST /v2/payments/captures/{id}/refund for the recorded amount, with a fixed PayPal-Request-Id so a repeated click can't refund twice.
  • Verified webhooks. PAYMENT.CAPTURE.COMPLETED and PAYMENT.CAPTURE.REFUNDED are verified against the raw request body. Seats are granted and revoked through idempotent Postgres functions. A partial refund is recorded but never revokes seats.
  • Two AI surfaces, one money path. Whether the instructor uses the seat assistant on the Overview page or Ask AI inside AG Studio, both run on Claude Sonnet 5.5 through a sign-in-only server proxy with hard timeouts, and neither model can create, capture or refund a PayPal order. Those endpoints are reached only by the instructor's Confirm click, and the server re-checks the user, price and capture ownership on every call.
  • AG Grid, AG Charts and AG Studio. The seat ledger tables and the by-class table are AG Grid, with wrapped headers so no column truncates at any width. Instructor analytics is an AG Studio report: revenue and seat KPIs, AG Charts of seats and revenue by day, and three custom widgets (Revenue tile, Seat progress, Class fill). A custom Seat agent sits beside Studio's built-in agents. Studio's lead agent hands seat requests to it with delegate_to, and it places the proposal in the same Confirm bar.
  • Stack. React, Vite and Express on Vercel, Supabase Postgres, and Playwright browser tests, all passing.

Challenges I ran into

  • Theming AG Grid and AG Charts with modern color tokens. The dashboard's three themes (Black & Safety-Yellow, Industrial, Light) use oklch colors. AG Studio only converts rgb() and color(srgb) values for its charts and grids, so oklch fell back to defaults. I generate sRGB hex twins of every color token per theme and point Studio at those. Unit tests enforce WCAG AA contrast in all three themes, and a headless test samples the chart canvas to prove each palette is drawn.
  • Immediate updates that stay correct. A Confirm click grants or revokes seats right away, so the ledger changes at once. The verified webhook that follows calls the same idempotent Postgres function, so it reconciles the record if a browser tab closes mid-checkout and is a no-op when the click already did the work.

What I learned

Keeping the model out of the money path made the AI easier to trust and to test. The agent can be as helpful as it likes, because the only thing that can spend or refund is a human click the server re-checks.

What's next

  • Class rosters: seats assigned to named students, with readiness pulled from the exam-prep product.
  • PayPal Invoicing for schools that pay by purchase order.

Built With

Share this project:

Updates

Submission history