Exclude SYNTHETIC flag from BillingData BigQuery view

The BillingData view is intended to be the stable, clean source of data for the invoicing pipeline and detail report output.  As such, cutting over to the synthetically created OneTimes is an implementation detail and shouldn't be visible in the output (esp. since that goes straight to the detail reports that registrars receive, and it'd probably just be confusing for them).  I think it's fair to generically exclude the SYNTHETIC flag from showing up here - it will still be in BigQuery on the individual OneTimes if we want to look for it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148682719
This commit is contained in:
nickfelt 2017-02-27 12:53:51 -08:00 committed by Ben McIlwain
parent 64bfbea324
commit 5a00317dcc

View file

@ -56,8 +56,9 @@ FROM (
-- Parse out the amount of minor units by stripping out non-digit chars
-- (i.e. currency, space, and period) and then converting to integer.
INTEGER(REGEXP_REPLACE(cost, r'\D+', '')) AS amountMinor,
-- Convert repeated flags field into flat comma-delimited string field.
GROUP_CONCAT(flags) WITHIN RECORD AS flags,
-- Convert repeated flags field into flat comma-delimited string field,
-- excluding the internal-only flag 'SYNTHETIC'.
GROUP_CONCAT(IF(flags != 'SYNTHETIC', flags, NULL)) WITHIN RECORD AS flags,
-- Cancellations for recurring events will point to the recurring event's
-- key, which is stored in cancellationMatchingBillingEvent. The path
-- contains kind, id, and domainRepoId, all of which must match, so just