@@ -267,22 +267,6 @@ func (c *CostCenterManager) ResetUsage(ctx context.Context, cc CostCenter) (Cost
267
267
return CostCenter {}, fmt .Errorf ("cannot reset usage for Billing Strategy %s for Cost Center ID: %s" , cc .BillingStrategy , cc .ID )
268
268
}
269
269
270
- entity , _ := cc .ID .Values ()
271
-
272
- // We do not carry over the spending limit from the existing CostCenter.
273
- // At the moment, we don't have a use case for it. Getting the spending limit from configured values
274
- // ensures that we progressively update the spending limit to configured values rather than having to
275
- // perform bulk DB queries when the defaults do change.
276
- var spendingLimit int32
277
- switch entity {
278
- case AttributionEntity_Team :
279
- spendingLimit = c .cfg .ForTeams
280
- case AttributionEntity_User :
281
- spendingLimit = c .cfg .ForUsers
282
- default :
283
- return CostCenter {}, fmt .Errorf ("cannot reset usage for unknown attribution entity ID: %s" , cc .ID )
284
- }
285
-
286
270
now := time .Now ().UTC ()
287
271
288
272
// Default to 1 month from now, if there's no nextBillingTime set on the record.
@@ -300,7 +284,7 @@ func (c *CostCenterManager) ResetUsage(ctx context.Context, cc CostCenter) (Cost
300
284
// All fields on the new cost center remain the same, except for BillingCycleStart, NextBillingTime, and CreationTime
301
285
newCostCenter := CostCenter {
302
286
ID : cc .ID ,
303
- SpendingLimit : spendingLimit ,
287
+ SpendingLimit : cc . SpendingLimit ,
304
288
BillingStrategy : cc .BillingStrategy ,
305
289
BillingCycleStart : NewVarCharTime (now ),
306
290
NextBillingTime : NewVarCharTime (nextBillingTime ),
0 commit comments