fix(billing): 保留规则集未覆盖的基础资源价格
ci / verify (pull_request) Successful in 12m21s

This commit is contained in:
2026-07-22 00:57:50 +08:00
parent fe83da56d2
commit 0818f55235
2 changed files with 32 additions and 3 deletions
+7 -3
View File
@@ -17,12 +17,16 @@ type EffectiveBillingConfigInput struct {
func ResolveEffectiveBillingConfig(input EffectiveBillingConfigInput) map[string]any {
config := mergeObjects(input.BaseConfig, nil)
if len(input.InheritedRuleSetConfig) > 0 {
config = mergeObjects(input.InheritedRuleSetConfig, nil)
// Rule sets are allowed to cover only a subset of resource types. Keep
// base-model prices for resources that the inherited rule set does not
// define, while letting the rule set remain authoritative for matching
// top-level keys.
config = mergeObjects(config, input.InheritedRuleSetConfig)
} else if len(input.LegacyPlatformModelConfig) > 0 {
config = mergeObjects(input.LegacyPlatformModelConfig, nil)
config = mergeObjects(config, input.LegacyPlatformModelConfig)
}
if len(input.ModelRuleSetConfig) > 0 {
config = mergeObjects(input.ModelRuleSetConfig, nil)
config = mergeObjects(config, input.ModelRuleSetConfig)
}
return mergeObjects(config, input.Override)
}