Skip to content

Add table detailed billing report #129

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Mar 24, 2025

Example query results

Results
Add example SQL query results here (please include the input queries as well)

Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

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

@ParthaI Please see review comments, thanks!

// Fallbacks for TpIndex and TpTimestamp
if typehelpers.SafeString(row.LinkedAccountId) != "" {
row.TpIndex = *row.LinkedAccountId
} else if typehelpers.SafeString(row.PayerAccountId) != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment on when we would use the payer account ID instead (probably when the line is for the payer itself).

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, is there a way to tell if a line item is for the bill payer vs. linked account? For instance, if the line is for a linked account, but someone removes the SubAccountId value accidentally, are there other ways to tell if a line is for a linked vs. payer account?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the cost is associated with the billing account, the record_type column will contain the value PayerLineItem.

Copy link
Contributor

@cbruno10 cbruno10 Mar 25, 2025

Choose a reason for hiding this comment

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

In that case, for tp_index, could we:

  • For linked accounts, use LinkedAccountId
  • For payer accounts, use PayerAccountId

In both cases, we'd have no fallback (Tailpipe should error if either of those fields are missing for the respective account type)

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.

2 participants