spring:
  application:
    name: sigefp-api
  
  datasource:
    url: jdbc:postgresql://localhost:5432/sigefp
    username: postgres
    password: 'postgres' # Altere para a senha real do seu PostgreSQL
    driver-class-name: org.postgresql.Driver
    hikari:
      maximum-pool-size: 10
      minimum-idle: 5
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000

  jpa:
    hibernate:
      ddl-auto: update # validate, update, create, create-drop
      # update: cria/atualiza tabelas automaticamente (desenvolvimento)
      # validate: apenas valida se tabelas existem (produção)
    show-sql: false
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        format_sql: true
        jdbc:
          batch_size: 20
        order_inserts: true
        order_updates: true

  jackson:
    serialization:
      write-dates-as-timestamps: false
    time-zone: Africa/Bissau
    locale: pt_GW
    default-property-inclusion: non_null

server:
  port: 8081
  servlet:
    context-path: /

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics
  endpoint:
    health:
      show-details: when-authorized

# JWT Configuration
jwt:
  secret: MySecretKeyForJWTTokenGenerationThatMustBeAtLeast256BitsLongForProductionUse
  expiration: 86400000 # 24 horas em milissegundos
  refresh-expiration: 604800000 # 7 dias em milissegundos

# SpringDoc OpenAPI (Swagger) Configuration
springdoc:
  api-docs:
    path: /api-docs
  swagger-ui:
    path: /swagger-ui.html
    enabled: true
    operations-sorter: method
    tags-sorter: alpha
    try-it-out-enabled: true
  show-actuator: false

logging:
  level:
    root: INFO
    br.gov.sigefp: DEBUG
    org.springframework.security: DEBUG
    org.hibernate.SQL: DEBUG
    org.hibernate.type.descriptor.sql.BasicBinder: TRACE
  pattern:
    console: "%d{dd/MM/yyyy HH:mm:ss} - %msg%n"
    file: "%d{dd/MM/yyyy HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"

# Configurações específicas para Guiné-Bissau
guinea-bissau:
  country:
    code: GW
    name: Guiné-Bissau
  currency:
    code: XOF
    symbol: FCFA
  timezone: Africa/Bissau
  locale: pt_GW
  phone-code: "+245"
  date-format: "dd/MM/yyyy"
  datetime-format: "dd/MM/yyyy HH:mm"

