spring:
  application:
    name: effigenix-erp

  datasource:
    url: ${DB_URL:jdbc:postgresql://localhost:5432/effigenix}
    username: ${DB_USERNAME:effigenix}
    password: ${DB_PASSWORD:effigenix}
    driver-class-name: org.postgresql.Driver

  jpa:
    database-platform: org.hibernate.dialect.PostgreSQLDialect
    hibernate:
      ddl-auto: validate  # Liquibase handles schema, not Hibernate
    show-sql: false
    properties:
      hibernate:
        format_sql: true
        use_sql_comments: true

  liquibase:
    change-log: classpath:db/changelog/db.changelog-master.xml

  security:
    user:
      name: ${SPRING_SECURITY_USER:admin}
      password: ${SPRING_SECURITY_PASSWORD:admin}  # Only for development, will be replaced by JWT

# JWT Configuration
jwt:
  secret: ${JWT_SECRET:VerySecretKeyForDevelopmentPleaseChangeInProductionMin256Bits}
  expiration: 28800000  # 8 hours in milliseconds
  refresh-expiration: 604800000  # 7 days in milliseconds

# Sentry / Bugsink Error Tracking
sentry:
  dsn: ${SENTRY_DSN:}
  environment: ${SENTRY_ENVIRONMENT:development}
  traces-sample-rate: 0

# Server Configuration
server:
  port: 8080
  error:
    include-message: always
    include-binding-errors: always

# Logging
logging:
  level:
    root: INFO
    de.effigenix: DEBUG

# CORS Configuration
effigenix:
  cors:
    allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:3000}
  inventory:
    expiry-check-cron: "0 0 6 * * *"

# API Documentation
springdoc:
  api-docs:
    path: /api-docs
    enabled: ${SWAGGER_ENABLED:true}
  swagger-ui:
    path: /swagger-ui.html
    enabled: ${SWAGGER_ENABLED:true}
