# Local profile configuration
# This profile aims to configure an environment that can be developed even if the network is disconnected.

spring:
  jpa:
    hibernate:
      ddl-auto: update  # Use update for local development to automatically update schema
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        format_sql: true
        show_sql: true  # Show SQL for local debugging
        use_sql_comments: true
    open-in-view: false

  flyway:
    enabled: ${MIGRATIONS_ENABLE:true}
    baseline-on-migrate: true
    locations: classpath:db/migration
    table: flyway_schema_history

logging:
  level:
    root: ${LOG_LEVEL:INFO}
    org.hibernate.SQL: DEBUG
    org.hibernate.type.descriptor.sql.BasicBinder: TRACE
    band.effective.office.backend: ${LOG_LEVEL:DEBUG}

# Application Configuration
application:
  url: ${APPLICATION_URL:http://localhost:8080}

# Calendar provider configuration
calendar:
  provider: google # Options: google, dummy
  default-calendar: ${DEFAULT_CALENDAR} # Default calendar ID
  application-name: ${CALENDAR_APPLICATION_NAME} # Application name for Google Calendar API
  delegated-user: ${CALENDAR_DELEGATED_USER} # Email of the user to impersonate (optional)
  credentials.file: ${GOOGLE_CREDENTIALS_FILE:classpath:google-credentials.json}
  # Calendar subscription configuration
  subscription:
    default-app-email: ${DEFAULT_APP_EMAIL}
    google-credentials: ${GOOGLE_CREDENTIALS_FILE:classpath:google-credentials.json}
    application-url: ${APPLICATION_URL}
    test-application-url: ${TEST_APPLICATION_URL}
    calendars: ${CALENDARS}
    test-calendars: ${TEST_CALENDARS}
    firebase-credentials: ${FIREBASE_CREDENTIALS:classpath:firebase-credentials.json}
# Note: For local development, you need to set the JSON_GOOGLE_CREDENTIALS environment variable
# with the contents of your Google service account credentials JSON file
