spring:
  application:
    name: petshop-backend

  config:
    import: optional:file:.env[.properties]

  servlet:
    multipart:
      enabled: true
      max-file-size: 5MB
      max-request-size: 5MB

  datasource:
    url: ${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/Petstoredb?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC}
    username: ${SPRING_DATASOURCE_USERNAME:petshop}
    password: ${SPRING_DATASOURCE_PASSWORD:petshop}
    driver-class-name: com.mysql.cj.jdbc.Driver

  sql:
    init:
      mode: never

  jpa:
    hibernate:
      ddl-auto: validate
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    show-sql: ${JPA_SHOW_SQL:false}
    properties:
      hibernate:
        format_sql: true
    open-in-view: false

  flyway:
    enabled: false

server:
  port: ${SERVER_PORT:8080}
  address: ${SERVER_ADDRESS:0.0.0.0}
  servlet:
    context-path: /

springdoc:
  api-docs:
    path: /v3/api-docs
  swagger-ui:
    path: /swagger-ui

app:
  upload:
    base-dir: ${UPLOAD_BASE_DIR:uploads}
  frontend-url: ${FRONTEND_URL:http://localhost:3000}

resend:
  api-key: ${RESEND_API_KEY:}
  from: ${RESEND_FROM:PetShop <onboarding@resend.dev>}

jwt:
  secret: ${JWT_SECRET}
  expiration: ${JWT_EXPIRATION:86400000}

stripe:
  secret-key: ${STRIPE_SECRET_KEY:}

openrouter:
  api-key: ${OPENROUTER_API_KEY:}
  model: ${OPENROUTER_MODEL:openrouter/free}

logging:
  file:
    name: ${LOG_FILE:log.txt}
  level:
    com.petshop: ${LOG_LEVEL:INFO}
    org.springframework.security: ${LOG_LEVEL_SECURITY:WARN}
    org.springdoc.core.events.SpringDocAppInitializer: ERROR

  jackson:
    serialization:
      write-dates-as-timestamps: false
    deserialization:
      fail-on-unknown-properties: false
