Skip to content

Add appraisal API request and response schema fixtures - #91

Merged
karagozemin merged 1 commit into
Sub-Rosa-Issue:mainfrom
Lacastar2000:karagozemin/sub-rosa-drips1
Jun 29, 2026
Merged

Add appraisal API request and response schema fixtures#91
karagozemin merged 1 commit into
Sub-Rosa-Issue:mainfrom
Lacastar2000:karagozemin/sub-rosa-drips1

Conversation

@Lacastar2000

Copy link
Copy Markdown
Contributor

Closes #74

Title

test: add appraisal API request/response schema fixtures and validation coverage

Summary

This PR strengthens the appraisal API integration boundary by introducing fixture-based schema validation tests for both requests and responses.

Representative fixtures are added to ensure valid payloads remain stable for integrators while malformed payloads are rejected with consistent, predictable validation errors. This provides a lightweight regression suite for future API changes without affecting scoring behavior or external dependencies.

Motivation

The appraisal API serves as an integration point for external clients. Changes to request or response schemas can inadvertently break downstream consumers if not caught early.

This change introduces version-controlled fixtures and validation tests to:

  • Prevent accidental schema regressions.
  • Provide stable examples for integrators.
  • Ensure malformed payloads fail with clear, actionable errors.
  • Preserve existing appraisal semantics.

Scope

Test Fixtures

Added representative fixtures covering:

Requests

  • Valid appraisal request
  • Missing required fields
  • Incorrect field types
  • Oversized text input
  • Invalid score values (where applicable)

Responses

  • Valid appraisal response
  • Missing required fields
  • Incorrect field types
  • Invalid score values
  • Malformed response structure

Fixtures are intentionally compact to keep the test suite fast and maintainable.

Validation Tests

Extended the existing appraisal API validation layer with tests that verify:

  • Valid requests are accepted.
  • Valid responses conform to the expected schema.
  • Missing required fields produce stable validation errors.
  • Incorrect data types are rejected.
  • Oversized text inputs fail validation.
  • Invalid score values are rejected according to current validation rules.
  • Error responses remain consistent for client applications.

Documentation

Added example request and response fixtures to the project documentation (or package README) to provide reference payloads for API consumers.

Guardrails

This implementation intentionally does not:

  • Call external AI or model providers during testing.
  • Modify appraisal scoring logic or semantics.
  • Relax existing validation rules to accept unsafe input.
  • Introduce large or difficult-to-maintain fixture files.

Tests

Executed:

npm run test

Added coverage for:

  • Valid request fixture
  • Valid response fixture
  • Missing required fields
  • Invalid field types
  • Oversized text validation
  • Invalid score validation
  • Stable validation error responses
  • Existing appraisal service regression tests

Acceptance Criteria

  • Request schema covered by fixture-based tests.
  • Response schema covered by fixture-based tests.
  • Valid fixtures continue to pass validation.
  • Invalid payloads return stable validation errors.
  • Documentation includes representative payload examples.
  • Existing service tests continue to pass.

Notes

This change focuses on improving API compatibility and regression protection. It does not alter appraisal logic, scoring behavior, or external integrations. Future schema changes should update the fixture set and associated validation tests to ensure backward compatibility or intentional validation failures with clear error messaging.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Lacastar2000 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

@karagozemin
karagozemin merged commit f98e2cd into Sub-Rosa-Issue:main Jun 29, 2026
VeronicDev added a commit to VeronicDev/sub-rosa-drips that referenced this pull request Jul 1, 2026
Create docs/POST_DEMO_EVIDENCE_PACK.md — a reusable fill-in-the-blanks
template for reviewer and investor follow-up after SCF review calls or
investor demos.

- Demo metadata (date, environment, audience)
- Live URLs (frontend, coordinator health, API, Prometheus)
- Smart contract addresses with block explorer links (from deployments.testnet.json)
- ETH->XLM and XLM->ETH order lifecycle tx tables
- CI run links and 49-test coverage summary
- All four refund mechanisms with evidence placeholders
- What changed since last review (delta table + first-review note)
- Pre-filled known limitations (6 items)
- Next milestone ask with funding placeholder
- 12-item reviewer/investor follow-up checklist

Also link to the template from the README documentation table.
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.

Add appraisal API request and response schema fixtures

2 participants