server:
  port: ${SERVER_PORT:8080}

spring:
  application:
    name: writeoff-backend
  datasource:
    url: ${DB_URL:jdbc:mysql://localhost:3306/writeoff?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai}
    username: ${DB_USERNAME:root}
    password: ${DB_PASSWORD:root}
    driver-class-name: com.mysql.cj.jdbc.Driver
  flyway:
    enabled: true
    locations: classpath:db/migration

logging:
  level:
    root: ${LOG_LEVEL:INFO}
    org.springframework.jdbc.core.JdbcTemplate: INFO
    org.springframework.jdbc.core.StatementCreatorUtils: INFO
    org.springframework.jdbc.datasource: INFO

app:
  repository:
    mode: ${APP_REPOSITORY_MODE:jdbc}
  security:
    jwt-secret: ${JWT_SECRET:replace-with-your-jwt-secret}
    jwt-expire-minutes: ${JWT_EXPIRE_MINUTES:120}
    access-expire-minutes: ${ACCESS_EXPIRE_MINUTES:${JWT_EXPIRE_MINUTES:120}}
    idle-timeout-minutes: ${IDLE_TIMEOUT_MINUTES:60}
    refresh-expire-days: ${REFRESH_EXPIRE_DAYS:14}
    password-setup-expire-minutes: ${PASSWORD_SETUP_EXPIRE_MINUTES:1440}
    refresh-cookie-name: ${REFRESH_COOKIE_NAME:refreshToken}
    refresh-cookie-secure: ${REFRESH_COOKIE_SECURE:false}
    refresh-cookie-same-site: ${REFRESH_COOKIE_SAME_SITE:Lax}
  frontend-base-url: ${FRONTEND_BASE_URL:http://localhost:5173}
  oss:
    endpoint: ${OSS_ENDPOINT:https://oss-cn-beijing.aliyuncs.com}
    bucket: ${OSS_BUCKET:write-off}
    access-key-id: ${OSS_ACCESS_KEY_ID:LTAI5tAkZSLF5xbFGPVqmYeq}
    access-key-secret: ${OSS_ACCESS_KEY_SECRET:ETrDjr35Ty2uMSqulOuk2Yky5R1R0Y}
    sign-expire-seconds: ${OSS_SIGN_EXPIRE_SECONDS:600}
  scheduler:
    enabled: ${SCHEDULER_ENABLED:true}
    poll-interval-ms: ${SCHEDULER_POLL_INTERVAL_MS:3000}
    batch-size: ${SCHEDULER_BATCH_SIZE:100}
    job-timeout-seconds: ${JOB_TIMEOUT_SECONDS:120}
    max-retry: ${JOB_MAX_RETRY:3}
  notification:
    webhook-secret: ${NOTIFICATION_WEBHOOK_SECRET:change-me}
    gateway-crypto-secret: ${NOTIFICATION_GATEWAY_CRYPTO_SECRET:${JWT_SECRET:replace-with-your-jwt-secret}}
    tenant-admin-mail-subject-template: ${TENANT_ADMIN_MAIL_SUBJECT_TEMPLATE:Tenant admin account notification}
    tenant-admin-mail-body-template: '${TENANT_ADMIN_MAIL_BODY_TEMPLATE:Action: {actionCn}\nTenant name: {tenantName}\nTenant code: {tenantCode}\nLogin path: {loginPath}\nAdmin phone: {phone}\nPassword setup link: {setupLink}\nPlease use the setup link to complete your password configuration before logging in.}'
    mail:
      default-subject: ${MAIL_DEFAULT_SUBJECT:绯荤粺閫氱煡}
  runtime:
    version: ${APP_VERSION:0.0.1-SNAPSHOT}
    build-time: ${BUILD_TIME:unknown}
  baidu-ocr:
    api-key: ${BAIDU_OCR_API_KEY:VDOgQBXtfMH5YYudCIhUULge}
    secret-key: ${BAIDU_OCR_SECRET_KEY:as6QiY79TOYm2kKTvdA3aEah1WawNGtT}
    token-url: ${BAIDU_OCR_TOKEN_URL:https://aip.baidubce.com/oauth/2.0/token}
    multiple-invoice-url: ${BAIDU_OCR_MULTIPLE_INVOICE_URL:https://aip.baidubce.com/rest/2.0/ocr/v1/multiple_invoice}
    id-card-url: ${BAIDU_OCR_ID_CARD_URL:https://aip.baidubce.com/rest/2.0/ocr/v1/idcard}
    bank-card-url: ${BAIDU_OCR_BANK_CARD_URL:https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard}
    document-extract-task-url: ${BAIDU_OCR_DOCUMENT_EXTRACT_TASK_URL:https://aip.baidubce.com/rest/2.0/brain/online/v1/extract/task}
    document-extract-query-url: ${BAIDU_OCR_DOCUMENT_EXTRACT_QUERY_URL:https://aip.baidubce.com/rest/2.0/brain/online/v1/extract/query_task}
    connect-timeout-ms: ${BAIDU_OCR_CONNECT_TIMEOUT_MS:5000}
    read-timeout-ms: ${BAIDU_OCR_READ_TIMEOUT_MS:20000}
    max-bytes: ${BAIDU_OCR_MAX_BYTES:3145728}
    document-extract-max-bytes: ${BAIDU_OCR_DOCUMENT_EXTRACT_MAX_BYTES:52428800}
