Skip to content

Add shop transactions and karma#6

Open
konard wants to merge 3 commits into
RattusRex:mainfrom
konard:issue-5-96dbaa24fd57
Open

Add shop transactions and karma#6
konard wants to merge 3 commits into
RattusRex:mainfrom
konard:issue-5-96dbaa24fd57

Conversation

@konard
Copy link
Copy Markdown

@konard konard commented May 26, 2026

Fixes #5

Summary

  • add persistent character inventories with gold and item rows
  • add shop endpoints for buying and selling items by name
  • subtract mercenary costs during buy/sell transactions and validate balances
  • prevent selling an item that is not present in the character inventory
  • add user-level karma with endpoints to increase and decrease it
  • add reproducible FastAPI tests using an isolated SQLite database

API changes

  • GET /characters/{character_id}/inventory
  • POST /characters/{character_id}/inventory/gold/add
  • POST /characters/{character_id}/shop/buy
  • POST /characters/{character_id}/shop/sell
  • POST /me/karma/add
  • POST /me/karma/subtract

Testing

  • python -m compileall app
  • pytest -q

konard added 2 commits May 26, 2026 22:00
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: RattusRex#5
@konard konard changed the title [WIP] Магазин Add shop transactions and karma May 26, 2026
@konard konard marked this pull request as ready for review May 26, 2026 22:06
@konard
Copy link
Copy Markdown
Author

konard commented May 26, 2026

Working session summary

Implemented and pushed the fix for issue 5.

PR: #6

What changed:

  • Added inventory persistence with gold and item rows.
  • Added shop buy/sell endpoints that handle item price plus mercenary cost.
  • Prevented selling items that are not in the character inventory.
  • Added global user karma with add/subtract endpoints.
  • Added requirements.txt, pytest.ini, and API tests covering buy, sell, and karma behavior.
  • Updated PR 6 title/body and marked it ready for review.

Verification:

  • python -m compileall app
  • pytest -q3 passed

No CI runs are configured or reported for this branch, and the working tree is clean.


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Author

konard commented May 26, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $4.906767

📊 Context and tokens usage:

  • 157.4K / 1.1M (15%) input tokens, 11.5K / 128K (9%) output tokens

Total: (157.4K + 2.8M cached) input tokens, 11.5K output tokens, $4.906767 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (21680KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Author

konard commented May 26, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • No CI/CD checks are configured for this repository
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

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