Skip to content

feat: 5021 5019 Add Mint Token search and Project Practices search to Indexer#5866

Open
kodareef5 wants to merge 1 commit intohashgraph:developfrom
kodareef5:feature/5021-indexer-token-search
Open

feat: 5021 5019 Add Mint Token search and Project Practices search to Indexer#5866
kodareef5 wants to merge 1 commit intohashgraph:developfrom
kodareef5:feature/5021-indexer-token-search

Conversation

@kodareef5
Copy link
Copy Markdown

Summary

Implements two new Indexer search capabilities as specified in #5021 and #5019.

Mint Token Search (#5021)

Users can search, filter, and browse issued carbon credit tokens (Mint Token VP documents) to find suitable carbon credits:

  • Token ID — filter by specific token
  • Policy/Methodology — filter by governing policy, with human-readable policy name in results
  • Amount range — filter by min/max minted amount
  • Date range — filter by issuance period
  • Keywords — free-text search across document fields
  • Geography — visible in results grid
  • Results enriched with token metadata (name, symbol, type, supply) from TokenCache and policy metadata (name, description)

Project Practices Search (#5019)

Users can compare how different projects implement the same methodology:

  • Policy ID — find all documents under a specific methodology
  • Schema name — filter by document type (case-insensitive substring match)
  • Schema ID — filter by exact schema identifier
  • Topic — filter by topic ID
  • Keywords — search within document field values
  • Results enriched with policy name for readability

Changes (14 files, +1,127/-3)

Backend — Message API (indexer-common)

  • 6 new message patterns for both search capabilities

Backend — Service Layer (indexer-service)

  • getMintTokenDocuments() — paginated VP search with token + policy enrichment, amount/date range filters
  • getMintTokenDocument() — detail view with full document, token info, policy info
  • getMintTokenFilters() — available policies and tokens for filter dropdowns
  • getProjectPractices() — paginated VC search with policy enrichment, schema name regex filter
  • getProjectPracticesFilters() — available schema names and policies for filters
  • Response includes explicit top-level policyId, policyDescription, geography fields

Backend — API Gateway (indexer-api-gateway)

  • 6 REST endpoints with full Swagger documentation

Frontend (indexer-frontend)

  • MintTokensComponent — grid with columns: amount, token name/symbol/ID, policy, geography, status, date
  • ProjectPracticesComponent — grid with policy enrichment and schema filtering
  • Both components load filter options from API via loadFilters()
  • Routes: /mint-tokens, /mint-tokens/:id, /project-practices, /project-practices/:id
  • Navigation: both added to Methodologies menu
  • i18n: English translations for all new labels

Architecture

Follows the exact patterns of existing entity endpoints:

  • Gateway routes to service via NestJS microservices message patterns
  • Service queries MongoDB via mikro-orm with parsePageParams/parsePageFilters
  • Frontend uses Angular standalone components extending BaseGridComponent
  • Token metadata enriched by batch query to TokenCache collection
  • Policy metadata enriched by batch query to INSTANCE_POLICY messages
  • Keywords use escapeStringRegexp via existing parseKeywordFilter
  • Schema name uses createRegex for case-insensitive substring matching

Security

  • Token ID, Policy ID, Schema ID use exact match (no regex injection)
  • Schema name goes through createRegex which calls escapeStringRegexp
  • Keywords handled by existing parseKeywordFilter with escapeStringRegexp
  • Amount values converted via Number() before MongoDB query
  • No user input passed directly to MongoDB operators

Closes #5021
Closes #5019

Test Plan

  • GET /entities/mint-tokens returns paginated VP documents with token enrichment
  • Filter by tokenId, policyId, amount range, date range, keywords all work
  • Response includes policyId, policyDescription, geography at top level
  • GET /entities/mint-tokens/filters returns available policies and tokens
  • GET /entities/mint-tokens/:messageId returns detail with token + policy info
  • GET /entities/project-practices returns paginated VC documents with policy enrichment
  • Filter by policyId, schemaName (substring), schemaId (exact), topicId, keywords
  • GET /entities/project-practices/filters returns schema names and policies
  • Frontend grids load, sort, paginate, and filter correctly
  • Navigation shows both items under Methodologies menu
  • Detail views navigate correctly via "Open" button

@kodareef5 kodareef5 requested review from a team as code owners March 22, 2026 15:43
@kodareef5 kodareef5 changed the title BOUNTY: Add Mint Token search (#5021) and Project Practices search (#5019) to Indexer feat: 5021 5019 Add Mint Token search and Project Practices search to Indexer Mar 22, 2026
… Indexer

Implements two new Indexer search capabilities:

Mint Token Search (hashgraph#5021):
- Paginated VP document search with token + policy enrichment
- Filters: tokenId, policyId, amount range, date range, keywords
- Response includes policyId, policyDescription, geography at top level
- Filter options API for dropdowns

Project Practices Search (hashgraph#5019):
- Paginated VC document search with policy enrichment
- Filters: policyId, schemaName (substring), schemaId, topicId, keywords
- Filter options API for schema names and policies

Full stack: message API, service layer, API gateway with Swagger docs,
Angular frontend components with grid, filters, sorting, i18n.

Closes hashgraph#5021
Closes hashgraph#5019

Signed-off-by: Koda Reef <koda.reef5@gmail.com>
@kodareef5 kodareef5 force-pushed the feature/5021-indexer-token-search branch from 45d2e0a to 042d75b Compare March 22, 2026 15:48
@kodareef5
Copy link
Copy Markdown
Author

Hi @prernaadev01 @ruslanPL-EnvisionBlockchain — I'm unable to assign myself due to permissions. Could you please update the assignee? Happy to address any review feedback. Thanks!

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.

2 participants