spring:
  application:
    name: ga-api
  profiles:
    active: trading_ai
  datasource:
    url: jdbc:postgresql://localhost:5432/ga
    username: ga
    password: ga
    driver-class-name: org.postgresql.Driver
  flyway:
    enabled: true
    locations: classpath:db/migration
    baseline-on-migrate: true
  data:
    redis:
      host: localhost
      port: 6379
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB

server:
  port: 8082
  servlet:
    encoding:
      charset: UTF-8
      force: true

mybatis:
  config-location: classpath:mybatis/mybatis-config.xml
  mapper-locations: classpath*:mapper/**/*.xml
  type-aliases-package: com.ga.core.vo,com.ga.common.model

pagehelper:
  helper-dialect: postgresql
  reasonable: true
  support-methods-arguments: true

springdoc:
  swagger-ui:
    path: /swagger-ui.html

ga:
  jwt:
    secret: ${JWT_SECRET:change-me-please-this-must-be-at-least-256-bits-long-secret-key}
    access-token-expire: 7200000
    refresh-token-expire: 604800000
  encrypt:
    key: ${ENCRYPT_KEY:0123456789abcdef0123456789abcdef}

app:
  attachment:
    path: ${ATTACHMENT_PATH:./uploads}
  withdraw:
    approval-line-id: ${WITHDRAW_APPROVAL_LINE_ID:1}
  # 외부연동 어댑터 선택 (ga-external-adapter 모듈의 구현체 분기)
  # bank: mock | kftc — 실제 KFTC SDK 통합 전까지 mock 유지
  # message: mock | toast — 실제 NHN Toast/카카오 통합 전까지 mock 유지
  adapter:
    bank:    ${ADAPTER_BANK:mock}
    message: ${ADAPTER_MESSAGE:mock}
    push:    ${ADAPTER_PUSH:mock}
    # FCM HTTP v1 (push=fcm 일 때 사용). 운영 시 projectId/accessToken 주입.
    fcm:
      base-url:     ${FCM_BASE_URL:https://fcm.googleapis.com}
      project-id:   ${FCM_PROJECT_ID:}
      access-token: ${FCM_ACCESS_TOKEN:}
    # KFTC 오픈뱅킹 입금이체 (bank=kftc 일 때 사용). 운영 시 토큰/약정계좌 주입.
    kftc:
      base-url:         ${KFTC_BASE_URL:https://openapi.openbanking.or.kr}
      access-token:     ${KFTC_ACCESS_TOKEN:}
      cntr-account-type: ${KFTC_CNTR_ACCOUNT_TYPE:N}
      cntr-account-num: ${KFTC_CNTR_ACCOUNT_NUM:}
      wd-print-content: ${KFTC_WD_PRINT:수수료정산}
      name-check-option: ${KFTC_NAME_CHECK:off}
      transfer-purpose: ${KFTC_TRANSFER_PURPOSE:TR}
    # NHN Cloud(Toast) SMS/알림톡 (message=toast 일 때 사용). 운영 시 AppKey/SecretKey 주입.
    toast:
      sms-base-url:      ${TOAST_SMS_BASE_URL:https://api-sms.cloud.toast.com}
      sms-app-key:       ${TOAST_SMS_APP_KEY:}
      sms-secret-key:    ${TOAST_SMS_SECRET_KEY:}
      sender-no:         ${TOAST_SENDER_NO:}
      alimtalk-base-url: ${TOAST_ALIMTALK_BASE_URL:https://kakaotalk-bizmessage.api.nhncloudservice.com}
      alimtalk-app-key:  ${TOAST_ALIMTALK_APP_KEY:}
      alimtalk-secret-key: ${TOAST_ALIMTALK_SECRET_KEY:}
      sender-key:        ${TOAST_SENDER_KEY:}
  # 펌뱅킹 재시도 배치
  bank-retry:
    limit: ${BANK_RETRY_LIMIT:50}
    # 미설정 시 사실상 비활성 (매년 1/1 0시). 운영 활성화 예: "0 */10 * * * *"
    cron:  ${BANK_RETRY_CRON:0 0 0 1 1 ?}
  # 펌뱅킹 SETTLED 동기화 배치 — 어댑터 queryStatus 폴링
  bank-settle:
    limit: ${BANK_SETTLE_LIMIT:50}
    # 미설정 시 사실상 비활성. 운영 활성화 예: "0 */5 * * * *"
    cron:  ${BANK_SETTLE_CRON:0 0 0 1 1 ?}

logging:
  level:
    com.ga: DEBUG
    org.mybatis: INFO
