spring:
  application:
    name: petshop-backend
  main:
    lazy-initialization: true

  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
    hikari:
      maximum-pool-size: 20
      minimum-idle: 5
      connection-timeout: 30000

  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: ${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
    enabled: ${SWAGGER_ENABLED:false}
  swagger-ui:
    path: /swagger-ui
    enabled: ${SWAGGER_ENABLED:false}

app:
  upload:
    base-dir: ${UPLOAD_BASE_DIR:uploads}
  frontend-url: ${FRONTEND_URL:http://localhost:3000}
  allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000,http://localhost:3001,http://127.0.0.1:3000,https://petshop-web.nicepond-c7280126.westus2.azurecontainerapps.io}

petshop:
  business:
    open-time: "09:00"
    close-time: "17:00"
    slot-interval-minutes: 30
    max-image-size-bytes: 5242880
    employee-discount-percent: 0.10
    loyalty-points-per-dollar: 20

azure:
  storage:
    connection-string: ${AZURE_STORAGE_CONNECTION_STRING:}
    container-prefix: ${AZURE_STORAGE_CONTAINER_PREFIX:petshop}

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:logs/app.log}
  level:
    com.petshop: ${LOG_LEVEL:INFO}
    org.springframework.security: ${LOG_LEVEL_SECURITY:WARN}
    org.springdoc.core.events.SpringDocAppInitializer: ERROR
