Skip to content

fix(routes): wrap marketplace plugin and dispute responses in envelopes - #1475

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:fix/1249-envelope-plugins-and-disputes
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:fix/1249-envelope-plugins-and-disputes

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1249

Summary

Updates src/routes/marketplace/plugins.ts and src/routes/billing/disputes.ts so every JSON response is wrapped in the standard successEnvelope / errorEnvelope (via next(AppError)), updates docs/openapi.json to document /api/marketplace/plugins and /api/billing/disputes with standard envelope schemas, and expands src/contracts/responseEnvelope.contract.test.ts to verify both route families.

Acceptance Criteria Mapping

  • GET /api/marketplace/plugins and POST /api/marketplace/plugins/:pluginId/install return { success: true, data, requestId, timestamp } on success and { success: false, error, requestId, timestamp } on failure: Implemented using successEnvelope and typed AppError subclasses (NotFoundError, ConflictError).
  • POST /api/billing/disputes and GET /api/billing/disputes/:id return the standard envelope on all status codes: Implemented using successEnvelope and BadRequestError / NotFoundError / ConflictError.
  • src/contracts/responseEnvelope.contract.test.ts includes both route families and passes: Added contract assertions covering both success and error envelopes.

Validation

  • npx jest src/contracts/responseEnvelope.contract.test.ts src/routes/marketplace/plugins.test.ts src/routes/billing/disputes.test.ts --no-cache (all pass).

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

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.

Wrap marketplace plugin and dispute responses in envelopes

2 participants