Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round 1 changes for 1952 #2022

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

reshmabidikar
Copy link
Contributor

Round 1 changes for #1952:

  • Tracking ids disabled for internal method calls
  • Tracking ids returned for API facing method calls

I will implement the following as part of Round 2:

In addition to those, we should check for all the get paths that are used for apis, whether we also use those internally and possibly introduce a flag to discriminate between internal and external (invoice api) use cases.

@reshmabidikar reshmabidikar marked this pull request as ready for review June 6, 2024 09:53
@@ -521,14 +521,14 @@ public List<InvoiceItemModelDao> inTransaction(final EntitySqlDaoWrapperFactory
}

@Override
public List<InvoiceModelDao> getInvoicesBySubscription(final UUID subscriptionId, final InternalTenantContext context) {
public List<InvoiceModelDao> getInvoicesBySubscription(final UUID subscriptionId, final InternalTenantContext context) { //TODO_1952 - This method is used only by tests, so passing includeTrackingIds=false. Can we delete this method?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think deleting would be great - if not passing false is good.

@@ -1316,7 +1316,7 @@ public InvoiceModelDao getParentDraftInvoice(final UUID parentAccountId, final I
final InvoiceSqlDao invoiceSqlDao = entitySqlDaoWrapperFactory.become(InvoiceSqlDao.class);
final InvoiceModelDao invoice = invoiceSqlDao.getParentDraftInvoice(parentAccountId.toString(), context);
if (invoice != null) {
invoiceDaoHelper.populateChildren(invoice, invoicesTags, false, entitySqlDaoWrapperFactory, context);
invoiceDaoHelper.populateChildren(invoice, invoicesTags, false, false, entitySqlDaoWrapperFactory, context); //TODO_1952 - Passing includeTrackingIds=false, revisit to confirm if this is correct
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, passing false is correct - this is only used internally. The rule is that if the invoice (or list of invoices) are not returned to the client (jaxrs or plugins), we can pass false.

@@ -281,7 +285,7 @@ public List<InvoiceModelDao> getAllInvoicesByAccountFromTransaction(final Boolea
.filter(invoice -> includeVoidedInvoices || !InvoiceStatus.VOID.equals(invoice.getStatus()))
.collect(Collectors.toUnmodifiableList());
if (includeInvoiceComponents) {
populateChildren(filtered, invoicesTags, false, entitySqlDaoWrapperFactory, context);
populateChildren(filtered, invoicesTags, false, true, entitySqlDaoWrapperFactory, context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. For pass #2, this probably one option where we could optimize based on use cases, internal vs externals.

@reshmabidikar reshmabidikar changed the base branch from master to work-for-1952 June 7, 2024 05:39
@sbrossie sbrossie merged commit 53b633d into killbill:work-for-1952 Jun 8, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants