-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) != "" { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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)
tables/detailed_billing_report/detailed_billing_report_table.go
Outdated
Show resolved
Hide resolved
Co-authored-by: cbruno10 <[email protected]>
Example query results
Results