Skip to content

Transaction Review Service#33

Open
NicoleWiktor wants to merge 15 commits intoautomationExamples:mainfrom
NicoleWiktor:nicole-wiktor-assessment
Open

Transaction Review Service#33
NicoleWiktor wants to merge 15 commits intoautomationExamples:mainfrom
NicoleWiktor:nicole-wiktor-assessment

Conversation

@NicoleWiktor
Copy link
Copy Markdown

Transaction Review Service: Spec-Driven Backend

Summary

This PR implements a backend service that evaluates transactions and decides whether to approve, review, or reject them based on a set of predefined criteria.

The focus of this implementation was to build a system that is clear, testable, and structured around a spec-driven development workflow.


Approach

I began by using ChatGPT to structure the system design and define the overall architecture, including:

  • defining core features and responsibilities
  • identifying necessary endpoints and workflows
  • outlining how the decision engine should behave
  • thinking through test coverage and edge cases

From there, I created a SPECS/ directory and wrote out each feature before implementation.

Once the specs were defined, I used GPT-5.3 Codex within the Cursor IDE to assist with implementing features, including:

  • FastAPI route structure
  • SQLAlchemy models
  • test case scaffolding

This allowed me to stay focused on system design and correctness while using AI as a tool to accelerate development. I also focused on keeping the system easy to reason about by separating validation from decision logic and using deterministic rules, which made testing and debugging straightforward.

The decision engine is implemented as a deterministic, rule-based system that produces both a decision and structured reasoning, making the behavior testable and easy to extend.


What's Included

  • POST /transactions - submit and evaluate a transaction against predefined decision criteria
  • Deterministic decision engine producing approved, review, or rejected outcomes with structured reasoning
  • SQLite database for persistence

Additional endpoints:

  • GET /transactions - list all transactions
  • GET /transactions?decision=... - filter by decision
  • GET /transactions/{transaction_id} - retrieve a specific transaction
  • GET /transactions/summary - aggregate decision counts
  • GET / - health check
  • Comprehensive API test suite (21 tests) covering core flows and edge cases

Testing

The test suite covers:

  • valid and invalid transaction submissions
  • all decision paths (approved, review, rejected)
  • filtering and retrieval
  • error cases (422, 404)
  • summary results (both empty and populated)

Notes

  • Detailed setup and run instructions are provided in the README.
  • Everything runs locally
  • No secrets or credentials are included
  • SQLite is used to keep setup simple

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant