Skip to content

Instantly share code, notes, and snippets.

@tomohisa
Created August 11, 2025 08:12
Show Gist options
  • Save tomohisa/86aa0660d6ded1df62f4586bfd5e6071 to your computer and use it in GitHub Desktop.
Save tomohisa/86aa0660d6ded1df62f4586bfd5e6071 to your computer and use it in GitHub Desktop.

Expense Claims (Auto-Evaluation) — Basic Spec

Stack: C# + Sekiban (reuse Weather sample structure), Blazor (1 page), Sekiban Documents via MCP. Assumption: Single user context (e.g., demo-user).

Goal

Let one user run multiple parallel expense stories. Small claims auto-approve; big ones get flagged; a monthly cap blocks excess. Show intent via commands + timeline.

Domain

Aggregate: ExpenseClaim State: ClaimId, UserId, Amount, Category, Status, SubmittedAt, DecisionNote Commands: Submit, AttachReceipt, Approve, Reject, MarkPaid, Withdraw Events: Submitted, ReceiptAttached, AutoApproved, Flagged, Approved, Rejected, Paid, Withdrawn

Rules (keep it simple) • Amount <= 50 → AutoApproved • Amount > 50 → Flagged (receipt required before Approve/Reject) • Monthly cap = 500 per user (sum of Approved + AutoApproved). Exceeding → reject at Submit.

Projections • MyClaimsList: user’s claims with status. • MyMonthlyTotals: per YearMonth totals and remaining budget.

API (Minimal) • POST /claims/submit • POST /claims/{id}/attach-receipt • POST /claims/{id}/approve / reject / mark-paid / withdraw • GET /claims/mine / mine/monthly / {id}/events

Blazor (One Page)

Left: New Claim form (Amount/Category/Note). Center: MyClaimsList table with context actions. Right: Event timeline for selected claim. Top-right: “This month: $X / $500”.

MCP (Sekiban Documents) Prompts 1. “Generate one-page domain doc (aggregate, commands/events, rules, projections).” 2. “Update doc with endpoint list + short happy/failure paths.” 3. “Create a 10-line demo runbook.”

Demo Flow (4 quick stories) • Coffee $12 → AutoApproved → Paid • Flight $420 → Flagged → AttachReceipt → Approved • Dinner $200 (no receipt) → Flagged → Rejected • Submit until cap exceeded → Submit rejected (cap)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment