package config

import (
	"time"

	"github.com/pingcap/dbaas/billing2/constant"
)

const (
	// Deployment Project
	Project = "project"
	ENV     = "env"

	// Default Unit Category
	DefaultUnitCategory       = "default-unit-category"
	DefaultLabelValueCategory = "default-label-value-category"

	// BillingServerPort is the billing server port
	BillingServerPort = "billing-server-port"
	// MySQLHost is the mysql host key
	MySQLHost = "mysql-host"
	// MYSQLPort is the mysql port key
	MYSQLPort = "mysql-port"
	// MySQLUser is the mysql user key
	MySQLUser = "mysql-user"
	// MySQLPassword is the mysql password key
	MySQLPassword = "mysql-password"
	//billing database
	Database = "database"

	MaxDatabaseConnections               = "max-database-connections"
	MaxDatabaseIDELConnections           = "max-database-idle-connections"
	MaxDatabaseConnectionLifeTimeSeconds = "max-database-idle-duration-seconds"
	MySQLConnectTimeoutSeconds           = "mysql-connect-timeout-seconds"
	MySQLReadTimeoutSeconds              = "mysql-read-timeout-seconds"
	MySQLWriteTimeoutSeconds             = "mysql-write-timeout-seconds"
	// MySQLPasswordFile is the file contains the mysql password
	MySQLPasswordFile = "mysql-password-file"
	// MySQLPasswordUseFile identify if we get mysql password in file
	MySQLPasswordUseFile = "mysql-password-use-file"

	ReadOnlyMySQLHost     = "readonly-mysql-host"
	ReadOnlyMYSQLPort     = "readonly-mysql-port"
	ReadOnlyMySQLUser     = "readonly-mysql-user"
	ReadOnlyMySQLPassword = "readonly-mysql-password"
	ReadOnlyMySQLDatabase = "readonly-mysql-database"

	// Validate units exists in package create and update
	PackageUnitsValidate = "package-units-validate"

	DBaaSCentralEnable = "dbaas-central-enable"
	// DBaaSCentralHost is the rpc call addr: host with port
	DBaaSCentralHost = "dbaas-central-host"
	// DBaaSCentralScheme  is the rpc scheme
	DBaaSCentralScheme = "dbaas-central-scheme"
	// DBaaSCentralAuth0Domain  is the auth0 domain
	DBaaSCentralAuth0Domain = "dbaas-central-auth0-domain"
	// DBaaSCentralClientID  is the auth0 client id
	DBaaSCentralAuth0ClientID = "dbaas-central-auth0-client-id"
	// DBaaSCentralClientSecret is the auth0 client secret
	DBaaSCentralAuth0ClientSecret = "dbaas-central-auth0-client-secret" //nolint:gosec
	// DBaaSCentralAudience  is the auth0 client audience
	DBaaSCentralAuth0Audience = "dbaas-central-auth0-client-audience"

	MaxDefaultPerWorkerConcurrentJobs = "max-default-per-worker-concurrent-jobs"

	// InvoiceWorkerCheckInterval specify the invoice work interval, default is 5m
	InvoiceWorkerCheckInterval = "invoice-worker-check-interval"
	// InvoiceDay is the day of month to send invoice
	Invoicehours = "invoice-hours"

	InvoicesQueryMaxSpanDays = "invoices-query-max-span-days"

	PartnerTenantInvoicehours   = "partner-invoice-hours"
	PartnerSupportPlanHours     = "partner-support-plan-hours"
	BillingConfigActiveMinutes  = "billing-config-active-minutes"
	BillingConfigDelayDays      = "billing-config-delay-days"
	BillingConfigWorkerInterval = "billing-config-worker-interval"

	// EnableInvoiceWorker identify if invoice worker is enabled
	EnableInvoiceWorker = "enable-invoice-worker"

	// StripeInvoicePayingWorkerInterval drives StripeInvoicePayingWorker; defaults to 1m.
	StripeInvoicePayingWorkerInterval = "stripe-invoice-paying-worker-interval"
	// StripeInvoicePayingJanitorInterval drives StripeInvoicePayingJanitorWorker;
	// defaults to 1m. The janitor force-fails payings that have been in
	// status='running' with no heartbeat for janitorStaleThreshold (10m).
	StripeInvoicePayingJanitorInterval = "stripe-invoice-paying-janitor-interval"
	// StripePushMinAmountUSD is the threshold below which invoices are accumulated
	// instead of pushed to Stripe individually. Defaults to 1.00 USD.
	StripePushMinAmountUSD = "stripe-push-min-amount-usd"
	// StripePushMaxCarryoverMonths caps how long an accumulated carryover pool
	// stays active before being marked as expired. Defaults to 12.
	StripePushMaxCarryoverMonths = "stripe-push-max-carryover-months"
	// StripePushKeepDraftOnChargeModeManual keeps manual-charge-mode
	// Stripe invoices in draft state (no FinalizeInvoice) so ops can
	// manually review and adjust line items before finalizing. When
	// false the invoice is finalized like a single-invoice push.
	// Defaults to true.
	StripePushKeepDraftOnChargeModeManual = "stripe-push-keep-draft-on-charge-mode-manual"
	// StripePayingPushPerInvoice selects the paying worker's push strategy.
	// true (default): walk the combined (carried + current-month) set oldest
	// first — carried invoices wait in a push batch, sub-threshold invoices
	// are flipped to below_threshold_carry, and the first invoice that crosses
	// the threshold triggers a merged Stripe push; the rest go per-invoice via
	// Pay. false: one merged Stripe invoice for the whole combined set.
	StripePayingPushPerInvoice = "stripe-paying-push-per-invoice"
	// EnableAuth identify if auth is enabled
	EnableAuth = "enable-auth"

	// stripe-payment-enable
	StripePaymentEnable = "stripe-payment-enable"
	// StripeSecretKey is the stripe secret key
	StripeSecretKey = "stripe-secret-key"
	// StripePublicKey is the stripe pubic key
	StripePublicKey = "stripe-public-key"

	StripeSubAccountSecretKeys = "stripe-sub-account-secret-keys"

	TaxReverseChargeDescription = "tax-reverse-charge-description"

	TaxNotCollectingDescription = "tax-not-collecting-description"
	TaxNotCollectingTaxRateID   = "tax-not-collecting-tax-id"

	EnableSyncPayableWorker           = "enable-sync-payable-worker"
	SyncPayableWorkerInterval         = "sync-payable-worker-interval"
	SyncDefaultAndBillingInfoInterval = "sync-default-and-billing-info-interval"
	CalculateCacheInterval            = "calculate-cache-interval"
	RemoveUnusedCostsInterval         = "remove-unused-costs-interval"
	MergeSmallCostsInterval           = "merge-small-costs-interval"
	SupportPlanMeteringInterval       = "support-plan-metering-interval"
	CreditsWorkerInterval             = "credits-worker-interval"

	RemoveUnusedCostsDays          = "remove-unused-costs-days"
	RemoveUnusedCostsOffsetSeconds = "remove-unused-costs-offset-seconds"
	MergeSmallCostsDays            = "merge-small-costs-days"
	MergeSmallCostsOffsetSeconds   = "merge-small-costs-offset-seconds"

	EnableRemoveUnusedCosts         = "enable-remove-unused-costs"
	RemoveUnusedCostsMonthBefore    = "remove-unused-costs-month-before"
	RemoveUnusedCostsLimit          = "remove-unused-costs-limit"
	RemoveUnusedCostsTimeoutSeconds = "remove-unused-costs-timeout-seconds"
	RemoveMergedCostsInterval       = "remove-merged-costs-interval"
	RemoveUnusedCostsBatchSleepMs   = "remove-unused-costs-batch-sleep-ms"
	RemoveUnusedCostsOrgSleepMs     = "remove-unused-costs-org-sleep-ms"

	// aws-payment-enable
	AWSPaymentEnable = "aws-payment-enable"
	// Aws MarketPlace Region
	AwsMarketplaceRegion = "aws-marketplace-region"
	// Aws MarketPlace ProductCode
	AWSProductCode                 = "aws-marketplace-productcode"
	AWSRole                        = "aws-role"
	EnableAWSProduct1DollarUnit    = "enable-aws-product-1dollar-unit"
	AWSProduct1DollarUnitBlacklist = "aws-product-1dollar-unit-blacklist"
	AWSProductUnit                 = "aws-product-unit"
	AWSProduct1DollarUnit          = "aws-product-1dollar-unit"
	// aws price region
	AWSPriceRegion = "aws-price-region"

	AWSCPPODiscountedProductUnitFilterIDs = "aws-cppo-discounted-product-unit-filter-ids"

	AWSCPPODiscountedProductCode = "aws-cppo-discounted-product-code"
	AWSCPPODiscountedProductUnit = "aws-cppo-discounted-product-unit"

	AWSCPPONonDiscountedProductCode = "aws-cppo-non-discounted-product-code"
	AWSCPPONonDiscountedProductUnit = "aws-cppo-non-discounted-product-unit"

	// 1000 means 0.001
	AWSProductUnitPriceFactor                  = "aws-product-unit-price-factor"
	AWSProduct1DollarUnitPriceFactor           = "aws-product-1dollar-unit-price-factor"
	AWSCPPODiscountedProductUnitPriceFactor    = "aws-cppo-discounted-product-unit-price-factor"
	AWSCPPONonDiscountedProductUnitPriceFactor = "aws-cppo-non-discounted-product-unit-price-factor"

	// Azure MarketPlace
	AZUREMarketplaceClientID     = "azure-marketplace-client-id"
	AZUREMarketplaceClientSecret = "azure-marketplace-client-secret"
	AZUREMarketplaceTenantID     = "azure-marketplace-tenant-id"
	AzureOfferList               = "azure-offer-list"
	MarketplacePaymentInterval   = "marketplace-payment-worker-interval"

	// Azure-payment-enable
	AZUREPaymentEnable          = "azure-payment-enable"
	AZUREProductDimension       = "azure-product-dimension"
	AZUREProductUnitPriceFactor = "azure-product-unit-price-factor"

	CostSummaryGroupLabelList = "cost-summary-group-label-list"

	GlobalPricePackage = "global-price-package"
	POCPackage         = "poc-package"
	OnDemandPackage    = "on-demand-package"
	DevTierPackage     = "dev-tier-package"

	GeneralCreditTypeID     = "general-credit-type-id"
	SupportPlanCreditTypeID = "support-plan-credit-type-id"
	CreditsPricePackage     = "credits-price-package"

	// Gcp MarketPlace
	GCPPaymentEnable            = "gcp-payment-enable"
	GCPProcurementBaseUrl       = "gcp-procurement-base-url"
	GCPProductCode              = "gcp-marketplace-productcode"
	GCPProductUnit              = "gcp-product-unit"
	GCPProductSKUID             = "gcp-product-sku-id"
	GCPMarketPlaceProject       = "gcp-marketplace-project"
	GCPProudctUnitPriceFactor   = "gcp-product-unit-price-factor"
	GCPMarketPlaceSA            = "gcp-marketplace-sa"
	GCPReconciliationOffsetHour = "gcp-reconciliation-offset-hour"
	GCPPriceAPIKey              = "gcp-price-api-key"
	// azure sku price query
	GCPSkuPriceQueryEnable = "gcp-sku-price-query-enable"
	GCPSkuPriceQueryUrl    = "gcp-sku-price-query-url"

	// Aliyun marketPlace
	AliyunPaymentEnable              = "aliyun-payment-enable"
	AliyunMarketPlaceAccessKeyId     = "aliyun-marketplace-access-key-id"
	AliyunMarketPlaceAccessKeySecret = "aliyun-marketplace-access-key-secret"
	AliyunMarketPlaceRegionId        = "aliyun-marketplace-region-id"
	AliyunMarketPlaceEndpoint        = "aliyun-marketplace-endpoint"
	AliyunProductUnitPriceFactor     = "aliyun-product-unit-price-factor"
	AliyunMarketPlaceBillableItem    = "aliyun-marketplace-billable-item"
	AliyunMarketPlaceMeteringAssist  = "aliyun-marketplace-metering-assist"

	// Aliyun marketPlace product sgcmgj00036777
	AliyunMarketPlaceSgcmgj00036777AccessKeyId     = "aliyun-marketplace-sgcmgj00036777-access-key-id"
	AliyunMarketPlaceSgcmgj00036777AccessKeySecret = "aliyun-marketplace-sgcmgj00036777-access-key-secret"

	BillingCostsPrecisionDigits    = "billing-costs-precision-digits"
	BillingCostsCSVPrecisionDigits = "billing-costs-csv-precision-digits"
	BillingCostsMaxPrecisionDigits = "billing-costs-max-precision-digits"

	KeeyShowingCategory = "keey-showing-category"
	RedisHost           = "redis-host"
	RedisDB             = "redis-db"

	EnableCache           = "enable-cache"
	CacheFailedRetryTimes = "cache-retry-times"

	CDNFileContentType   = "cdn-file-content-type"
	S3FileTCPNSwagger    = "s3-file-tcpn-swagger"
	S3FileTCPNUserManual = "s3-file-tcpn-user-manual"

	DefaultBillingCompanyKey = "default-billing-company-key"

	EnableRemoteConfig = "enable-remote-config"

	DefaultCostQuota             = "default-cost-quota"
	DefaultCreditRiskLevel       = "default-risk-level"
	EnableCreateCostQuotaInvoice = "enable-create-cost-quota-invoice"

	EnableMailNotify    = "enable-mail-notify"
	InvoiceNotifyEmail  = "invoice-notify-email"
	ContractNotifyEmail = "contract-notify-email"
	DefaultMailFrom     = "default-mail-from"
	MailEnvSuffix       = "mail-env-suffix"
	MailApiKey          = "mail-api-key"

	EnableSentryLog = "enable-sentry-log"
	SentryServerDSN = "sentry-server-dsn"
	SentryServerEnv = "sentry-server-env"
	SentryLogLevel  = "sentry-log-level"

	EnableMarketplaceMonthlyInvoiceSend    = "enable-marketplace-montly-invoice-send"
	MaxHourlyInvoiceReseekDays             = "max-hourly-invoice-reseek-days"
	HourlyInvoiceTenantBillingConfigIDList = "hourly-invoice-tenant-billing-config-id-list"
	DailyInvoiceTenantBillingConfigIDList  = "daily-invoice-tenant-billing-config-id-list"
	HourlyInvoiceIssueDelayHours           = "hourly-invoice-issue-delay-days"
	DailyInvoiceIssueDelayDays             = "daily-invoice-issue-delay-days"
	AliCloudDailyInvoiceIssueDelayDays     = "alicloud-daily-invoice-issue-delay-days"
	AliyunHourBoundarySafeMargin           = "aliyun-hour-boundary-safe-margin"
	BigCustomerDailyInvoiceHours           = "big-customer-daily-invoice-hours"

	RefundWorkerInterval      = "refund-worker-interval"
	RefundMaxRetryCount       = "refund-max-retry-count"
	RefundCheckWorkerInterval = "refund-check-worker-interval"

	IsCreditCardValidateAllowed      = "is-credit-card-validate-allowed"
	CreditCardValidateAllowedTenants = "credit-card-validate-allowed-tenants"
	TenantCreditRiskCloseInterval    = "tenant-credit-risk-close-interval"
	EnableInfraHandler               = "enable-infra-handler"

	CoreProxySvcAddress = "core-proxy-svc-address"
	DataflowSvcAddress  = "dataflow-svc-address"
	AccountSvcAddress   = "account-svc-address"
	TiDBMgmtSvcAddress  = "tidb-mgmt-svc-address"

	MaxRunningTenantCreditRiskClose = "max-running-tenant-credit-risk-close"

	DevTierDurationDays = "dev-tier-duration-days"

	EnableSalesforce = "enable-salesforce"

	POCCleanupRefreshDays                     = "poc-cleanup-refresh-days"
	POCClusterRemainDays                      = "poc-cluster-remain-days"
	POCManualBackupsRemainDays                = "poc-manual-backups-remain-days"
	POCSendEmailBeforeDeleteManualBackupsDays = "poc-send-email-before-delete-manual-backups-days"
	POCRemainDaysCredits                      = "poc-remain-days-credits"
	EnablePOCEndedCleanup                     = "eanble-poc-ended-cleanup"
	PocAfterNoPayable                         = "poc-after-no-payable"

	PlanWorkerInterval = "plan-worker-interval"

	SalesforceDomain       = "salesforce-domain"
	SalesforceClientID     = "salesforce-client-id"
	SalesforceClientSecret = "slaesforce-client-secret"
	SalesforceUsername     = "salesforce-username"
	SalesforcePassword     = "salesforce-password"

	FromPersonalEnv = "from-personal-env"

	EnableRBAC           = "enable-rbac"
	EnableRBACMiddleware = "enable-rbac-middleware"
	EnableAPIStackTrace  = "enable-api-stack-trace"

	// measure delay monitor and supportPlan worker delay time
	MeasureDelayHours             = "measure-delay-hours"
	IsRefuseDelayMeasure          = "is-refuse-delay-measure"
	MeasureDelayCategoryWhiteList = "measure-delay-category-whitelist"
	DefaultInterval               = "default-interval"
	CheckSpendLimitInterval       = "check-spend-limit-interval"

	RechargeCreditsBeforeSeconds = "recharge-credits-before-seconds"
	RechargeCreditWorkerInterval = "recharge-credits-worker-interval"
	MaxTenantPlanUnitFilters     = "max-tenant-plan-unit-filters"

	DefaultDiscountUnitFilters = "default-discount-unit-filters"
	LatestExpiration           = "last-expiration"

	InactiveDiscountWorkerInterval      = "inactive-discount-worker-interval"
	InactiveBindedPackageWorkerInterval = "inactive-binded-package-worker-interval"

	PreventRemainingCreditsToBeNegative = "prevent-remaining-credits-to-be-negative"

	MeasuresMaxTransactionRecords    = "measures-max-transaction-records"
	MeasuresWarningTransactionCounts = "measures-warning-transaction-counts"

	MaxReMeasuresTimes = "max-re-measures-times"

	BindedPackageInactiveDelayHour = "binded-package-inactive-delay-hour"
	DiscountInactiveDelayHour      = "discount-inactive-delay-hour"

	// Referral system
	ReferralRewardConfig         = "referral-reward-config"
	ReferralCreditsUnitFilterIDs = "referral-credits-unit-filter-ids"
	ReferralShareLinkBase        = "referral-share-link-base"

	// Referral reward amounts (per event type)
	ReferralAmountSignup               = "referral-amount-signup"
	ReferralAmountRefereeSignup        = "referral-amount-referee-signup"
	ReferralAmountBindCard             = "referral-amount-bindcard"
	ReferralAmountRefereeBindCard      = "referral-amount-referee-bindcard"
	ReferralAmountFirstUse             = "referral-amount-first-use"
	ReferralAmountContinuousUse        = "referral-amount-continuous-use"
	ReferralAmountRefereeContinuousUse = "referral-amount-referee-continuous-use"

	// Community reward
	CommunityRewardRate = "community-reward-rate" // percentage of payment amount (e.g. 0.03 = 3%)

	// Promotion checker
	PromotionClinicAPIBase             = "promotion-clinic-api-base"
	PromotionClinicAPIKey              = "promotion-clinic-api-key"
	PromotionCheckInterval             = "promotion-check-interval"
	PromotionFirstUseThreshold         = "promotion-first-use-threshold"  // min requests in 1 hour
	PromotionContinuousUseDays         = "promotion-continuous-use-days"  // consecutive days
	PromotionContinuousUseDaily        = "promotion-continuous-use-daily" // min requests per day
	BindedSupportPlanInactiveDelayHour = "binded-support-plan-inactive-delay-hour"
	MaxPackageIDEnableCache            = "max-package-id-enable-cache"

	//aws SQS ，value from Pulumi
	EnableQueueMeasure  = "enable-queue-measure"
	MeasureQueueUrl     = "measure-queue-url"
	MeasureDlQueueUrl   = "measure-dl-queue-url"
	MeasureQueueRegin   = "measure-queue-regin"
	MeasureQueueName    = "measure-queue-name"
	MeasureDlQueueName  = "measure-dl-queue-name"
	HTTPMeasuresToQueue = "http-measures-to-queue"

	MeasureDisableSuccessResponse = "measures-disable-success-response"

	// novuhandler
	NovuAPIHost              = "novuhandler-api-host"
	NovuAPIKey               = "novuhandler-api-key"
	EnableBroadcast          = "enable-broadcast"
	EnableBroadcastOperators = "enable-broadcast-operators"

	//from oneconfig
	SqsReceiveSleepSeconds   = "sqs-receive-sleep-seconds"
	SqsDlReceiveSleepSeconds = "sqs-dl-receive-sleep-seconds"

	DataapiUsageUnitsMap                       = "dataapi-usage-units-map"
	CheckSupportPlanAccuracyType               = "check-supportplan-accuracy-type"
	CheckSupportPlanAccuracyWorkerInterval     = "check-supportplan-accuracy-worker-interval"
	SupportPlanFreeTrialReminderWorkerInterval = "support-plan-free-trial-reminder-worker-interval"

	SyncMarketBillsWorkerInterval = "sync-market-bills-worker-interval"
	WorkerServerlessShowKindName  = "worker-serverless-show-kind-name"

	DefaultWorkerConcurrency           = "default-worker-concurrency"
	SyncPayableWorkerConcurrency       = "sync-payable-worker-concurrency"
	MergeSmallCostsWorkerConcurrency   = "merge-small-costs-worker-concurrency"
	RemoveUnusedCostsWorkerConcurrency = "remove-unused-costs-worker-concurrency"
	CheckSpendLimitWorkerConcurrency   = "check-spend-limit-worker-concurrency"
	InvoiceWorkerConcurrency           = "invoice-worker-concurrency"
	OpenCreditsPackageConcurrency      = "open_credits_package_concurrency"

	SpendLimitNotCheckWhitelist = "spend-limit-not-check-white-list"

	EnableEventbus = "enable-eventbus"

	//AP -switch
	APISwitchUpdateUnit = "api-switch-update-unit"

	AWSMarketplaceDailyReportAPIRegion        = "aws-marketplace-daily-report-api-region"
	AWSMarketplaceDailyReportDataSetTypeList  = "aws-marketplace-daily-report-data-set-type-list"
	AWSMarketplaceDailyReportGenerateInterval = "aws-marketplace-daily-report-generate-interval"
	ReconciliationDailyWorkerInterval         = "reconciliation-daily-worker-interval"
	ReconciliationMonthlyWorkerInterval       = "reconciliation-monthly-worker-interval"
	ARTableEstimatedWorkerInterval            = "ar-table-estimated-worker-interval"
	ARTableActualWorkerInterval               = "ar-table-actual-worker-interval"

	AWSMarketplaceDailyReportGenerateRunningOffsetHours = "aws-marketplace-report-generate-running-offset-hours"
	AWSMarketplaceDailyReportGenerateDelayDays          = "aws-marketplace-report-generate-delay-days"

	DailyReconciliationDelayDays        = "daily-reconciliation-delay-days"
	MonthlyReconciliationDelayDays      = "monthly-reconciliation-delay-days"
	ReconciliationReportAWSS3BucketName = "reconciliation-report-aws-s3-bucket-name"
	ReconciliationAWSS3BucketName       = "reconciliation-aws-s3-bucket-name"
	ReconciliationAWSRoleNameArn        = "reconciliation-aws-role-name-arn"
	ReconciliationAWSSNSTopicArn        = "reconciliation-aws-sns-topic-arn"
	ReconciliationAWSS3Region           = "reconciliation-aws-s3-region"
	ReconciliationGCSBucketName         = "reconciliation-gcs-bucket-name"

	EnablePutARTableToS3        = "enable-put-ar-table-to-s3"
	ARTableAWSBucketName        = "ar-table-aws-bucket-name"
	ARTableExportTimeoutMinutes = "ar-table-export-timeout-minutes"
	ARTablePresignExpireMinutes = "ar-table-presign-expire-minutes"
	// ARTableSkipTenantIDs lists tenants (or tenantID-billingConfigID) to skip
	// on AR table generation (both estimated and actual), so a single slow big
	// customer cannot stall the whole export.
	ARTableSkipTenantIDs = "ar-table-skip-tenant-ids"

	ViewBillsByConfig                                 = "view-bills-by-config"
	BillsInvisibleList                                = "bills-invisible-list"
	MonthlyBillsInvisibleList                         = "monthly-bills-invisible-list"
	MonthlyBillsCacheList                             = "monthly-bills-cache-list"
	MaxCostExplorerQueryConcurrency                   = "max-cost-explorer-query-concurrency"
	MaxCostExplorerInternalQueryConcurrency           = "max-cost-explorer-internal-query-concurrency"
	MaxCostExplorerTrendsQueryDaysSpan                = "max-cost-explorer-trends-query-days-span"
	MaxCostExplorerTrendsLongTimeSpanQueryConcurrency = "max-cost-explorer-trends-long-time-span-query-concurrency"
	CostExplorerTrendsLongTimeSpanQueryThresholdDays  = "cost-explorer-trends-long-time-span-query-threshold-days"

	CostExplorerTrendsQueryRequestTimesLimitPerTenant                = "cost-explorer-trends-query-request-times-limit-per-tenant"
	CostExplorerTrendsQueryRequestTimesLimitPerTenantTimeSpanSeconds = "cost-explorer-trends-query-request-times-limit-per-tenant-time-span-seconds"

	JSMEnableSender = "jsm-enable-sender"
	JSMSQSRegion    = "jsm-sqs-region"
	JSMSQSQueue     = "jsm-sqs-queue"

	SupportPlanUpdateSyncToEventBusEnable = "support-plan-update-sync-to-eventbus-enable"
	InAPPNotificationEnable               = "in-app-notification-enable"
	SyncOnDemandOrgToJSMEnable            = "sync-on-demand-org-to-jsm-enable"

	EnableTaxCalculation            = "enable-tax-calculation"
	TiDBCloudStripeProductTaxCode   = "tidb-cloud-stripe-product-tax-code"
	TiDBCloudStripeProductReference = "tidb-cloud-stripe-product-reference"

	CommitmentInvoiceItem = "commitment-invoice-item"
	NonPOCCreditsValidate = "non-poc-credits-validate"

	EnableOnlineMerging = "enable-online-merging"
	// EnableOfflineMerging gates the MergeSmallCosts worker, which compacts
	// leftover DONE rows into new merged rows via raw SQL. Default false:
	// worker-compacted rows carry no MergedLabelsHistory and no raw-row
	// merged_cost_id linkage, so their MSP/CPPO transfers can never replay
	// per-contribution and fall back to stale merged-row labels. Rows that
	// skip offline merging stay non-merged and are transferred individually.
	EnableOfflineMerging           = "enable-offline-merging"
	OnlineMergingMissingRetryTimes = "online-merging-retry-times"
	MergeSkipLabelsUnitFilterIDs   = "merge-skip-labels-unit-filter-ids"
	// EnableMergedLabelsHistory turns on appending each raw-cost contribution into
	// UserUnitCost.MergedLabelsHistory when a merged row folds costs together
	// (txCost online path and mergeRawUnitCost offline path). Only units that skip
	// labels on merge (UnitSkipLabelsOnMerge) are recorded, since other units'
	// contributions share identical labels.
	// Default true; opt out per-cluster by setting false.
	EnableMergedLabelsHistory = "enable-merged-labels-history"

	BillsDisplayProjectAndClusterNameWithID      = "bills-display-project-and-cluster-name-with-id"
	AttachProjectAndClusterNameWithIDOnMeasuring = "attach-project-and-cluster-name-with-id-on-measuring"
	SnapshotRecalculateApplyLogOnly              = "snapshot-recalculate-apply-log-only"

	EnableIgnoreClusterInvalidatedMeasure = "enable-ignore-cluster-invalidated-measure"
	IgnoreNotExistedClusterOnMeasuring    = "ignore-not-existed-cluster-on-measuring"
	IgnoreDeletedClusterOnMeasuring       = "ignore-deleted-cluster-on-measuring"

	MaxMeasureQueryConcurrency           = "max-measure-concurrency"
	EnableMeasureQueryConcurrencyControl = "enable-measure-query-concurrency-control"

	NonClusterCategories        = "non-cluster-categories"
	EnableUseMgmtGetClusterInfo = "enable-use-mgmt-get-cluster-info"

	UnsupportedCardBrands = "unsupported-card-brands"

	AWSDisableHourlyInvoiceSendingAfter = "aws-disable-hourly-invoice-sending-after"
	GCPDisableHourlyInvoiceSendingAfter = "gcp-disable-hourly-invoice-sending-after"

	CoreSVCAPIKey                              = "core-svc-api-key"
	InMonthInvoiceHours                        = "in-month-invoice-hours"
	InvoicePayableDurationAfterInvoiceableHour = "invoice-payable-duration-after-invoiceable-hour"

	MaxBudgetThresholds      = "max-budget-thresholds"
	BudgetThresholdPrecision = "budget-threshold-precision"
	BudgetsUrlTmpl           = "budgets-url-tmpl"

	RestrictInternalUserToBindCreditCard       = "restrict-internal-user-to-bind-credit-card"
	RestrictedEmailDomainsForBindingCreditCard = "restricted-email-domains-for-binding-credit-card"

	AccessControlAllowOrigin = "access-control-allow-origin"

	BillingStressTest = "billing_stress_test"

	// azure sku price query
	AzureSkuPriceQueryEnable = "azure-sku-price-query-enable"
	AzureSkuPriceQueryUrl    = "azure-sku-price-query-url"

	SyncMarketOrgBillsEnable = "sync-market-bills-enable"

	EnableActionCheck                            = "enable-action-check"
	EnableActionCheckProviderMatched             = "enable-action-check-provider-matched"
	EnableThirdPartyProviderFromAccountCheck     = "enable-third-party-provider-from-account-check"
	EnableActionCheckOnClosing                   = "enable-action-check-on-closing"
	EnableActionCheckOnBillable                  = "enable-action-check-on-billable"
	EnableActionCheckOnBillingConfigIsNotExisted = "enable-action-check-on-billing-config-is-not-existed"
	ActionCheckRetOnErr                          = "action-check-ret-on-err"

	NoTrafficCheckerDBCostWithoutTrafficExcludeCatNames = "no-traffic-checker-db-cost-without-traffic-exclude-cat-names"
	NoTrafficCheckerTrafficCostCatNames                 = "no-traffic-checker-traffic-cost-cat-names"
	NoTrafficCheckerEnableCheckThreshold                = "no-traffic-checker-enable-check-threshold"
	NoTrafficCheckerRunInterval                         = "no-traffic-checker-run-interval"
	NoTrafficCheckerRunConcurrency                      = "no-traffic-checker-run-concurrency"

	MaxAttachLabelTimeSecond = "max-attach-label-time-second"

	AlicloudCustomerSupportPlanID = "alicloud-customer-support-plan-id"
	AlicloudManagingOrgID         = "alicloud-managing-org-id"

	TradingProhibitedCountryNameList = "trading-prohibited-country-name-list"

	CountryCodeMapping = "country-code-mapping"

	WaitingCustomerActionDurationSeconds = "waiting-customer-action-duration-seconds"

	PaymentRequiredEmailTemplateID = "payment-required-email-template-id"

	AlicloudInvisibleCustomers = "alicloud-invisible-customers"

	CostExplorerCacheWorkerInterval = "cost-explorer-worker-cache-interval"
	CostExplorerCacheWorkerEnable   = "cost-explorer-worker-cache-enable"

	ManusTenantsToNotifyOnClusterConsumption            = "manus-tenants-to-notify-on-cluster-consumption"
	ManusThresholdForNotifyOnClusterConsumption         = "manus-threshold-for-notify-on-cluster-consumption"
	ManusUnitFilterIDsForClusterConsumptionNotification = "manus-unit-filter-ids-for-cluster-consumption"
	ManusSQSQueueForClusterConsumptionNotification      = "manus-sqs-queue-for-cluster-consumption"
	ManusAWSRoleForClusterConsumptionNotification       = "manus-aws-role-for-cluster-consumption"
	ManusAWSExternalIDForClusterConsumptionNotification = "manus-aws-external-id-for-cluster-consumption"
	ManusAWSRegionForClusterConsumptionNotification     = "manus-aws-region-for-cluster-consumption"

	ManusSQSQueueForClusterConsumptionNotification2      = "manus-sqs-queue-for-cluster-consumption2"
	ManusAWSRoleForClusterConsumptionNotification2       = "manus-aws-role-for-cluster-consumption2"
	ManusAWSExternalIDForClusterConsumptionNotification2 = "manus-aws-external-id-for-cluster-consumption2"
	ManusAWSRegionForClusterConsumptionNotification2     = "manus-aws-region-for-cluster-consumption2"

	ManusSQSQueueForClusterSpendLimitNotification      = "manus-sqs-queue-for-cluster-spend-limit"
	ManusAWSRoleForClusterSpendLimitNotification       = "manus-aws-role-for-cluster-spend-limit"
	ManusAWSExternalIDForClusterSpendLimitNotification = "manus-aws-external-id-for-cluster-spend-limit"
	ManusAWSRegionForClusterSpendLimitNotification     = "manus-aws-region-for-cluster-spend-limit"

	ManusSQSQueueForClusterSpendLimitNotification2      = "manus-sqs-queue-for-cluster-spend-limit2"
	ManusAWSRoleForClusterSpendLimitNotification2       = "manus-aws-role-for-cluster-spend-limit2"
	ManusAWSExternalIDForClusterSpendLimitNotification2 = "manus-aws-external-id-for-cluster-spend-limit2"
	ManusAWSRegionForClusterSpendLimitNotification2     = "manus-aws-region-for-cluster-spend-limit2"

	// ---- query timeout hierarchy (innermost → outermost) ----
	//
	// MySQL-level (network I/O):
	//   MySQLReadTimeoutSeconds  — connection read deadline. Kills dead connections
	//     after this many seconds of silence. Keeps network blips from hanging.
	//   MySQLWriteTimeoutSeconds — connection write deadline.
	//
	// Per-sub-query DB timeout (Go context, one individual DB call):
	//   PerDBQueryTimeoutSeconds — single sub-query context timeout. After
	//     day-splitting each scans ≤1 day of user_unit_costs, so 30 s is ample
	//     for HTTP requests from all customers. Workers use the same default.
	//
	// Split-loop overall timeout (Go context, all sub-queries combined):
	//   SplitLoopTotalTimeoutSeconds — wall-clock cap for all customers in HTTP
	//     handlers. Default 120 s (2 min).
	//
	// Worker-only overrides (not yet wired, reserved for worker goroutines):
	//   BigCustomerSplitLoopTimeoutMinutes — split-loop overall timeout for big
	//     customers in workers. Default 30 min.
	//
	// Observability (not a timeout):
	//   DBQuerySlowLogThresholdSeconds — queries slower than this emit WARN logs.

	DisableClusterDisplayTenants       = "disable-cluster-display-tenants"
	BigCustomerSplitLoopTimeoutMinutes = "big-customer-split-loop-timeout-minutes"
	WorkerSplitLoopTimeoutSeconds      = "worker-split-loop-timeout-seconds"
	PerDBQueryTimeoutSeconds           = "per-db-query-timeout-seconds"
	// BigCustomerQueryTimeoutMinutes is the per-query DB timeout for big-customer
	// single-query scans (pre-3bfb2859 behaviour, restored when the per-day split
	// was reverted). Default 15 minutes. Only active when the tenant is in the
	// DisableClusterDisplayTenants list (shouldRemoveLabelsFromGroupBy).
	BigCustomerQueryTimeoutMinutes = "big-customer-query-timeout-minutes"
	DBQuerySlowLogThresholdSeconds = "db-query-slow-log-threshold-seconds"
	SplitLoopTotalTimeoutSeconds   = "split-loop-total-timeout-seconds"

	OnlyClusterTieredBillingOrgs = "only-cluster-tiered-billing-orgs"

	EnableS3BillsDetailExport         = "enable-s3-bills-detail-export"
	EnablePutBillsDetailToS3          = "enable-put-bills-detail-to-s3"
	S3BillsDetailBucketName           = "s3-bills-detail-bucket-name"
	S3BillsDetailRegion               = "s3-bills-detail-region"
	S3BillsDetailPresignExpireMinutes = "s3-bills-detail-presign-expire-minutes"
	S3BillsDetailWorkerInterval       = "s3-bills-detail-worker-interval"
	S3BillsDetailTenantList           = "s3-bills-detail-tenant-list"

	EnableSnapshotMeteringRawOutbox            = "enable-snapshot-metering-raw-outbox"
	SnapshotMeteringRawTenantWhitelist         = "snapshot-metering-raw-tenant-whitelist"
	SnapshotMeteringRawOutboxWorkerInterval    = "snapshot-metering-raw-outbox-worker-interval"
	SnapshotMeteringRawOutboxScanLimit         = "snapshot-metering-raw-outbox-scan-limit"
	SnapshotMeteringRawOutboxBatchSize         = "snapshot-metering-raw-outbox-batch-size"
	SnapshotMeteringRawOutboxMinFlushRows      = "snapshot-metering-raw-outbox-min-flush-rows"
	SnapshotMeteringRawOutboxMaxFlushDelaySecs = "snapshot-metering-raw-outbox-max-flush-delay-seconds"
	SnapshotMeteringRawOutboxDrainMaxSeconds   = "snapshot-metering-raw-outbox-drain-max-seconds"
	SnapshotMeteringRawOutboxUploadConcurrency = "snapshot-metering-raw-outbox-upload-concurrency"
	SnapshotMeteringRawHashBucketCount         = "snapshot-metering-raw-hash-bucket-count"
	SnapshotMeteringRawDedicatedTenantList     = "snapshot-metering-raw-dedicated-tenant-list"
	SnapshotMeteringRawS3BucketName            = "snapshot-metering-raw-s3-bucket-name"
	SnapshotMeteringRawS3Region                = "snapshot-metering-raw-s3-region"
	SnapshotMeteringRawRetentionDays           = "snapshot-metering-raw-retention-days"
	SnapshotRawUserUnitCostRerunRetentionDays  = "snapshot-raw-user-unit-cost-rerun-retention-days"

	// EnableUseDbSideBindedPackageFilter controls the measure hot path
	// binded-package lookup. When true, filter binded_packages (and any
	// M2M unit-filter join) at the database level using
	// GetEffectiveBindedPackages / GetEffectiveBindedPackagesWithUnitMatch.
	// When false, fall back to the legacy GetAllTenantBindedPackage
	// + Go-side filter, which loads all packages for the tenant but
	// relies on the existing tenant_id+status composite index.
	//
	// History: PR #1233 enabled this by default and shipped a regression
	// on 2026-06-16 (prod-billing-aurora writer load spiked). The
	// reverted code is the default. Re-enable via oneconfig
	// (set "enable-use-db-side-binded-package-filter": true) only after
	// migration 2026-06-22-binded-packages-measure-indexes has run
	// (it adds the composite indexes that the DB-side path relies on).
	EnableUseDbSideBindedPackageFilter = "enable-use-db-side-binded-package-filter"

	// LakeCloudServiceFeeTenantList is the whitelist of tenant IDs (as
	// strings) for which the Lake Cloud Service Fee calculation is active.
	// When empty the feature is disabled — the measure path does not skip
	// any units and the dedicated workers are no-ops.
	LakeCloudServiceFeeTenantList = "lake-cloud-service-fee-tenant-list"

	// LakeCloudServiceFeeInterval is the run interval of the daily
	// Lake Cloud Service Fee worker.
	LakeCloudServiceFeeInterval = "lake-cloud-service-fee-interval"

	// AgenticPlanWorkerInterval is the run interval of the Agentic Plan
	// V2 Active/Idle hourly settlement worker (design doc §4/§7).
	AgenticPlanWorkerInterval = "agentic-plan-worker-interval"

	// AgenticPlanTenantList is the Agentic Plan V2 whitelist — the same
	// oneconfig tenant-list pattern as LakeCloudServiceFeeTenantList.
	// Empty disables both the settlement worker and the tier1
	// suppression short-circuit. Semantics are processing-time (like
	// the raw-outbox routing whitelist), not effective-window: removal
	// takes effect at the next pricing/worker tick. The catch-up loop
	// advances contiguously from the last settled hour; a gap whose
	// first hour was legacy-billed (remove→re-add) triggers a fresh
	// start instead, so tier1-billed hours are never double-charged.
	AgenticPlanTenantList = "agentic-plan-tenant-list"

	// LakeCloudServiceFeeDelayHours is the minimum number of hours that
	// must elapse since midnight (UTC) before the daily worker processes
	// the previous day. Default 6.
	LakeCloudServiceFeeDelayHours = "lake-cloud-service-fee-delay-hours"

	// LakeCloudServiceFeeCompensationDays is the number of days (before
	// yesterday) to check and backfill on each daily worker run. 0 means
	// only yesterday is processed.
	LakeCloudServiceFeeCompensationDays = "lake-cloud-service-fee-compensation-days"

	// June2026DailySplitEnabled gates the June 2026 bills freeze. When true,
	// June 2026 bills use the per-day-split + per-row-Truncate algorithm
	// (commit 3bfb2859 semantics, the value finance has already reconciled
	// against for 2026-06). When false, June 2026 bills use the default
	// single-query + per-row-Truncate algorithm, which is the cents-precise
	// (pre-3bfb2859) answer.
	//
	// Default: false. The freeze is opt-in so that the safe algorithm is the
	// default once finance signs off on the 2026-06 reconciliation. To
	// temporarily restore the frozen 2026-06 numbers (e.g. for diffing against
	// an existing bill), set this flag to true via oneconfig.
	June2026DailySplitEnabled = "june-2026-daily-split-enabled"

	// PricingConcurrency controls how many goroutines per pod
	// concurrently claim and process metering_events. Each goroutine
	// independently does SELECT ... FOR UPDATE SKIP LOCKED, so multiple
	// goroutines and multiple pods never grab the same row. Default: NumCPU.
	PricingConcurrency = "pricing-concurrency"

	// EnablePricingTraceLog controls whether step-by-step trace logs
	// are emitted during the Pricing flow. Uses costID as traceID.
	// Default: false.
	EnablePricingTraceLog = "enable-pricing-trace-log"

	// PricingRetryConcurrency controls how many goroutines
	// retry price_failed metering events. Default: 1.
	PricingRetryConcurrency = "pricing-retry-concurrency"

	// PricingMergeConcurrency controls how many goroutines per pod
	// concurrently claim and merge pricing_events. Default: 1.
	PricingMergeConcurrency = "pricing-merge-concurrency"

	// EnablePricingWorker is the L2 kill switch for the pricing
	// pipeline workers (pricing / retry / merge / stuck reaper).
	// Turning it off stops new-path consumption entirely — in-flight
	// metering_events rows lose their consumer, so a drain is
	// mandatory before flipping it (see the rollout doc).
	EnablePricingWorker = "enable-pricing-worker"

	// EnablePricingInlineShadow is the safety valve for the inline
	// shadow pricing pool, which covers orgs still on the old measure
	// path. Turning it off only stops shadow coverage (observable via
	// the shadow_* counters); it never affects authoritative paths.
	EnablePricingInlineShadow = "enable-pricing-inline-shadow"

	// PricingShadowConcurrency is the worker count of the inline
	// shadow pricing pool inside the server pod. Each worker holds
	// one DB connection while pricing, so the total must stay within
	// MaxDatabaseConnections (default 50) alongside serving traffic.
	// Initial sizing guidance: 8-16 workers.
	PricingShadowConcurrency = "pricing-shadow-concurrency"

	// PricingShadowQueueSize is the bounded queue length of the
	// inline shadow pricing pool. When full, tasks are dropped
	// (counted in shadow_drop_total) so SQS consumption is never
	// blocked by shadow work.
	PricingShadowQueueSize = "pricing-shadow-queue-size"

	// PricingEventArchiveRetentionDays is the DB hot-window for
	// pricing_events. Rows with cost_timestamp older than this are
	// archived to S3 and deleted. Default 60.
	PricingEventArchiveRetentionDays = "pricing-event-archive-retention-days"

	// PricingEventArchiveWorkerInterval is the gocron interval of the
	// archive worker. Default 1h.
	PricingEventArchiveWorkerInterval = "pricing-event-archive-worker-interval"

	// MeteringEventArchiveRetentionDays is the DB hot-window for
	// metering_events. Rows with cost_timestamp older than this are
	// archived to S3 and deleted. Default 60.
	MeteringEventArchiveRetentionDays = "metering-event-archive-retention-days"

	// MeteringEventArchiveWorkerInterval is the gocron interval of the
	// metering archive worker. Default 1h.
	MeteringEventArchiveWorkerInterval = "metering-event-archive-worker-interval"
)

func SetDefault() {
	Get().SetDefault(BillingStressTest, false)
	Get().SetDefault(DefaultUnitCategory, "Default")
	//Get().SetDefault(DefaultLabelValueCategory, "default")
	Get().SetDefault(MySQLHost, "localhost")
	Get().SetDefault(MySQLUser, "root")
	Get().SetDefault(Database, "billing2")
	Get().SetDefault(MySQLPasswordUseFile, false)
	Get().SetDefault(DBaaSCentralEnable, true)
	Get().SetDefault(MYSQLPort, uint16(3306))
	Get().SetDefault(ReadOnlyMySQLHost, "localhost")
	Get().SetDefault(ReadOnlyMySQLUser, "root")
	Get().SetDefault(ReadOnlyMySQLDatabase, "billing2")
	Get().SetDefault(ReadOnlyMYSQLPort, uint16(3306))
	Get().SetDefault(MaxDatabaseIDELConnections, 10)
	Get().SetDefault(MaxDatabaseConnections, 50)
	Get().SetDefault(MaxDatabaseConnectionLifeTimeSeconds, 600)
	Get().SetDefault(MySQLConnectTimeoutSeconds, 60)
	Get().SetDefault(MySQLReadTimeoutSeconds, 30)  // MySQL connection read timeout (seconds, network I/O)
	Get().SetDefault(MySQLWriteTimeoutSeconds, 30) // MySQL connection write timeout (seconds, network I/O)
	Get().SetDefault(DBaaSCentralEnable, true)
	Get().SetDefault(DBaaSCentralScheme, "http")
	Get().SetDefault(DBaaSCentralHost, "account-admin-http:8080")
	Get().SetDefault(Invoicehours, 50)
	Get().SetDefault(BillingConfigActiveMinutes, 10)
	Get().SetDefault(BillingConfigDelayDays, 4)
	Get().SetDefault(BillingConfigWorkerInterval, "5m")
	Get().SetDefault(PartnerTenantInvoicehours, 6)

	Get().SetDefault(PartnerSupportPlanHours, 76)
	Get().SetDefault(StripePaymentEnable, false)
	Get().SetDefault(EnableAWSProduct1DollarUnit, false)
	Get().SetDefault(AWSProductUnitPriceFactor, 1000)
	Get().SetDefault(AWSProduct1DollarUnitPriceFactor, 1)
	Get().SetDefault(AWSCPPODiscountedProductUnitPriceFactor, 1)
	Get().SetDefault(AWSCPPONonDiscountedProductUnitPriceFactor, 1)

	Get().SetDefault(AWSPaymentEnable, false)
	Get().SetDefault(MaxDefaultPerWorkerConcurrentJobs, 1)
	Get().SetDefault(InvoiceWorkerCheckInterval, "65m")
	Get().SetDefault(SyncPayableWorkerInterval, "5m")
	Get().SetDefault(SyncDefaultAndBillingInfoInterval, "5m")
	Get().SetDefault(CalculateCacheInterval, "30m")
	Get().SetDefault(PackageUnitsValidate, true)
	Get().SetDefault(EnableInvoiceWorker, true)
	Get().SetDefault(EnableSyncPayableWorker, true)
	Get().SetDefault(StripeInvoicePayingWorkerInterval, "1m")
	Get().SetDefault(StripeInvoicePayingJanitorInterval, "1m")
	Get().SetDefault(StripePushMinAmountUSD, "1.00")
	Get().SetDefault(StripePushMaxCarryoverMonths, 12)
	Get().SetDefault(StripePushKeepDraftOnChargeModeManual, true)
	Get().SetDefault(StripePayingPushPerInvoice, true)
	Get().SetDefault(BillingServerPort, 18888)
	Get().SetDefault(CostSummaryGroupLabelList, "project,MSPCustomerID")
	Get().SetDefault(GCPPaymentEnable, false)
	Get().SetDefault(GCPProudctUnitPriceFactor, 1000)
	Get().SetDefault(GCPProcurementBaseUrl, "https://cloudcommerceprocurement.googleapis.com/")
	Get().SetDefault(GCPReconciliationOffsetHour, 9)

	Get().SetDefault(AliyunProductUnitPriceFactor, 100)

	Get().SetDefault(RemoveUnusedCostsInterval, "1h")
	Get().SetDefault(RemoveUnusedCostsOffsetSeconds, 14400)

	Get().SetDefault(MergeSmallCostsInterval, "8h")
	Get().SetDefault(SupportPlanMeteringInterval, "1h")
	Get().SetDefault(CreditsWorkerInterval, "5m")
	Get().SetDefault(RemoveUnusedCostsDays, 4)
	Get().SetDefault(MergeSmallCostsDays, 2)
	Get().SetDefault(EnableCache, true)
	Get().SetDefault(CDNFileContentType, "application/octet-stream")
	Get().SetDefault(S3FileTCPNSwagger, "/tcpn/service.openapi.swagger.json")
	Get().SetDefault(S3FileTCPNUserManual, "/tcpn/userManual.pdf")
	Get().SetDefault(DefaultBillingCompanyKey, "pingcap")

	Get().SetDefault(BillingCostsPrecisionDigits, 2)
	Get().SetDefault(BillingCostsCSVPrecisionDigits, 6)
	Get().SetDefault(BillingCostsMaxPrecisionDigits, 15)
	Get().SetDefault(EnableRemoteConfig, true)

	Get().SetDefault(EnableRemoteConfig, true)

	Get().SetDefault(CreditsPricePackage, 1)
	Get().SetDefault(GlobalPricePackage, 5)
	Get().SetDefault(DefaultCostQuota, 500)
	Get().SetDefault(DefaultCreditRiskLevel, 1)
	Get().SetDefault(EnableCreateCostQuotaInvoice, true)

	Get().SetDefault(EnableMailNotify, false)
	Get().SetDefault(DefaultMailFrom, "no-reply@tidbcloud.com")

	Get().SetDefault(EnableSentryLog, false)
	Get().SetDefault(SentryLogLevel, "error")
	Get().SetDefault(EnableMarketplaceMonthlyInvoiceSend, false)
	Get().SetDefault(MaxHourlyInvoiceReseekDays, 2)
	Get().SetDefault(DailyInvoiceIssueDelayDays, 2)
	Get().SetDefault(AliCloudDailyInvoiceIssueDelayDays, 1)
	Get().SetDefault(AliyunHourBoundarySafeMargin, "5m")
	Get().SetDefault(HourlyInvoiceIssueDelayHours, 24)
	Get().SetDefault(InvoicesQueryMaxSpanDays, 93)
	Get().SetDefault(BigCustomerDailyInvoiceHours, 48)

	Get().SetDefault(RefundWorkerInterval, "2m")
	Get().SetDefault(RefundMaxRetryCount, 3)
	Get().SetDefault(RefundCheckWorkerInterval, "6h")

	Get().SetDefault(IsCreditCardValidateAllowed, true)
	Get().SetDefault(CreditCardValidateAllowedTenants, "all")
	Get().SetDefault(TenantCreditRiskCloseInterval, "10m")

	Get().SetDefault(EnableInfraHandler, true)
	Get().SetDefault(CoreProxySvcAddress, "tempo-proxy.tidb-management-service:10102")
	Get().SetDefault(DataflowSvcAddress, "dataflow-grpc:10000")
	Get().SetDefault(AccountSvcAddress, "account-provider-grpc:10000")
	Get().SetDefault(TiDBMgmtSvcAddress, "tidb-mgmt-service.tidb-management-service:10001")
	Get().SetDefault(MaxRunningTenantCreditRiskClose, 5)

	Get().SetDefault(POCPackage, 1)
	Get().SetDefault(OnDemandPackage, 2)
	Get().SetDefault(DevTierPackage, 3)

	Get().SetDefault(DevTierDurationDays, 365)

	Get().SetDefault(EnablePOCEndedCleanup, true)
	Get().SetDefault(POCClusterRemainDays, 3)
	Get().SetDefault(POCManualBackupsRemainDays, 7)
	Get().SetDefault(POCSendEmailBeforeDeleteManualBackupsDays, 2)
	Get().SetDefault(POCRemainDaysCredits, 10000)

	Get().SetDefault(PlanWorkerInterval, "1h")

	Get().SetDefault(EnableRBAC, false)
	Get().SetDefault(EnableRBACMiddleware, true)
	Get().SetDefault(EnableSalesforce, false)
	Get().SetDefault(EnableAPIStackTrace, false)

	Get().SetDefault(EnableRemoveUnusedCosts, true)
	Get().SetDefault(RemoveUnusedCostsMonthBefore, 12)
	Get().SetDefault(RemoveUnusedCostsLimit, 5000)
	Get().SetDefault(RemoveUnusedCostsTimeoutSeconds, 60)
	Get().SetDefault(RemoveMergedCostsInterval, "24h")
	Get().SetDefault(RemoveUnusedCostsBatchSleepMs, 50)
	Get().SetDefault(RemoveUnusedCostsOrgSleepMs, 500)

	Get().SetDefault(MeasureDelayHours, 60)
	Get().SetDefault(IsRefuseDelayMeasure, true)
	Get().SetDefault(MeasureDelayCategoryWhiteList, "Support Plan")

	Get().SetDefault(DefaultInterval, "5m")
	Get().SetDefault(LatestExpiration, time.Date(2099, 12, 31, 0, 0, 0, 0, time.UTC))

	Get().SetDefault(InactiveDiscountWorkerInterval, "1h")
	Get().SetDefault(InactiveBindedPackageWorkerInterval, "1h")

	Get().SetDefault(PreventRemainingCreditsToBeNegative, false)
	Get().SetDefault(DefaultDiscountUnitFilters, []string{constant.NodeComputeTypeName, constant.DM, constant.TiCDC})

	Get().SetDefault(MaxTenantPlanUnitFilters, 5)

	Get().SetDefault(MergeSmallCostsOffsetSeconds, 86400)
	Get().SetDefault(SupportPlanCreditTypeID, 31)

	Get().SetDefault(MeasuresMaxTransactionRecords, 10000)
	Get().SetDefault(MeasuresWarningTransactionCounts, 20)

	Get().SetDefault(MeasureDisableSuccessResponse, false)

	Get().SetDefault(BindedPackageInactiveDelayHour, 72)
	Get().SetDefault(DiscountInactiveDelayHour, 72)
	Get().SetDefault(BindedSupportPlanInactiveDelayHour, 72)

	// Referral defaults
	Get().SetDefault(ReferralRewardConfig, `{"credits_validity_days":365,"usage":"referral"}`)
	Get().SetDefault(ReferralCreditsUnitFilterIDs, []uint{})
	Get().SetDefault(ReferralAmountSignup, 5)
	Get().SetDefault(ReferralAmountRefereeSignup, 5)
	Get().SetDefault(ReferralAmountBindCard, 5)
	Get().SetDefault(ReferralAmountRefereeBindCard, 5)
	Get().SetDefault(ReferralAmountFirstUse, 3)
	Get().SetDefault(ReferralAmountContinuousUse, 10)
	Get().SetDefault(ReferralAmountRefereeContinuousUse, 10)
	Get().SetDefault(CommunityRewardRate, 0.03)
	Get().SetDefault(ReferralShareLinkBase, "https://tidbcloud.com/signup")
	Get().SetDefault(PromotionClinicAPIBase, "https://clinic.pingcap.com")
	Get().SetDefault(PromotionClinicAPIKey, "")
	Get().SetDefault(PromotionCheckInterval, "10m")
	Get().SetDefault(PromotionFirstUseThreshold, 10)
	Get().SetDefault(PromotionContinuousUseDays, 7)
	Get().SetDefault(PromotionContinuousUseDaily, 10)
	Get().SetDefault(MaxPackageIDEnableCache, 5)
	Get().SetDefault(DataapiUsageUnitsMap, map[string]string{"tcds-request-unit:aws:us-west-2": "request",
		"tcds-request-network:aws:us-west-2":      "network",
		"tcds-request-unit:aws:ap-northeast-1":    "request",
		"tcds-request-network:aws:ap-northeast-1": "network",
		"tcds-request-unit:aws:ap-northeast-2":    "request",
		"tcds-request-network:aws:ap-northeast-2": "network",
		"tcds-request-unit:aws:ap-southeast-1":    "request",
		"tcds-request-network:aws:ap-southeast-1": "network",
		"tcds-request-unit:aws:eu-central-1":      "request",
		"tcds-request-network:aws:eu-central-1":   "network",
		"tcds-request-unit:aws:us-east-1":         "request",
		"tcds-request-network:aws:us-east-1":      "network"})

	Get().SetDefault(MaxReMeasuresTimes, 3)
	Get().SetDefault(CheckSupportPlanAccuracyWorkerInterval, "24h")
	Get().SetDefault(SupportPlanFreeTrialReminderWorkerInterval, "1h")
	Get().SetDefault(SyncMarketBillsWorkerInterval, "1h")
	Get().SetDefault(WorkerServerlessShowKindName, "TiDB Serverless")

	Get().SetDefault(CacheFailedRetryTimes, uint(2))

	Get().SetDefault(CheckSpendLimitInterval, "10m")

	Get().SetDefault(DefaultWorkerConcurrency, uint(15))
	Get().SetDefault(SyncPayableWorkerConcurrency, uint(1))
	Get().SetDefault(MergeSmallCostsWorkerConcurrency, uint(3))
	Get().SetDefault(RemoveUnusedCostsWorkerConcurrency, uint(5))
	Get().SetDefault(CheckSpendLimitWorkerConcurrency, uint(50))
	Get().SetDefault(InvoiceWorkerConcurrency, uint(3))
	Get().SetDefault(OpenCreditsPackageConcurrency, uint(3))

	Get().SetDefault(AWSMarketplaceDailyReportAPIRegion, "us-east-1")
	Get().SetDefault(AWSMarketplaceDailyReportDataSetTypeList, []string{"daily_business_usage_by_instance_type"})
	Get().SetDefault(AWSMarketplaceDailyReportGenerateInterval, "4h")
	Get().SetDefault(ReconciliationDailyWorkerInterval, "8h")
	Get().SetDefault(ReconciliationMonthlyWorkerInterval, "24h")
	Get().SetDefault(ARTableEstimatedWorkerInterval, "8h")
	Get().SetDefault(ARTableActualWorkerInterval, "8h")
	Get().SetDefault(AWSPriceRegion, "us-east-1")

	Get().SetDefault(AWSMarketplaceDailyReportGenerateRunningOffsetHours, 12)
	Get().SetDefault(AWSMarketplaceDailyReportGenerateDelayDays, 2)
	Get().SetDefault(DailyReconciliationDelayDays, 5)
	Get().SetDefault(MonthlyReconciliationDelayDays, 7)
	Get().SetDefault(ReconciliationAWSS3Region, "us-west-2")
	Get().SetDefault(ReconciliationReportAWSS3BucketName, "tidbcloud-marketplace-reconciliation")
	Get().SetDefault(ReconciliationAWSS3BucketName, "tidbcloud-marketplace-commerce-analytics")
	Get().SetDefault(ReconciliationGCSBucketName, "gcp_marketplace_reports")

	Get().SetDefault(EnableQueueMeasure, true)
	Get().SetDefault(HTTPMeasuresToQueue, false)

	Get().SetDefault(APISwitchUpdateUnit, true)

	Get().SetDefault(EnableEventbus, true)

	Get().SetDefault(ViewBillsByConfig, true)
	Get().SetDefault(MaxCostExplorerQueryConcurrency, 10)
	Get().SetDefault(MaxCostExplorerInternalQueryConcurrency, 25)
	Get().SetDefault(MaxCostExplorerTrendsQueryDaysSpan, 366)
	Get().SetDefault(CostExplorerTrendsQueryRequestTimesLimitPerTenant, 10)
	Get().SetDefault(CostExplorerTrendsQueryRequestTimesLimitPerTenantTimeSpanSeconds, 60)

	Get().SetDefault(MaxCostExplorerTrendsLongTimeSpanQueryConcurrency, 3)
	Get().SetDefault(CostExplorerTrendsLongTimeSpanQueryThresholdDays, 31*3)

	Get().SetDefault(TiDBCloudStripeProductTaxCode, "txcd_10103001")
	Get().SetDefault(TiDBCloudStripeProductReference, "TiDB Cloud Service")

	Get().SetDefault(TaxReverseChargeDescription, "Reverse charge transaction.")
	Get().SetDefault(TaxNotCollectingDescription, "Tax not collected based on the information provided. Additional tax may apply as applicable.")

	Get().SetDefault(CommitmentInvoiceItem, "TiDB Cloud Services Credits")
	Get().SetDefault(NonPOCCreditsValidate, true)
	Get().SetDefault(EnableOnlineMerging, true)
	Get().SetDefault(EnableOfflineMerging, false)
	Get().SetDefault(OnlineMergingMissingRetryTimes, 3)
	Get().SetDefault(EnableMergedLabelsHistory, true)

	Get().SetDefault(BillsDisplayProjectAndClusterNameWithID, false)
	Get().SetDefault(AttachProjectAndClusterNameWithIDOnMeasuring, true)

	Get().SetDefault(EnableIgnoreClusterInvalidatedMeasure, true)
	Get().SetDefault(IgnoreNotExistedClusterOnMeasuring, true)
	Get().SetDefault(IgnoreDeletedClusterOnMeasuring, true)

	Get().SetDefault(MaxMeasureQueryConcurrency, 15)
	Get().SetDefault(EnableMeasureQueryConcurrencyControl, true)

	Get().SetDefault(NonClusterCategories, []string{"Backup Cost", "Data Backup Cost"})
	Get().SetDefault(EnableUseMgmtGetClusterInfo, true)
	Get().SetDefault(UnsupportedCardBrands, []string{"jcb"})
	Get().SetDefault(EnableBroadcast, false)

	Get().SetDefault(AWSDisableHourlyInvoiceSendingAfter, time.Date(2024, 5, 1, 0, 0, 0, 0, time.UTC))
	Get().SetDefault(GCPDisableHourlyInvoiceSendingAfter, time.Date(2024, 5, 1, 0, 0, 0, 0, time.UTC))
	// create at nextmonth-hours 00:00:00
	Get().SetDefault(InMonthInvoiceHours, 5*24)

	Get().SetDefault(MaxBudgetThresholds, 5)
	Get().SetDefault(BudgetThresholdPrecision, 4)

	Get().SetDefault(RestrictedEmailDomainsForBindingCreditCard, []string{"pingcap.cn"})
	Get().SetDefault(RestrictInternalUserToBindCreditCard, false)

	Get().SetDefault(AccessControlAllowOrigin, []string{"*"})

	Get().SetDefault(SupportPlanUpdateSyncToEventBusEnable, true)

	Get().SetDefault(InvoicePayableDurationAfterInvoiceableHour, 24)

	Get().SetDefault(MarketplacePaymentInterval, "20m")
	Get().SetDefault(AZUREPaymentEnable, false)
	Get().SetDefault(AZUREProductDimension, "tidb_debug_unit")
	Get().SetDefault(AZUREProductUnitPriceFactor, 1000)

	Get().SetDefault(InAPPNotificationEnable, true)

	Get().SetDefault(SyncOnDemandOrgToJSMEnable, true)
	Get().SetDefault(ARTableAWSBucketName, "tidbcloud-billing-ar-tables")
	Get().SetDefault(EnablePutARTableToS3, true)
	Get().SetDefault(ARTableExportTimeoutMinutes, 15)
	Get().SetDefault(ARTablePresignExpireMinutes, 15)
	Get().SetDefault(ARTableSkipTenantIDs, []string{})

	Get().SetDefault(SyncMarketOrgBillsEnable, false)

	Get().SetDefault(EnableActionCheck, true)
	Get().SetDefault(EnableActionCheckProviderMatched, true)
	Get().SetDefault(EnableActionCheckOnClosing, true)
	Get().SetDefault(EnableActionCheckOnBillable, true)
	Get().SetDefault(EnableActionCheckOnBillingConfigIsNotExisted, true)
	Get().SetDefault(EnableThirdPartyProviderFromAccountCheck, true)
	Get().SetDefault(ActionCheckRetOnErr, false)

	Get().SetDefault(PocAfterNoPayable, time.Date(2025, 8, 1, 0, 0, 0, 0, time.UTC))

	Get().SetDefault(NoTrafficCheckerDBCostWithoutTrafficExcludeCatNames, []string{"Backup"})
	Get().SetDefault(NoTrafficCheckerTrafficCostCatNames, []string{"Data Transfer"})
	Get().SetDefault(NoTrafficCheckerEnableCheckThreshold, "1")
	Get().SetDefault(NoTrafficCheckerRunInterval, "24h")
	Get().SetDefault(NoTrafficCheckerRunConcurrency, 1)
	Get().SetDefault(MaxAttachLabelTimeSecond, 30)

	Get().SetDefault(WaitingCustomerActionDurationSeconds, 360)

	Get().SetDefault(CostExplorerCacheWorkerInterval, "2h")
	Get().SetDefault(CostExplorerCacheWorkerEnable, true)

	Get().SetDefault(DisableClusterDisplayTenants, []string{})
	Get().SetDefault(BigCustomerSplitLoopTimeoutMinutes, 30) // split-loop timeout for big-customer workers (minutes)
	Get().SetDefault(BigCustomerQueryTimeoutMinutes, 15)     // per-query timeout for big-customer single-query scans (minutes)
	Get().SetDefault(WorkerSplitLoopTimeoutSeconds, 300)     // split-loop timeout for regular-customer workers (seconds)
	Get().SetDefault(PerDBQueryTimeoutSeconds, 30)           // per-sub-query DB timeout, all HTTP customers (seconds)
	Get().SetDefault(DBQuerySlowLogThresholdSeconds, 30)     // slow-query WARN log threshold (seconds, not a timeout)
	Get().SetDefault(SplitLoopTotalTimeoutSeconds, 120)      // split-loop timeout, all HTTP customers (seconds)

	Get().SetDefault(PaymentRequiredEmailTemplateID, "d-488d32b4cc034877a2341370d25932eb")

	Get().SetDefault(TradingProhibitedCountryNameList, []string{
		"Norther Korea",
		"Iran",
		"Mali",
		"South Sudan",
		"Central African Republic",
		"Yemen",
		"Guinea-Bissau",
		"Libya",
		"Cuba",
		"Sudan",
		"Haiti",
	})
	Get().SetDefault(CountryCodeMapping, map[string]string{
		"Afghanistan":                        "AF",
		"Åland Islands":                      "AX",
		"Albania":                            "AL",
		"Algeria":                            "DZ",
		"American Samoa":                     "AS",
		"Andorra":                            "AD",
		"Angola":                             "AO",
		"Anguilla":                           "AI",
		"Antarctica":                         "AQ",
		"Antigua and Barbuda":                "AG",
		"Argentina":                          "AR",
		"Armenia":                            "AM",
		"Aruba":                              "AW",
		"Australia":                          "AU",
		"Austria":                            "AT",
		"Azerbaijan":                         "AZ",
		"Bahamas":                            "BS",
		"Bahrain":                            "BH",
		"Bangladesh":                         "BD",
		"Barbados":                           "BB",
		"Belarus":                            "BY",
		"Belgium":                            "BE",
		"Belize":                             "BZ",
		"Benin":                              "BJ",
		"Bermuda":                            "BM",
		"Bhutan":                             "BT",
		"Bolivia (Plurinational State of)":   "BO",
		"Bonaire, Sint Eustatius and Saba":   "BQ",
		"Bosnia and Herzegovina":             "BA",
		"Botswana":                           "BW",
		"Bouvet Island":                      "BV",
		"Brazil":                             "BR",
		"British Indian Ocean Territory":     "IO",
		"Brunei Darussalam":                  "BN",
		"Bulgaria":                           "BG",
		"Burkina Faso":                       "BF",
		"Burundi":                            "BI",
		"Cabo Verde":                         "CV",
		"Cambodia":                           "KH",
		"Cameroon":                           "CM",
		"Canada":                             "CA",
		"Cayman Islands":                     "KY",
		"Central African Republic":           "CF",
		"Chad":                               "TD",
		"Chile":                              "CL",
		"China":                              "CN",
		"Christmas Island":                   "CX",
		"Cocos (Keeling) Islands":            "CC",
		"Colombia":                           "CO",
		"Comoros":                            "KM",
		"Congo":                              "CG",
		"Congo (Democratic Republic of the)": "CD",
		"Cook Islands":                       "CK",
		"Costa Rica":                         "CR",
		"Côte d'Ivoire":                      "CI",
		"Croatia":                            "HR",
		"Cuba":                               "CU",
		"Curaçao":                            "CW",
		"Cyprus":                             "CY",
		"Czechia":                            "CZ",
		"Denmark":                            "DK",
		"Djibouti":                           "DJ",
		"Dominica":                           "DM",
		"Dominican Republic":                 "DO",
		"Ecuador":                            "EC",
		"Egypt":                              "EG",
		"El Salvador":                        "SV",
		"Equatorial Guinea":                  "GQ",
		"Eritrea":                            "ER",
		"Estonia":                            "EE",
		"Eswatini":                           "SZ",
		"Ethiopia":                           "ET",
		"Falkland Islands (Malvinas)":        "FK",
		"Faroe Islands":                      "FO",
		"Fiji":                               "FJ",
		"Finland":                            "FI",
		"France":                             "FR",
		"French Guiana":                      "GF",
		"French Polynesia":                   "PF",
		"French Southern Territories":        "TF",
		"Gabon":                              "GA",
		"Gambia":                             "GM",
		"Georgia":                            "GE",
		"Germany":                            "DE",
		"Ghana":                              "GH",
		"Gibraltar":                          "GI",
		"Greece":                             "GR",
		"Greenland":                          "GL",
		"Grenada":                            "GD",
		"Guadeloupe":                         "GP",
		"Guam":                               "GU",
		"Guatemala":                          "GT",
		"Guernsey":                           "GG",
		"Guinea":                             "GN",
		"Guinea-Bissau":                      "GW",
		"Guyana":                             "GY",
		"Haiti":                              "HT",
		"Heard Island and McDonald Islands":  "HM",
		"Holy See":                           "VA",
		"Honduras":                           "HN",
		"Hong Kong":                          "HK",
		"Hungary":                            "HU",
		"Iceland":                            "IS",
		"India":                              "IN",
		"Indonesia":                          "ID",
		"Iran (Islamic Republic of)":         "IR",
		"Iraq":                               "IQ",
		"Ireland":                            "IE",
		"Isle of Man":                        "IM",
		"Israel":                             "IL",
		"Italy":                              "IT",
		"Jamaica":                            "JM",
		"Japan":                              "JP",
		"Jersey":                             "JE",
		"Jordan":                             "JO",
		"Kazakhstan":                         "KZ",
		"Kenya":                              "KE",
		"Kiribati":                           "KI",
		"Korea (Democratic People's Republic of)": "KP",
		"Korea (Republic of)":                     "KR",
		"Kuwait":                                  "KW",
		"Kyrgyzstan":                              "KG",
		"Lao People's Democratic Republic":        "LA",
		"Latvia":                                  "LV",
		"Lebanon":                                 "LB",
		"Lesotho":                                 "LS",
		"Liberia":                                 "LR",
		"Libya":                                   "LY",
		"Liechtenstein":                           "LI",
		"Lithuania":                               "LT",
		"Luxembourg":                              "LU",
		"Macao":                                   "MO",
		"Madagascar":                              "MG",
		"Malawi":                                  "MW",
		"Malaysia":                                "MY",
		"Maldives":                                "MV",
		"Mali":                                    "ML",
		"Malta":                                   "MT",
		"Marshall Islands":                        "MH",
		"Martinique":                              "MQ",
		"Mauritania":                              "MR",
		"Mauritius":                               "MU",
		"Mayotte":                                 "YT",
		"Mexico":                                  "MX",
		"Micronesia (Federated States of)":        "FM",
		"Moldova (Republic of)":                   "MD",
		"Monaco":                                  "MC",
		"Mongolia":                                "MN",
		"Montenegro":                              "ME",
		"Montserrat":                              "MS",
		"Morocco":                                 "MA",
		"Mozambique":                              "MZ",
		"Myanmar":                                 "MM",
		"Namibia":                                 "NA",
		"Nauru":                                   "NR",
		"Nepal":                                   "NP",
		"Netherlands":                             "NL",
		"New Caledonia":                           "NC",
		"New Zealand":                             "NZ",
		"Nicaragua":                               "NI",
		"Niger":                                   "NE",
		"Nigeria":                                 "NG",
		"Niue":                                    "NU",
		"Norfolk Island":                          "NF",
		"North Macedonia":                         "MK",
		"Northern Mariana Islands":                "MP",
		"Norway":                                  "NO",
		"Oman":                                    "OM",
		"Pakistan":                                "PK",
		"Palau":                                   "PW",
		"Palestine, State of":                     "PS",
		"Panama":                                  "PA",
		"Papua New Guinea":                        "PG",
		"Paraguay":                                "PY",
		"Peru":                                    "PE",
		"Philippines":                             "PH",
		"Pitcairn":                                "PN",
		"Poland":                                  "PL",
		"Portugal":                                "PT",
		"Puerto Rico":                             "PR",
		"Qatar":                                   "QA",
		"Réunion":                                 "RE",
		"Romania":                                 "RO",
		"Russian Federation":                      "RU",
		"Rwanda":                                  "RW",
		"Saint Barthélemy":                        "BL",
		"Saint Helena, Ascension and Tristan da Cunha": "SH",
		"Saint Kitts and Nevis":                        "KN",
		"Saint Lucia":                                  "LC",
		"Saint Martin (French part)":                   "MF",
		"Saint Pierre and Miquelon":                    "PM",
		"Saint Vincent and the Grenadines":             "VC",
		"Samoa":                                        "WS",
		"San Marino":                                   "SM",
		"Sao Tome and Principe":                        "ST",
		"Saudi Arabia":                                 "SA",
		"Senegal":                                      "SN",
		"Serbia":                                       "RS",
		"Seychelles":                                   "SC",
		"Sierra Leone":                                 "SL",
		"Singapore":                                    "SG",
		"Sint Maarten (Dutch part)":                    "SX",
		"Slovakia":                                     "SK",
		"Slovenia":                                     "SI",
		"Solomon Islands":                              "SB",
		"Somalia":                                      "SO",
		"South Africa":                                 "ZA",
		"South Georgia and the South Sandwich Islands": "GS",
		"South Sudan":                  "SS",
		"Spain":                        "ES",
		"Sri Lanka":                    "LK",
		"Sudan":                        "SD",
		"Suriname":                     "SR",
		"Svalbard and Jan Mayen":       "SJ",
		"Sweden":                       "SE",
		"Switzerland":                  "CH",
		"Syrian Arab Republic":         "SY",
		"Taiwan (Province of China)":   "TW",
		"Tajikistan":                   "TJ",
		"Tanzania, United Republic of": "TZ",
		"Thailand":                     "TH",
		"Timor-Leste":                  "TL",
		"Togo":                         "TG",
		"Tokelau":                      "TK",
		"Tonga":                        "TO",
		"Trinidad and Tobago":          "TT",
		"Tunisia":                      "TN",
		"Turkey":                       "TR",
		"Turkmenistan":                 "TM",
		"Turks and Caicos Islands":     "TC",
		"Tuvalu":                       "TV",
		"Uganda":                       "UG",
		"Ukraine":                      "UA",
		"United Arab Emirates":         "AE",
		"United Kingdom of Great Britain and Northern Ireland": "GB",
		"United States Minor Outlying Islands":                 "UM",
		"United States of America":                             "US",
		"Uruguay":                                              "UY",
		"Uzbekistan":                                           "UZ",
		"Vanuatu":                                              "VU",
		"Venezuela (Bolivarian Republic of)":                   "VE",
		"Viet Nam":                                             "VN",
		"Virgin Islands (British)":                             "VG",
		"Virgin Islands (U.S.)":                                "VI",
		"Wallis and Futuna":                                    "WF",
		"Western Sahara":                                       "EH",
		"Yemen":                                                "YE",
		"Zambia":                                               "ZM",
		"Zimbabwe":                                             "ZW",
	})

	Get().SetDefault(ManusThresholdForNotifyOnClusterConsumption, "0.01")

	Get().SetDefault(EnableS3BillsDetailExport, true)
	Get().SetDefault(EnablePutBillsDetailToS3, true)
	Get().SetDefault(S3BillsDetailBucketName, "tidbcloud-billing-bills-detail")
	Get().SetDefault(S3BillsDetailRegion, "us-west-2")
	Get().SetDefault(S3BillsDetailPresignExpireMinutes, 60)
	Get().SetDefault(S3BillsDetailWorkerInterval, "1h")
	Get().SetDefault(S3BillsDetailTenantList, []string{})

	Get().SetDefault(EnableSnapshotMeteringRawOutbox, true)
	Get().SetDefault(SnapshotMeteringRawOutboxWorkerInterval, "1h")
	Get().SetDefault(SnapshotMeteringRawOutboxScanLimit, 50000)
	Get().SetDefault(SnapshotMeteringRawOutboxBatchSize, 5000)
	Get().SetDefault(SnapshotMeteringRawOutboxMinFlushRows, 2000)
	Get().SetDefault(SnapshotMeteringRawOutboxMaxFlushDelaySecs, 10800)
	Get().SetDefault(SnapshotMeteringRawOutboxDrainMaxSeconds, 240)
	Get().SetDefault(SnapshotMeteringRawOutboxUploadConcurrency, 4)
	Get().SetDefault(SnapshotMeteringRawHashBucketCount, 4096)
	Get().SetDefault(SnapshotMeteringRawDedicatedTenantList, []string{})
	Get().SetDefault(SnapshotMeteringRawS3BucketName, "tidbcloud-billing-metering")
	Get().SetDefault(SnapshotMeteringRawS3Region, "us-west-2")
	Get().SetDefault(SnapshotMeteringRawRetentionDays, 30)
	Get().SetDefault(SnapshotRawUserUnitCostRerunRetentionDays, 3)
	Get().SetDefault(SnapshotRecalculateApplyLogOnly, true)

	// Default off. See EnableUseDbSideBindedPackageFilter for context.
	Get().SetDefault(EnableUseDbSideBindedPackageFilter, false)

	// Lake Cloud Service Fee — empty tenant whitelist disables the feature.
	Get().SetDefault(LakeCloudServiceFeeTenantList, []string{})
	Get().SetDefault(LakeCloudServiceFeeInterval, "65m")
	Get().SetDefault(LakeCloudServiceFeeDelayHours, 6)
	Get().SetDefault(LakeCloudServiceFeeCompensationDays, 2)
	Get().SetDefault(AgenticPlanWorkerInterval, "10m")
	Get().SetDefault(AgenticPlanTenantList, []string{})

	// Default off. June 2026 bills use the correct single-query algorithm by
	// default; opt in to the per-day-split freeze via oneconfig when comparing
	// against finance's reconciled 2026-06 numbers. See June2026DailySplitEnabled
	// for the full contract.
	Get().SetDefault(June2026DailySplitEnabled, false)

	Get().SetDefault(PricingConcurrency, 0)
	Get().SetDefault(PricingRetryConcurrency, 1)
	Get().SetDefault(PricingMergeConcurrency, 1)
	Get().SetDefault(EnablePricingWorker, true)
	Get().SetDefault(EnablePricingInlineShadow, true)
	Get().SetDefault(PricingShadowConcurrency, 8)
	Get().SetDefault(PricingShadowQueueSize, 4096)
	Get().SetDefault(PricingEventArchiveRetentionDays, 60)
	Get().SetDefault(PricingEventArchiveWorkerInterval, "1h")
	Get().SetDefault(MeteringEventArchiveRetentionDays, 60)
	Get().SetDefault(MeteringEventArchiveWorkerInterval, "1h")
	Get().SetDefault(EnablePricingTraceLog, false)
}
