spring:
  datasource:
    # prod 只保留结构，真实生产连接信息和密码必须由环境变量或部署平台 Secret 注入。
    url: ${TH_HOTEL_PROD_DB_URL}
    username: ${TH_HOTEL_PROD_DB_USERNAME}
    password: ${TH_HOTEL_PROD_DB_PASSWORD}
    driver-class-name: com.mysql.cj.jdbc.Driver
  flyway:
    enabled: true
  servlet:
    multipart:
      # prod Debug EML / 文件转换如被显式开启，multipart 上限应高于业务上限，便于服务层返回受控错误。
      max-file-size: ${DOCUMENT_CONVERSION_PROD_MULTIPART_MAX_FILE_BYTES:${DOCUMENT_CONVERSION_MULTIPART_MAX_FILE_BYTES:${DEBUG_EML_UPLOAD_PROD_MULTIPART_MAX_FILE_BYTES:${DEBUG_EML_UPLOAD_MULTIPART_MAX_FILE_BYTES:25165824}}}}
      max-request-size: ${DOCUMENT_CONVERSION_PROD_MULTIPART_MAX_REQUEST_BYTES:${DOCUMENT_CONVERSION_MULTIPART_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_PROD_MULTIPART_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_MULTIPART_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_PROD_MAX_REQUEST_BYTES:${DEBUG_EML_UPLOAD_MAX_REQUEST_BYTES:29360128}}}}}}

agentbus:
  probe:
    enabled: ${AGENTBUS_PROD_PROBE_ENABLED:false}
  ws:
    url: ${AGENTBUS_PROD_WS_URL}
    token: ${AGENTBUS_PROD_WS_TOKEN}
    reconnect-delay: 5s
    connect-timeout: 15s
  capture:
    enabled: true
  superagent-dispatch:
    # prod 默认关闭自动分发；上线前必须确认 SuperAgent Open API、监控和回滚方案。
    enabled: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_ENABLED:false}
    worker-enabled: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_WORKER_ENABLED:false}
    batch-size: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_BATCH_SIZE:${AGENTBUS_SUPERAGENT_DISPATCH_BATCH_SIZE:10}}
    max-attempts: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_MAX_ATTEMPTS:${AGENTBUS_SUPERAGENT_DISPATCH_MAX_ATTEMPTS:3}}
    lock-ttl: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_LOCK_TTL:${AGENTBUS_SUPERAGENT_DISPATCH_LOCK_TTL:5m}}
    initial-backoff: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_INITIAL_BACKOFF:${AGENTBUS_SUPERAGENT_DISPATCH_INITIAL_BACKOFF:30s}}
    max-backoff: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_MAX_BACKOFF:${AGENTBUS_SUPERAGENT_DISPATCH_MAX_BACKOFF:15m}}
    worker-fixed-delay-ms: ${AGENTBUS_PROD_SUPERAGENT_DISPATCH_WORKER_FIXED_DELAY_MS:${AGENTBUS_SUPERAGENT_DISPATCH_WORKER_FIXED_DELAY_MS:10000}}

superagent:
  task-result:
    # prod SuperAgent HMAC 密钥不能为空；生产优先使用 prod 专属变量，兼容旧通用变量。
    hmac-secret: ${SUPERAGENT_PROD_TASK_RESULT_HMAC_SECRET:${SUPERAGENT_TASK_RESULT_HMAC_SECRET}}
  open-api:
    # prod 默认不开放 Debug EML 真实调用；如需启用，必须先接入正式权限和审计策略。
    enabled: ${SUPERAGENT_PROD_OPEN_API_ENABLED:false}
    base-url: ${DEERFLOW_PROD_BASE_URL:${DEERFLOW_BASE_URL}}
    api-key: ${DEERFLOW_PROD_OPEN_API_KEY:${DEERFLOW_OPEN_API_KEY}}
    external-subject-id: ${SUPERAGENT_PROD_DEBUG_EML_EXTERNAL_SUBJECT_ID:${SUPERAGENT_DEBUG_EML_EXTERNAL_SUBJECT_ID:th-hotel-debug-eml-upload}}
    agentbus-external-subject-id: ${SUPERAGENT_PROD_AGENTBUS_EXTERNAL_SUBJECT_ID:${SUPERAGENT_AGENTBUS_EXTERNAL_SUBJECT_ID:th-hotel-agentbus-source-message}}
    connect-timeout: ${SUPERAGENT_PROD_DEBUG_EML_CONNECT_TIMEOUT:${SUPERAGENT_DEBUG_EML_CONNECT_TIMEOUT:15s}}
    read-timeout: ${SUPERAGENT_PROD_DEBUG_EML_READ_TIMEOUT:${SUPERAGENT_DEBUG_EML_READ_TIMEOUT:180s}}
    sse-recovery-max-attempts: ${SUPERAGENT_PROD_OPEN_API_SSE_RECOVERY_MAX_ATTEMPTS:${SUPERAGENT_OPEN_API_SSE_RECOVERY_MAX_ATTEMPTS:5}}

