ledger account reference removed

This commit is contained in:
Stephan D
2025-12-11 23:30:42 +01:00
parent 1bab0b14ef
commit 5bebadf17c
11 changed files with 148 additions and 42 deletions

View File

@@ -49,7 +49,7 @@ func TestQuoteFees_ComputesDerivedLines(t *testing.T) {
},
}
plan.SetID(primitive.NewObjectID())
plan.SetOrganizationRef(orgRef)
plan.OrganizationRef = &orgRef
service := NewService(
zap.NewNop(),
@@ -163,7 +163,7 @@ func TestQuoteFees_FiltersByAttributesAndDates(t *testing.T) {
},
}
plan.SetID(primitive.NewObjectID())
plan.SetOrganizationRef(orgRef)
plan.OrganizationRef = &orgRef
service := NewService(
zap.NewNop(),
@@ -224,7 +224,7 @@ func TestQuoteFees_RoundingDown(t *testing.T) {
},
}
plan.SetID(primitive.NewObjectID())
plan.SetOrganizationRef(orgRef)
plan.OrganizationRef = &orgRef
service := NewService(
zap.NewNop(),
@@ -277,7 +277,7 @@ func TestQuoteFees_UsesInjectedCalculator(t *testing.T) {
},
}
plan.SetID(primitive.NewObjectID())
plan.SetOrganizationRef(orgRef)
plan.OrganizationRef = &orgRef
result := &types.CalculationResult{
Lines: []*feesv1.DerivedPostingLine{
@@ -353,7 +353,7 @@ func TestQuoteFees_PopulatesFxUsed(t *testing.T) {
},
}
plan.SetID(primitive.NewObjectID())
plan.SetOrganizationRef(orgRef)
plan.OrganizationRef = &orgRef
fakeOracle := &oracleclient.Fake{
LatestRateFn: func(ctx context.Context, req oracleclient.LatestRateParams) (*oracleclient.RateSnapshot, error) {
@@ -452,7 +452,7 @@ func (s *stubPlansStore) FindActiveOrgPlan(_ context.Context, orgRef primitive.O
if s.plan == nil {
return nil, storage.ErrFeePlanNotFound
}
if s.plan.GetOrganizationRef() != orgRef {
if (s.plan.OrganizationRef != nil) && (*s.plan.OrganizationRef != orgRef) {
return nil, storage.ErrFeePlanNotFound
}
if !s.plan.Active {