Commit Graph
387 Commits
Author SHA1 Message Date
nutcas3 ef4e8a05cd refactor: Replace interface{} with any and optimize slice operations
- Replace map[string]interface{} with map[string]any in UpdateCarrierMetrics
- Replace interface{} with any for GeneratedAt field in PricingEffectiveness struct
- Replace loop-based empty string checks with slices.Contains in ValidateConditions
- Replace range loop index initialization with range-only syntax in calculateAPIPerformance
- Add slices import for standard library slice utilities
2026-05-02 17:57:20 +03:00
nutcas3 5fddd48994 feat: Implement revenue analytics calculation, resource performance tracking, and round-robin load balancing
- Add revenue calculation in GetRevenueAnalytics with active subscription base price aggregation
- Add date range filtering for revenue analytics with StartDate and EndDate support
- Add per-plan revenue, subscription count, and average revenue calculations
- Add error handling with partial result fallback for revenue queries
- Replace mock resource performance with event-based performance
2026-05-02 17:56:34 +03:00
nutcas3 4241c38389 feat: Implement MCC-based regional scoring with geographic grouping for carrier selection
- Replace neutral 50.0 score with MCC-to-region mapping logic in calculateRegionScore
- Add mccToRegion function mapping MCC first digit to region codes (EU, NA, AS, OC, AF, SA)
- Add sameRegionGroup function grouping regions into EMEA, AMER, and APAC clusters
- Add 90.0 score for exact MCC region match, 70.0 for same region group, 30.0 for distant regions
- Add MCC range documentation for Europe (2xx), North America (3xx
2026-05-02 17:55:54 +03:00
nutcas3 b1ceddd9e7 refactor: Extract CRUD operations from pricing service into separate file and improve discount extraction logic
- Move CreateRule, GetRule, UpdateRule, DeleteRule, ListRules, CalculatePrice, and ApplyRules to pricing_service_crud.go
- Remove duplicate struct and constructor comments from pricing_service.go
- Replace hardcoded discount values in extractDiscountValue with actual rule Actions field parsing
- Add AdjustmentType-based discount calculation for Percentage, Fixed, Multiply, and Override
2026-05-02 17:55:26 +03:00
nutcas3 c53faf34ad feat: Implement rate limiting and resource access validation in tenant middleware
- Add RateLimit implementation with tenant context retrieval and plan-based rate limit checking
- Add rate limit exceeded logging with tenant_id and endpoint fields
- Add HTTP 429 response with error message and endpoint when rate limit exceeded
- Add ValidateResourceAccess implementation with tenant ownership verification
- Add context injection for validated_resource, validated_resource_id, and tenant_id
2026-05-02 17:54:51 +03:00
nutcas3 76052466e1 feat: Add tenant context injection to currency service methods for downstream isolation
- Replace TODO comments with context.WithValue calls injecting tenant_id in ProcessBilling
- Add tenant context injection in ConvertAmount for tenant-specific exchange rates
- Add tenant context injection in GetBillingHistory for repository-level filtering
- Add tenant context injection in CalculateTotalBilling for scoped calculations
- Update comments to reflect context-based isolation strategy
2026-05-02 17:54:22 +03:00
nutcas3 31fefa643f feat: Implement carrier metrics persistence with dedicated metrics table and timestamp updates
- Replace mock logging with actual database persistence in UpdateCarrierMetrics
- Add carrier record timestamp update with updated_at field
- Add carrier_metrics table insertion with JSON-serialized metrics data
- Add metricsRecord struct with CarrierID, MetricsData, and RecordedAt fields
- Add zero-division protection for success rate calculation
- Update logging to use structured fields with WithField
2026-05-02 17:54:05 +03:00
nutcas3 9b37aaf224 feat: Implement refund processing and billing analytics endpoints in currency handlers
- Add ProcessRefund implementation with negative billing entry for refunds and transaction ID fallback
- Add GetBillingAnalytics implementation with date range filtering, billing summary calculation, and transaction history
- Add default 30-day date range for analytics with RFC3339 date parsing for custom ranges
- Replace NotImplemented responses with full BillingService integration
2026-05-02 17:53:15 +03:00
nutcas3 6f8b53f7da feat: Implement carrier weight updates, pricing analytics calculations, and tenant rate limiting
- Add updateCarrierWeights implementation with regional and plan-based weight adjustments in carrier_methods.go
- Add calculateRegionalWeightAdjustment helper with usage-based weight scaling and clamping
- Add calculatePlanWeightAdjustment helper with plan usage analysis and adjustment limits
- Add calculateConversionRate helper in pricing_integration.go using discount statistics and active rule ratios
2026-05-02 05:38:06 +03:00
nutcas3 6fc23dff0b feat: Implement tenant-aware currency service wrapper with billing isolation and audit logging
- Add TenantAwareCurrencyService struct with tenantID, billingService, and logger fields
- Add ProcessBilling method with tenant context logging for billing requests
- Add ConvertAmount method with tenant context logging for currency conversions
- Add GetBillingHistory method with tenant context logging for transaction retrieval
- Add CalculateTotalBilling method with tenant context logging for billing summ
2026-05-02 05:26:47 +03:00
nutcas3 16f4c4216c feat: Add tenant-aware rate limiter with sliding window counters and plan-based limits
- Add TenantRateLimiter with plan-based rate limits for Free, Basic, Pro, and Enterprise tiers
- Add RateLimit struct with RequestsPerMinute, RequestsPerHour, RequestsPerDay, and BurstSize fields
- Add TenantUsageTracker with sliding window counters for minute, hour, and day tracking
- Add SlidingWindowCounter with Allow and Count methods for time-based request tracking
- Add AllowRequest method with multi-tier rate limit
2026-05-02 05:26:01 +03:00
nutcas3 8cabf170f2 feat: Refactor ID generation to use Snowflake IDs with prefixes and add domain-specific ID generators
- Replace timestamp-based GenerateRuleID with Snowflake-based GeneratePrefixed("rule")
- Replace random string-based GenerateEventID with Snowflake-based GeneratePrefixed("evt")
- Add GenerateUsageID with resourceType and tenantID parameters for traceable usage IDs
- Add GenerateAPIID, GenerateTenantID, GenerateProfileID, GenerateSubscriptionID, GenerateCarrierID, GeneratePricingID generators
2026-05-02 05:11:19 +03:00
nutcas3 cac6db74a7 feat: Add ID generation utilities with rule ID, event ID, and random string generators
- Add GenerateRuleID function using nanosecond timestamp
- Add GetCurrentTime helper returning current time
- Add GenerateEventID function with "evt_" prefix and 16-character random string
- Add GenerateRandomString function with alphanumeric charset
2026-05-02 05:09:20 +03:00
nutcas3 b160029e30 refactor: Replace time and ID generation helpers with centralized id package utilities
- Replace getCurrentTime() calls with id.GetCurrentTime() in pricing_integration.go and pricing_service.go
- Replace generateRuleID() with id.GenerateRuleID() in pricing rule creation
- Replace generateEventID() with id.GenerateEventID() in tenant middleware
- Remove local helper functions: generateRuleID, getCurrentTime, generateEventID, generateRandomString, getCurrentTimestamp
- Remove unused time package imports
2026-05-02 05:09:12 +03:00
nutcas3 ec812835c8 refactor: Extract helper methods, fix formatting, and add TODO comments for pending implementations
- Extract generateHistoryAnalytics helper in selection_handler_methods.go
- Extract generateRecommendations helper in selection_handler_selection.go
- Extract parsePositiveInt helper in rateplan_handlers_analytics.go
- Replace hardcoded URL path with action parameter in ES2Service.sendActivationRequest
- Add TODO comments for wrapCurrencyService and updateCarrierWeights pending implementations
- Fix struct field alignment and formatting in carrier_methods.go
2026-05-02 05:08:43 +03:00
nutcas3 d2bd13eff6 feat: Add pricing repository, tenant-aware transaction support, and pricing integration service
- Add GormPricingRepository with CreateRule, GetRule, UpdateRule, DeleteRule, ListRules, CountRules methods
- Add GetActiveRules, GetRulesByType methods for retrieving active pricing rules by tenant and type
- Add TenantScopedDB wrapper with automatic tenant filtering for tenant-aware database operations
- Implement TenantScopedTransaction with tenant context propagation and automatic filtering
2026-05-02 04:44:31 +03:00
nutcas3 990f741387 refactor: Refactor tenant analytics to use repository data and extract helper methods to separate files
- Move parseAPIRequestEvents, buildResourcePerformance, parseErrorEvents, parseSlowQueryEvents from tenant_analytics_mock.go to tenant_analytics.go
- Update buildUsageByType to fetch usage statistics from repository instead of using mock data
- Add calculateResourceUsageAnalytics helper to calculate analytics from usage records
- Update buildUsageTrends to use repository data with buildUsageTrendData helper
- Update buildUsagePeaks to use repository data with buildUsagePeakData helper
2026-05-02 04:43:05 +03:00
nutcas3 5637b216f2 feat: Add pricing interfaces and types for dynamic pricing rule management
- Add Repository interface with CreateRule, GetRule, UpdateRule, DeleteRule, ListRules, CountRules methods
- Add GetActiveRules, GetRulesByType methods for rule evaluation
- Add Service interface with rule management, pricing calculations, validation, and analytics methods
- Add RuleEngine interface with EvaluateRule, ApplyRule, ValidateConditions, ExecuteActions methods
- Add PricingEventHandler interface for rule lifecycle events
- Add PricingValidator interface for rule and context validation
- Add PricingCache interface for caching pricing data
2026-05-02 04:41:50 +03:00
nutcas3 064bc3dda5 refactor: Extract tenant integration helper types to separate file and replace ID generation with id package
- Move TenantAwareServices, TenantResourceQuotaChecker, TenantEventLogger from tenant_integration.go to tenant_integration_core.go
- Move wrapCurrencyService, NewTenantResourceQuotaChecker, NewTenantEventLogger, CheckQuota, UpdateUsage methods to tenant_integration_core.go
- Move LogResourceAccess, LogQuotaViolation methods to tenant_integration_core.go
- Replace generateID helper with id.
2026-05-02 04:41:23 +03:00
nutcas3 9b9d73fed9 feat: Add Snowflake ID generator with thread-safe generation, parsing utilities, and default generator
- Add Snowflake struct with mutex, timestamp, nodeID, sequence fields
- Add NewSnowflake constructor with nodeID validation (0 to MaxNodeID range)
- Add Generate method with sequence overflow handling and millisecond-based timestamp
- Add GenerateString method for string representation of generated IDs
- Add Parse, Time, NodeID, Sequence utility functions for ID decomposition
- Add defaultGenerator
2026-05-02 04:38:10 +03:00
nutcas3 96ca53e790 feat: Add pricing handlers with CRUD operations, rule application, price calculation, and analytics endpoints
- Add PricingHandler with CreateRule, GetRule, UpdateRule, DeleteRule, ListRules methods
- Add CalculatePrice endpoint for price calculation based on active rules
- Add ApplyRules endpoint for applying specific pricing rules to context
- Add GetAnalytics endpoint for retrieving pricing analytics by tenant
- Add RegisterRoutes method to register pricing routes under /pricing group
2026-05-02 04:34:59 +03:00
nutcas3 9414a8f871 refactor: Remove unused rate plan currency integrator and tenant analytics mock helper methods
- Delete RatePlanCurrencyIntegrator implementation from rateplan_core.go
- Delete SubscribeToPlanWithCurrency, CalculatePlanCostInCurrency, calculateOverageCost methods
- Delete tenant analytics mock helper methods from tenant_analytics_mock.go
- Remove getMockResourceCount, getMockQuotaLimit, getMockQuotaUsed, parseTimeRange methods
- Remove parseAPIRequestEvent, parseErrorEvent, parseSlowQueryEvent, calculateAPI
2026-05-02 04:34:42 +03:00
nutcas3 271b43e4ac refactor: Implement tenant analytics dashboard and usage analytics with helper methods
- Implement GetTenantDashboard with usage stats, metrics, recent events, and quota status
- Implement GetUsageAnalytics with usage by type, trends, and peaks
- Implement GetPerformanceAnalytics with API performance, resource performance, errors, and slow queries
- Extract helper methods to tenant_analytics_mock.go: parseTimeRange, parseAPIRequestEvent, parseErrorEvent, parseSlowQueryEvent, calculateAPIPerformance, build
2026-05-02 04:26:35 +03:00
nutcas3 f112aa4c52 refactor: Replace map[string]interface{} with map[string]any across currency, handlers, integration, and rateplan packages
- Update BillingSummary.Breakdown field type from map[string]interface{} to map[string]any
- Update Transaction.Metadata field type from map[string]interface{} to map[string]any
- Update RatePlanCurrencyIntegrator subscription and billing metadata to use map[string]any
- Update handler request/response types to use map[string]any (CreateRatePlanRequest, UpdateRatePlanRequest,
2026-05-02 03:21:42 +03:00
nutcas3 31a8886bc0 refactor: Add rate plan currency integration service and update tenant repository with user count method
- Add RatePlanCurrencyIntegrator with SubscribeToPlanWithCurrency, CalculatePlanCostInCurrency, calculateOverageCost methods
- Add NewRatePlanCurrencyIntegrator constructor with billingService, exchangeService, ratePlanService, logger, baseCurrency fields
- Add currency conversion support for rate plan subscriptions with exchange rate metadata tracking
- Add billing integration for initial subscription
2026-05-02 03:20:53 +03:00
nutcas3 17e31d7977 refactor: Refactor tenant and rate plan services with improved code organization and currency integration updates
- Update RatePlanCurrencyIntegrator to use billingService.ConvertAmount with CurrencyConversionRequest struct instead of exchangeService
- Remove calculateOverageCost method from rateplan_methods.go (moved or deprecated)
- Rename tenant variable to newTenant in CreateTenant to avoid shadowing
- Extract tenant user methods from tenant_user.go to new tenant_user_methods.go file
2026-05-02 03:18:45 +03:00
nutcas3 a11ad09109 refactor: Move tenant repository implementation to tenant package and update imports
- Move GormTenantRepository implementation from repository package to tenant package
- Move TenantResourceValidator from repository to tenant package
- Update tenant_aware_repository.go to import tenant package for Tenant and TenantStatusActive types
- Remove duplicate tenant model definitions and helper methods from repository package
- Update ValidateTenant to use tenant.Tenant and tenant.TenantStatusActive types
2026-05-02 03:18:18 +03:00
nutcas3 77483349c9 refactor: Extract ES2 types from client.go to separate types.go file
- Move ES2Client struct definition from client.go to types.go
- Move DownloadProfileRequest, DownloadProfileResponse, GetProfileStatusRequest, GetProfileStatusResponse types to types.go
- Move DeleteProfileRequest, DeleteProfileResponse, EnableProfileRequest, EnableProfileResponse types to types.go
- Move DisableProfileRequest, DisableProfileResponse types to types.go
- Add net/http, time, and config package imports to types.go
2026-05-02 02:51:41 +03:00
nutcas3 9faf20cce4 feat: Add TenantRepository interface with CRUD operations, user management, API keys, usage tracking, and event logging
- Add TenantRepository interface with CreateTenant, GetTenant, GetTenantByDomain, UpdateTenant, DeleteTenant, ListTenants, CountTenants methods
- Add CreateTenantUser, GetTenantUser, UpdateTenantUser, DeleteTenantUser, ListTenantUsers, CountTenantUsers for user management
- Add CreateAPIKey, GetAPIKey, GetAPIKeyByHash, UpdateAPIKey, DeleteAPIKey, ListAPIKeys for API key operations
2026-05-02 02:51:14 +03:00
nutcas3 0ebf301c2e refactor: Update tenant integration to use concrete service types and tenant package imports
- Change TenantIntegrationManager.tenantService from Service interface to *services.TenantServiceImpl concrete type
- Change TenantResourceQuotaChecker.tenantService from Service interface to *services.TenantServiceImpl
- Change TenantEventLogger.tenantService from Service interface to *services.TenantServiceImpl
- Update TenantAwareServices fields to use tenant package types (TenantContext, TenantConfig)
2026-05-02 02:50:59 +03:00
nutcas3 bf5ee28917 feat: Add currency analytics, billing, and exchange rate services with multi-currency support and transaction processing
- Add AnalyticsServiceImpl with revenue/volume analysis, exchange rate trends, usage stats, and transaction type analytics
- Add GetRevenueByCurrency, GetTransactionVolumeByCurrency, GetExchangeRateTrends, GetCurrencyUsageStats methods
- Add GetMonthlyRevenueTrends, GetTopCurrenciesByRevenue, GetTransactionTypeAnalytics for reporting
- Add BillingServiceImpl with multi-currency billing, payment
2026-05-02 02:50:41 +03:00
nutcas3 d3d43e5f35 feat: Add tenant integration layer with repository wrapper, analytics types, and performance monitoring
- Add TenantAwareCurrencyRepository wrapper with tenant isolation for all currency repository methods
- Add NewTenantAwareCurrencyRepository and WithTenant methods for tenant context management
- Add TenantIntegrationManager with GetTenantAwareServices for tenant validation and configuration
- Add TenantAwareServices struct with tenant context, config, and currency service fields
- Add TenantResource
2026-05-02 02:44:48 +03:00
nutcas3 d70a3d930d refactor: Move tenant repository files to repository package and update imports
- Move tenant_aware_repository.go from internal/tenant to internal/repository package
- Move repository.go to tenant_repository.go in internal/repository package
- Add tenant package import for type references in tenant_repository.go
- Update filter type references to use tenant package prefix (TenantFilter, TenantUserFilter, TenantUsageFilter)
- Update return type for GetUsageStats to use tenant.TenantUsageStats
2026-05-02 02:39:35 +03:00
nutcas3 5dd8f4cbb7 feat: Add tenant-aware repository layer with isolation, validation, query building, and resource access control
- Add TenantAwareRepository with GORM database and tenant ID fields
- Add NewTenantAwareRepository, WithTenant, GetTenantID, ValidateTenant methods for tenant context management
- Add TenantScopedQuery and TenantScopedTransaction for tenant-isolated database operations
- Add CreateWithTenant, GetByTenantID, UpdateWithTenant, DeleteWithTenant, ListWithTenant, CountWithTenant helper methods
- Add TenantA
2026-05-02 01:39:46 +03:00
nutcas3 6693f83437 feat: Add tenant service implementation with CRUD operations, user management, API key handling, and event logging
- Add ServiceImpl struct with repository, rate limiter, event publisher, config manager, audit logger, metrics collector, and logger fields
- Add CreateTenant with validation, domain uniqueness check, default settings/quotas/features initialization, and tenant created event
- Add GetTenant, GetTenantByDomain, UpdateTenant, DeleteTenant, and ListTenants methods with event logging
2026-05-02 01:39:36 +03:00
nutcas3 a27c21b873 feat: Add tenant service extended methods with quota management, usage tracking, permissions, and metrics collection
- Add CheckQuota method with quota limit validation, unlimited quota support (-1), and quota exceeded event logging
- Add GetUsageStats with resource breakdown, quota status calculation, warning/critical thresholds, and active user counting
- Add UpdateUsage with automatic usage record creation and existing record updates
- Add GetQuotaStatus, GetTenantConfig, UpdateTenantConfig, Get
2026-05-02 01:39:21 +03:00
nutcas3 b0bb0908e1 feat: Add tenant repository implementation with GORM-based data access layer for multi-tenancy support
- Add GormTenantRepository struct with GORM database field
- Add CreateTenant, GetTenant, GetTenantByDomain, UpdateTenant, DeleteTenant methods with context support
- Add ListTenants and CountTenants with filtering by ID, name, domain, status, plan, sorting, and pagination
- Add CreateTenantUser, GetTenantUser, UpdateTenantUser, DeleteTenantUser methods for user management
- Add ListTenantUsers and
2026-05-02 01:39:10 +03:00
nutcas3 6261c51d70 feat: Add tenant domain models with multi-tenancy support, user management, usage tracking, and API key authentication
- Add Tenant struct with plan, limits, settings, and metadata fields
- Add TenantStatus constants (active, inactive, suspended, deleted)
- Add TenantPlan constants (free, basic, pro, enterprise)
- Add TenantSettings with currency, feature flags, rate limiting, security, and compliance configuration
- Add PasswordPolicy struct with length, character requirements, and age settings
2026-05-02 01:39:00 +03:00
nutcas3 69951d68db feat: Add tenant middleware with authentication, authorization, isolation, and activity logging
- Add TenantMiddleware struct with tenant service and logger fields
- Add ExtractTenantFromHeader and ExtractTenantFromAPIKey methods for tenant identification from headers, subdomains, and API keys
- Add RequireTenant middleware with header and API key extraction fallback and tenant access validation
- Add RequireTenantRole middleware with role-based access control for multiple required roles
2026-05-02 01:38:47 +03:00
nutcas3 00ad4f34e3 feat: Add tenant package interfaces with repository, service, middleware, and supporting components
- Add Repository interface with tenant CRUD, user management, API keys, usage tracking, config, and event operations
- Add Service interface with tenant management, user operations, API key handling, quota checking, config management, authentication, and analytics methods
- Add Middleware interface with request extraction, access validation, context injection, rate limiting, and resource isolation
2026-05-02 01:38:30 +03:00
nutcas3 4c45a50823 feat: Add tenant integration layer with repository wrapper, service manager, quota checker, and event logger
- Add TenantAwareCurrencyRepository wrapper with tenant isolation for all currency repository methods
- Add NewTenantAwareCurrencyRepository and WithTenant methods for tenant context management
- Add TenantIntegrationManager with GetTenantAwareServices for tenant validation and configuration
- Add TenantAwareServices struct with tenant context, config, and currency service fields
- Add TenantResourceQuotaChecker
2026-05-02 01:38:15 +03:00
nutcas3 6b8c7f9760 feat: Add tenant types package with filters, requests, usage stats, events, and metrics domain models
- Add TenantFilter with ID, name, domain, status, plan, pagination, and sorting fields
- Add CreateTenantRequest, UpdateTenantRequest with plan, limits, settings, and metadata support
- Add TenantUserFilter, CreateTenantUserRequest, UpdateTenantUserRequest with role and status management
- Add CreateAPIKeyRequest, UpdateAPIKeyRequest with permissions, rate limits, and expiration support
- Add TenantUs
2026-05-02 01:37:25 +03:00
nutcas3 5e8d217527 feat: Add tenant analytics service with dashboard, usage, performance, cost analytics, and comprehensive reporting
- Add TenantAnalyticsService struct with repository, metrics collector, event publisher, and logger fields
- Add GetTenantDashboard with usage stats, metrics, recent events, and quota status aggregation
- Add GetTenantMetrics with active users, request tracking, error rate calculation, response time analysis, and health score computation
- Add GetUsageAnalytics with time range filtering, resource type breakdown
2026-05-02 01:36:45 +03:00
nutcas3 ea11a73ebc feat: Add tenant handler layer with CRUD, user management, API keys, and analytics endpoints
- Add TenantHandler struct with tenant service and logger fields
- Add CreateTenant, GetTenant, GetTenantByDomain, UpdateTenant, DeleteTenant, and ListTenants endpoints
- Add AddUserToTenant, GetTenantUser, UpdateTenantUser, RemoveUserFromTenant, and ListTenantUsers endpoints
- Add CreateAPIKey, GetAPIKey, UpdateAPIKey, DeleteAPIKey, and ListAPIKeys endpoints with key string return on creation
2026-05-02 01:36:26 +03:00
nutcas3 4fe9d22284 feat: Add repository types package with rate plan, subscription, usage, and analytics domain models
- Add Repository interface with rate plan CRUD, subscription management, usage tracking, and analytics operations
- Add RatePlan struct with pricing, allowances, overage rates, discounts, and metadata fields
- Add RatePlanSubscription struct with billing cycle, auto-renewal, and applied discounts support
- Add RatePlanUsage struct with cycle tracking and data/voice/SMS usage metrics
- Add filter types for rate plans, subscriptions, usage analytics, and revenue analytics
2026-05-02 01:24:23 +03:00
nutcas3 a9df60801b refactor: Rename currency parameter from 'currency' to 'curr' in currencyToModel helper method and add Service interface to rate plan package
- Rename currency parameter to curr in GormRepository.currencyToModel to avoid shadowing currency package name
- Add Service interface with rate plan, subscription, usage, and analytics operations
- Add CreateRatePlan, GetRatePlan, UpdateRatePlan, DeleteRatePlan, ListRatePlans, and SearchRatePlans methods
- Add SubscribeToPlan, GetSubscription, UpdateSubscription, CancelSubscription, GetActiveSubscription, and ListSubscriptions methods
- Add Rec
2026-05-02 01:23:40 +03:00
nutcas3 eb7e05d967 refactor: Update handler constructors to use interface types instead of concrete implementations
- Update CurrencyHandler.exchangeService field from *currency.ExchangeRateService to currency.ExchangeRateService interface
- Update NewCurrencyHandler parameter from *currency.ExchangeRateService to currency.ExchangeRateService interface
- Update RatePlanHandler.service field from *rateplan.Service to rateplan.Service interface
- Update NewRatePlanHandler parameter from *rateplan.Service to rateplan.Service interface
2026-05-02 01:23:24 +03:00
nutcas3 ebb9bb4148 refactor: Update service layer to use repository package types and align imports
- Update Service struct to use repository.Repository interface
- Update all method signatures to use repository package types (RatePlan, RatePlanSubscription, RatePlanUsage, etc.)
- Update filter and request types to use repository package (RatePlanFilter, SubscriptionFilter, CalculateCostRequest, etc.)
- Update status constants to use repository package (SubscriptionStatusActive, PlanStatusActive, DiscountTypePercentage, DiscountTypeFixed)
2026-05-02 01:23:00 +03:00
nutcas3 a31344714e refactor: Add ExchangeRateService interface and format currency types with consistent alignment
- Add ExchangeRateService interface with GetExchangeRate, ConvertAmount, GetRateHistory, UpdateExchangeRate, GetSupportedCurrencies, ValidateCurrencyPair, and RefreshRates methods
- Add CurrencyRevenue struct with currency and revenue fields
- Add TransactionTypeStats struct with type, count, amount, and currency fields
- Align struct field tags consistently across Currency, ExchangeRate, Transaction, and request/response types
2026-05-02 01:22:37 +03:00
nutcas3 295649bcea refactor: Rename service package to services and move repository implementations to repository package
- Rename internal/service to internal/services in carrier-connector
- Update service imports in selection_integration.go and smdp_integration.go
- Move currency repository files from internal/currency to internal/repository
- Move rate plan repository files from internal/rateplan to internal/repository
- Update package declarations and imports for currency domain types
- Add currency package imports
2026-05-02 01:21:18 +03:00