Skip to content

feat: REST API — Bounty CRUD Endpoints (T1-003)#135

Closed
yw13931835525-cyber wants to merge 1 commit intoSolFoundry:mainfrom
yw13931835525-cyber:feat/bounty-crud-api
Closed

feat: REST API — Bounty CRUD Endpoints (T1-003)#135
yw13931835525-cyber wants to merge 1 commit intoSolFoundry:mainfrom
yw13931835525-cyber:feat/bounty-crud-api

Conversation

@yw13931835525-cyber
Copy link

@yw13931835525-cyber yw13931835525-cyber commented Mar 20, 2026

Bounty T1-003: REST API — Bounty CRUD Endpoints

What this PR delivers

Implements a full production-ready bounty CRUD API layer for SolFoundry:

Endpoints

  • POST /api/bounties — Create a new bounty
  • GET /api/bounties — List bounties with filter/sort/pagination
  • GET /api/bounties/{id} — Get a single bounty
  • PATCH /api/bounties/{id} — Update a bounty
  • DELETE /api/bounties/{id} — Delete a bounty

Schema and Validation

  • Pydantic v2 schemas with full validators (category, status, reward_token, skills deduplication)
  • Input validation on all fields, 422 on bad payloads
  • 404 on missing bounty for GET/PATCH/DELETE

ORM Model

  • SQLAlchemy async model with all bounty fields
  • GIN indexes on search_vector, skills, and composite (status, tier), (status, category)
  • reward_amount, deadline, popularity indexes for fast sorting

Service Layer

  • Async BountyService with clean separation of concerns
  • Supports filter by: tier, category, status, reward_min/max, skills
  • Sort by: newest, reward_high, reward_low, deadline, popularity
  • Pagination with skip/limit

Tests

  • 183 lines of pytest-asyncio tests covering:
    • Create (201), list, get, update, delete (204)
    • 404 not found paths
    • Validation error (422)
    • Skill deduplication

Stack

FastAPI + SQLAlchemy async + PostgreSQL + Pydantic v2 + pytest-asyncio

Payout Address

FNDRY: (fill in before merge)
Wallet: (fill in before merge)

Closes #3

Summary by CodeRabbit

Release Notes

  • New Features

    • Added GET /bounties endpoint for listing bounties with filtering capabilities.
    • Added PATCH /bounties/{id} endpoint for updating bounty details.
    • Added DELETE /bounties/{id} endpoint for removing bounties.
    • Enhanced search filtering with improved parameter handling.
    • Strengthened data validation for bounty fields including rewards and skills.
  • Tests

    • Added comprehensive bounty CRUD operation test suite.

- Full CRUD: create, read, list, update, delete bounty endpoints
- Pydantic schemas with validators for category/status/reward
- SQLAlchemy ORM model with GIN indexes for search/filter
- Service layer with async queries and pagination
- Test suite covering all CRUD operations + validation + 404s
- Compatible with existing FastAPI app and database.py setup

Closes SolFoundry#3
@github-actions
Copy link

⚠️ Missing Solana wallet address

@yw13931835525-cyber, your PR doesn't include a Solana wallet address. We need this to send your $FNDRY bounty payout.

Please edit your PR description and add your Solana wallet address.

You have 24 hours to add your wallet or this PR will be automatically closed.


SolFoundry Review Bot

@github-actions
Copy link

🚫 Auto-closed — did not pass submission checks

Reason: Duplicate — PR #114 was already merged for bounty #3

Submission Rules

  • PR must link a bounty issue (Closes #N)
  • Do not commit node_modules/, binary files, or build artifacts
  • Include meaningful code changes (not just config/README edits)
  • Keep submissions focused on the bounty scope
  • No excessive TODOs/placeholders

Please review the bounty rules and open a new PR when ready.


SolFoundry Review Bot

@github-actions github-actions bot closed this Mar 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR implements a comprehensive CRUD API for bounties across the backend stack. It introduces a request-scoped BountyService provider used via dependency injection in the API layer, adds new endpoints for list, create, update, and delete operations alongside existing search and retrieve functionality, refactors the ORM model BountyDB to SQLAlchemy 2.0 typed mappings with validation and normalization logic, upgrades the BountyService class to include CRUD methods with async database operations, conditionally initializes PostgreSQL-specific full-text search infrastructure, and includes end-to-end test coverage for the CRUD API operations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

approved, paid

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Changes include bounty management features (CRUD, search, filtering) all aligned with issue #3. However, Docker Compose, Alembic migrations, and OpenAPI docs requirements from issue #3 deliverables are not evident in the provided summaries. Verify that docker-compose.yml, database migrations, and OpenAPI/Swagger documentation are included in the PR or document why these were deferred.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: REST API — Bounty CRUD Endpoints (T1-003)' clearly summarizes the main change: implementing CRUD endpoints for the bounty REST API, directly addressing the core objective.
Linked Issues check ✅ Passed The PR fully implements the core coding requirements from issue #3: POST/GET/PATCH/DELETE bounty endpoints with filtering, pagination, validation, async ORM model, service layer, and pytest tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Important

Merge conflicts detected (Beta)

  • Resolve merge conflict in branch feat/bounty-crud-api
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

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

Labels

missing-wallet PR is missing a Solana wallet for bounty payout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant