server:
  port: 8081

spring:
  mvc:
    throw-exception-if-no-handler-found: true
  web:
    resources:
      add-mappings: false
  servlet:
    multipart:
      max-file-size: 50MB
      max-request-size: 55MB
  jackson:
    default-property-inclusion: always
  datasource:
    url: jdbc:postgresql://183.99.177.40:5432/invyone
    username: postgres
    password: "invyone0909!!"
    driver-class-name: org.postgresql.Driver
    hikari:
      maximum-pool-size: 10
      minimum-idle: 2
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000
  flyway:
    enabled: true
    baseline-on-migrate: true
    baseline-version: 0
    out-of-order: true   # 누락된 낮은 버전 마이그레이션도 적용 허용 (V015 이전 누락 케이스 안전망)
    locations: classpath:db/migration
    schemas: public
    table: flyway_schema_history

mybatis:
  mapper-locations: classpath:mapper/*.xml,classpath:mapper/ai/*.xml
  configuration:
    map-underscore-to-camel-case: false
    default-fetch-size: 100
    default-statement-timeout: 30

ai:
  encryption-key: ${AI_PROVIDER_ENCRYPTION_KEY:dGVzdC1lbmNyeXB0aW9uLWtleS0zMi1ieXRlcy1iYXNlNjQh}
  default-timezone: ${AI_DEFAULT_TIMEZONE:Asia/Seoul}
  rate-limit-per-minute: ${AI_RATE_LIMIT_PER_MINUTE:60}
  llm-http-timeout-sec: ${LLM_HTTP_TIMEOUT_SEC:60}
  quartz-clustered: ${AI_QUARTZ_CLUSTERED:false}

jwt:
  # JWT_SECRET 환경변수 필수. 디폴트 없음 — 미지정 시 앱 기동 실패 (의도된 동작)
  # 새 secret 생성: openssl rand -base64 64 | tr -d '\n='
  secret: ${JWT_SECRET}
  expiration: ${JWT_EXPIRATION:86400000}

cors:
  # 콤마 구분 문자열. setAllowedOriginPatterns 로 매칭됨.
  # Spring CORS 문법: 포트 와일드카드는 `[*]` 로 표기. YAML 이 `[...]` 를 sequence 로 해석하지
  # 않도록 반드시 따옴표로 감싸기.
  # dev 디폴트: localhost + 사무실 Tailscale IP + *.localhost 테넌트 (RFC 6761) + 테넌트 서브도메인 (모든 포트) 패턴.
  allowed-origins: "${CORS_ALLOWED_ORIGINS:http://localhost:3000,http://localhost:9772,http://localhost:9771,http://100.126.230.80:9772,http://*.localhost:[*],http://*.invyone.com:[*],https://*.invyone.com:[*],http://*.invyone.com,https://*.invyone.com}"

file:
  upload-dir: ./uploads

openclaw:
  enabled: ${OPENCLAW_ENABLED:false}
  gateway-url: ${OPENCLAW_GATEWAY_URL:http://localhost:18789}
  timeout: 60s
  health-check-interval: 30s

logging:
  level:
    com.erp: DEBUG
    org.mybatis: DEBUG
