# Development profile configuration
# Activated with: mvn spring-boot:run -Dspring-boot.run.profiles=dev

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/fitpub
    username: fitpub
    password: change_me_in_production
    driver-class-name: org.postgresql.Driver

  jpa:
    hibernate:
      ddl-auto: validate  # Use Flyway for schema management, even in dev
    show-sql: true  # Show SQL queries in console
    properties:
      hibernate:
        format_sql: true  # Format SQL for readability
        use_sql_comments: true  # Add comments to SQL

  flyway:
    enabled: true  # Use Flyway for migrations
    baseline-on-migrate: true
    locations: classpath:db/migration

# Development-specific FitPub configuration
fitpub:
  domain: ${FITPUB_DOMAIN:localhost:8080}
  base-url: ${FITPUB_BASE_URL:http://localhost:8080}

  activitypub:
    enabled: true
    max-federation-retries: 3
    request-timeout-seconds: 30

  security:
    jwt:
      # Use a default secret for development (override with env var for security)
      secret: ${JWT_SECRET:dev-secret-key-change-in-production-must-be-at-least-32-characters-long}
      expiration: 86400000  # 24 hours

  storage:
    fit-files:
      enabled: true
      retention-days: 365

# Logging - verbose in development
logging:
  level:
    root: INFO
    org.operaton.fitpub: DEBUG
    org.hibernate.SQL: DEBUG
    org.hibernate.type.descriptor.sql.BasicBinder: TRACE
    org.springframework.security: DEBUG
    org.springframework.web: DEBUG

# Server configuration
server:
  port: ${PORT:8080}
  error:
    include-message: always
    include-binding-errors: always
    include-stacktrace: always  # Show stack traces in dev mode
