Skip to content

Feature/org slash rate analytics#969

Open
wonderfulmarv01 wants to merge 4 commits into
Disciplr-Org:mainfrom
wonderfulmarv01:feature/org-slash-rate-analytics
Open

Feature/org slash rate analytics#969
wonderfulmarv01 wants to merge 4 commits into
Disciplr-Org:mainfrom
wonderfulmarv01:feature/org-slash-rate-analytics

Conversation

@wonderfulmarv01

Copy link
Copy Markdown

closes #713
Fix Merge Conflict Resolutions & Restore Organization Analytics Tests
Overview
This PR resolves several incorrect merge conflict resolutions and syntax errors in the codebase, ensuring that the project compiles correctly and the organization-scoped slash-rate and capital-at-risk analytics tests can run and pass.

Changes

  1. Syntax & Compilation Fixes

handlers.ts
: Removed a stray backtick from the 'vault.reconcile' key and a stray closing brace } that was prematurely terminating the handlers object.

types.ts
: Added the missing closing parenthesis ) for the 'vault.reconcile' case statement.

featureFlags.ts
: Added the missing catch block to the try block in the getFlag function's organization-specific flag lookup.

soroban.ts
: Removed a duplicate closing brace } to properly close the createDefaultSorobanClient arrow function.
2. Dependency Management

package.json
: Added argon2 to dependencies to resolve a missing package error that was blocking the test execution.
Verification & Testing
Organization Analytics Risk Tests:
bash
bun test src/tests/orgAnalytics.risk.test.ts
Result: Passed (3/3 tests passed) in

- Implemented GET /api/orgs/:orgId/analytics/risk endpoint to retrieve risk metrics for organizations.
- Added logic to calculate slash rate and capital at risk based on vault data.
- Introduced new OrgRiskAnalyticsVault and OrgRiskAnalyticsResponse interfaces for structured data handling.
- Created unit tests to validate the new endpoint functionality and ensure accurate metric calculations.
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 organization-scoped slash-rate and capital-at-risk analytics endpoint in src/routes/orgAnalytics.ts

2 participants