spring:
  application:
    name: bergerie-ladoum
  datasource:
    url: ${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/bergerie_ladoum?createDatabaseIfNotExist=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true}
    username: ${SPRING_DATASOURCE_USERNAME:root}
    password: ${SPRING_DATASOURCE_PASSWORD:}
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      initialization-fail-timeout: 60000
      connection-timeout: 30000
      maximum-pool-size: 5
      minimum-idle: 1
      idle-timeout: 300000
      max-lifetime: 600000
  jpa:
    hibernate:
      ddl-auto: ${JPA_DDL_AUTO:update}
    show-sql: ${JPA_SHOW_SQL:false}
    properties:
      hibernate:
        dialect: org.hibernate.dialect.MySQLDialect
        format_sql: true
        jdbc:
          time_zone: UTC
    open-in-view: false
  servlet:
    multipart:
      enabled: true
      max-file-size: 5MB
      max-request-size: 10MB

server:
  port: ${PORT:8080}
  address: 0.0.0.0
  servlet:
    context-path: ${SERVER_CONTEXT_PATH:/api}
  forward-headers-strategy: framework
  compression:
    enabled: true
    mime-types: application/json,application/xml,text/html,text/plain,text/css,application/javascript

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

management:
  endpoints:
    web:
      exposure:
        include: health,info
  endpoint:
    health:
      show-details: when-authorized
      probes:
        enabled: true

logging:
  level:
    root: INFO
    sn.ladoum.bergerie: INFO
    org.hibernate.SQL: WARN
    com.zaxxer.hikari: INFO
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"

app:
  jwt:
    secret: ${APP_JWT_SECRET:ChangeMeSuperSecretKeyForJwtSigningBergerieLadoum2025MinimumLen32}
    expiration-ms: ${APP_JWT_EXPIRATION_MS:86400000}
  admin:
    email: ${APP_ADMIN_EMAIL:mausarr05@gmail.com}
    password: ${APP_ADMIN_PASSWORD:Admin@123}
    nom: ${APP_ADMIN_NOM:Mamadou sarr}
    telephone: ${APP_ADMIN_TELEPHONE:775897644}
    actif: ${APP_ADMIN_ACTIF:true}
  storage:
    location: ${APP_STORAGE_LOCATION:uploads}
    public-base-url: ${APP_STORAGE_PUBLIC_BASE_URL:/uploads}
  frontend:
    base-url: ${APP_FRONTEND_BASE_URL:http://localhost:4200}
  cors:
    allowed-origins: ${APP_CORS_ALLOWED_ORIGINS:http://localhost:4200}