Skip to content

feat: implement Scheme Manager with automatic eligibility validation#8

Open
Abhishek1106kr wants to merge 1 commit intoONEST-Network:mainfrom
Abhishek1106kr:feature/scheme-manager
Open

feat: implement Scheme Manager with automatic eligibility validation#8
Abhishek1106kr wants to merge 1 commit intoONEST-Network:mainfrom
Abhishek1106kr:feature/scheme-manager

Conversation

@Abhishek1106kr
Copy link
Copy Markdown

Summary

This PR implements the Scheme Manager adapter for the ONEST financial support protocol, as specified in Issue #2. It provides a lightweight Go-based microservice that enables organizations to quickly integrate with the ONEST network for running financial support or scholarship schemes.

Key Features

  • PushSchemes API: POST /scheme/push - Push new schemes with defined eligibility criteria
  • GetApplications API: GET /scheme/{id}/applications - Fetch all applications for a specific scheme
  • UpdateStatus API: PATCH /scheme/status - Update the status of scheme applications
  • ApplyToScheme API: POST /scheme/{id}/apply - Submit an application with automatic eligibility validation

Technical Implementation

  • Language: Go (Gin framework for REST APIs)
  • Database: MongoDB (with TTL indexing for auto-expiry of old records)
  • Auto-Eligibility: Built-in eligibility scoring based on gender, years of experience, and academic qualification
  • Dockerized: docker-compose.yml for easy local deployment with MongoDB

Files Added

  • api/handlers/scheme.go - REST API handlers
  • api/routes/scheme.go - Router configuration
  • internal/scheme/eligibility.go - Eligibility validation logic
  • internal/scheme/handler.go - Core business logic
  • pkg/database/mongodb/scheme/ - Scheme DB operations and schema
  • pkg/database/mongodb/scheme-application/ - Application DB operations and schema
  • pkg/types/payload/scheme/ - Request/Response types
  • docker-compose.yml - Docker setup
  • run.ps1 - Windows run script

Testing

  • All APIs tested with valid and invalid inputs
  • Auto-eligibility validation works as expected (threshold: 0.7)
  • MongoDB TTL index set to expire records after 30 days

Related Issue

Closes #2

[C4GT Community]: Scheme Manager for ONEST

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.

[C4GT Community]: Scheme Manager for ONEST

1 participant