@@ -81,7 +81,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
8181 ctx := s .T ().Context ()
8282 namespace := "flatfee-intentoverride-adapter"
8383 charge := s .createCharge (namespace )
84- overrideTaxCodeID := s .taxCodeEnv .CreateTaxCode (s .T (), namespace ).ID
8584
8685 overrideServicePeriod := timeutil.ClosedPeriod {
8786 From : time .Date (2026 , 1 , 10 , 0 , 0 , 0 , 0 , time .UTC ),
@@ -114,16 +113,11 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
114113 Metadata : models.Metadata {
115114 "source" : "manual" ,
116115 },
117- TaxConfig : productcatalog.TaxCodeConfig {
118- Behavior : lo .ToPtr (productcatalog .InclusiveTaxBehavior ),
119- TaxCodeID : overrideTaxCodeID ,
120- },
121116 ServicePeriod : overrideServicePeriod ,
122117 FullServicePeriod : overrideFullServicePeriod ,
123118 BillingPeriod : overrideBillingPeriod ,
124119 },
125120 InvoiceAt : overrideInvoiceAt ,
126- FeatureKey : "manual-feature" ,
127121 PaymentTerm : paymentTerm ,
128122 ProRating : proRating ,
129123 AmountBeforeProration : amountBeforeProration ,
@@ -153,7 +147,7 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
153147 updated , err = s .adapter .CreateChargeOverride (ctx , updated , override )
154148 s .Require ().NoError (err )
155149 s .Nil (updated .DeletedAt )
156- s .requireOverrideMatches (updated .Intent .GetOverrideLayerMutableFields (), overrideServicePeriod , overrideFullServicePeriod , overrideBillingPeriod , overrideInvoiceAt , overrideTaxCodeID , overrideDiscountCorrelationID )
150+ s .requireOverrideMatches (updated .Intent .GetOverrideLayerMutableFields (), overrideServicePeriod , overrideFullServicePeriod , overrideBillingPeriod , overrideInvoiceAt , overrideDiscountCorrelationID )
157151
158152 _ , err = s .adapter .CreateChargeOverride (ctx , updated , override )
159153 s .Require ().Error (err )
@@ -164,14 +158,11 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
164158 }))
165159 updated , err = s .adapter .UpdateCharge (ctx , updated )
166160 s .Require ().NoError (err )
167- s .requireOverrideMatches (updated .Intent .GetOverrideLayerMutableFields (), overrideServicePeriod , overrideFullServicePeriod , overrideBillingPeriod , overrideInvoiceAt , overrideTaxCodeID , overrideDiscountCorrelationID )
161+ s .requireOverrideMatches (updated .Intent .GetOverrideLayerMutableFields (), overrideServicePeriod , overrideFullServicePeriod , overrideBillingPeriod , overrideInvoiceAt , overrideDiscountCorrelationID )
168162
169163 s .Require ().NoError (updated .Intent .Mutate (chargesmeta .ChangeTargetOverride , func (fields * flatfee.IntentMutableFields ) {
170164 fields .Description = nil
171165 fields .Metadata = nil
172- fields .TaxConfig .Behavior = nil
173- fields .TaxConfig .TaxCodeID = overrideTaxCodeID
174- fields .FeatureKey = ""
175166 fields .PercentageDiscounts = nil
176167 }))
177168 updated , err = s .adapter .UpdateCharge (ctx , updated )
@@ -180,9 +171,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
180171 s .Require ().NotNil (updatedOverride )
181172 s .Nil (updatedOverride .Description )
182173 s .Nil (updatedOverride .Metadata )
183- s .Nil (updatedOverride .TaxConfig .Behavior )
184- s .Equal (overrideTaxCodeID , updatedOverride .TaxConfig .TaxCodeID )
185- s .Empty (updatedOverride .FeatureKey )
186174 s .Nil (updatedOverride .PercentageDiscounts )
187175
188176 fetched , err := s .adapter .GetByID (ctx , flatfee.GetByIDInput {
@@ -193,10 +181,13 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
193181 s .Require ().NotNil (fetchedOverride )
194182 s .Nil (fetchedOverride .Description )
195183 s .Nil (fetchedOverride .Metadata )
196- s .Nil (fetchedOverride .TaxConfig .Behavior )
197- s .Equal (overrideTaxCodeID , fetchedOverride .TaxConfig .TaxCodeID )
198- s .Empty (fetchedOverride .FeatureKey )
199184 s .Nil (fetchedOverride .PercentageDiscounts )
185+ s .Equal (updated .Intent .GetBaseIntent ().TaxConfig , fetched .Intent .GetTaxConfig ())
186+ expectedFeatureKey := ""
187+ if updated .Intent .GetBaseIntent ().FeatureKey != nil {
188+ expectedFeatureKey = * updated .Intent .GetBaseIntent ().FeatureKey
189+ }
190+ s .Equal (expectedFeatureKey , fetched .Intent .GetFeatureKey ())
200191
201192 fetchedByIDs , err := s .adapter .GetByIDs (ctx , flatfee.GetByIDsInput {
202193 Namespace : namespace ,
@@ -208,9 +199,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestUpdateAndReadIntentOverride() {
208199 s .Require ().NotNil (fetchedByIDOverride )
209200 s .Nil (fetchedByIDOverride .Description )
210201 s .Nil (fetchedByIDOverride .Metadata )
211- s .Nil (fetchedByIDOverride .TaxConfig .Behavior )
212- s .Equal (overrideTaxCodeID , fetchedByIDOverride .TaxConfig .TaxCodeID )
213- s .Empty (fetchedByIDOverride .FeatureKey )
214202 s .Nil (fetchedByIDOverride .PercentageDiscounts )
215203
216204 cleared , err := s .adapter .DeleteChargeOverride (ctx , fetched .ChargeBase )
@@ -238,7 +226,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) TestDeleteChargeWithIntentOverrideDe
238226 override := flatfee.IntentMutableFields {
239227 IntentMutableFields : chargesmeta.IntentMutableFields {
240228 Name : "manual flat fee" ,
241- TaxConfig : baseIntent .TaxConfig ,
242229 ServicePeriod : baseIntent .ServicePeriod ,
243230 FullServicePeriod : baseIntent .FullServicePeriod ,
244231 BillingPeriod : baseIntent .BillingPeriod ,
@@ -286,7 +273,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) requireOverrideMatches(
286273 fullServicePeriod timeutil.ClosedPeriod ,
287274 billingPeriod timeutil.ClosedPeriod ,
288275 invoiceAt time.Time ,
289- taxCodeID string ,
290276 discountCorrelationID string ,
291277) {
292278 s .T ().Helper ()
@@ -295,10 +281,6 @@ func (s *FlatFeeIntentOverrideAdapterSuite) requireOverrideMatches(
295281 s .Equal ("manual flat fee" , override .Name )
296282 s .Equal ("manual description" , lo .FromPtr (override .Description ))
297283 s .Equal (models.Metadata {"source" : "manual" }, override .Metadata )
298- s .Require ().NotNil (override .TaxConfig .Behavior )
299- s .Equal (productcatalog .InclusiveTaxBehavior , * override .TaxConfig .Behavior )
300- s .Equal (taxCodeID , override .TaxConfig .TaxCodeID )
301- s .Equal ("manual-feature" , override .FeatureKey )
302284 s .Equal (servicePeriod , override .ServicePeriod )
303285 s .Equal (fullServicePeriod , override .FullServicePeriod )
304286 s .Equal (billingPeriod , override .BillingPeriod )
@@ -331,13 +313,13 @@ func (s *FlatFeeIntentOverrideAdapterSuite) createCharge(namespace string) flatf
331313 ManagedBy : billing .SubscriptionManagedLine ,
332314 CustomerID : customerID ,
333315 Currency : currencyx .Code ("USD" ),
316+ TaxConfig : productcatalog.TaxCodeConfig {
317+ TaxCodeID : taxCodeID ,
318+ },
334319 },
335320 IntentMutableFields : flatfee.IntentMutableFields {
336321 IntentMutableFields : chargesmeta.IntentMutableFields {
337- Name : "flat-fee-charge" ,
338- TaxConfig : productcatalog.TaxCodeConfig {
339- TaxCodeID : taxCodeID ,
340- },
322+ Name : "flat-fee-charge" ,
341323 ServicePeriod : servicePeriod ,
342324 FullServicePeriod : servicePeriod ,
343325 BillingPeriod : servicePeriod ,
0 commit comments