fix: add missing week field to scout reward POST #75
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#75
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/scout-reward-week"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
weekfield in the request bodyscout_view.pywas posting without it, causing a 422 validation error when a user selected a card from a scout opportunitycurrent['week']viadb_get("current")before posting — same pattern used by daily check-in and game rewardsdb_getmock to the happy-path testFiles Changed
discord_ui/scout_view.py— addeddb_getimport, fetch current week, includeweekin payloadtests/scouting/test_scout_view.py— addeddb_getmock totest_successful_scout_creates_card_copyTest Plan
- Fix int_timestamp() no-arg path returning seconds instead of milliseconds, which would silently break the daily scout token cap against the real API - Acknowledge double-click interactions with ephemeral message instead of silently returning (Discord requires all interactions to be acked) - Reorder scout flow: create card copy before consuming token so a failure doesn't cost the player a token for nothing - Move build_scouted_card_list import to top of scout_view.py - Remove unused asyncio import from helpers/scouting.py - Fix footer text inconsistency ("One scout per player" everywhere) - Update tests for new operation order and double-click behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>- Include pack_id in db_post("cards") payload (API requires it) - Player names now link to card image URLs in scout embed - Display format: "🟡 All-Star — [2023 Mike Trout](card_image_url)" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>- Add SCOUTABLE_PACK_TYPES env var (default: Standard,Premium) to control which pack types offer scout opportunities - Unify embed construction into build_scout_embed() — removes 3 near-duplicate embed builders across scout_view.py and scouting.py - Replace manual total_scouts counter with derived property from claims dict - Remove redundant db_get("current") API call per scout click — use PD_SEASON - Remove duplicate expiry computation in create_scout_opportunity - Move send_to_channel to top-level import, remove redundant local import - Update tests to match simplified code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c875cee9eeto3e9c2f6564