Skip to content

[CT-30] Build DocumentMetadataEndpoint #562

@mftee

Description

@mftee

Problem

After a document is submitted there is no endpoint to retrieve the stored submission metadata (submitter identity, document_id, submission timestamp, Stellar transaction hash). Callers who need this information must re-query Stellar directly.

Proposed Solution

Create a DocumentMetadataEndpoint inside contract/module/metadata/ that retrieves and returns the stored submission metadata from Redis.

Acceptance Criteria

  • GET /module/metadata/:hash looks up the Redis key submit:{hash} and returns the stored record
  • Response contains: document_hash, document_id, submitter, tx_hash, and anchored_at (ISO 8601 formatted timestamp)
  • Returns 404 with a document not found error (using the ApiError format from CT-29) when no submission record exists for the given hash
  • Validates the hash format using HashValidator::validate_sha256 and returns 400 for invalid input
  • Response is served from Redis cache only — does not query Stellar Horizon
  • Unit tests cover: hash found, hash not found, invalid hash format, Redis connection error
  • Implementation files live inside contract/module/metadata/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions