Conversation
Gitignore fix
Introduces a provider abstraction layer to support multiple market data sources. **Changes:** - Created `internal/providers/` package with Provider interface - Implemented PolygonProvider wrapping existing Polygon.io client - Created providers.Service to manage provider lifecycle - Updated Server to use providerService instead of polygonService - Renamed polygonService to providerService throughout handlers **Benefits:** - Enables support for multiple data providers - Maintains backward compatibility with existing Polygon.io integration - Provides clear interface for adding new providers (e.g., Alpha Vantage) - Standardizes error handling and response types **Files Added:** - internal/providers/provider.go (interface definition) - internal/providers/polygon.go (Polygon.io implementation) - internal/providers/service.go (provider service layer) - internal/providers/provider_test.go (unit tests) - internal/providers/README.md (documentation) **Files Modified:** - internal/web/server.go - internal/web/polygon_handlers.go - internal/web/symbol_handlers.go No breaking changes - all existing functionality preserved.
…dling and rate limiting
… error handling and logging
…d improve error handling in API connection tests
… provider structure and enhance error handling
Refactor web utilities and enhance UI components
…ge version and adding a non-root user
…do o diretório home e as permissões
…o a criação do usuário não privilegiado.
Enhance Docker security (MarkT1065#56)
Security fixes docker
Gfinance yfinance add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OVERVIEW
Introduces a direction field for options to distinguish short and long positions across the data model, database, APIs, and UI.
Updates option creation, update, closing, and retrieval logic to validate and persist direction, defaulting to Short where unspecified for backward compatibility.
Adjusts analytics, metrics, charts, and summaries to treat short vs long options correctly for exposure, premiums, and profit calculations, including new summary fields for short/long counts and credits/debits.
Enhances templates and client-side scripts to display and edit option direction, refine performance metrics visibility, and improve tooltip and table summaries.
Extends migration tests and provider integration tests to cover the new direction column, index, defaults, and long option handling.
sequenceDiagram
actor User
participant Browser
participant Server
participant OptionService
participant Database
User->>Browser: submit createOption (symbol, type, direction)
Browser->>Server: POST /api/options (OptionRequest)
Server->>OptionService: CreateWithCommissionAndDirection(symbol, type, direction, opened, strike, expiration, premium, contracts, commission)
OptionService->>Database: INSERT INTO options(symbol, type, direction, ...)
Database-->>OptionService: created row with direction
OptionService-->>Server: Option (Direction)
Server-->>Browser: JSON response (includes direction)
erDiagram
options {
int id
string symbol
string type
string direction
float premium
}
OptionSummary {
string symbol
int total_positions
int short_positions
int long_positions
float total_premium
float short_credit
float long_debit
}
options ||--o{ OptionSummary : aggregated_by_symbol
Solves #22