apiVersion: v1
kind: ConfigMap
metadata:
  name: sme-services-config
  namespace: sme
  annotations:
    description: |
      Central source of truth for SME service URLs, DB URIs, and external
      dependencies. All SME Deployments reference keys here via
      envFrom/valueFrom.configMapKeyRef — see issue #87.

      Forking this manifest to a new environment (staging, other clusters)
      should require editing only THIS file, not every service YAML.
data:
  # ---- cluster-internal service endpoints -----------------------------------
  # The SME microservice mesh. All services run in the `sme` namespace and
  # expose their own ports. Gateway fan-out uses these URLs; services call
  # each other directly using these too.
  AUTH_URL: "http://auth.sme.svc.cluster.local:8081"
  CATALOG_URL: "http://catalog.sme.svc.cluster.local:8082"
  TENANT_URL: "http://tenant.sme.svc.cluster.local:8083"
  PROVISIONING_URL: "http://provisioning.sme.svc.cluster.local:8084"
  BILLING_URL: "http://billing.sme.svc.cluster.local:8085"
  DOMAIN_URL: "http://domain.sme.svc.cluster.local:8086"
  NOTIFICATION_URL: "http://notification.sme.svc.cluster.local:8087"

  # ---- shared backing-store endpoints ---------------------------------------
  MONGODB_URI: "mongodb://ferretdb.sme.svc.cluster.local:27017"
  VALKEY_ADDR: "valkey.sme.svc.cluster.local:6379"
  POSTGRES_HOST: "sme-pg-rw.sme.svc.cluster.local"
  POSTGRES_PORT: "5432"

  # ---- cross-namespace event bus --------------------------------------------
  # Redpanda currently lives in the talentmesh namespace (migration tracked
  # in issue #68). Centralised so the eventual move to a sme-owned broker
  # is a single-key change.
  REDPANDA_BROKERS: "redpanda.talentmesh.svc.cluster.local:9092"

  # ---- public / CORS endpoints ----------------------------------------------
  CORS_ORIGIN_PUBLIC: "https://sme.openova.io"
  CORS_ORIGIN_ADMIN: "https://sme.openova.io,https://admin.sme.openova.io"
  CORS_ORIGIN_GATEWAY: "https://sme.openova.io,https://admin.sme.openova.io,https://console.sme.openova.io,https://portal.sme.openova.io"
  PUBLIC_BASE_URL: "https://sme.openova.io"
  PUBLIC_API_BASE_URL: "https://sme.openova.io/api"
  CNAME_TARGET: "sme.openova.io"

  # ---- checkout redirect targets --------------------------------------------
  CHECKOUT_SUCCESS_URL: "https://sme.openova.io/checkout/success"
  CHECKOUT_CANCEL_URL: "https://sme.openova.io/checkout/cancel"
