Commit Graph
604 Commits
Author SHA1 Message Date
nutcas3 fa7c4a1bf6 feat: Add predictive maintenance service with asset monitoring, failure prediction, ML models, and health scoring
- Add MaintenanceType constants for preventive, corrective, predictive, and emergency maintenance
- Add AssetType constants for server, database, network, storage, application, and load_balancer
- Add Asset struct with ID, Name, Type, Status, Location, HealthScore, LastMaintenance, NextMaintenance, and Metadata fields
- Add MaintenanceAlert struct with ID, AssetID, Type, Severity, Title, Description, RiskScore,
2026-05-03 11:22:16 +03:00
nutcas3 7ce809084d feat: Add fraud detection service with pattern matching, ML models, risk scoring, and automated blocking
- Add FraudType constants for account_takeover, subscription_fraud, payment_fraud, usage_anomaly, identity_fraud, and sim_swap
- Add FraudSeverity type with Low, Medium, High, and Critical levels
- Add FraudAlert struct with ID, Type, Severity, ProfileID, RiskScore, Evidence, IPAddress, UserAgent, Location, Status, Actions, and Metadata fields
- Add FraudPattern struct with pattern configuration and weight-based scoring
- Add FraudDetectionService with patterns, alerts
2026-05-03 11:22:01 +03:00
nutcas3 9239198027 feat: Add market analysis service with penetration metrics, competitor analysis, and opportunity identification
- Add MarketMetrics struct with Period, TotalMarketSize, OurSubscribers, MarketShare, GrowthRate, ByCountry, ByCarrier, ByDemographic, CompetitorAnalysis, and PenetrationOpportunities fields
- Add CountryMetrics struct with Country, TotalPopulation, ActiveSubscribers, PenetrationRate, GrowthRate, ARPU, and MarketPotential fields
- Add MarketCarrierMetrics struct with CarrierName, Subscribers
2026-05-03 11:21:26 +03:00
nutcas3 42d7f4ac86 feat: Add churn analysis service with risk prediction, metrics calculation, and retention recommendations
- Add ChurnRiskLevel type with Low, Medium, High, and Critical constants
- Add ChurnPrediction struct with ProfileID, RiskLevel, RiskScore, PredictedChurnDate, Reasons, Recommendations, and LastUpdated fields
- Add ChurnMetrics struct with Period, TotalSubscribers, ChurnedSubscribers, ChurnRate, MonthlyChurnRate, AnnualChurnRate, AverageTenure, and RiskDistribution fields
- Add ChurnFactor struct with Factor
2026-05-03 11:21:14 +03:00
nutcas3 f4780a5562 feat: Add platform routes with analytics, whitelabel, compliance, exchange rate, and infrastructure endpoints
- Add registerAnalyticsRoutes, registerWhitelabelRoutes, registerComplianceRoutes, registerExchangeRateRoutes, and registerInfraRoutes to setupRoutes
- Add routes_platform.go with analytics dashboard, revenue analytics, and scheduled report endpoints
- Add whitelabel branding, partner config, and email template endpoints
- Add compliance DSR, consent management, audit logging, and data residency endpoints
2026-05-03 10:53:26 +03:00
nutcas3 c6fccc893d feat: Fix type conversions, rename ExchangeRateProvider to RateProviderType, and improve currency integration
- Fix GetRevenueAnalytics return type by dereferencing metrics struct
- Fix getCarrierMetrics to use int64 for Count and convert to int for ActiveCarriers
- Rename ExchangeRateProvider to RateProviderType for consistency
- Change RatePlanCurrencyIntegrator.exchangeService from pointer to interface type
- Add function documentation comments for NewRatePlanCurrencyIntegrator, SubscribeToPlanWith
2026-05-03 10:52:29 +03:00
nutcas3 79fa56f25d feat: Add encryption service with AES-GCM, field-level encryption, and PBKDF2 key derivation
- Add EncryptionService struct with masterKey and gcm cipher fields
- Add EncryptionConfig with MasterKey and KeyDerivationSalt fields
- Add NewEncryptionService constructor with PBKDF2 key derivation, 100000 iterations, and AES-GCM cipher initialization
- Add Encrypt and Decrypt methods with nonce generation and validation
- Add EncryptString and DecryptString methods with base64 encoding
- Add FieldEncryptor struct
2026-05-03 10:51:47 +03:00
nutcas3 772c564a18 feat: Add whitelabel handler with branding, partner config, and email template endpoints
- Add WhitelabelHandler struct with service and logger dependencies and NewWhitelabelHandler constructor
- Add CreateBranding, GetBranding, GetBrandingByDomain, and UpdateBranding methods for branding configuration management
- Add CreatePartnerConfig and GetPartnerConfig methods for partner-specific settings
- Add CreateEmailTemplate, GetEmailTemplate, and ListEmailTemplates methods for email template management
2026-05-03 10:51:31 +03:00
nutcas3 9914ee5955 feat: Add geographic routing service with region management, IP-based routing, and endpoint selection
- Add GeoRouter struct with regions map, defaultReg, and mutex fields
- Add Region struct with ID, Name, Endpoints, Priority, IsActive, and Latency fields
- Add GeoRoutingConfig with DefaultRegion and Regions fields
- Add NewGeoRouter constructor with region initialization
- Add GetRegionForIP method with IP parsing and geo lookup
- Add lookupRegion helper with simplified IP range-based region detection
2026-05-03 10:51:11 +03:00
nutcas3 7be483dbd5 feat: Add compliance handler with DSR management, consent tracking, audit logging, and data residency endpoints
- Add ComplianceHandler struct with service and logger dependencies and NewComplianceHandler constructor
- Add CreateDSR, GetDSR, ListDSRs, and ProcessDSR methods for data subject request management
- Add RecordConsent, RevokeConsent, and GetConsents methods for consent tracking with IP and user agent capture
- Add QueryAuditLogs method with jurisdiction, actor, and action filtering
- Add SetDataRes
2026-05-03 10:50:50 +03:00
nutcas3 b2f92cc8f4 feat: Add threat detection service with brute force, rate limit abuse, SQL injection detection, and IP tracking
- Add ThreatLevel type with Low, Medium, High, and Critical constants
- Add ThreatType type with BruteForce, RateLimitAbuse, SQLInjection, XSS, Unauthorized, DataExfil, and Anomalous constants
- Add ThreatEvent struct with ID, TenantID, Type, Level, Source, Target, Description, Metadata, DetectedAt, Mitigated, and MitigatedAt fields
- Add ThreatDetector struct with logger, rules, events, ip
2026-05-03 10:50:34 +03:00
nutcas3 1e2b38d463 feat: Add analytics handler with dashboard, revenue analytics, and scheduled report endpoints
- Add AnalyticsHandler struct with service and logger dependencies and NewAnalyticsHandler constructor
- Add GetDashboard method with tenant ID extraction, date range filtering, and dashboard metrics retrieval
- Add GetRevenueAnalytics method with tenant filtering and group-by support
- Add CreateScheduledReport and ListScheduledReports methods for report management
- Add date parsing for start_date and end_date query
2026-05-03 10:50:19 +03:00
nutcas3 26bb4f97b5 feat: Add real-time exchange rate service with multi-provider support, caching, and automatic refresh
- Add ExchangeRateProvider type with OpenExchange, Fixer, XE, and Internal constants
- Add RealTimeExchangeService struct with provider, apiKey, baseCurrency, rates cache, lastUpdate, cacheTTL, mutex, logger, and httpClient fields
- Add ExchangeRateConfig with Provider, APIKey, BaseCurrency, and CacheTTL fields
- Add NewRealTimeExchangeService constructor with default 15-minute cache TTL and USD
2026-05-03 10:50:06 +03:00
nutcas3 4d0eb13cee feat: Add whitelabel service with branding, partner config, and email template management
- Add Service struct with db and logger dependencies and NewService constructor
- Add CreateBranding, GetBranding, GetBrandingByDomain, and UpdateBranding methods for branding configuration management
- Add CreatePartnerConfig and GetPartnerConfig methods for partner-specific settings
- Add CreateEmailTemplate, GetEmailTemplate, and ListEmailTemplates methods for custom email template management
- Add BrandingConfig with
2026-05-03 10:48:26 +03:00
nutcas3 52797e54fc feat: Add circuit breaker with state management, failure tracking, fallback support, and statistics
- Add CircuitState type with StateClosed, StateOpen, and StateHalfOpen constants and String method
- Add CircuitBreaker struct with name, state, failureCount, successCount, lastFailure, config, mutex, and onStateChange fields
- Add CircuitBreakerConfig with FailureThreshold, SuccessThreshold, Timeout, and HalfOpenMaxCalls fields
- Add NewCircuitBreaker constructor and DefaultCircuitBreakerConfig with
2026-05-03 10:43:06 +03:00
nutcas3 625bfb5671 feat: Add in-memory cache with TTL, LRU eviction, JSON serialization, and statistics tracking
- Add Cache struct with entries map, mutex, maxSize, defaultTTL, strategy, and stats fields
- Add CacheStrategy type with LRU, TTL, write-through, write-back, and read-through constants
- Add CacheEntry struct with Key, Value, ExpiresAt, CreatedAt, and HitCount fields
- Add NewCache constructor with CacheConfig parameter and automatic cleanup goroutine
- Add Get, Set, Delete, and Clear methods with hit
2026-05-03 10:41:33 +03:00
nutcas3 d9c2026cb9 feat: Add compliance service with DSR management, consent tracking, audit logging, and data residency
- Add Service struct with db and logger dependencies and NewService constructor
- Add CreateDSR, GetDSR, ListDSRs, and ProcessDSR methods for data subject request lifecycle management
- Add processAccessRequest, processErasureRequest, processRectificationRequest, and calculateDueDate helper methods
- Add RecordConsent, RevokeConsent, and GetConsents methods for consent management
- Add LogAudit
2026-05-03 10:41:09 +03:00
nutcas3 58e36d63ca feat: Add analytics service with dashboard metrics, revenue tracking, and scheduled reporting
- Add Service struct with GetDashboard, GetRevenueAnalytics, CreateScheduledReport, and ListScheduledReports methods
- Add getRevenueMetrics, getSubscriberStats, getUsageMetrics, getCarrierMetrics, getGeoMetrics, and getPerformanceStats helper methods
- Add DashboardMetrics, RevenueMetrics, SubscriberStats, UsageMetrics, CarrierMetrics, GeoMetrics, and PerformanceStats types
- Add CarrierStat, CountryStat, RegionStat
2026-05-03 10:40:51 +03:00
nutcas3 4205d4c2aa refactor: Replace unused context parameters with blank identifiers and fix variable references
- Replace ctx parameter with _ in provisionTenantContext, provisionDatabaseSchema, provisionStorageResources, configureCarrier, configureRatePlans, setupPaymentProcessing, and validateCompliance methods
- Fix tenant_id scope to use wrappedTx.tenantID instead of r.tenantID in TenantScopedTransaction
- Fix pricing effectiveness analytics to use ratePlanAnalytics.AverageDiscount and ratePlanAnalytics.TotalSavings instead of analytics.
2026-05-03 10:31:49 +03:00
nutcas3 7a80fb9aeb feat: Extract domain route registration from setupRoutes into separate functions in routes_domain.go
- Move rate plan, pricing, currency, tenant, and SMDP route registration from routes.go to new routes_domain.go file
- Add registerMVNORoutes, registerRatePlanRoutes, registerPricingRoutes, registerCurrencyRoutes, registerTenantRoutes, and registerSMDPRoutes functions
- Simplify setupRoutes to call domain-specific registration functions with required dependencies
- Remove nested route group blocks in favor
2026-05-03 10:22:08 +03:00
nutcas3 82ecbff62a feat: Add RatePlanAdapter with CRUD operations, subscription management, usage tracking, and analytics
- Add RatePlanAdapter struct wrapping Service to implement rateplan.Service interface
- Add NewRatePlanAdapter constructor returning rateplan.Service
- Add CreateRatePlan, GetRatePlan, UpdateRatePlan, DeleteRatePlan, ListRatePlans, SearchRatePlans, and GetPopularPlans methods with type conversions
- Add SubscribeToPlan, GetSubscription, UpdateSubscription, CancelSubscription, GetActiveSubscription
2026-05-03 10:21:46 +03:00
nutcas3 e5ccb62277 feat: Add comprehensive routing for rate plans, pricing, currency, tenants, SMDP, and selection endpoints
- Add db parameter to setupRoutes function signature and pass from main.go
- Add rate plan routes with CRUD, search, subscription, and management endpoints using RatePlanAdapter
- Add pricing routes with rule management endpoints using PricingService
- Add currency routes with conversion, exchange rates, billing operations, and analytics placeholder endpoints
- Add tenant routes with management
2026-05-03 10:14:02 +03:00
nutcas3 b69d73ade7 feat: Wire MVNO handlers with repository and service dependencies in carrier-connector routes
- Add logrus and gorm imports to main.go for MVNO infrastructure setup
- Create logger instance and separate database connection for MVNO repository in main
- Initialize GormRepository with database connection and logger
- Pass repo and logger to setupRoutes for MVNO handler initialization
- Replace placeholder MVNO endpoints with actual handler methods in routes.go
- Create OnboardingService, MVNOHandler, and ManagementHandler instances
2026-05-03 09:55:29 +03:00
nutcas3 bc5ead59c6 feat: Remove MVNO router and add placeholder endpoints to main routes
- Delete router.go with Router struct, NewRouter constructor, SetupRoutes, SetupMiddleware, HealthCheck, and RegisterHealthCheck methods
- Add /mvno route group with POST /onboarding, GET /, GET /:id, PUT /:id/status, and GET /stats placeholder endpoints
- Replace router-based MVNO setup with direct route registration returning http.StatusNotImplemented responses
2026-05-03 09:52:50 +03:00
nutcas3 88fd53a37d feat: Remove MVNO handlers, service, and repository implementations from carrier-connector
- Delete handler.go with StartOnboarding, GetMVNO, ListMVNOs, and RegisterRoutes methods
- Delete handler_management.go with GetMVNO, ListMVNOs, UpdateMVNOStatus, and GetMVNOStats endpoints
- Delete onboarding_service.go with StartOnboarding, executeOnboarding, executeStep workflow orchestration
- Delete repository.go with GormRepository CRUD operations, filtering, and statistics methods
- Update provisioner.go to use map[string]any instead of map[string]interface{}
2026-05-03 09:51:28 +03:00
nutcas3 2344ef0710 feat: Add logger dependency to SelectionService and refactor handler initialization
- Add logrus import and logger initialization in NewSelectionIntegration
- Pass logger instance to NewSelectionService constructor
- Replace selectionService.GetHandler() with direct handlers.NewSelectionHandler(manager) call
2026-05-03 09:50:51 +03:00
nutcas3 f6394e1636 feat: Reorder OnboardingProgress and OnboardingStep structs and add MVNOFilter type
- Move OnboardingProgress struct definition before OnboardingStep for logical ordering
- Add MVNOFilter struct with status, plan, business_id, limit, offset, and date range filtering fields
2026-05-03 09:50:38 +03:00
nutcas3 5cb2904c36 feat: Add MVNO repository with CRUD operations, filtering, and statistics aggregation
- Add MVNORepository implementation with CreateMVNO, GetMVNO, UpdateMVNO, ListMVNOs, DeleteMVNO, and UpdateMVNOStatus methods
- Add MVNOFilter struct with status, plan, business_id, limit, offset, and date range filtering
- Add GetMVNO and GetMVNOByBusinessID methods with record not found error handling
- Add ListMVNOs with dynamic query building, filter application, and descending created_at ordering
- Add GetMVNOStats with total count, status distribution, and plan distribution aggregation
2026-05-03 09:50:26 +03:00
nutcas3 c7ddd3c5d7 feat: Extract repository interfaces from types.go into separate interfaces.go file
- Move TenantRepository and Repository interfaces from types.go to new interfaces.go file
- Add mvno package import for MVNO-related repository methods
- Add CreateMVNO, GetMVNO, GetMVNOByBusinessID, UpdateMVNO, ListMVNOs, DeleteMVNO, UpdateMVNOStatus, and GetMVNOStats methods to Repository interface
- Remove context import from types.go after interface extraction
2026-05-03 09:49:56 +03:00
nutcas3 192b4ce7ff feat: Refactor step status checking from if-else to switch statement in GetStepSuccessRate
- Replace if-else chain with switch statement for step.Status evaluation in monitor.go
- Maintain completed and failed case handling with cleaner control flow
2026-05-03 09:49:37 +03:00
nutcas3 9296bc567b feat: Add MVNO onboarding service with step-based workflow execution and progress tracking
- Add OnboardingService struct with validator, provisioner, and monitor dependencies
- Add NewOnboardingService constructor with logger dependency injection
- Add StartOnboarding method with request validation, MVNO record creation, and async workflow execution
- Add executeOnboarding method with sequential step processing, context cancellation support, and progress updates
- Add executeStep method with switch
2026-05-02 19:50:28 +03:00
nutcas3 bf46ecda02 feat: Refactor MVNO handlers to use domain types and interface-based service dependency
- Rename Handler to MVNOHandler for clarity in handler_mvno.go
- Replace services.OnboardingService with OnboardingService interface for dependency injection
- Change monitor.OnboardingRequest, monitor.MVNOStatus, monitor.MVNOFilter, and monitor.MVNOPlan to mvno package types
- Remove monitor package import from handler_management.go and handler_mvno.go
- Add context.Context import for service method signatures
2026-05-02 19:49:39 +03:00
nutcas3 026a34fdcf feat: Add carrier-connector HTTP handlers with MVNO onboarding, management, and statistics endpoints
- Add Handler struct with StartOnboarding, GetMVNO, and ListMVNOs methods in handler_mvno.go
- Add ManagementHandler struct with GetMVNO, ListMVNOs, UpdateMVNOStatus, and GetMVNOStats methods in handler_management.go
- Add RegisterRoutes method for /mvno/onboarding, /mvno, and /mvno/:id route registration
- Add query parameter parsing for status, plan, and limit filters in ListMVNOs
- Add structured logging
2026-05-02 19:42:56 +03:00
nutcas3 358df2153b feat: Add production MVNO provisioner with tenant, carrier, billing, and API access setup
- Add ProductionProvisioner struct with tenant, carrier, billing, and storage service dependencies
- Add TenantService, CarrierManager, BillingService, and StorageService interfaces for external integrations
- Add TenantConfig and CarrierInfo structs for tenant and carrier data models
- Add NewProductionProvisioner constructor with service dependency injection
- Add ProvisionResources method with tenant context
2026-05-02 19:09:54 +03:00
nutcas3 7239bdea48 feat: Add MVNO provisioner methods with tenant setup, resource allocation, carrier configuration, and validation
- Add provisionTenantContext with tenant config creation, settings mapping, and tenant service integration
- Add provisionDatabaseSchema with dedicated schema creation for MVNO isolation
- Add provisionStorageResources with plan-based storage allocation (10GB to 10TB)
- Add selectCarriers with country-based carrier selection, active status filtering, and duplicate prevention
- Add config
2026-05-02 19:09:40 +03:00
nutcas3 afd2bd01b3 feat: Add MVNO router with route setup, middleware configuration, and health check endpoint
- Add Router struct with handler and logger dependencies for routing configuration
- Add NewRouter constructor with repository, service, and handler initialization
- Add SetupRoutes method with /api/v1 versioning, logging, and recovery middleware
- Add SetupMiddleware with CORS headers, rate limiting placeholder, and request ID tracking
- Add HealthCheck method with service status, name, and version response
2026-05-02 19:06:03 +03:00
nutcas3 04e9426aaf feat: Add MVNO provisioner with resource provisioning, carrier setup, billing, and API access configuration
- Add MVNOProvisioner struct with logger dependency for resource provisioning operations
- Add ProvisionResources method with tenant context, database schema, and storage provisioning
- Add SetupCarriers method with carrier selection, configuration, and carrier pool assignment
- Add SetupBilling method with billing ID generation, rate plan configuration, and payment processing setup
- Add SetupAPIAcc
2026-05-02 19:04:42 +03:00
nutcas3 3b10a90851 feat: Add MVNO repository with CRUD operations, filtering, and statistics aggregation
- Add Repository interface with CreateMVNO, GetMVNO, UpdateMVNO, ListMVNOs, DeleteMVNO, and UpdateMVNOStatus methods
- Add GormRepository struct with db and logger dependencies for GORM-based persistence
- Add MVNOFilter struct with status, plan, business_id, limit, offset, and date range filtering
- Add GetMVNO and GetMVNOByBusinessID methods with record not found error handling
- Add ListMVNOs with dynamic query
2026-05-02 19:04:14 +03:00
nutcas3 fd827d4ad0 feat: Add MVNO onboarding service with step-based workflow execution and progress tracking
- Add OnboardingService struct with validator, provisioner, and monitor dependencies
- Add StartOnboarding method with request validation, MVNO record creation, and async workflow execution
- Add executeOnboarding method with sequential step processing, context cancellation support, and progress updates
- Add executeStep method with switch-based routing for validation, provisioning, carrier setup, billing
2026-05-02 19:04:01 +03:00
nutcas3 afe3a79ae4 feat: Add MVNO onboarding monitor with progress tracking and metrics collection
- Add OnboardingMonitor struct with progress map and mutex for concurrent access
- Add UpdateProgress and GetProgress methods for tracking individual MVNO onboarding state
- Add GetAllProgress with map copy to prevent concurrent access issues
- Add GetActiveOnboardingCount and GetCompletedOnboardingCount for status aggregation
- Add GetAverageOnboardingTime calculation with completed onboarding duration tracking
- Add GetStepSuccess
2026-05-02 19:03:50 +03:00
nutcas3 95cd99f7ea feat: Add MVNO domain types with status, plan, config, and onboarding request models
- Add MVNO struct with ID, Name, BusinessID, Status, Plan, Config, and timestamps
- Add MVNOStatus enum with pending, review, approved, active, suspended, and terminated states
- Add MVNOPlan enum with starter, growth, scale, and enterprise tiers
- Add MVNOConfig struct with subscriber limits, country restrictions, carrier pool, and feature flags
- Add OnboardingRequest struct with business info, contact details, plan selection
2026-05-02 19:03:39 +03:00
nutcas3 695013be92 feat: Add MVNO onboarding validator with business, plan, and technical validation
- Add OnboardingValidator struct with ValidateRequest and ValidateMVNO methods in validator.go
- Add business info validation with name length, ID format, email regex, and phone length checks
- Add plan validation with subscriber limits for Starter (1000) and Growth (10000) plans
- Add technical requirements validation with country code format and use case length checks
- Add compliance validation with country-specific regulatory checks and restricted country filtering
- Add technical feasibility validation
2026-05-02 19:03:24 +03:00
nutcas3 77ca25a453 feat: Add MVNO HTTP handlers with onboarding, management, and statistics endpoints
- Add Handler struct with StartOnboarding, GetMVNO, and ListMVNOs methods in handler.go
- Add ManagementHandler struct with GetMVNO, ListMVNOs, UpdateMVNOStatus, and GetMVNOStats methods in handler_management.go
- Add RegisterRoutes method for /mvno/onboarding, /mvno, and /mvno/:id route registration
- Add query parameter parsing for status, plan, and limit filters in ListMVNOs
- Add structured logging with mvno_id, status, and error
2026-05-02 19:03:01 +03:00
NutcaseandGitHub d8dbebda6a Merge branch 'main' into new-features 2026-05-02 18:51:17 +03:00
nutcas3 fb1b251694 refactor: Update comments in tenant repository to reflect actual implementation
- Replace vague "separate table or log system" comment with specific tenant_events table reference in CreateEvent
- Replace "For now, update tenant settings" with clearer "Store configuration in tenant metadata field and update settings" in UpdateConfig
- Remove "For now, we'll use a simple approach" qualifier from CreateEvent comment
2026-05-02 18:45:20 +03:00
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