{
  "repo": "tidbcloud/dbaas",
  "binary": "worker",
  "binary_path": "billing2/cmd/worker/main.go",
  "dependencies": {
    "HTTP GET /version": {"infrastructure": {}, "services": []},
    "Runtime ScheduledWorkers.CreateInvoiceWorker": {
      "infrastructure": {"mysql": {"conditions": ["Always"], "operations": [{"operation": "SELECT/INSERT/UPDATE", "tables": ["invoices", "payment_methods", "user_unit_costs"]}]}},
      "services": [
        {"name": "central", "target_interface": "GET /api/v1/admin/orgs", "operation_type": "http_get", "conditions": ["Always"]},
        {"name": "stripe", "target_interface": "POST /v1/invoice_items", "operation_type": "http_post", "conditions": ["payment_type=stripe"]},
        {"name": "stripe", "target_interface": "POST /v1/invoices", "operation_type": "http_post", "conditions": ["payment_type=stripe"]},
        {"name": "aws-marketplace", "target_interface": "marketplacemetering.BatchMeterUsage", "operation_type": "aws_sdk", "conditions": ["payment_type=aws"]},
        {"name": "gcp-marketplace", "target_interface": "servicecontrol.AllocateQuota", "operation_type": "grpc_unary", "conditions": ["payment_type=gcp"]}
      ]
    },
    "Runtime ScheduledWorkers.SyncTenantPayableWorker": {
      "infrastructure": {"mysql": {"conditions": ["Always"], "operations": [{"operation": "SELECT/UPDATE", "tables": ["payment_methods"]}]}},
      "services": [
        {"name": "central", "target_interface": "GET /api/v1/admin/orgs", "operation_type": "http_get", "conditions": ["Always"]},
        {"name": "stripe", "target_interface": "GET /v1/payment_methods", "operation_type": "http_get", "conditions": ["stripe enabled"]}
      ]
    },
    "Runtime ScheduledWorkers.CalculateCache": {
      "infrastructure": {"mysql": {"conditions": ["Always"], "operations": [{"operation": "SELECT", "tables": ["user_unit_costs"]}]}, "redis": {"conditions": ["Always"], "operations": [{"operation": "SET", "key_pattern": "monthly_cost:{tenant_id}:{year}:{month}"}]}},
      "services": [{"name": "central", "target_interface": "GET /api/v1/admin/orgs", "operation_type": "http_get", "conditions": ["Always"]}]
    },
    "Runtime ScheduledWorkers.RemoveUnusedCosts": {
      "infrastructure": {"mysql": {"conditions": ["Always"], "operations": [{"operation": "DELETE", "tables": ["user_unit_costs"]}]}},
      "services": []
    },
    "Runtime ScheduledWorkers.MergeSmallCosts": {
      "infrastructure": {"mysql": {"conditions": ["Always"], "operations": [{"operation": "SELECT/DELETE/INSERT", "tables": ["user_unit_costs"]}]}},
      "services": []
    }
  }
}
