@@ -113,7 +113,7 @@ func (a *adapter) UpdateCustomerOverride(ctx context.Context, input billing.Upda
113113
114114func (a * adapter ) GetCustomerOverride (ctx context.Context , input billing.GetCustomerOverrideAdapterInput ) (* billing.CustomerOverride , error ) {
115115 return entutils .TransactingRepo (ctx , a , func (ctx context.Context , tx * adapter ) (* billing.CustomerOverride , error ) {
116- query := a .db .BillingCustomerOverride .Query ().
116+ query := tx .db .BillingCustomerOverride .Query ().
117117 Where (billingcustomeroverride .Namespace (input .Customer .Namespace )).
118118 Where (billingcustomeroverride .CustomerID (input .Customer .ID )).
119119 WithBillingProfile (func (bpq * db.BillingProfileQuery ) {
@@ -135,7 +135,7 @@ func (a *adapter) GetCustomerOverride(ctx context.Context, input billing.GetCust
135135
136136 if dbCustomerOverride .BillingProfileID == nil {
137137 // Let's fetch the default billing profile
138- dbDefaultProfile , err := a .db .BillingProfile .Query ().
138+ dbDefaultProfile , err := tx .db .BillingProfile .Query ().
139139 Where (billingprofile .Namespace (input .Customer .Namespace )).
140140 Where (billingprofile .Default (true )).
141141 Where (billingprofile .DeletedAtIsNil ()).
@@ -158,7 +158,7 @@ func (a *adapter) ListCustomerOverrides(ctx context.Context, input billing.ListC
158158 // Warning: We need to use the customer db parts as for the UI (and for a good API) we need to
159159 // be able to filter based on customer fields too.
160160 return entutils .TransactingRepo (ctx , a , func (ctx context.Context , tx * adapter ) (billing.ListCustomerOverridesAdapterResult , error ) {
161- query := a .db .Customer .Query ().
161+ query := tx .db .Customer .Query ().
162162 Where (dbcustomer .NamespaceEQ (input .Namespace )).
163163 Where (dbcustomer .DeletedAtIsNil ())
164164
0 commit comments