aliyun:
  oss:
    endpoint: ${ALIYUN_OSS_PROD_ENDPOINT:${ALIYUN_OSS_ENDPOINT}}
    bucket: ${ALIYUN_OSS_PROD_BUCKET:${ALIYUN_OSS_BUCKET}}
    access-key-id: ${ALIYUN_OSS_PROD_ACCESS_KEY_ID:${ALIYUN_OSS_ACCESS_KEY_ID}}
    access-key-secret: ${ALIYUN_OSS_PROD_ACCESS_KEY_SECRET:${ALIYUN_OSS_ACCESS_KEY_SECRET}}
    public-base-url: ${ALIYUN_OSS_PROD_PUBLIC_BASE_URL:${ALIYUN_OSS_PUBLIC_BASE_URL}}
    debug-eml-prefix: ${ALIYUN_OSS_PROD_DEBUG_EML_PREFIX:${ALIYUN_OSS_DEBUG_EML_PREFIX:debug/eml/}}

debug:
  eml-upload:
    # prod 默认关闭；不要在未接入正式用户权限前开放。
    enabled: ${DEBUG_EML_UPLOAD_PROD_ENABLED:false}
    access-key: ${DEBUG_EML_UPLOAD_PROD_ACCESS_KEY:${DEBUG_EML_UPLOAD_ACCESS_KEY}}
    max-file-bytes: ${DEBUG_EML_UPLOAD_PROD_MAX_FILE_BYTES:${DEBUG_EML_UPLOAD_MAX_FILE_BYTES:10485760}}
    sse-heartbeat-interval: ${DEBUG_EML_UPLOAD_PROD_SSE_HEARTBEAT_INTERVAL:${DEBUG_EML_UPLOAD_SSE_HEARTBEAT_INTERVAL:15s}}

document-conversion:
  # prod 默认关闭；启用前必须确认 LibreOffice、字体、OSS、访问口令、监控和临时目录清理策略。
  enabled: ${DOCUMENT_CONVERSION_PROD_ENABLED:false}
  access-key: ${DOCUMENT_CONVERSION_PROD_ACCESS_KEY:${DOCUMENT_CONVERSION_ACCESS_KEY:}}
  soffice-path: ${DOCUMENT_CONVERSION_PROD_SOFFICE_PATH:${DOCUMENT_CONVERSION_SOFFICE_PATH:soffice}}
  temp-dir: ${DOCUMENT_CONVERSION_PROD_TEMP_DIR:${DOCUMENT_CONVERSION_TEMP_DIR:${java.io.tmpdir}/th-hotel-document-conversion}}
  max-file-bytes: ${DOCUMENT_CONVERSION_PROD_MAX_FILE_BYTES:${DOCUMENT_CONVERSION_MAX_FILE_BYTES:20971520}}
  timeout-seconds: ${DOCUMENT_CONVERSION_PROD_TIMEOUT_SECONDS:${DOCUMENT_CONVERSION_TIMEOUT_SECONDS:60}}
  max-concurrent: ${DOCUMENT_CONVERSION_PROD_MAX_CONCURRENT:${DOCUMENT_CONVERSION_MAX_CONCURRENT:2}}
  output-oss-prefix: ${DOCUMENT_CONVERSION_PROD_OUTPUT_OSS_PREFIX:${DOCUMENT_CONVERSION_OUTPUT_OSS_PREFIX:document-conversions/excel-to-pdf/}}
  worker-enabled: ${DOCUMENT_CONVERSION_PROD_WORKER_ENABLED:${DOCUMENT_CONVERSION_WORKER_ENABLED:false}}

auth:
  bootstrap:
    admin:
      # prod 初始超级管理员必须通过生产 Secret 注入；系统已有超级管理员后不会覆盖。
      username: ${AUTH_PROD_BOOTSTRAP_ADMIN_USERNAME:${AUTH_BOOTSTRAP_ADMIN_USERNAME}}
      password: ${AUTH_PROD_BOOTSTRAP_ADMIN_PASSWORD:${AUTH_BOOTSTRAP_ADMIN_PASSWORD}}
      display-name: ${AUTH_PROD_BOOTSTRAP_ADMIN_DISPLAY_NAME:${AUTH_BOOTSTRAP_ADMIN_DISPLAY_NAME:系统管理员}}
    default-hotel-id: ${AUTH_PROD_BOOTSTRAP_DEFAULT_HOTEL_ID:${AUTH_BOOTSTRAP_DEFAULT_HOTEL_ID}}
    default-hotel-name: ${AUTH_PROD_BOOTSTRAP_DEFAULT_HOTEL_NAME:${AUTH_BOOTSTRAP_DEFAULT_HOTEL_NAME}}
    default-hotel-time-zone: ${AUTH_PROD_BOOTSTRAP_DEFAULT_HOTEL_TIME_ZONE:${AUTH_BOOTSTRAP_DEFAULT_HOTEL_TIME_ZONE:Asia/Bangkok}}
  session:
    ttl-minutes: ${AUTH_PROD_SESSION_TTL_MINUTES:${AUTH_SESSION_TTL_MINUTES:720}}

reservation:
  demo-data:
    # prod 永远不启用演示数据造数接口。
    enabled: false
    access-key: ${RESERVATION_PROD_DEMO_DATA_ACCESS_KEY:${RESERVATION_DEMO_DATA_ACCESS_KEY:}}

server:
  port: ${SERVER_PORT:8080}
