Skip to content

feat(api): add proposal management API (#216) - #227

Merged
SudiptaPaul-31 merged 3 commits into
Lumina-eX:mainfrom
Sam-Rytech:feat/216-proposal-management-api
Oct 3, 2026
Merged

SudiptaPaul-31 merged 3 commits into
Lumina-eX:mainfrom
Sam-Rytech:feat/216-proposal-management-api

Conversation

@Sam-Rytech

@Sam-Rytech Sam-Rytech commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
  • POST/GET /api/projects/:id/proposals and PATCH/DELETE /api/proposals/:id
  • Freelancer-only create/edit/delete; project client drives review status
  • One active proposal per freelancer per project (pre-check + partial unique index, 409 on conflict)
  • Status lifecycle submitted/updated/under_review -> accepted|rejected, invalid transitions return 409
  • Zod validation with field-level errors; { success, data, errors } envelope
  • Paginated, status-filterable listing with per-project cache invalidation
  • Migration 010_project_proposals.sql with project/freelancer indexes

Closes #216

- POST/GET /api/projects/:id/proposals and PATCH/DELETE /api/proposals/:id
- Freelancer-only create/edit/delete; project client drives review status
- One active proposal per freelancer per project (pre-check + partial
  unique index, 409 on conflict)
- Status lifecycle submitted/updated/under_review -> accepted|rejected,
  invalid transitions return 409
- Zod validation with field-level errors; { success, data, errors } envelope
- Paginated, status-filterable listing with per-project cache invalidation
- Migration 010_project_proposals.sql with project/freelancer indexes
@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@Sam-Rytech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SudiptaPaul-31

Copy link
Copy Markdown
Collaborator

@Sam-Rytech resolve conflicts

Resolve the add/add conflict in app/api/proposals/[id]/route.ts with the
client proposal dashboard (Lumina-eX#213), which added the same path:

- keep this PR's PATCH (content edit / status change) and DELETE handlers
  for project_proposals;
- keep Lumina-eX#213's GET handler, resolveUser helper and imports unchanged.

Both proposal modules coexist: @/lib/proposals (this PR) and
@/lib/proposals/{db,service,types} (Lumina-eX#213).
@Sam-Rytech

Copy link
Copy Markdown
Contributor Author

@SudiptaPaul-31 Conflict fixed

@SudiptaPaul-31

Copy link
Copy Markdown
Collaborator

@Sam-Rytech ci failing

The Lumina-eX#189 milestone state machine (merged in Lumina-eX#236) requires
start_milestone (Funded -> InProgress) before submit_milestone. Six
dispute tests still called submit_milestone straight after fund(), so
submit returned InvalidMilestoneStatus (Lumina-eX#6):

- test_arbiter_can_raise_dispute and test_dispute_events_are_emitted
  failed, breaking the `contracts` CI job on main and on every open PR.
- test_release_blocked_while_disputed, test_refund_blocked_while_disputed,
  test_multiple_disputes_rejected and test_resolve_without_dispute_fails
  passed only by accident, panicking at submit instead of at the step
  they actually test.

Add the missing start_milestone call to all six. `cargo test
--workspace` in contracts/ now passes (escrow 29/29).
@Sam-Rytech

Copy link
Copy Markdown
Contributor Author

@SudiptaPaul-31 Check it out

@SudiptaPaul-31
SudiptaPaul-31 merged commit 767217c into Lumina-eX:main Oct 3, 2026
2 checks passed
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.

[Feature]: Proposal Management API

2 participants