Füge neue SQL-Abfragen für die Abfrage von Lagerbeständen nach Typ hinzu: Implementiere QUERY_GET_REGION_STOCKS_BY_TYPE und QUERY_GET_USER_STOCKS_BY_TYPE, um die Abfrage von Lagerbeständen zu optimieren. Aktualisiere die Logik in events.rs, um die neuen Abfragen zu verwenden und erweitere die Struktur StorageDamageInfo, um zusätzliche Informationen zu zerstörten Einheiten und betroffenen Regionen zu speichern. Ergänze die Dokumentation in AGENTS.md mit Projektleitlinien und Entwicklungsbefehlen.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m48s

This commit is contained in:
Torsten Schulz (local)
2026-05-27 17:51:39 +02:00
parent 86d79c90a5
commit f09033a99d
3 changed files with 214 additions and 28 deletions

29
AGENTS.md Normal file
View File

@@ -0,0 +1,29 @@
# Repository Guidelines
## Project Structure & Module Organization
- **Daemon-Worker Architecture**: A standalone Rust daemon for the Falukant game backend, managing game mechanics through background workers.
- **Workers (`./src/worker/`)**: Modular task handlers (e.g., `PoliticsWorker`, `FalukantFamilyWorker`, `EventsWorker`) that execute periodic game logic ("ticks"). Most workers extend the `BaseWorker` logic.
- **Database Layer**: Uses PostgreSQL for persistence. Core SQL queries are centralized in `./src/worker/sql.rs`, while connection management resides in `./src/db/`.
- **Real-time Communication**: `./src/websocket_server.rs` manages client connections, broadcasting game state updates via `./src/message_broker.rs`.
- **Migrations**: Database schema changes are managed manually via SQL scripts in `./migrations/`.
- **Documentation**: Detailed technical specs and handoff notes are located in `./docs/`.
## Build, Test, and Development Commands
- `cargo build`: Compile the project.
- `cargo clippy`: Run the linter to ensure code quality.
- `cargo run`: Start the daemon.
- `cargo fmt`: Format the codebase according to Rust standards.
- `cargo check`: Rapidly check for compilation errors.
## Coding Style & Naming Conventions
- **Rust Standards**: Follows idiomatic Rust conventions (snake_case for variables/functions, PascalCase for types).
- **Linter**: Enforced via `clippy`. Use `cargo clippy` before committing.
- **Database Logic**: Prefer centralizing complex SQL queries in `./src/worker/sql.rs` rather than inlining them in worker logic.
## Testing Guidelines
- **Manual Verification**: No automated test suite exists (`cargo test` returns no results). Verify changes by running the daemon and inspecting database state or WebSocket output.
- **Smoke Tests**: Follow instructions in `./docs/` for feature-specific manual testing (e.g., `./docs/FALUKANT_DEATH_SUCCESSION_SMOKE_TEST.md`).
## Commit & Pull Request Guidelines
- **Commit Messages**: Primarily written in German, though English is acceptable. Messages typically start with an imperative verb (e.g., "Füge", "Verbessere", "Behebe", "Refactor", "Enhance").
- **Context**: Reference specific features or workers in the commit subject to maintain clarity in the history.