log:
  level: 0

environment: "staging"

secret:
  rootConfigSecretName: ""
  awsASM:
    region: "us-west-2"

database:
  host: ""
  port: 4000
  user: ""
  password: ""
  database: "jsm_syncer"

apiServer:
  address: ":8080"

eventbus:
  account:
    enabled: true
    topic: "AccountDataChangeEvent"
    consumerGroup: "jsm-syncer"
  billing:
    enabled: true
    supportPlanTopic: "binded-support-plan-update"
    tenantPlanTopic: "tenant_plan"
    consumerGroup: "jsm-syncer"

sqs:
  msp:
    enabled: true
    queueURL: ""
  lake:
    enabled: true
    queueURL: ""

atlassian:
  baseURL: "https://tidb.atlassian.net"
  username: ""
  apiToken: ""
  rateLimit:
    # Each endpoint can have an independent policy. Limits are per service
    # instance, so divide the desired total QPS across replicas.
    # Cooldown is the minimum wait after a 429. A longer Atlassian Retry-After
    # value always takes precedence.
    global:
      cooldown: "1m"
    userSearch:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
    findOrganization:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
    createOrganization:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
    addOrganizationToServiceDeskProject:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
    listOrganizationUsers:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
    addUsersToOrganization:
      requestsPerSecond: 10
      burst: 1
      maxRetries: 4
      cooldown: "1m"
  projects:
    accountBilling:
      key: "TCAB"
      roleID: ""
    technical:
      key: "TCID"
      roleID: ""
    lake:
      key: "TCLID"
      roleID: ""

account:
  grpcAddress: ""
  timeout: "10s"
  pageSize: 500

billing:
  baseURL: ""
  timeout: "10s"

devops:
  baseURL: ""
  apiToken: ""
  timeout: "10s"
  pageSize: 100

lake:
  mock:
    enabled: false
    lakes: []
    memberships: []

mgmt:
  grpcAddress: ""
  timeout: "30s"

reconciliation:
  # Standard 5-field cron specs: minute hour day-of-month month day-of-week.
  # Atlassian account-ID resolution for users whose atlassian_account_id is still empty.
  accountIDResolution:
    enabled: true
    # Frequently retry recently-created users, plus run a daily full fallback.
    recentSpec: "*/10 * * * *"
    fullSpec: "0 2 * * *"
    # Worker concurrency only controls in-flight resolution work. Atlassian
    # request throughput is controlled by atlassian.rateLimit.userSearch.
    concurrency: 3
  # Org catalog sync: Account org list + JSM org/project ensure + local membership snapshot + bulk Atlassian access sync.
  orgFullSync:
    enabled: true
    spec: "0 22 * * 0"
    pageSize: 500
    jsmOrganizationWorkers: 5
    orgMembershipWorkers: 10
    atlassianMembershipWorkers: 5
  # Daily JSM membership drift repair for active/pending Developer, Enterprise, and Premium orgs.
  # Compares the existing TiDB Cloud membership snapshot directly with the live JSM organization.
  # Users without a stored Atlassian account ID are skipped; this job does not resolve account IDs.
  orgMembershipSync:
    enabled: true
    spec: "0 4 * * *"
    pageSize: 500
    atlassianMembershipWorkers: 5
  # High-frequency small-batch metadata backfill for org rows missing plan/biz_region/support_plan/MSP relation.
  orgMetadataBackfill:
    enabled: true
    spec: "*/5 * * * *"
    pageSize: 100
    batchLimit: 100
  # Low-frequency full metadata refresh from DevOps/Billing/Account MSP relation.
  orgMetadataRefresh:
    enabled: true
    spec: "0 3 * * *"
    pageSize: 500
  # Lake snapshot reconciliation. Keep disabled or mocked until the Lake API contract is ready.
  lakeSnapshot:
    enabled: false
    spec: "*/10 * * * *"
    pageSize: 500
  # Technical Jira role reconciliation. CRUD APIs also enqueue this same job.
  technicalProjectRole:
    enabled: true
    spec: "*/30 * * * *"
