# NextGen Metering Service Configuration Example
port: 8080
metricsPort: 9090
vendor: aws  # or gcp, azure
region: us-east-1
env: dev  # or prod, staging
logLevel: debug
bucket: your-bucket-name

# NextGen Metering Configuration
nextGenMetering:
  # Start time for metering (Unix timestamp)
  # If not set, will start from 1 hour ago
  startTime: 0
  
  # Task interval in minutes (how often the task runs)
  taskInterval: 1
  
  # Delay in minutes (process data that is at least this old)
  delayMinutes: 5
  
  # Enable recompute for historical data
  enableRecompute: true
  
  # Number of days to recompute
  recomputeDays: 1

  # Plan controls the billing plan. "premium" (default) for normal mode, "byoc" for BYOC mode.
  # plan: premium

  # Delta Lake table path
  deltaTablePath: "s3://your-bucket/delta-tables/nextgen-metering-sku"
  
  # Checkpoint path for storing processing state
  checkpointPath: "s3://your-bucket/checkpoints/nextgen-metering"
  
  # Storage options for Delta Lake (S3/Azure/GCS configuration)
  storageOptions:
    # For S3
    AWS_REGION: "us-east-1"
    AWS_ACCESS_KEY_ID: "your-access-key"
    AWS_SECRET_ACCESS_KEY: "your-secret-key"
    # AWS_S3_ALLOW_UNSAFE_RENAME: "true"  # Only if needed for compatibility
    
    # For Azure (uncomment if using Azure)
    # AZURE_STORAGE_ACCOUNT_NAME: "your-storage-account"
    # AZURE_STORAGE_ACCOUNT_KEY: "your-storage-key"
    
    # For GCS (uncomment if using GCS)
    # GOOGLE_SERVICE_ACCOUNT: "/path/to/service-account.json"

  # Maintenance job (daily compact/delete/vacuum)
  maintenance:
    enable: true
    # Interval in minutes (default 1440 = once per day)
    intervalMinutes: 1440
    # Enable deletion of historical rows before the configured threshold
    enableDelete: true
    # Keep data for the last 90 days (optional if deleteBeforeTimestamp is set)
    deleteRetentionDays: 90
    # Absolute cutoff timestamp (Unix seconds). Takes precedence when >0.
    deleteBeforeTimestamp: 0
    # Enable vacuum to clean stale files
    enableVacuum: true
    # Retention window in hours for vacuum (default Delta Lake requirement is 168)
    vacuumRetentionHours: 168
    # Dry run vacuum to preview deletions without removing files
    vacuumDryRun: false

# Secret configuration (set via environment variables)
# API_GATEWAY_AUTH_KEY environment variable will be used
