server:
  port: ${AFTER_SALE_SERVICE_PORT:8087}
spring:
  application:
    name: aftersale-service
  datasource:
    url: jdbc:mysql://${DB_HOST:111.229.80.149}:${DB_PORT:3306}/${DB_NAME:erp_db}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: ${DB_USER:root}
    password: ${DB_PASSWORD:nihao588+}
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      minimum-idle: 5
      maximum-pool-size: 20
      idle-timeout: 30000
      max-lifetime: 1800000
      connection-timeout: 30000
  redis:
    host: ${REDIS_HOST:111.229.80.149}
    port: ${REDIS_PORT:6379}
    password: ${REDIS_PASSWORD:Y(@r5tGk9$Lp2}
    database: 0
    timeout: 5000
    lettuce:
      pool:
        max-active: 20
        max-idle: 10
        min-idle: 5
  cloud:
    nacos:
      discovery:
        server-addr: ${NACOS_HOST:111.229.80.149}:${NACOS_PORT:8848}
        namespace: ${NACOS_NAMESPACE:public}
  zipkin:
    base-url: ${ZIPKIN_SERVER_URL:http://localhost:9411}
    sender:
      type: web
  sleuth:
    sampler:
      probability: 1.0
      rate: 100
    trace-id128: true
mybatis-plus:
  mapper-locations: classpath*:mapper/**/*.xml
  type-aliases-package: com.erp.aftersale.entity
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deleted
      logic-delete-value: 1
      logic-not-delete-value: 0
order:
  service:
    url: ${ORDER_SERVICE_URL:http://order-service}
inventory:
  service:
    url: ${INVENTORY_SERVICE_URL:http://inventory-service}
finance:
  service:
    url: ${FINANCE_SERVICE_URL:http://finance-service}
aftersale:
  short-id-prefix: AS
  auto-approve-refund-threshold: 10000
  allowed-order-statuses:
  - shipped
  - completed
logging:
  level:
    com.erp.aftersale: DEBUG
    com.erp.aftersale.client: INFO
  pattern:
    console: '%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n'
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,caches,beans,env,loggers,threaddump,heapdump,scheduledtasks
        base-path: /actuator
  endpoint:
    health:
      show-details: always
      probes:
        enabled: true
    prometheus:
      enabled: true
    info:
      enabled: true
  metrics:
    tags:
      application: aftersale-service
    export:
      prometheus:
        enabled: true
  health:
    livenessstate:
      enabled: true
    readinessstate:
      enabled: true
springdoc:
  api-docs:
    enabled: true
    path: /v3/api-docs
  swagger-ui:
    enabled: true
    path: /swagger-ui.html
    tags-sorter: alpha
    operations-sorter: alpha
    display-request-duration: true
knife4j:
  enable: true
  setting:
    language: zh_cn
  openapi:
    info:
      title: aftersale-service API
      description: API Documentation
      version: 1.0.0
      contact:
        name: ERP Team
        email: dev@erpzbbh.cn

# 公共OpenAPI配置（来自 common-config）
erp:
  openapi:
    title: aftersale-service API
    description: aftersale-service 服务API文档
    version: 1.0.0
    service-url: ${aftersale-service_SERVICE_URL:https://api.erpzbbh.cn}
