spring:
  boot:
    admin:
      client:
        instance:
          service-base-url: ${pcp.services.tgu}
          service-path: /swagger/ui
          management-base-url: ${pcp.services.tgu}
  flyway:
    enabled: true
    baseline-on-migrate: true
    locations: classpath:db/migration

camunda:
  client:
    mode: self-managed
    grpc-address: http://camunda.k8s.265.nstart.local:30901
    auth:
      method: none
    prefer-rest-over-grpc: false

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus

springdoc:
  swagger-ui:
    path: /swagger/ui

planning:
  notification-before-start-minutes: 263
  target-plan-duration-minutes: 1440
  target-plan-duration-delta-minutes: 240
  external-update-enabled: true
  external-points-lookahead-days: 10
  in-memory-history-days: 14
  external-update-fixed-delay-ms: 600000
  notification-check-fixed-delay-ms: 30000
  min-reissue-lead-minutes: 5
  reissue-prep-minutes: 30
  worker-lock-ttl-seconds: 300
  waiting-decision-grace-minutes: 30

topics:
  visibility-windows-changed: pcp.tgu.visibility-windows-changed.v1
  satellite-plan-decision: pcp.tgu.satellite-plan-decision.v1
  layin-failed: pcp.tgu.layin-failed.v1
  plan-not-accepted: pcp.tgu.plan-not-accepted.v1
  station-params-changed: pcp.tgu.station-params-changed.v1

tgu:
  test-controller:
    enabled: true

classifier:
  platforms-url: https://ordinis.nstart.cloud/api/v1/spacecraft/records
  platforms-cache-ttl: 15m
  allowed-platform-statuses:
    - OPERATIONAL

---
spring:
  config:
    activate:
      on-profile: local
  datasource:
    driver-class-name: org.postgresql.Driver
    url: ${DB_URL:jdbc:postgresql://${pcp.infra.postgres.host}:${pcp.infra.postgres.port}/pcp_tgu}
    username: ${DB_USERNAME:postgres}
    password: ${DB_PASSWORD:password}
  jpa:
    hibernate:
      ddl-auto: validate
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        jdbc:
          lob:
            non_contextual_creation: true
  kafka:
    bootstrap-servers: ${pcp.infra.kafka.host}:${pcp.infra.kafka.port}
    consumer:
      group-id: pcp-tgu-service
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
      properties:
        spring.json.trusted.packages: "*"
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.springframework.kafka.support.serializer.JsonSerializer

external-api:
  base-url: ${pcp.services.ballistics}
server:
  port: ${pcp.ports.tgu:7011}

camunda:
  client:
    grpc-address: ${CAMUNDA_GRPC_ADDRESS:http://localhost:26500}

---
spring:
  config:
    activate:
      on-profile: dev
  datasource:
    driver-class-name: org.postgresql.Driver
    url: ${DB_URL:jdbc:postgresql://${pcp.infra.postgres.host}:${pcp.infra.postgres.port}/pcp_tgu}
    username: ${DB_USERNAME:postgres}
    password: ${DB_PASSWORD:password}
  jpa:
    hibernate:
      ddl-auto: validate
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        jdbc:
          lob:
            non_contextual_creation: true
  kafka:
    bootstrap-servers: ${pcp.infra.kafka.host}:${pcp.infra.kafka.port}
    consumer:
      group-id: pcp-tgu-service
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
      properties:
        spring.json.trusted.packages: "*"
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
    admin:
      auto-create: true

external-api:
  base-url: ${pcp.services.ballistics}
server:
  port: ${pcp.ports.tgu:8080}
